REST API
EPyT-Flow comes with a REST API for supporting the integration into other projects
such as web applications. The REST server is based on Falcon
and is implemented in the class RestApiService – it runs on port
8080 as a default. It provides the following methods:
Method |
URL |
Implementation |
Description |
|---|---|---|---|
POST |
/scenario/new |
Creates a new scenario (based on a given .inp and .msx file, or on a given scenario configuration). |
|
DELETE |
/scenario/{scenario_id} |
Deletes a scenario. |
|
GET |
/scenario/{scenario_id}/export |
Exports a given scenario to an .inp and (optionally) .msx file. |
|
GET |
/scenario/{scenario_id}/topology |
Gets the topology of a given scenario. |
|
GET |
/scenario/{scenario_id}/scenario_config |
Gets the entire configuration/specification of a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/general_params |
Gets the general parameters (e.g. simulation duration, etc.) of a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/quality_params |
Gets or sets the (EPANET) quality parameters of a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/sensor_config |
Gets or sets the sensor configuration of a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/uncertainty/model |
Gets or sets the model uncertainties of a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/uncertainty/sensors |
Gets or sets the sensor uncertainties (i.e. noise) of a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/controls/simple |
Gets or adds simple control modules to a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/controls/complex |
Gets or adds complex control modules to a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/events/quality |
Gets or adds quality events (e.g. injection events) to a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/events/leakages |
Gets or adds a leakage to a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/events/sensor_faults |
Gets or adds a sensor fault to a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/events/sensor_reading_attacks |
Gets or adds a sensor reading attack to a given scenario. |
|
POST |
/scenario/{scenario_id}/node/{node_id}/demand_pattern |
Set the demand pattern of a specific node in a given scenario. |
|
GET, POST |
/scenario/{scenario_id}/simulation |
Runs the simulation of a given scenario. |
|
POST |
/scenario/{scenario_id}/simulation/basic_quality |
Runs the basic quality simulation of a given scenario. |
|
POST |
/scenario/{scenario_id}/simulation/advanced_quality |
Runs the advanced quality simulation of a given scenario. |
|
DELETE |
/scada_data/{data_id} |
Deletes a given SCADA data instance. |
|
GET, POST |
/scada_data/{data_id}/sensor_config |
Gets or sets the sensor configuration of a given SCADA data instance. |
|
GET, POST |
/scada_data/{data_id}/sensor_faults |
Gets or sets the sensor faults of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/nodes/pressures |
Gets all pressure sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/nodes/demands |
Gets all demand sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/nodes/bulk_species |
Gets all bulk species node sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/nodes/quality |
Gets all node quality sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/links/flows |
Gets all flow sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/links/quality |
Gets all link quality sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/links/bulk_species |
Gets all sbulk species link ensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/links/surface_species |
Gets all demand sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/pump_states |
Gets all demand sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/valve_states |
Gets all demand sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/tank_volumes |
Gets all demand sensor readings of a given SCADA data instance. |
|
GET |
/scada_data/{data_id}/export/xlsx |
Exports a given SCADA data instance to a .xlsx file. |
|
GET |
/scada_data/{data_id}/export/matlab |
Exports a given SCADA data instance to a Matlab data file. |
|
GET |
/scada_data/{data_id}/export/numpy |
Exports a given SCADA data instance to a Numpy data file. |
|
GET |
/scada_data/{data_id}/export |
Exports a given SCADA data instance to an .epytflow_scada_data data file. |
|
POST |
/scada_data/{data_id}/convert_units |
Converts the units of a given SCADA data instance and returns a new SCADA data instance. |