Page History
Content layer | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The following table describes the parameters used in the REST API request:
|
Panel | ||||
---|---|---|---|---|
| ||||
GET /simulation/api/status/<simulation_id> |
This REST API request gets the status, simulation time, 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). For iterative executions (e.g., TradeStudy and MonteCarlo), the request also returns the total number of iteration runs and the number of the currently running iteration. If the simulation is placed in a waiting line, the QUEUED state and queued number are provided. If the model has a UI mockup, Time Series Chart, Timeline Chart, or HTML Table, you can use the URL provided in the 'ui' or indexUI' key to open the specified UI. If a user has the administrator role, the user ID is also returned.
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. |
Code Block | ||
---|---|---|
| ||
/simulation/api/status/77d0c496-c1e2-42cd-8ba4-04e4c7f359d3 {'state': 'RUNNING', 'simulationId': '77d0c496-c1e2-42cd-8ba4-04e4c7f359d3', 'simulationTime': '0 ms', 'indexUI': 'http://nm-simulation.dsone.3ds.com/simulation/api/ui/index/77d0c496-c1e2-42cd-8ba4-04e4c7f359d3?pages=Coffee%20Machine.html&pages=Water%20Heating%20Element.html&pages=Wallet.html', 'project': 'CoffeeMachine', 'config': 'Coffee Machine', 'elapsedTime': 0, 'podName': 'simulation-deployment-6989d5dfc9-r6llk', 'ui': ['http://nm-simulation.dsone.3ds.com/simulation/api/ui/77d0c496-c1e2-42cd-8ba4-04e4c7f359d3/Coffee%20Machine.html', 'http://nm-simulation.dsone.3ds.com/simulation/api/ui/77d0c496-c1e2-42cd-8ba4-04e4c7f359d3/Water%20Heating%20Element.html', 'http://nm-simulation.dsone.3ds.com/simulation/api/ui/77d0c496-c1e2-42cd-8ba4-04e4c7f359d3/Wallet.html']} /simulation/api/status/ce8c8215-0515-43fd-9d34-92d1d7a95d87 {'state': 'COMPLETED', 'simulationId': 'ce8c8215-0515-43fd-9d34-92d1d7a95d87', 'simulationTime': '3000 ms', 'project': 'SpacecraftMassRollup', 'config': 'spacecraft mass analysis', 'elapsedTime': 6598} /simulation/api/status/b7bdf933-f58d-4e7e-b73b-8370c60485cd {'state': 'QUEUED', 'queueNumber': 3, 'simulationId': 'b7bdf933-f58d-4e7e-b73b-8370c60485cd', 'simulationTime': '0 ms', 'project': 'CarBrakingAnalysis', 'elapsedTime': 52} |
Get simulation variables
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
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. |
Code Block | ||
---|---|---|
| ||
/simulation/api/get/ce8c8215-0515-43fd-9d34-92d1d7a95d87 { "variables": [ "propulsion.tank.me", "propulsion.thruster.me", "telecom.antena.me", "telecom.amplifier.me" ] } |
Set simulation variables
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
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. |
Code Block | ||
---|---|---|
| ||
/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 } } |
Pause simulation
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
POST /simulation/api/pause/<simulation_id> |
This REST API request pauses the execution of 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 the running simulation. |
Resume simulation
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
POST /simulation/api/resume/<simulation_id> |
This REST API request resumes the execution of 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 the running simulation. |
Get simulation results
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
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. If the CSV export is specified for the Simulation Configuration, the CSV export results are returned in JSON format. If a Time Series or Timeline chart is specified for the Simulation Configuration, the chart data is returned in JSON format as well.
The figure below demonstrates how to specify input and output parameters.
Specifying input and output parameters.
Note |
---|
|
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. |
Code Block | ||
---|---|---|
| ||
/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 the list of running simulations
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
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.
Code Block | ||
---|---|---|
| ||
/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" ] } |
Terminate simulation
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
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. |
Code Block | ||
---|---|---|
| ||
/simulation/api/terminate/4e35bc60-2c66-48e8-96e2-80f5270c08cf /simulation/api/status/4e35bc60-2c66-48e8-96e2-80f5270c08cf { "state": "TERMINATED", "elapsedTime": 11702 } |
Check for Simulation Configurations
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
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. |
Code Block | ||
---|---|---|
| ||
/simulation/api/hasConfigs/project/SpacecraftMassRollup { "hasConfigs": true } |
Get Simulation Configurations
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
GET /simulation/api/configs/project/<project>/version/<version>/branch/<branch>/element/<element> |
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:
- Whose execution target is the classifier of the executable element.
- Whose execution target is the Instance Specification having at least one classifier matching those of the executable element.
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 | path | optional | The qualified name or server ID of the element to be executed. |
?filter | query | optional | Returns Simulations Configurations with a specified UI tag for a particular project. The only possible value for the filter parameter is ui. Only Simulations Configurations having at least one of the following UI elements are returned:
|
Code Block | ||
---|---|---|
| ||
/simulation/api/configs/project/SpacecraftMassRollup { "id": "7915fcfa-fd88-4910-8560-13f4439cec3d", "name": "spacecraft mass analysis", "description": "" } |
Get Simulation Configuration descriptor
Panel | ||||||
---|---|---|---|---|---|---|
| ||||||
GET simulation/api/descriptor/project/<project>/version/<version>/branch/<branch>/config/<config> |
This REST API request retrieves Simulation Configuration data (description, execution target, time step, 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.
Specifying 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 | optional | The Simulation Configuration name or server ID. |
Code Block | ||
---|---|---|
| ||
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'}]}]}} simulation/api/descriptor/project/BouncingBall/config/Run BouncingBall {'config': 'Run BouncingBall', 'description': 'Simulation Config dedicated to run simulation with bouncingBall.fmu.', 'model': 'bouncingBall', 'timeStep': '10 ms' } |