csle_common.metastore package

Submodules

csle_common.metastore.metastore_facade module

class csle_common.metastore.metastore_facade.MetastoreFacade[source]

Bases: object

Facade for the metastore, contains methods for querying the metastore

static delete_all(table: str) None[source]

Deletes all rows in the metastore from a given table

Parameters

table – the table to delete from

Returns

None

static get_alpha_vec_policy(id: int) Union[None, csle_common.dao.training.alpha_vectors_policy.AlphaVectorsPolicy][source]

Function for fetching a AlphaVec policy with a given id from the metastore

Parameters

id – the id of the AlphaVec policy

Returns

The AlphaVec policy or None if it could not be found

static get_config(id: int) Union[None, csle_common.dao.emulation_config.config.Config][source]

Function for fetching the config with a given id from the metastore

Parameters

id – the id of the config

Returns

The config or None if it could not be found

static get_data_collection_job_config(id: int) Union[None, csle_common.dao.jobs.data_collection_job_config.DataCollectionJobConfig][source]

Function for fetching a data collection job config with a given id from the metastore

Parameters

id – the id of the data collection job config

Returns

The data collection job config or None if it could not be found

static get_dqn_policy(id: int) Union[None, csle_common.dao.training.dqn_policy.DQNPolicy][source]

Function for fetching a DQN policy with a given id from the metastore

Parameters

id – the id of the DQN policy

Returns

The DQN policy or None if it could not be found

static get_empirical_system_model_config(id: int) Union[None, csle_common.dao.system_identification.empirical_system_model.EmpiricalSystemModel][source]

Function for fetching an empirical system model config with a given id from the metastore

Parameters

id – the id of the empirical system model config

Returns

The empirical system model config or None if it could not be found

static get_emulation(id: int) Union[None, csle_common.dao.emulation_config.emulation_env_config.EmulationEnvConfig][source]

Function for extracting the metadata of an emulation with a id

Parameters

id – the id of the emulation

Returns

The emulation config or None if the emulation was not found

static get_emulation_by_name(name: str) Union[None, csle_common.dao.emulation_config.emulation_env_config.EmulationEnvConfig][source]

Function for extracting the metadata of an emulation with a given name

Parameters

name – the name of the emulation

Returns

The emulation config or None if the emulation was not found

static get_emulation_execution(ip_first_octet: int, emulation_name: str) Union[None, csle_common.dao.emulation_config.emulation_execution.EmulationExecution][source]

Function for fetching a emulation execution with a given id from the metastore

Parameters
  • ip_first_octet – the id of the emulation execution

  • emulation_name – the name of the emulation

Returns

The emulation execution or None if it could not be found

static get_emulation_image(emulation_name: str) Union[None, Tuple[str, bytes]][source]

Function for fetching the image of a given emulation

Parameters

emulation_name – the name of the emulatin to fetch the image for

Returns

The simulation trace or None if it could not be found

static get_emulation_simulation_trace(id: int) Union[None, csle_common.dao.emulation_config.emulation_simulation_trace.EmulationSimulationTrace][source]

Function for fetching a simulation trace with a given id from the metastore

Parameters

id – the id of the emulation-simulation trace

Returns

The emulation-simulation trace or None if it could not be found

static get_emulation_statistic(id: int) Union[None, csle_common.dao.system_identification.emulation_statistics.EmulationStatistics][source]

Function for fetching an emulation satistic with a given id from the metastore

Parameters

id – the id of the statistics

Returns

The emulation statistic or None if it could not be found

static get_emulation_trace(id: int) Union[None, csle_common.dao.emulation_config.emulation_trace.EmulationTrace][source]

Function for fetching an emulation trace with a given id from the metastore

Parameters

id – the id of the emulation trace

Returns

The emulation trace or None if it could not be found

static get_experiment_execution(id: int) Union[None, csle_common.dao.training.experiment_execution.ExperimentExecution][source]

Function for fetching an experiment execution with a given id from the metastore

Parameters

id – the id of the emulation trace

Returns

The emulation trace or None if it could not be found

static get_fnn_w_softmax_policy(id: int) Union[None, csle_common.dao.training.fnn_with_softmax_policy.FNNWithSoftmaxPolicy][source]

Function for fetching a FNN with softmax policy with a given id from the metastore

Parameters

id – the id of the FNN with softmax policy

Returns

The FNN with softmax policy or None if it could not be found

static get_gaussian_mixture_system_model_config(id: int) Union[None, csle_common.dao.system_identification.gaussian_mixture_system_model.GaussianMixtureSystemModel][source]

Function for fetching a gaussian mixture system model config with a given id from the metastore

Parameters

id – the id of the gaussian mixture system model config

Returns

The gaussian mixture system model config or None if it could not be found

static get_gp_system_model_config(id: int) Union[None, csle_common.dao.system_identification.gp_system_model.GPSystemModel][source]

Function for fetching a gp system model config with a given id from the metastore

Parameters

id – the id of the gp system model config

Returns

The gp system model config or None if it could not be found

static get_linear_threshold_stopping_policy(id: int) Union[None, csle_common.dao.training.linear_threshold_stopping_policy.LinearThresholdStoppingPolicy][source]

Function for fetching a mult-threshold policy with a given id from the metastore

Parameters

id – the id of the linear-threshold policy

Returns

The mult-threshold policy or None if it could not be found

static get_management_user_by_username(username: str) Union[None, csle_common.dao.management.management_user.ManagementUser][source]

Function for extracting a management user account based on the username

Parameters

username – the username of the user

Returns

The management user or None if no user with the given username was found

static get_management_user_config(id: int) Union[None, csle_common.dao.management.management_user.ManagementUser][source]

Function for fetching a management user with a given id from the metastore

Parameters

id – the id of the management user

Returns

The management user or None if it could not be found

static get_mcmc_system_model_config(id: int) Union[None, csle_common.dao.system_identification.mcmc_system_model.MCMCSystemModel][source]

Function for fetching a mcmc system model config with a given id from the metastore

Parameters

id – the id of the mcmc system model config

Returns

The mcmc system model config or None if it could not be found

static get_multi_threshold_stopping_policy(id: int) Union[None, csle_common.dao.training.multi_threshold_stopping_policy.MultiThresholdStoppingPolicy][source]

Function for fetching a mult-threshold policy with a given id from the metastore

Parameters

id – the id of the multi-threshold policy

Returns

The mult-threshold policy or None if it could not be found

static get_ppo_policy(id: int) Union[None, csle_common.dao.training.ppo_policy.PPOPolicy][source]

Function for fetching a PPO policy with a given id from the metastore

Parameters

id – the id of the PPO policy

Returns

The PPO policy or None if it could not be found

static get_session_token_by_username(username: str) Union[None, csle_common.dao.management.session_token.SessionToken][source]

Function for extracting a session token account based on the username

Parameters

username – the username of the user

Returns

The session token or None if no user with the given username was found

static get_session_token_metadata(token: str) Union[None, csle_common.dao.management.session_token.SessionToken][source]

Function for fetching the metadata of a given session token

Parameters

token – the token to lookup the metadata dor

Returns

The session token and its metadata or None if it could not be found

static get_simulation(id: int) Union[None, csle_common.dao.simulation_config.simulation_env_config.SimulationEnvConfig][source]

Function for extracting the metadata of a simulation with a given id

Parameters

id – the id of the simulation

Returns

The simulation config or None if the simulation was not found

static get_simulation_by_name(name: str) Union[None, csle_common.dao.simulation_config.simulation_env_config.SimulationEnvConfig][source]

Function for extracting the metadata of a simulation with a given name

Parameters

name – the name of the simulation

Returns

The simulation config or None if the simulation was not found

static get_simulation_image(simulation_name: str) Union[None, Tuple[str, bytes]][source]

Function for fetching the image of a given simulation

Parameters

simulation_name – the name of the simulation to fetch the image for

Returns

The simulation trace or None if it could not be found

static get_simulation_trace(id: int) Union[None, csle_common.dao.simulation_config.simulation_trace.SimulationTrace][source]

Function for fetching a simulation trace with a given id from the metastore

Parameters

id – the id of the simulation trace

Returns

The simulation trace or None if it could not be found

static get_statistics_dataset_metadata(id: int) Union[None, csle_common.dao.datasets.statistics_dataset.StatisticsDataset][source]

Function for fetching the metadata of a given dataset name

Parameters

id – the id of the dataset to get the metadata of

Returns

The statistics dataset and its metadata or None if it could not be found

static get_statistics_dataset_metadata_by_name(dataset_name: str) Union[None, csle_common.dao.datasets.statistics_dataset.StatisticsDataset][source]

Function for fetching the metadata of a given dataset name

Parameters

dataset_name – the dataset name to lookup the metadata for

Returns

The statistics dataset and its metadata or None if it could not be found

static get_system_identification_job_config(id: int) Union[None, csle_common.dao.jobs.system_identification_job_config.SystemIdentificationJobConfig][source]

Function for fetching a system identification job config with a given id from the metastore

Parameters

id – the id of the system identification job config

Returns

The system identification job config or None if it could not be found

static get_tabular_policy(id: int) Union[None, csle_common.dao.training.tabular_policy.TabularPolicy][source]

Function for fetching a Tabular policy with a given id from the metastore

Parameters

id – the id of the Tabular policy

Returns

The Tabular policy or None if it could not be found

static get_traces_dataset_metadata(id: int) Union[None, csle_common.dao.datasets.traces_dataset.TracesDataset][source]

Function for fetching the metadata of a given dataset name

Parameters

id – the id of the dataset to get the metadata of

Returns

The traces dataset and its metadata or None if it could not be found

static get_traces_dataset_metadata_by_name(dataset_name: str) Union[None, csle_common.dao.datasets.traces_dataset.TracesDataset][source]

Function for fetching the metadata of a given dataset name

Parameters

dataset_name – the dataset name to lookup the metadata for

Returns

The traces dataset and its metadata or None if it could not be found

static get_training_job_config(id: int) Union[None, csle_common.dao.jobs.training_job_config.TrainingJobConfig][source]

Function for fetching a training job config with a given id from the metastore

Parameters

id – the id of the training job config

Returns

The trainign job config or None if it could not be found

static get_vector_policy(id: int) Union[None, csle_common.dao.training.vector_policy.VectorPolicy][source]

Function for fetching a vector policy with a given id from the metastore

Parameters

id – the id of the vector policy

Returns

The vector policy or None if it could not be found

static install_emulation(config: csle_common.dao.emulation_config.emulation_env_config.EmulationEnvConfig) Optional[int][source]

Installs the emulation configuration in the metastore

Parameters

config – the config to install

Returns

id of the created row or None if the installation failed

static install_simulation(config: csle_common.dao.simulation_config.simulation_env_config.SimulationEnvConfig) Union[None, int][source]

Installs the simulation configuration in the metastore

Parameters

config – the config to install

Returns

id of the created row

static list_alpha_vec_policies() List[csle_common.dao.training.alpha_vectors_policy.AlphaVectorsPolicy][source]
Returns

A list of AlphaVec policies in the metastore

static list_alpha_vec_policies_ids() List[Tuple[int, str]][source]
Returns

A list of AlphaVec policies ids in the metastore

static list_config_ids() List[int][source]
Returns

A list of config ids in the metastore

static list_configs() List[csle_common.dao.emulation_config.config.Config][source]
Returns

A list of configs in the metastore

static list_data_collection_jobs() List[csle_common.dao.jobs.data_collection_job_config.DataCollectionJobConfig][source]
Returns

A list of data collection jobs in the metastore

static list_data_collection_jobs_ids() List[Tuple[int, str, int]][source]
Returns

A list of data collection job ids in the metastore

static list_dqn_policies() List[csle_common.dao.training.dqn_policy.DQNPolicy][source]
Returns

A list of DQN policies in the metastore

static list_dqn_policies_ids() List[Tuple[int, str]][source]
Returns

A list of DQN policies ids in the metastore

static list_empirical_system_models() List[csle_common.dao.system_identification.empirical_system_model.EmpiricalSystemModel][source]
Returns

A list of empirical system models in the metastore

static list_empirical_system_models_ids() List[Tuple[int, str, int]][source]
Returns

A list of empirical system model ids in the metastore

static list_emulation_execution_ids() List[Tuple[int, str]][source]
Returns

A list of emulation executions in the metastore

static list_emulation_executions() List[csle_common.dao.emulation_config.emulation_execution.EmulationExecution][source]
Returns

A list of emulation executions in the metastore

static list_emulation_executions_by_id(id: int) List[csle_common.dao.emulation_config.emulation_execution.EmulationExecution][source]
Parameters

id – the first IP octet of the execution

Returns

A list of emulation executions in the metastore for a given emulation

static list_emulation_executions_for_a_given_emulation(emulation_name: str) List[csle_common.dao.emulation_config.emulation_execution.EmulationExecution][source]
Parameters

emulation_name – the name of the emulation

Returns

A list of emulation executions in the metastore for a given emulation

static list_emulation_images() List[Tuple[str, bytes]][source]
Returns

A list of emulation names and images in the metastore

static list_emulation_simulation_traces() List[csle_common.dao.emulation_config.emulation_simulation_trace.EmulationSimulationTrace][source]
Returns

A list of emulation-simulation traces in the metastore

static list_emulation_simulation_traces_ids() List[int][source]
Returns

A list of emulation-simulation traces ids in the metastore

static list_emulation_statistics() List[csle_common.dao.system_identification.emulation_statistics.EmulationStatistics][source]
Returns

A list of emulation statistics in the metastore

static list_emulation_statistics_ids() List[Tuple[int, str]][source]
Returns

A list of emulation statistics ids in the metastore

static list_emulation_traces() List[csle_common.dao.emulation_config.emulation_trace.EmulationTrace][source]
Returns

A list of emulation traces in the metastore

static list_emulation_traces_ids() List[Tuple[int, str]][source]
Returns

A list of emulation traces ids in the metastore

static list_emulations() List[csle_common.dao.emulation_config.emulation_env_config.EmulationEnvConfig][source]
Returns

A list of emulations in the metastore

static list_emulations_ids() List[Tuple[int, str]][source]
Returns

A list of emulation ids and names in the metastore

static list_experiment_executions() List[csle_common.dao.training.experiment_execution.ExperimentExecution][source]
Returns

A list of emulation traces in the metastore

static list_experiment_executions_ids() List[Tuple[int, str, str]][source]
Returns

A list of experiment execution ids in the metastore

static list_fnn_w_softmax_policies() List[csle_common.dao.training.fnn_with_softmax_policy.FNNWithSoftmaxPolicy][source]
Returns

A list of FNN with softmax policies in the metastore

static list_fnn_w_softmax_policies_ids() List[Tuple[int, str]][source]
Returns

A list of FNN with softmax policies ids in the metastore

static list_gaussian_mixture_system_models() List[csle_common.dao.system_identification.gaussian_mixture_system_model.GaussianMixtureSystemModel][source]
Returns

A list of gaussian mixture system models in the metastore

static list_gaussian_mixture_system_models_ids() List[Tuple[int, str, int]][source]
Returns

A list of gaussian mixture system model ids in the metastore

static list_gp_system_models() List[csle_common.dao.system_identification.gp_system_model.GPSystemModel][source]
Returns

A list of gp system models in the metastore

static list_gp_system_models_ids() List[Tuple[int, str, int]][source]
Returns

A list of gp system model ids in the metastore

static list_linear_threshold_stopping_policies() List[csle_common.dao.training.linear_threshold_stopping_policy.LinearThresholdStoppingPolicy][source]
Returns

A list of Linear-threshold stopping policies in the metastore

static list_linear_threshold_stopping_policies_ids() List[Tuple[int, str]][source]
Returns

A list of Linear-threshold stopping policies ids in the metastore

static list_management_users() List[csle_common.dao.management.management_user.ManagementUser][source]
Returns

A list of management users in the metastore

static list_management_users_ids() List[int][source]
Returns

A list of management user ids in the metastore

static list_mcmc_system_models() List[csle_common.dao.system_identification.mcmc_system_model.MCMCSystemModel][source]
Returns

A list of MCMC system models in the metastore

static list_mcmc_system_models_ids() List[Tuple[int, str, int]][source]
Returns

A list of MCMC system model ids in the metastore

static list_multi_threshold_stopping_policies() List[csle_common.dao.training.multi_threshold_stopping_policy.MultiThresholdStoppingPolicy][source]
Returns

A list of Multi-threshold stopping policies in the metastore

static list_multi_threshold_stopping_policies_ids() List[Tuple[int, str]][source]
Returns

A list of Multi-threshold stopping policies ids in the metastore

static list_ppo_policies() List[csle_common.dao.training.ppo_policy.PPOPolicy][source]
Returns

A list of PPO policies in the metastore

static list_ppo_policies_ids() List[Tuple[int, str]][source]
Returns

A list of PPO policies ids in the metastore

static list_session_tokens() List[csle_common.dao.management.session_token.SessionToken][source]
Returns

A list of session tokens in the metastore

static list_simulation_ids() List[Tuple[int, str]][source]
Returns

A list of simulation ids and names in the metastore

static list_simulation_images() List[Tuple[str, bytes]][source]
Returns

A list of simulation names and images in the metastore

static list_simulation_traces() List[csle_common.dao.simulation_config.simulation_trace.SimulationTrace][source]
Returns

A list of simulation traces in the metastore

static list_simulation_traces_ids() List[Tuple[int, str]][source]
Returns

A list of simulation traces ids in the metastore

static list_simulations() List[csle_common.dao.simulation_config.simulation_env_config.SimulationEnvConfig][source]
Returns

A list of simulations in the metastore

static list_statistics_datasets() List[csle_common.dao.datasets.statistics_dataset.StatisticsDataset][source]
Returns

A list of statistics datasets in the metastore

static list_statistics_datasets_ids() List[Tuple[int, str]][source]
Returns

A list of statistics datasets ids in the metastore

static list_system_identification_jobs() List[csle_common.dao.jobs.system_identification_job_config.SystemIdentificationJobConfig][source]
Returns

A list of system identification jobs in the metastore

static list_system_identification_jobs_ids() List[Tuple[int, str, int]][source]
Returns

A list of system identification job ids in the metastore

static list_tabular_policies() List[csle_common.dao.training.tabular_policy.TabularPolicy][source]
Returns

A list of Tabular policies in the metastore

static list_tabular_policies_ids() List[Tuple[int, str]][source]
Returns

A list of Tabular policies ids in the metastore

static list_traces_datasets() List[csle_common.dao.datasets.traces_dataset.TracesDataset][source]
Returns

A list of traces datasets in the metastore

static list_traces_datasets_ids() List[Tuple[int, str]][source]
Returns

A list of traces datasets ids in the metastore

static list_training_jobs() List[csle_common.dao.jobs.training_job_config.TrainingJobConfig][source]
Returns

A list of training jobs in the metastore

static list_training_jobs_ids() List[Tuple[int, str, str, int]][source]
Returns

A list of training job ids in the metastore

static list_vector_policies() List[csle_common.dao.training.vector_policy.VectorPolicy][source]
Returns

A list of vector policies in the metastore

static list_vector_policies_ids() List[Tuple[int, str]][source]
Returns

A list of vector policies ids in the metastore

static remove_alpha_vec_policy(alpha_vec_policy: csle_common.dao.training.alpha_vectors_policy.AlphaVectorsPolicy) None[source]

Removes a AlphaVec policy from the metastore

Parameters

alpha_vec_policy – the policy to remove

Returns

None

static remove_config(config: csle_common.dao.emulation_config.config.Config) None[source]

Removes a config from the metastore

Parameters

config – the config to remove

Returns

None

static remove_data_collection_job(data_collection_job: csle_common.dao.jobs.data_collection_job_config.DataCollectionJobConfig) None[source]

Removes a data collection job from the metastore

Parameters

config – the config to uninstall

Returns

None

static remove_dqn_policy(dqn_policy: csle_common.dao.training.dqn_policy.DQNPolicy) None[source]

Removes a DQN policy from the metastore

Parameters

dqn_policy – the policy to remove

Returns

None

static remove_empirical_system_model(empirical_system_model: csle_common.dao.system_identification.empirical_system_model.EmpiricalSystemModel) None[source]

Removes a empirical system model from the metastore

Parameters

empirical_system_model – the to remove

Returns

None

static remove_emulation_execution(emulation_execution: csle_common.dao.emulation_config.emulation_execution.EmulationExecution) None[source]

Removes a emulation execution from the metastore

Parameters

emulation_execution – the policy to remove

Returns

None

static remove_emulation_simulation_trace(emulation_simulation_trace: csle_common.dao.emulation_config.emulation_simulation_trace.EmulationSimulationTrace) None[source]

Removes an emulation-simulation trace from the metastore

Parameters

emulation_simulation_trace – the emulation-simulation trace to remove

Returns

None

static remove_emulation_statistic(emulation_statistic: csle_common.dao.system_identification.emulation_statistics.EmulationStatistics) None[source]

Removes an emulation statistic from the metastore

Parameters

emulation_statistic – the emulation statistic to remove

Returns

None

static remove_emulation_trace(emulation_trace: csle_common.dao.emulation_config.emulation_trace.EmulationTrace) None[source]

Removes an emulation trace from the metastore

Parameters

emulation_trace – the emulation trace to remove

Returns

None

static remove_experiment_execution(experiment_execution: csle_common.dao.training.experiment_execution.ExperimentExecution) None[source]

Removes an experiment execution from the metastore

Parameters

experiment_execution – the experiment execution to remove

Returns

None

static remove_fnn_w_softmax_policy(fnn_w_softmax_policy: csle_common.dao.training.fnn_with_softmax_policy.FNNWithSoftmaxPolicy) None[source]

Removes a FNN with softmax policy from the metastore

Parameters

fnn_w_softmax_policy – the policy to remove

Returns

None

static remove_gaussian_mixture_system_model(gaussian_mixture_system_model: csle_common.dao.system_identification.gaussian_mixture_system_model.GaussianMixtureSystemModel) None[source]

Removes a gaussian mixture system model from the metastore

Parameters

gaussian_mixture_system_model – the to remove

Returns

None

static remove_gp_system_model(gp_system_model: csle_common.dao.system_identification.gp_system_model.GPSystemModel) None[source]

Removes a gp system model from the metastore

Parameters

gp_system_model – the model to remove

Returns

None

static remove_linear_threshold_stopping_policy(linear_threshold_stopping_policy: csle_common.dao.training.linear_threshold_stopping_policy.LinearThresholdStoppingPolicy) None[source]

Removes a linear-threshold stopping policy from the metastore

Parameters

linear_threshold_stopping_policy – the policy to remove

Returns

None

static remove_management_user(management_user: csle_common.dao.management.management_user.ManagementUser) None[source]

Removes a management user from the metastore

Parameters

management_user – the user to remove

Returns

None

static remove_mcmc_system_model(mcmc_system_model: csle_common.dao.system_identification.mcmc_system_model.MCMCSystemModel) None[source]

Removes a MCMC system model from the metastore

Parameters

mcmc_system_model – the system model to remove

Returns

None

static remove_multi_threshold_stopping_policy(multi_threshold_stopping_policy: csle_common.dao.training.multi_threshold_stopping_policy.MultiThresholdStoppingPolicy) None[source]

Removes a multi-threshold stopping policy from the metastore

Parameters

multi_threshold_stopping_policy – the policy to remove

Returns

None

static remove_ppo_policy(ppo_policy: csle_common.dao.training.ppo_policy.PPOPolicy) None[source]

Removes a PPO policy from the metastore

Parameters

ppo_policy – the policy to remove

Returns

None

static remove_session_token(session_token: csle_common.dao.management.session_token.SessionToken) None[source]

Removes a session token from the metastore

Parameters

session_token – the session token to remove

Returns

None

static remove_simulation_trace(simulation_trace: csle_common.dao.simulation_config.simulation_trace.SimulationTrace) None[source]

Removes a simulation trace from the metastore

Parameters

simulation_trace – the simulation trace to remove

Returns

None

static remove_statistics_dataset(statistics_dataset: csle_common.dao.datasets.statistics_dataset.StatisticsDataset) None[source]

Removes a statistics dataset from the metastore

Parameters

statistics_dataset – the statistic dataset to remove

Returns

None

static remove_system_identification_job(system_identification_job: csle_common.dao.jobs.system_identification_job_config.SystemIdentificationJobConfig) None[source]

Removes a system identification job from the metastore

Parameters

system_identification_job – the job to remove

Returns

None

static remove_tabular_policy(tabular_policy: csle_common.dao.training.tabular_policy.TabularPolicy) None[source]

Removes a Tabular policy from the metastore

Parameters

tabular_policy – the policy to remove

Returns

None

static remove_traces_dataset(traces_dataset: csle_common.dao.datasets.traces_dataset.TracesDataset) None[source]

Removes a traces dataset from the metastore

Parameters

traces_dataset – the traces dataset to remove

Returns

None

static remove_training_job(training_job: csle_common.dao.jobs.training_job_config.TrainingJobConfig) None[source]

Removes a training job from the metastore

Parameters

config – the config to uninstall

Returns

None

static remove_vector_policy(vector_policy: csle_common.dao.training.vector_policy.VectorPolicy) None[source]

Removes a vector policy from the metastore

Parameters

vector_policy – the policy to remove

Returns

None

static save_alpha_vec_policy(alpha_vec_policy: csle_common.dao.training.alpha_vectors_policy.AlphaVectorsPolicy) Union[Any, int][source]

Saves a AlphaVec policy to the metastore

Parameters

alpha_vec_policy – the policy to save

Returns

id of the created record

static save_config(config: csle_common.dao.emulation_config.config.Config) Union[Any, int][source]

Saves a config to the metastore

Parameters

config – the config to save

Returns

id of the config

static save_data_collection_job(data_collection_job: csle_common.dao.jobs.data_collection_job_config.DataCollectionJobConfig) Union[Any, int][source]

Saves a data collection job to the metastore

Parameters

data_collection_job – the data collection job to save

Returns

id of the created record

static save_dqn_policy(dqn_policy: csle_common.dao.training.dqn_policy.DQNPolicy) Union[Any, int][source]

Saves a DQN policy to the metastore

Parameters

dqn_policy – the policy to save

Returns

id of the created record

static save_empirical_system_model(empirical_system_model: csle_common.dao.system_identification.empirical_system_model.EmpiricalSystemModel) Union[Any, int][source]

Saves a empirical system model to the metastore

Parameters

empirical_system_model – the empirical system model to save

Returns

id of the created record

static save_emulation_execution(emulation_execution: csle_common.dao.emulation_config.emulation_execution.EmulationExecution) Union[Any, int][source]

Saves a emulation execution to the metastore

Parameters

emulation_execution – the policy to save

Returns

None

static save_emulation_image(img: bytes, emulation_name: str) Any[source]

Saves the image of an emulation in the metastore

Parameters
  • img – the image data to save

  • emulation_name – the name of the emulation

Returns

id of the created row

static save_emulation_simulation_trace(emulation_simulation_trace: csle_common.dao.emulation_config.emulation_simulation_trace.EmulationSimulationTrace) Union[Any, int][source]

Saves an emulation_simulation trace

Parameters

emulation_simulation_trace – the emulation trace to save

Returns

id of the new row

static save_emulation_statistic(emulation_statistics: csle_common.dao.system_identification.emulation_statistics.EmulationStatistics) Union[Any, int][source]

Saves a DTO with emulation statistics to the metastore

Parameters

emulation_statistics – the emulation statistics to save

Returns

id of the created record

static save_emulation_trace(emulation_trace: csle_common.dao.emulation_config.emulation_trace.EmulationTrace) Union[Any, int][source]

Saves a trace from the emulation

Parameters

emulation_trace – the emulation trace to save

Returns

id of the created record

static save_experiment_execution(experiment_execution: csle_common.dao.training.experiment_execution.ExperimentExecution) Union[Any, int][source]

Saves an experiment execution to the metastore

Parameters

experiment_execution – the experiment execution to save

Returns

id of the created record

static save_fnn_w_softmax_policy(fnn_w_softmax_policy: csle_common.dao.training.fnn_with_softmax_policy.FNNWithSoftmaxPolicy) Union[Any, int][source]

Saves a FNN with softmax policy to the metastore

Parameters

fnn_w_softmax_policy – the policy to save

Returns

id of the created record

static save_gaussian_mixture_system_model(gaussian_mixture_system_model: csle_common.dao.system_identification.gaussian_mixture_system_model.GaussianMixtureSystemModel) Union[Any, int][source]

Saves a gaussian mixture system model to the metastore

Parameters

gaussian_mixture_system_model – the gaussian mixture system model to save

Returns

id of the created record

static save_gp_system_model(gp_system_model: csle_common.dao.system_identification.gp_system_model.GPSystemModel) Union[Any, int][source]

Saves a gp system model to the metastore

Parameters

gp_system_model – the gp system model to save

Returns

id of the created record

static save_linear_threshold_stopping_policy(linear_threshold_stopping_policy: csle_common.dao.training.linear_threshold_stopping_policy.LinearThresholdStoppingPolicy) Union[Any, int][source]

Saves a linear-threshold stopping policy to the metastore

Parameters

linear_threshold_stopping_policy – the policy to save

Returns

id of the created record

static save_management_user(management_user: csle_common.dao.management.management_user.ManagementUser) Union[None, int][source]

Saves a management user to the metastore

Parameters

management_user – the management user to save

Returns

id of the created record

static save_mcmc_system_model(mcmc_system_model: csle_common.dao.system_identification.mcmc_system_model.MCMCSystemModel) Union[Any, int][source]

Saves a mcmc system model to the metastore

Parameters

mcmc_system_model – the mcmc system model to save

Returns

id of the created record

static save_multi_threshold_stopping_policy(multi_threshold_stopping_policy: csle_common.dao.training.multi_threshold_stopping_policy.MultiThresholdStoppingPolicy) Union[Any, int][source]

Saves a multi-threshold stopping policy to the metastore

Parameters

multi_threshold_stopping_policy – the policy to save

Returns

id of the created record

static save_ppo_policy(ppo_policy: csle_common.dao.training.ppo_policy.PPOPolicy) Union[Any, int][source]

Saves a PPO policy to the metastore

Parameters

ppo_policy – the policy to save

Returns

id of the created record

static save_session_token(session_token: csle_common.dao.management.session_token.SessionToken) Union[None, str][source]

Saves a session token to the metastore

Parameters

session_token – the session token to save

Returns

token of the created record

static save_simulation_image(img: bytes, simulation_name: str) Union[Any, int][source]

Saves the image of a simulation in the metastore

Parameters
  • img – the image data to save

  • simulation_name – the name of the simulation

Returns

id of the created row

static save_simulation_trace(simulation_trace: csle_common.dao.simulation_config.simulation_trace.SimulationTrace) Union[Any, int][source]

Saves a trace from the simulation

Parameters

simulation_trace – the simulation trace to save

Returns

id of the created record

static save_statistics_dataset(statistics_dataset: csle_common.dao.datasets.statistics_dataset.StatisticsDataset) Union[Any, int][source]

Saves a statistics dataset to the metastore

Parameters

statistics_dataset – the statistics dataset to save

Returns

idg of the created record

static save_system_identification_job(system_identification_job: csle_common.dao.jobs.system_identification_job_config.SystemIdentificationJobConfig) Union[Any, int][source]

Saves a system_identification job to the metastore

Parameters

system_identification_job – the system identification job to save

Returns

id of the created record

static save_tabular_policy(tabular_policy: csle_common.dao.training.tabular_policy.TabularPolicy) Union[Any, int][source]

Saves a Tabular policy to the metastore

Parameters

tabular_policy – the policy to save

Returns

id of the created record

static save_traces_dataset(traces_dataset: csle_common.dao.datasets.traces_dataset.TracesDataset) Union[Any, int][source]

Saves a traces dataset to the metastore

Parameters

traces_dataset – the traces dataset to save

Returns

idg of the created record

static save_training_job(training_job: csle_common.dao.jobs.training_job_config.TrainingJobConfig) Union[Any, int][source]

Saves a training job to the metastore

Parameters

training_job – the training job to save

Returns

id of the created record

static save_vector_policy(vector_policy: csle_common.dao.training.vector_policy.VectorPolicy) Union[Any, int][source]

Saves a vector policy to the metastore

Parameters

vector_policy – the policy to save

Returns

id of the created record

static uninstall_emulation(config: csle_common.dao.emulation_config.emulation_env_config.EmulationEnvConfig) None[source]

Uninstalls the emulation configuration in the metastore

Parameters

config – the config to uninstall

Returns

None

static uninstall_simulation(config: csle_common.dao.simulation_config.simulation_env_config.SimulationEnvConfig) None[source]

Uninstalls the simulation configuration in the metastore

Parameters

config – the config to uninstall

Returns

None

static update_config(config: csle_common.dao.emulation_config.config.Config, id: int) None[source]

Updates a config in the metastore

Parameters
  • config – the config to save

  • id – the id of the row to update

Returns

id of the created record

static update_data_collection_job(data_collection_job: csle_common.dao.jobs.data_collection_job_config.DataCollectionJobConfig, id: int) None[source]

Updates a data collection job in the metastore

Parameters
  • training_job – the training job to save

  • id – the id of the row to update

Returns

id of the created record

static update_empirical_system_model(empirical_system_model: csle_common.dao.system_identification.empirical_system_model.EmpiricalSystemModel, id: int) None[source]

Updates a empirical system model in the metastore

Parameters
  • empirical_system_model – the empirical system model to save

  • id – the id of the row to update

Returns

id of the created record

static update_emulation_execution(emulation_execution: csle_common.dao.emulation_config.emulation_execution.EmulationExecution, ip_first_octet: int, emulation: str) None[source]

Updates an emulation execution in the metastore

Parameters
  • emulation_execution – the emulation execution to update

  • ip_first_octet – the first octet of the ip of the execution

  • emulation – the emulation of the execution

Returns

id of the created record

static update_emulation_statistic(emulation_statistics: csle_common.dao.system_identification.emulation_statistics.EmulationStatistics, id: int) None[source]

Updates a row with emulation statistic in the metastore

Parameters
  • emulation_statistics – the emulation statistics to save

  • id – the id of the row to update

Returns

id of the created record

static update_experiment_execution(experiment_execution: csle_common.dao.training.experiment_execution.ExperimentExecution, id: int) None[source]

Updates an experiment execution in the metastore

Parameters
  • experiment_execution – the experiment execution to update

  • id – the id of the row to update

Returns

id of the created record

static update_gaussian_mixture_system_model(gaussian_mixture_system_model: csle_common.dao.system_identification.gaussian_mixture_system_model.GaussianMixtureSystemModel, id: int) None[source]

Updates a gaussian mixture system model in the metastore

Parameters
  • gaussian_mixture_system_model – the gaussian mixture system model to save

  • id – the id of the row to update

Returns

id of the created record

static update_gp_system_model(gp_system_model: csle_common.dao.system_identification.gp_system_model.GPSystemModel, id: int) None[source]

Updates a gp system model in the metastore

Parameters
  • gp_system_model – the gp system model to save

  • id – the id of the row to update

Returns

id of the created record

static update_management_user(management_user: csle_common.dao.management.management_user.ManagementUser, id: int) None[source]

Updates a management user in the metastore

Parameters
  • management_user – the management user to update

  • id – the id of the row to update

Returns

id of the created record

static update_mcmc_system_model(mcmc_system_model: csle_common.dao.system_identification.mcmc_system_model.MCMCSystemModel, id: int) None[source]

Updates a mcmc system model in the metastore

Parameters
  • mcmc_system_model – the mcmc system model to save

  • id – the id of the row to update

Returns

id of the created record

static update_session_token(session_token: csle_common.dao.management.session_token.SessionToken, token: str) None[source]

Updates a session token in the metastore

Parameters
  • session_token – the session token to update

  • token – the token of the row to update

Returns

None

static update_statistics_dataset(statistics_dataset: csle_common.dao.datasets.statistics_dataset.StatisticsDataset, id: int) None[source]

Updates a statistics dataset in the metastore

Parameters
  • statistics_dataset – the statistics dataset to update

  • id – the id of the row to update

Returns

id of the created record

static update_system_identification_job(system_identification_job: csle_common.dao.jobs.system_identification_job_config.SystemIdentificationJobConfig, id: int) None[source]

Updates a system identification job in the metastore

Parameters
  • system_identification_job – the system identification job to save

  • id – the id of the row to update

Returns

id of the created record

static update_traces_dataset(traces_dataset: csle_common.dao.datasets.traces_dataset.TracesDataset, id: int) None[source]

Updates a traces dataset in the metastore

Parameters
  • traces_dataset – the traces dataset to update

  • id – the id of the row to update

Returns

id of the created record

static update_training_job(training_job: csle_common.dao.jobs.training_job_config.TrainingJobConfig, id: int) None[source]

Updates a training job in the metastore

Parameters
  • training_job – the training job to save

  • id – the id of the row to update

Returns

id of the created record

Module contents