csle_rest_api.resources.emulations package

Submodules

csle_rest_api.resources.emulations.routes module

Routes and sub-resources for the /emulations resource

csle_rest_api.resources.emulations.routes.emulation_by_id(emulation_id: int) Tuple[flask.wrappers.Response, int][source]

The /emulations/id resource. Gets an emulation by its id.

Parameters

emulation_id – the id of the emulation

Returns

the emulation with the given id if it exists

csle_rest_api.resources.emulations.routes.emulation_ids() Tuple[flask.wrappers.Response, int][source]

Utility method for returning the list of emulation ids from the metastore to an HTTP client

Returns

HTTP response with list of emulation ids

csle_rest_api.resources.emulations.routes.emulations() Tuple[flask.wrappers.Response, int][source]

The /emulations resource

Returns

Returns a list of emulations, a list of emulation ids, or deletes the list of emulations

csle_rest_api.resources.emulations.routes.get_execution_of_emulation(emulation_id: int, execution_id: int) Tuple[flask.wrappers.Response, int][source]

The /emulations/ids/executions/id resource. Gets a given execution of a given emulation.

Parameters
  • emulation_id – the id of the emulation

  • execution_id – the id of the execution

Returns

The sought for execution if it exist

csle_rest_api.resources.emulations.routes.get_executions_of_emulation(emulation_id: int) Tuple[flask.wrappers.Response, int][source]

The /emulations/id/executions resource. Gets all executions of a given emulation.

Parameters

emulation_id – the id of the emulation

Returns

the list of executions of the emulation

csle_rest_api.resources.emulations.routes.monitor_emulation(emulation_id: int, execution_id: int, minutes: int) Tuple[flask.wrappers.Response, int][source]

The /emulations/id/executions/id/monitor/minutes resource. Fetches monitoring data from Kafka.

Parameters
  • emulation_id – the emulation id

  • execution_id – the execution id

  • minutes – the number of minutes past to collect data from

Returns

the collected data

Module contents