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[docker.models.containers.Container], emulation: str, kafka_container: str)[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO Object representing a running or stopped Docker container
- static from_dict(d: Dict[str, Any]) csle_common.dao.docker.docker_container_metadata.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) csle_common.dao.docker.docker_container_metadata.DockerContainerMetadata [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
csle_common.dao.docker.docker_env_metadata module
- class csle_common.dao.docker.docker_env_metadata.DockerEnvMetadata(containers: List[csle_common.dao.docker.docker_container_metadata.DockerContainerMetadata], name: str, subnet_prefix: str, subnet_mask: str, level: str, config: Union[None, csle_common.dao.emulation_config.emulation_env_config.EmulationEnvConfig], kafka_config: Union[None, csle_common.dao.emulation_config.kafka_config.KafkaConfig])[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO Object representing a running environment
- static from_dict(d: Dict[str, Any]) csle_common.dao.docker.docker_env_metadata.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) csle_common.dao.docker.docker_env_metadata.DockerEnvMetadata [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO