Código fonte para asgard.models.spec.container

from enum import Enum
from typing import Optional, List

from asgard.models.base import BaseModel


[documentos]class ContainerParameterSpec(BaseModel): name: str value: str
[documentos]class ContainerVolumeModeSpec(str, Enum): RO = "RO" RW = "RW"
[documentos]class ContainerVolumeSpec(BaseModel): container_path: str host_path: str mode: ContainerVolumeModeSpec = ContainerVolumeModeSpec.RO persistent: bool = False external: bool = False
[documentos]class ContainerPortProtocolTypes(str, Enum): TCP = "TCP" UDP = "UDP"
[documentos]class ContainerPortSpec(BaseModel): name: str containerPort: int protocol: ContainerPortProtocolTypes = ContainerPortProtocolTypes.TCP
[documentos]class ContainerSpec(BaseModel): type: str = "DOCKER" image: str network: str parameters: Optional[List[ContainerParameterSpec]] privileged: bool = False pull_image: bool = True volumes: Optional[List[ContainerVolumeSpec]] ports: Optional[List[ContainerPortSpec]]