Skip to content

Actions

Actions functions as a "controller" for simulations once they have started. 'Started' in this case means that the processes needed for the calculations core to be able to run have started - the 3Di calculation core thus, has been initialized. By sending POST requests to the actions endpoint, it is now possible to pause the calculation or to shut it down forcefully.

POST /simulations/{id}/actions/

Parameter Type Description
name string Should be a value from the table below, describing the action you want to apply.
duration int Automatically pause the simulation after a given duration [seconds]. Only valid when using name=start.
timeout int When paused, the simulation will automatically be shutdown after the default timeout of 300 seconds has been reached. You can customize this value by specifying the timeout parameter.

Action name💡

Name Description
initialize The simulation will be started and immediately set to status paused.
start Initializes and directly starts the simulation.
pause The calculation will be paused until resumed by yet another start request. If the simulation is not resumed within the given timeout, the calculation will be stopped and the simulation container removed. The default timeout is 5 minutes. It is possible to change the timeout value by adding the timeout:<value> parameter to the pause request.
shutdown Requesting a shutdown will result in an immediate termination of the calculation. The status of the simulation will be set to 'finished.' Results of the simulation till this point will still be uploaded and available for further analysis.
queue This queues the simulation. Queued simulations will be started as soon as a session spot becomes available. Once a session spot becomes available, the simulation will begin automatically. The response body will then contain

💡

from threedi_api_client.api import ThreediApi
from threedi_api_client.versions import V3Api
from threedi_api_client.openapi.models import Action

with ThreediApi() as api_client:
    api_client: V3Api

    start_action = Action(name="start")
    # start_action = {"name": "start"} is also allowed.

    organisations = api_client.simulations_actions_create(<simulation_id>, start_action)