csle_collector.host_manager.dao package
Submodules
csle_collector.host_manager.dao.failed_login_attempt module
- class csle_collector.host_manager.dao.failed_login_attempt.FailedLoginAttempt[source]
Bases:
csle_base.json_serializable.JSONSerializable
Class representing a failed login event on some server in the emulation
- static from_dict(parsed_stats_dict: Dict[str, Any]) csle_collector.host_manager.dao.failed_login_attempt.FailedLoginAttempt [source]
Parses a FailedLoginAttempt object from a dict
- Parameters
parsed_stats_dict – the dict to parse
- Returns
the parsed FailedLoginAttempt object
- static from_json_file(json_file_path: str) csle_collector.host_manager.dao.failed_login_attempt.FailedLoginAttempt [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static parse_from_str(login_attempt_str: str) csle_collector.host_manager.dao.failed_login_attempt.FailedLoginAttempt [source]
Parses a failed login event DTO from a string
- Parameters
login_attempt_str – the string to parse
- Returns
the parsed DTO
csle_collector.host_manager.dao.host_metrics module
- class csle_collector.host_manager.dao.host_metrics.HostMetrics(num_logged_in_users: int = 0, num_failed_login_attempts: int = 0, num_open_connections: int = 0, num_login_events: int = 0, num_processes: int = 0, num_users: int = 0, ip: Optional[str] = None, ts: Union[None, float] = None)[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO class containing host metrics
- copy() csle_collector.host_manager.dao.host_metrics.HostMetrics [source]
- Returns
a copy of the object
- static from_dict(d: Dict[str, Any]) csle_collector.host_manager.dao.host_metrics.HostMetrics [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_collector.host_manager.dao.host_metrics.HostMetrics [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
- static from_kafka_record(record: str) csle_collector.host_manager.dao.host_metrics.HostMetrics [source]
Converts the Kafka record string to a DTO
- Parameters
record – the kafka record
- Returns
the created DTO
- get_deltas(stats_prime: csle_collector.host_manager.dao.host_metrics.HostMetrics) Tuple[List[int], List[str]] [source]
Get the deltas between two stats objects
- Parameters
stats_prime – the stats object to compare with
max_counter – the maximum counter_value
- Returns
the deltas and the labels
- get_values() Tuple[List[int], List[str]] [source]
Get the current values
- Returns
the values and the labels
- static schema() csle_collector.host_manager.dao.host_metrics.HostMetrics [source]
- Returns
get the schema of the DTO
- to_dto(ip: str) host_manager_pb2.HostMetricsDTO [source]
Converts the object into a gRPC DTO for serialization
- Parameters
ip – the ip to add to the DTO in addition to the metrics
- Returns
a csle_collector.host_manager.host_manager_pb2.HostMetricsDTO
csle_collector.host_manager.dao.successful_login module
- class csle_collector.host_manager.dao.successful_login.SuccessfulLogin[source]
Bases:
csle_base.json_serializable.JSONSerializable
DTO Class representing a parsed successful login event from a server in the emulation
- static from_dict(parsed_stats_dict: Dict[str, Any]) csle_collector.host_manager.dao.successful_login.SuccessfulLogin [source]
Parses a FailedLoginAttempt object from a dict
- Parameters
parsed_stats_dict – the dict to parse
- Returns
the parsed FailedLoginAttempt object
- static from_json_file(json_file_path: str) csle_collector.host_manager.dao.successful_login.SuccessfulLogin [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO