Welcome to BP2022-AP1’s documentation!#

simulation#

GET /simulation#

Get all ids of simulation configurations. Use this to start a run.

Example request:

GET /simulation HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

POST /simulation#

Create a new simulation configuration. A simulation configuration contains at least a spawner configuration. You can add additional fault injection configurations too. It returns the id connected to the simulation. Use this id to start a run.

Example request:

POST /simulation HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "description": "string",
    "platform_blocked_fault": [
        "string"
    ],
    "schedule_blocked_fault": [
        "string"
    ],
    "track_blocked_fault": [
        "string"
    ],
    "track_speed_limit_fault": [
        "string"
    ],
    "train_speed_fault": [
        "string"
    ],
    "train_prio_fault": [
        "string"
    ],
    "spawner": "string"
}
Status Codes:
  • 201 Created

    Successfully created new simulation configuration

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Configuration not found

DELETE /simulation/{id}#

Delete a simulation configuration if no run references the simulation configuration.

Parameters:
  • id (string) – Id of an existing simulation configuration

Status Codes:
GET /simulation/{id}#

Get all information about a simulation, including the ids of connected components and runs.

Parameters:
  • id (string) – Id of an existing simulation configuration

Example request:

GET /simulation/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "run": [
            "string"
        ],
        "description": "string",
        "platform_blocked_fault": [
            "string"
        ],
        "schedule_blocked_fault": [
            "string"
        ],
        "track_blocked_fault": [
            "string"
        ],
        "track_speed_limit_fault": [
            "string"
        ],
        "train_speed_fault": [
            "string"
        ],
        "train_prio_fault": [
            "string"
        ],
        "spawner": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

PUT /simulation/{id}#

Edit the component configurations connected to the simulation configuration. If you want to change a single component, please povide the complete list with components of the same type comparable with creating a simulation configuration. Editing is only possible if the simulation configuration is not connected to any run.

Parameters:
  • id (string) – Id of an existing simulation configuration

Example request:

PUT /simulation/{id} HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "description": "string",
    "platform_blocked_fault": [
        "string"
    ],
    "schedule_blocked_fault": [
        "string"
    ],
    "track_blocked_fault": [
        "string"
    ],
    "track_speed_limit_fault": [
        "string"
    ],
    "train_speed_fault": [
        "string"
    ],
    "train_prio_fault": [
        "string"
    ],
    "spawner": "string"
}
Status Codes:

run#

GET /run#

Get all ids of your runs.

Query Parameters:
  • simulationId (string) –

Example request:

GET /run HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Simulation id not found

POST /run#

Starts a new run of a given simulation configuration. Returns id connected to the run to get the results and status from.

Example request:

POST /run HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "simulation_configuration": "string"
}
Status Codes:
  • 201 Created

    Successfully created and started a new run

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Simulation not found

DELETE /run/{id}#

Delete a run and the connected logs. If the simulation is still running, cancel it.

Parameters:
  • id (string) – Id of an existing run

Status Codes:
GET /run/{id}#

Get current state and progress of the run.

Parameters:
  • id (string) – Id of an existing run

Example request:

GET /run/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "state": "string",
        "progress": 1.0,
        "simulation": "string",
        "process_id": 1
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Run not found

spawner#

GET /component/spawner#

Get ids of spawner configurations. Use this in the simulation configuration.

Query Parameters:
  • simulationId (string) – Specify the id of simulation if you only want to get the spawner configuration of a single simulation

Example request:

GET /component/spawner HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Simulation not found

POST /component/spawner#

Insert a new spawner component. Please provide a list of schedules with their id. Returns the id of the configuration object. Use this to reference in the simulation configuration.

Example request:

POST /component/spawner HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "schedule": [
        "string"
    ]
}
Status Codes:
  • 201 Created

    Successfully created new spawner configuration object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 400 Bad Request – An spawner configuration exists for this simulation already

  • 401 Unauthorized – Token is missing

DELETE /component/spawner/{id}#

Delete a spawner configuration. This is not possible if this configuration is referenced by a simulation configuration.

Parameters:
  • id (string) – Id of an existing spawner configuration

Status Codes:
GET /component/spawner/{id}#

Get all information about a spawner configuration including the referenced schedules.

Parameters:
  • id (string) – Id of an existing spawner configuration

Example request:

GET /component/spawner/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "schedule": [
            "string"
        ]
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

schedule#

GET /schedule/regular#

Get ids of all regular schedules. Use this id in the spawner configuration.

Example request:

GET /schedule/regular HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

POST /schedule/regular#

Insert a new regular schedule. It returns the id of the configuration object. Use this in the spawner configuration. For example, with a regular schedule, a train starts at intervals that you specify. Specify the gap with the field ‘regular_strategy_frequency’ and the interval where the schedule should be active with ‘start_tick’ and ‘end_tick’. Use ‘schedule_type’ to specify the acting objects, for example, TrainSchedule. Use ‘train_schedule_train_type’ to select this even more by defining the train type (Coal or passenger trains)

Example request:

POST /schedule/regular HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "strategy_type": "RegularScheduleStrategy",
    "schedule_type": "TrainSchedule",
    "strategy_start_tick": 1,
    "strategy_end_tick": 1,
    "train_schedule_train_type": "passenger",
    "regular_strategy_frequency": 1
}
Status Codes:
  • 201 Created

    Successfully created new regular schedule object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Platform not found

DELETE /schedule/regular/{id}#

Delete a schedule. Only possible, if no spawner configuration references the schedule.

Parameters:
  • id (string) – Id of an existing regular schedule configuration

Status Codes:
GET /schedule/regular/{id}#

Get all information about a schedule including the interval between the trains, the starting tick and ending tick of the schedule.

Parameters:
  • id (string) – Id of an existing regular schedule configuration

Example request:

GET /schedule/regular/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "schedule_type": "TrainSchedule",
        "strategy_start_tick": 1,
        "strategy_end_tick": 1,
        "train_schedule_train_type": "passenger",
        "regular_strategy_frequency": 1
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

GET /schedule/random#

Get ids of all random schedules. Use this id in the spawner configuration.

Example request:

GET /schedule/random HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

POST /schedule/random#

Insert a new random schedule. It returns the id of the configuration object. Use this in the spawner configuration. For example, with a random schedule, a train starts with a specified probability. Specify the probability with the field ‘random_strategy_trains_per_1000_ticks’ and the interval where the schedule should be active with ‘start_tick’ and ‘end_tick’. Use ‘inject_probability’ and ‘resolve_probability’ to adjust the probability of the schedule becoming active. Use ‘schedule_type’ to specify the acting objects, for example, TrainSchedule. Use ‘train_schedule_train_type’ to select this even more by defining the train type (coal or passenger trains).

Example request:

POST /schedule/random HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "schedule_type": "TrainSchedule",
    "strategy_start_tick": 1,
    "strategy_end_tick": 1,
    "train_schedule_train_type": "passenger",
    "random_strategy_trains_per_1000_ticks": 1.0,
    "random_strategy_seed": 1
}
Status Codes:
  • 201 Created

    Successfully created new random schedule object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Platform not found

DELETE /schedule/random/{id}#

Delete a schedule. Only possible, if no spawner configuration references the schedule.

Parameters:
  • id (string) – Id of an existing random schedule configuration

Status Codes:
GET /schedule/random/{id}#

Get all information about a schedule including the probability to spawn trains, the starting tick and ending tick of the schedule.

Parameters:
  • id (string) – Id of an existing random schedule configuration

Example request:

GET /schedule/random/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "strategy_type": "RegularScheduleStrategy",
        "schedule_type": "TrainSchedule",
        "strategy_start_tick": 1,
        "strategy_end_tick": 1,
        "train_schedule_train_type": "passenger",
        "random_strategy_trains_per_1000_ticks": 1.0,
        "random_strategy_seed": 1
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

GET /schedule/coal-demand#

Get ids of all coal demand schedules. Use this id in the spawner configuration.

Example request:

GET /schedule/coal-demand HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

POST /schedule/coal-demand#

Insert a new Coal demand schedule. It returns the id of the configuration object. Use this in the spawner configuration. The schedule decides to spawn trains based on data of the Federal Network Agency about electricity production from coal in East Germany with a temporal resolution of 15 min. You can specify the power station, a scaling factor, and the starting point of the data. If you want to read more, take a look at https://github.com/BP2022-AP1/bp2022-ap1/wiki/Coal-Consumption. You must also define the interval where the schedule should be active with ‘start_tick’ and ‘end_tick’. Use ‘schedule_type’ to specify the acting objects, for example, TrainSchedule. Use ‘train_schedule_train_type’ to select this even more by defining the train type (coal or passenger trains).

Example request:

POST /schedule/coal-demand HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "schedule_type": "TrainSchedule",
    "strategy_start_tick": 1,
    "strategy_end_tick": 1,
    "train_schedule_train_type": "passenger",
    "demand_strategy_power_station": "string",
    "demand_strategy_scaling_factor": 1.0,
    "demand_strategy_start_datetime": "2023-07-31"
}
Status Codes:
  • 201 Created

    Successfully created new coal demand schedule object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Platform not found

DELETE /schedule/coal-demand/{id}#

Delete a schedule. Only possible, if no spawner configuration references the schedule.

Parameters:
  • id (string) – Id of an existing demand schedule configuration

Status Codes:
GET /schedule/coal-demand/{id}#

Get all information about a schedule including the power station, scaling factor and starting time of the data, the starting tick and ending tick of the schedule.

Parameters:
  • id (string) – Id of an existing demand schedule configuration

Example request:

GET /schedule/coal-demand/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "strategy_type": "RegularScheduleStrategy",
        "schedule_type": "TrainSchedule",
        "strategy_start_tick": 1,
        "strategy_end_tick": 1,
        "train_schedule_train_type": "passenger",
        "demand_strategy_power_station": "string",
        "demand_strategy_scaling_factor": 1.0,
        "demand_strategy_start_datetime": "2023-07-31"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

fault-injector#

GET /component/fault-injection/schedule-blocked-fault#

Get ids of schedule-blocked-fault configurations. Use this in the simulation configuration.

Query Parameters:
  • simulationId (string) – Specify id of simulation if you only want to get the schedule-blocked-fault configuration of a single simulation

Example request:

GET /component/fault-injection/schedule-blocked-fault HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Simulation not found

POST /component/fault-injection/schedule-blocked-fault#

Insert a new schedule-blocked-fault configuration. It returns the id of the configuration object. Use this in the simulation configuration. A schedule-blocked fault prohibits a train from a schedule to spawning for some time. You can define the blocked schedule with the field ‘affected_element_id’. You can specify the amount of time with the fields ‘start_tick’ and ‘end_tick’ and the resolution probability of the fault with ‘inject_probability’ and ‘resolve_probability’. Set the injection probability and resolve the fault with ‘inject_probability’ and ‘resolve_probability’id. Additionally, you can set a fault injection, either regular or random, with the field ‘strategy’.

Example request:

POST /component/fault-injection/schedule-blocked-fault HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "description": "string",
    "strategy": "regular",
    "start_tick": 1,
    "end_tick": 1,
    "inject_probability": 1.0,
    "resolve_probability": 1.0,
    "affected_element_id": "string"
}
Status Codes:
  • 201 Created

    Successfully created new schedule-blocked-fault configuration object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

DELETE /component/fault-injection/schedule-blocked-fault/{id}#

Delete a schedule-blocked-fault configuration. This is not possible if this configuration is referenced by a simulation configuration.

Parameters:
  • id (string) – Id of an existing schedule blocked fault configuration

Status Codes:
GET /component/fault-injection/schedule-blocked-fault/{id}#

Get all information about a schedule-blocked-fault configuration. This includes the strategy, starting tick, ending tick, injection and resolution probability and the affected element id.

Parameters:
  • id (string) – Id of an existing schedule blocked fault configuration

Example request:

GET /component/fault-injection/schedule-blocked-fault/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "description": "string",
        "strategy": "regular",
        "start_tick": 1,
        "end_tick": 1,
        "inject_probability": 1.0,
        "resolve_probability": 1.0,
        "affected_element_id": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

GET /component/fault-injection/track-blocked-fault#

Get ids of track-blocked-fault configurations. Use this in the simulation configuration.

Query Parameters:
  • simulationId (string) – Specify id of simulation if you only want to get the track-blocked-fault configuration of a single simulation

Example request:

GET /component/fault-injection/track-blocked-fault HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Simulation not found

POST /component/fault-injection/track-blocked-fault#

Insert a new track-blocked-fault configuration. It returns the id of the configuration object. Use this in the simulation configuration. A track-blocked fault blocks a track on the rail system for an some time. You define the affected track with the field ‘affected_element_id’. You can find the id of the tracks in the SUMO configuration. You can specify the amount of time with the fields ‘start_tick’ and ‘end_tick’. Set the injection probability and resolve the fault with ‘inject_probability’ and ‘resolve_probability’id. Additionally, you can set a fault injection, either regular or random, with the field ‘strategy’.

Example request:

POST /component/fault-injection/track-blocked-fault HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "description": "string",
    "strategy": "regular",
    "start_tick": 1,
    "end_tick": 1,
    "inject_probability": 1.0,
    "resolve_probability": 1.0,
    "affected_element_id": "string"
}
Status Codes:
  • 201 Created

    Successfully created new track-blocked-fault configuration object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

DELETE /component/fault-injection/track-blocked-fault/{id}#

Delete a track-blocked-fault configuration. This is not possible if this configuration is referenced by a simulation configuration.

Parameters:
  • id (string) – Id of an existing track blocked fault configuration

Status Codes:
GET /component/fault-injection/track-blocked-fault/{id}#

Get all information about a track-blocked-fault configuration. This includes the strategy, starting tick, ending tick, injection and resolution probability and the affected element id.

Parameters:
  • id (string) – Id of an existing track blocked fault configuration

Example request:

GET /component/fault-injection/track-blocked-fault/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "description": "string",
        "strategy": "regular",
        "start_tick": 1,
        "end_tick": 1,
        "inject_probability": 1.0,
        "resolve_probability": 1.0,
        "affected_element_id": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

GET /component/fault-injection/track-speed-limit-fault#

Get the ids of track-speed-limit-fault configurations. Use this in the simulation configuration.

Query Parameters:
  • simulationId (string) – Specify id of simulation if you only want to get the track-speed-limit-fault configuration of a single simulation

Example request:

GET /component/fault-injection/track-speed-limit-fault HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Simulation not found

POST /component/fault-injection/track-speed-limit-fault#

Insert a new track-speed-limit-fault configuration. It returns the id of the configuration object. Use this in the simulation configuration. A track-speed-limit fault edits the maximum allowed speed of a train on a track for some time. You define the affected track with the field ‘affected_element_id’. You can find the id of the tracks in the SUMO configuration. Set the new temporal speed limit with ‘new_speed’. You can specify the amount of time with the fields ‘start_tick’ and ‘end_tick’. Set the injection probability and resolve the fault with ‘inject_probability’ and ‘resolve_probability’id. Additionally, you can set a fault injection, either regular or random, with the field ‘strategy’.

Example request:

POST /component/fault-injection/track-speed-limit-fault HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "description": "string",
    "strategy": "regular",
    "start_tick": 1,
    "end_tick": 1,
    "inject_probability": 1.0,
    "resolve_probability": 1.0,
    "affected_element_id": "string",
    "new_speed_limit": 1
}
Status Codes:
  • 201 Created

    Successfully created new track-speed-limit-fault configuration object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

DELETE /component/fault-injection/track-speed-limit-fault/{id}#

Delete a track-speed-limit-fault configuration. This is not possible if this configuration is referenced by a simulation configuration.

Parameters:
  • id (string) – Id of an existing track speed limit fault configuration

Status Codes:
GET /component/fault-injection/track-speed-limit-fault/{id}#

Get all information about a track-speed-limit-fault configuration. This includes the strategy, starting tick, ending tick, injection and resolution probability, the affected element id and the new speed limit.

Parameters:
  • id (string) – Id of an existing track speed limit fault configuration

Example request:

GET /component/fault-injection/track-speed-limit-fault/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "description": "string",
        "strategy": "regular",
        "start_tick": 1,
        "end_tick": 1,
        "inject_probability": 1.0,
        "resolve_probability": 1.0,
        "affected_element_id": "string",
        "new_speed_limit": 1
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

GET /component/fault-injection/train-prio-fault#

Get ids of train-prio-fault configurations. Use this in the simulation configuration.

Query Parameters:
  • simulationId (string) – Specify id of simulation if you only want to get the train-prio-fault configuration of a single simulation

Example request:

GET /component/fault-injection/train-prio-fault HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Simulation not found

POST /component/fault-injection/train-prio-fault#

Insert a new train-prio-fault configuration. It returns the id of the configuration object. Use this in the simulation configuration. A train-prio fault edits the priority of a train for some time. You define the affected train with the field ‘affected_element_id’. The ids of a train are composed of the id of the connected schedule, the tick when the train spawns, and the train type (either cargo or passenger). Set the temporal priority with ‘new_prio’. You can specify the amount of time with the fields ‘start_tick’ and ‘end_tick’. Set the injection probability and resolve the fault with ‘inject_probability’ and ‘resolve_probability’id. Additionally, you can set a fault injection, either regular or random, with the field ‘strategy’.

Example request:

POST /component/fault-injection/train-prio-fault HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "description": "string",
    "strategy": "regular",
    "start_tick": 1,
    "end_tick": 1,
    "inject_probability": 1.0,
    "resolve_probability": 1.0,
    "affected_element_id": "string",
    "new_prio": 1.0
}
Status Codes:
  • 201 Created

    Successfully created new train-prio-fault configuration object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

DELETE /component/fault-injection/train-prio-fault/{id}#

Delete a train-prio-fault configuration. This is not possible if this configuration is referenced by a simulation configuration.

Parameters:
  • id (string) – Id of an existing train prio fault configuration

Status Codes:
GET /component/fault-injection/train-prio-fault/{id}#

Get all information about a train-prio-fault configuration. This includes the strategy, starting tick, ending tick, injection and resolution probability, the affected element id and the new prio.

Parameters:
  • id (string) – Id of an existing train prio fault configuration

Example request:

GET /component/fault-injection/train-prio-fault/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "description": "string",
        "strategy": "regular",
        "start_tick": 1,
        "end_tick": 1,
        "inject_probability": 1.0,
        "resolve_probability": 1.0,
        "affected_element_id": "string",
        "new_prio": 1.0
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

GET /component/fault-injection/train-speed-fault#

Get ids of train-speed-fault configurations. Use this in the simulation configuration.

Query Parameters:
  • simulationId (string) – Specify the id of simulation if you only want to get the train-speed-fault configuration of a single simulation

Example request:

GET /component/fault-injection/train-speed-fault HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Simulation not found

POST /component/fault-injection/train-speed-fault#

Insert a new train-speed-fault configuration. It returns the id of the configuration object. Use this in the simulation configuration. A train-speed fault edits the maximum speed of a train for a specified period of time. You define the affected train with the field ‘affected_element_id’. The ids of a train are composed of the id of the connected schedule, the tick when the train spawns, and the train type (either cargo or passenger). Set the temporal priority with ‘new_speed’. You can specify the amount of time with the fields ‘start_tick’ and ‘end_tick’. Set the injection probability and resolve the fault with ‘inject_probability’ and ‘resolve_probability’id. Additionally, you can set a fault injection, either regular or random, with the field ‘strategy’.

Example request:

POST /component/fault-injection/train-speed-fault HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "description": "string",
    "strategy": "regular",
    "start_tick": 1,
    "end_tick": 1,
    "inject_probability": 1.0,
    "resolve_probability": 1.0,
    "affected_element_id": "string",
    "new_speed": 1.0
}
Status Codes:
  • 201 Created

    Successfully created new train-speed-fault configuration object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

DELETE /component/fault-injection/train-speed-fault/{id}#

Delete a train-speed-fault configuration. This is not possible if this configuration is referenced by a simulation configuration.

Parameters:
  • id (string) – Id of an existing train speed fault configuration

Status Codes:
GET /component/fault-injection/train-speed-fault/{id}#

Get all information about a train-speed-fault configuration. This includes the strategy, starting tick, ending tick, injection and resolution probability, the affected element id and the new speed.

Parameters:
  • id (string) – Id of an existing train speed fault configuration

Example request:

GET /component/fault-injection/train-speed-fault/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "description": "string",
        "strategy": "regular",
        "start_tick": 1,
        "end_tick": 1,
        "inject_probability": 1.0,
        "resolve_probability": 1.0,
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "affected_element_id": "string",
        "new_speed": 1.0
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

GET /component/fault-injection/platform-blocked-fault#

Get the ids of platform-blocked-fault configurations. Use this in the simulation configuration.

Query Parameters:
  • simulationId (string) – Specify id of simulation if you only want to get the platform-blocked-fault configuration of a single simulation

Example request:

GET /component/fault-injection/platform-blocked-fault HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    [
        "string"
    ]
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Simulation not found

POST /component/fault-injection/platform-blocked-fault#

Insert a new platform-blocked-fault configuration. It returns the id of the configuration object. Use this in the simulation configuration. A platform-blocked fault blocks a platform for trains for a specified period of time. You define the affected platform with the field ‘affected_element_id’. You can find the ids of the platforms in the SUMO configuration. You can specify the amount of time with the fields ‘start_tick’ and ‘end_tick’. Set the injection probability and resolve the fault with ‘inject_probability’ and ‘resolve_probability’id. Additionally, you can set a fault injection, either regular or random, with the field ‘strategy’.

Example request:

POST /component/fault-injection/platform-blocked-fault HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "description": "string",
    "strategy": "regular",
    "start_tick": 1,
    "end_tick": 1,
    "inject_probability": 1.0,
    "resolve_probability": 1.0,
    "affected_element_id": "string"
}
Status Codes:
  • 201 Created

    Successfully created new platform-blocked-fault configuration object

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "id": "string"
    }
    

  • 401 Unauthorized – Token is missing

DELETE /component/fault-injection/platform-blocked-fault/{id}#

Delete a platform-blocked-fault configuration. This is not possible if this configuration is referenced by a simulation configuration.

Parameters:
  • id (string) – Id of an existing platform blocked fault configuration

Status Codes:
GET /component/fault-injection/platform-blocked-fault/{id}#

Get all information about a platform-blocked-fault configuration. This includes the strategy, starting tick, ending tick, injection and resolution probability and the affected element id.

Parameters:
  • id (string) – Id of an existing platform blocked fault configuration

Example request:

GET /component/fault-injection/platform-blocked-fault/{id} HTTP/1.1
Host: example.com
Status Codes:
  • 200 OK

    Successful operation

    Example response:

    HTTP/1.1 200 OK
    Content-Type: application/json
    
    {
        "id": "string",
        "updated_at": "2023-07-31",
        "created_at": "2023-07-31",
        "readable_id": "string",
        "description": "string",
        "strategy": "regular",
        "start_tick": 1,
        "end_tick": 1,
        "inject_probability": 1.0,
        "resolve_probability": 1.0,
        "affected_element_id": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 404 Not Found – Id not found

token#

POST /token#

Create a new token with specified permission specified in body if current user is admin. Returns the clear token. Please provide this token in future requests in the header.

Example request:

POST /token HTTP/1.1
Host: example.com
Content-Type: application/json

{
    "permission": "user",
    "name": "string"
}
Status Codes:
  • 201 Created

    Successfully created new token

    Example response:

    HTTP/1.1 201 Created
    Content-Type: application/json
    
    {
        "permission": "user",
        "name": "string"
    }
    

  • 401 Unauthorized – Token is missing

  • 403 Forbidden – Permission is missing