The following table describes the parameters used in the REST API request:
|
POST simulation/api/step/<simulation_id> |
This REST API request performs a single time step of the specified simulation. To run the simulation by step, it should be run with the ?autoStart query parameter set to false.
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of a specific simulation. |
POST /simulation/api/start/<simulation_id> |
This REST API request starts the execution of the specified simulation. If the initialization phase is still in progress, the start endpoint is memorized and sent when the initialization phase is completed.
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of a specific simulation. |
GET /simulation/api/status/<simulation_id> |
This REST API request gets the status, simulation time, queued number, and elapsed time of a specific simulation. It returns the actual elapsed time of the simulation thread and the simulation state (INITIALIZED, INITIALIZING, READY, QUEUED, RUNNING, COMPLETED, TERMINATING, TERMINATED, ERROR). If the simulation is placed in a waiting line, the QUEUED state and queued number will be provided. The user ID is also returned if the user has the administrator role.
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of a specific simulation. |
/simulation/api/status/ce8c8215-0515-43fd-9d34-92d1d7a95d87 {'state': 'COMPLETED', 'simulationId': '55089221-8673-4391-aa3e-a8e774ecfa48', 'simulationTime': '3000 ms', 'elapsedTime': 6598} /simulation/api/status/ce8c8215-0515-43fd-9d34-92d1d7a95d87 {'state': 'QUEUED', 'queueNumber': 3, 'simulationId': 'ee99c51f-a8e8-40a4-a109-8f97aa579a33', 'simulationTime': '0 ms', 'elapsedTime': 52} simulation/api/status/b583a710-c538-4d7d-b49c-337673bce9a4 {'state': "RUNNING', 'simulationId': 'b583a710-c538-4d7d-b49c-337673bce9a4', 'simulationTime': '310 ms', 'ui': '<server_address>/simulation/api/ui/b583a710-c538-4d7d-b49c-337673bce9a4', 'elapsedTime': 12539} |
POST simulation/api/get/<simulation_id> |
This REST API request returns a list of simulation variables during simulation.
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of the running simulation. |
variables | body | optional | The set of simulation variables that should be obtained. If no variables are specified, the values of all simulation variables are returned. |
/simulation/api/get/ce8c8215-0515-43fd-9d34-92d1d7a95d87 { "variables": [ "propulsion.tank.me", "propulsion.thruster.me", "telecom.antena.me", "telecom.amplifier.me" ] } |
POST simulation/api/set/<simulation_id> |
This REST API request specifies values for a provided list of simulation variables during simulation.
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of the running simulation. |
variables | body | required | The set of simulation variables with values that should be used during the current simulation. |
context | body | optional | The context ID. |
propertyPath | body | optional | The property path of the context specified using property names or IDs. |
/simulation/api/set/ce8c8215-0515-43fd-9d34-92d1d7a95d87 Request body: { "variables": { "propulsion.tank.me": 38, "propulsion.thruster.me": 30, "telecom.antena.me": 19, "telecom.amplifier.me": 8 } } |
GET /simulation/api/result/<simulation_id> |
This REST API request returns the results of the specified simulation. You can specify what output parameters should be returned in the run REST API body. If output parameters are not specified, all output parameters are obtained. The verification results are returned based on the value of the verification parameter of the Run Simulation endpoint. In addition, if the CSV export is specified for the Simulation Configuration, the CSV export results are returned in the JSON format.
The figure below demonstrates how to specify input and output parameters.
|
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of the running simulation. |
/simulation/api/results/ce8c8215-0515-43fd-9d34-92d1d7a95d87 { "outputs": { "me": 98.0, "propulsion.me": 68.0, "propulsion.tank.me": 38.0, "propulsion.thruster.me": 30.0, "telecom.me": 30.0, "telecom.antenna.me": 10.0, "telecom.amplifier.me": 20.0 }, "csv exports": { "'SpaceCraftResults'": "me,propulsion.me,propulsion.tank.me,propulsion.thruster.me,telecom.me,telecom.amplifier.me,telecom.antenna.me\n98.0000,68.0000,38.0000,30.0000,30.0000,20.0000,10.0000\n98.0000,68.0000,38.0000,30.0000,30.0000,20.0000,10.0000\n98.0000,68.0000,38.0000,30.0000,30.0000,20.0000,10.0000\n" } } /simulation/api/results/309c8e47-4bdc-49be-b10a-aeacd9697584 {'outputs': {'requiredStoppingDistance': 49.09927575033121, 'stoppingDistance': 36.32807361129315}, 'verification': [{'property': 'brakeLifeExpectancy', 'status': 'fail', 'value': 56413.07910758578, 'requirements': [{'id': '3', 'text': 'Brake pads shall have a projected life of at least 57500 kilometers under normal driving conditions, as per industry standard assumptions.', 'constraint': 'brakeLifeExpectancy>=57500', 'status': 'fail', 'margin': -1086.92089241422, 'timestamp': 0}]}, {'property': 'wheel.brake.rotor.outerDiameter', 'status': 'fail', 'value': 0.25, 'requirements': [{'id': '6', 'text': 'The brake rotors shall have a 0.28 meter diameter.', 'constraint': 'outerDiameter==0.28', 'status': 'fail', 'margin': -0.03, 'timestamp': 0}]}]} |
GET /simulation/api/running |
This REST API request gets the list of all currently running simulations including the queued simulations that are placed in a waiting line.
/simulation/api/running { "running": [ "f5c574a8-cd9c-4dbd-aae4-b1d18f048721", "ac1afe0a-c093-4eb1-865e-081c381d7f9f" ], "queued": [ "ee99c51f-a8e8-40a4-a109-8f97aa579a33", "7c92a019-08b5-49bd-8c67-874613dcc1ae", "67840dbf-2071-4408-be76-8027e8a7aa48" ] } |
POST /simulation/api/terminate/<simulation_id> |
This REST API request terminates the specified simulation.
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
simulation_id | path | required | The ID of a specific simulation. |
/simulation/api/terminate/4e35bc60-2c66-48e8-96e2-80f5270c08cf /simulation/api/status/4e35bc60-2c66-48e8-96e2-80f5270c08cf { "state": "TERMINATED", "elapsedTime": 11702 } |
GET /simulation/api/hasConfigs/project/<project>/version/<version>/branch/<branch> |
This REST API request checks if the project has any Simulation Configurations.
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
project | path | required | The Teamwork Cloud project name or ID. |
version | path | optional | The Teamwork Cloud project version. |
branch | path | optional | The project branch name or ID. If the branch is omitted, the trunk is used instead. |
version | path | optional | The Teamwork Cloud project version. |
/simulation/api/hasConfigs/project/SpacecraftMassRollup { "hasConfigs": true } |
GET /simulation/api/configs/project/<project>/version/<version>/branch/<branch>/element/<element_id> |
This REST API request retrieves element IDs, names, and descriptions of the Simulation Configurations available for the given executable element.
If the executable element is an Instance Specification, the method returns the following Simulation Configurations:
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
project | path | required | The Teamwork Cloud project name or ID. |
version | path | optional | The Teamwork Cloud project version. |
branch | path | optional | The project branch name or ID. If the branch is omitted, the trunk is used instead. |
element_id | path | optional | The server ID of the Instance Specification to be executed. |
/simulation/api/configs/project/SpacecraftMassRollup { "id": "7915fcfa-fd88-4910-8560-13f4439cec3d", "name": "spacecraft mass analysis", "description": "" } |
GET simulation/api/descriptor/project/<project>/version/<version>/branch/<branch>/config/<config> |
This REST API request retrieves Simulation Configuration data (description, execution target, input and output parameters) from the specified project. The set of input and output parameters is specified using the Input Parameters and Output Parameters properties of a Simulation Configuration. The figure below demonstrates how to specify input and output parameters.
The following table describes the parameters used in the REST API request:
Parameter | In | Required or optional | Description |
---|---|---|---|
project | path | required | The Teamwork Cloud project name or ID. |
version | path | optional | The Teamwork Cloud project version. |
branch | path | optional | The project branch name or ID. If the branch is omitted, the trunk is used instead. |
config | path | required | The Simulation Configuration name or server ID. |
simulation/api/descriptor/project/SpacecraftMassRollup/config/spacecraft mass analysis {'config': 'spacecraft mass analysis', 'description': 'Simulation Config that is dedicated to run spacecraft mass rollup.', 'model': 'spacecraft', 'parameters': {'inputs': [{'parameter': 'telecom.amplifier.me', 'value': 32.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'telecom.antenna.me', 'value': 32.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'propulsion.tank.me', 'value': 68.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'propulsion.thruster.me', 'value': 68.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}], 'outputs': [{'parameter': 'telecom.me', 'value': 32.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'propulsion.me', 'value': 68.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}, {'parameter': 'me', 'value': 95.0, 'type': 'mass[kilogram]', 'unit': 'kilogram', 'requirements': [{'id': '1', 'text': 'Estimated mass shall be less than allocated mass'}]}]}} |