daemon.models.ports module

class daemon.models.ports.Ports(**data)[source]

Bases: pydantic.main.BaseModel

Port names

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

port_in: Optional[int]
port_out: Optional[int]
port_ctrl: Optional[int]
port_expose: Optional[int]
class daemon.models.ports.PortMapping(**data)[source]

Bases: pydantic.main.BaseModel

Used to set the additional port mappings in partial-daemon

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

pod_name: str
pea_name: str
ports: daemon.models.ports.Ports
class daemon.models.ports.PortMappings(**data)[source]

Bases: pydantic.main.BaseModel

Pydantic model for list of PortMappings

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

property ports: List[int]

Get all ports in current model

Return type

List[int]

Returns

list of ports

property docker_ports: Dict[str, int]

Get all ports for docker client

Return type

Dict[str, int]

Returns

dict of ports for docker-py syntax

property pod_names: List[str]

Get all pod names

Return type

List[str]

Returns

unique list of pod names

property pea_names: List[str]

Get all pea names

Return type

List[str]

Returns

list of pea names