csle_common.dao.docker package

Submodules

csle_common.dao.docker.docker_container_metadata module

class csle_common.dao.docker.docker_container_metadata.DockerContainerMetadata(name: str, status: str, short_id: str, image_short_id: str, image_tags: List[str], id: str, created: str, ip: str, network_id: int, gateway: str, mac: str, ip_prefix_len: int, name2: str, level: str, hostname: str, image_name: str, net: str, dir: str, config_path: str, container_handle: Optional[Container], emulation: str, kafka_container: str)[source]

Bases: JSONSerializable

DTO Object representing a running or stopped Docker container

static from_dict(d: Dict[str, Any]) DockerContainerMetadata[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the converted instance

static from_json_file(json_file_path: str) DockerContainerMetadata[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

csle_common.dao.docker.docker_env_metadata module

class csle_common.dao.docker.docker_env_metadata.DockerEnvMetadata(containers: List[DockerContainerMetadata], name: str, subnet_prefix: str, subnet_mask: str, level: str, config: Union[None, EmulationEnvConfig], kafka_config: Union[None, KafkaConfig])[source]

Bases: JSONSerializable

DTO Object representing a running environment

static from_dict(d: Dict[str, Any]) DockerEnvMetadata[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) DockerEnvMetadata[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

Module contents