epyt_flow.rest_api
- epyt_flow.rest_api.scada_data
- epyt_flow.rest_api.scada_data.handlers
- epyt_flow.rest_api.scada_data.data_handlers
ScadaDataDemandsHandlerScadaDataFlowsHandlerScadaDataLinkBulkSpeciesHandlerScadaDataLinksQualityHandlerScadaDataNodeBulkSpeciesHandlerScadaDataNodesQualityHandlerScadaDataPressuresHandlerScadaDataPumpStatesHandlerScadaDataSurfaceSpeciesHandlerScadaDataTankVolumesHandlerScadaDataValveStatesHandler
- epyt_flow.rest_api.scada_data.export_handlers
- epyt_flow.rest_api.scenario
- epyt_flow.rest_api.scenario.handlers
- epyt_flow.rest_api.scenario.simulation_handlers
- epyt_flow.rest_api.scenario.control_handlers
- epyt_flow.rest_api.scenario.event_handlers
- epyt_flow.rest_api.scenario.uncertainty_handlers
epyt_flow.rest_api.server
This module provides the EPyT-Flow REST API server.
epyt_flow.rest_api.res_manager
This module contains a class for managing recourses such as scenarios or SCADA data.
- class epyt_flow.rest_api.res_manager.ResourceManager[source]
Bases:
objectClass implementing a simple resource manager where resources are associated with UUIDs.
- close_item(item: Any)[source]
Closes a given resource item – i.e. all clean-up logic for an item should be called here.
- Parameters:
item (Any) – Resource item.
- create_new_item(item: Any) str[source]
Adds a new item to the resource manager.
- Parameters:
item (Any) – Item to be added.
- Returns:
UUID of the new item.
- Return type:
str
- get(item_uuid: str) Any[source]
Gets the item associated with a given UUID.
- Parameters:
item_uuid (str) – UUID of the item.
- Returns:
Resource item.
- Return type:
Any
epyt_flow.rest_api.base_handler
This module provides a base handler with some useful methods for all REST API handlers.
- class epyt_flow.rest_api.base_handler.BaseHandler[source]
Bases:
objectBase class for all REST API handlers.
- load_json_data_from_request(req: falcon.Request) Any[source]
Loads/Parses an object from given JSON data.
- Parameters:
req (falcon.Request) – Request instance.
- Returns:
Loaded object.
- Return type:
Any
- send_error(resp: falcon.Response, error_msg: str) None[source]
Sends an error message back.
- Parameters:
resp (falcon.Response) – Response instance.
error_msg (str) – Error message.
- send_invalid_resource_id_error(resp: falcon.Response) None[source]
Sends an error that th given resource ID (e.g. scenario ID, or SCADA data ID) is invalid.
- Parameters:
resp (falcon.Response) – Response instance.