REST API

GET /simulation

Gets the list of simulations on this server.

Status Codes
  • 200 OK – Simulations retrieved successfully

POST /simulation

Creates a new simulation in the specified state.

< json string experimentID

The experiment ID of the experiment

< json string experimentConfiguration

The file describing the experiment configuration

< json string mainScript

The main script of the experiment

< json string state

The initial state of the simulation (default: “initialized”)

< json string owner

The simulation owner (ebrains username or ‘hbp-default’)

< json string ctxId

The context id of the collab if we are running a collab based simulation

> json string state

The initial state of the simulation (default: “initialized”)

> json integer simulationID

The id of the simulation (needed for further REST calls)

< json string experimentConfiguration

The file describing the experiment configuration

< json string mainScript

The main script of the experiment

> json string owner

The simulation owner (ebrains username or ‘hbp-default’)

> json string creationDate

Date of creation of this simulation

> json string experimentID

The experiment ID of the experiment

Status Codes
  • 409 Conflict – Another simulation is already running on the server

  • 201 Created – Simulation created successfully

GET /version

Returns the versions of all NRP python component packages.

> json string hbp_nrp_backend

version

> json string hbp_nrp_simserver

version

Status Codes
  • 200 OK – Success. Components versions has been retrieved

GET /simulation/(int: sim_id)/state

Gets the state of the simulation with the specified simulation id. Possible values are simulation_lifecycle.SimulationLifecycle.STATES.

Parameters
  • sim_id – The simulation id

> json string state

The state of the simulation

Status Codes
  • 404 Not Found – The simulation with the given ID was not found

  • 401 Unauthorized – Insufficient permissions to see the simulation changes. You can only see the simulations you own or those for which the experiment has been shared with you

  • 200 OK – Success. The simulation state has been retrieved

PUT /simulation/(int: sim_id)/state

Sets the simulation with the given name into a new state. Allowed values are: created, initialized, started, paused, stopped

Parameters
  • sim_id – The simulation id

< json string state

The state of the simulation to set

> json string state

The state of the simulation

Status Codes
  • 404 Not Found – The simulation with the given ID was not found

  • 401 Unauthorized – Insufficient permissions to apply changes. Operation only allowed by simulation owner

  • 400 Bad Request – The state transition is invalid

  • 200 OK – Success. The new state has been correctly applied

GET /simulation/(int: sim_id)

Gets the simulation with the specified simulation id

Parameters
  • sim_id – The simulation ID

> json string state

The current state of the simulation

> json integer simulationID

The id of the simulation (needed for further REST calls)

> json string environmentConfiguration

Path and name of the environment configuration file

> json string owner

The simulation owner (Ebrains user id or ‘hbp-default’)

> json string creationDate

Date of creation of this simulation

> json string experimentID

The experiment ID if the experiment is using the storage

Status Codes
  • 404 Not Found – The simulation with the given ID was not found

  • 401 Unauthorized – Insufficient permissions to see the simulation changes. You can only see the simulations you own or those for which the experiment has been shared with you

  • 200 OK – Simulation retrieved successfully