Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
server_hostpathrequiredThe Teamwork Cloud server host name.
server_portpathrequiredThe Teamwork Cloud server port.
TWC_user_namepathoptional

The Teamwork Cloud user name. If you do not specify the user name in the request, an input field will be provided to specify it later.

TWC_user_passwordpathoptionalThe Teamwork Cloud password. If you do not specify the password in the request, an input field will be provided to specify it later.


Tip

For instructions on how to run server-side simulation using SSL, refer to Running server-side simulation with SSL

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescriptionOptions
projectpathrequiredThe Teamwork Cloud project name or ID.NA
versionpathoptionalThe Teamwork Cloud project version.NA
branchpathoptionalThe project branch name or ID. If the branch is omitted, the trunk is used instead.NA
elementpathoptionalThe qualified name or server ID of the element to be executed.NA
configpathoptionalThe Simulation Configuration name or server ID.NA
started_frompathoptionalAllows specifying the starting location of the simulation. The value of the started_from parameter is provided in the status endpoint response.NA
commit_results pathoptional

Commits a new project version with the simulation results. Available values are True or False (default).

NA
verificationpathoptional

Returns the selected verification results. Available values are:

    • All - all verification results are returned.
    • None - no verification results are returned.
    • Fail (default) - verification results with the fail status are returned.
NA
datapathoptionalA set of output parameters, which will be obtained after the simulation is complete.NA

timeout

pathoptional

Allows specifying the timeout duration in minutes. If the timeout parameter is not provided, the sim.timeout.min property will be taken from the webappplatform.properties instead.

NA

sync

pathoptional

Initiates a synchronous API call. If the sync is set to 'True', the call will return when it is completed. Available values are True or False (default).

NA
simconfig bodyoptionalThe set of simulation configuration properties along with their corresponding values. The simulation configuration options you specify will take precedence over the initial configuration option from a model.
  • "ALLOW_CONCURRENT_ALLOCATED_ACTIVITIES": true,
  • "AUTOMATIC_PARAMETRIC_RECALCULATION": true,
  • "AUTO_CONVERT_UNITS": true,
  • "AUTO_CREATE_FUML_OBJECT_OF_OUTPUT_PIN": true,
  • "AUTO_START": true,
  • "AUTO_START_ACTIVE_OPTIONS": true,
  • "AUTO_TERMINATE": true,
  • "CLOCK_RATIO": 1,
  • "CLONE_REFERENCES": true,
  • "COMPLETION_EVENTS_AND_TRANSITIONS": true,
  • "CONSTRAINT_FAILURE_AS_BREAKPOINT": true,
  • "DECIMAL_PLACES": 4,
  • "DEFAULT_LANGUAGE": "JavaScript Rhino",
  • "DURATION_SIMULATION_MODE": "MIN", // possible values: MIN, MAX, AVERAGE, RANDOM
  • "ENDTIME": 0,
  • "ENGINES_PRIORITY": "[on] fUML Engine\n[on] Interaction Engine\n[on] SCXML Engine",
  • "INITIALIZE_NUMERICAL_VALUE": false,
  • "INITIALIZE_REFERENCES": true,
  • "NUMBER_OF_RUNS": 0,
  • "NUMBER_OF_STEPS": 0,
  • "PASS_CALLER_CONTEXT": true,
  • "RECORD_TIMESTAMP": false,
  • "REMEMBER_FAILURE_STATUS": true,
  • "RESULT_LOCATION": "Results",
  • "RUN_FORKS_IN_PARALLEL": true,
  • "SOLVE_AFTER_INITIALIZATION": true,
  • "START_TIME": 0,
  • "STATE_ACTIVATION_SEMANTICS": "BEFORE_ENTRY", // possible values: "BEFORE_ENTRY", "AFTER_ENTRY"
  • "STEP_DELAY": 0,
  • "STEP_SIZE": 0,
  • "TERMINATE_BEHAVIOR_ON_EXCEPTION_THROWN": true,
  • "TERMINATE_NESTED_BEHAVIORS": true,
  • "TERMINATE_STREAMING_BEHAVIORS_BY_OUTPUT_PARAMETER_MULTIPLICITY": false,
  • "TIME_UNIT": "MILLISECOND",
  • "TIME_VALUE": "Model-based Clock Test::Clock::time",
  • "TIME_VARIABLE_NAME": "simtime",
  • "TREAT_ALL_CLASSIFIERS_AS_ACTIVE": true,
  • "USE_FUML_DECISION_SEMANTICS": false


Code Block
titleRequest and response examples
 # SpaceCraftMassRollup sample

parameters = {
    "inputs":
   {
       "telecom.antenna.me":10,
        "telecom.amplifier.me":20
   },
 "outputs": 
    [ 
        "me",
        "propulsion.me",
        "propulsion.tank.me",
        "propulsion.thruster.me",
        "telecom.me",
        "telecom.antenna.me",
        "telecom.amplifier.me"
    ] 
}
        
client.run('SpacecraftMassRollup_SimWeb', config='spacecraft mass analysis', commit_results=False, data=json.dumps(parameters))

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
simulation_idpathoptional

The ID of a specific simulation.

Note

If the simulation_id is not specified, the pyST client will use the simulation_id of the last simulation run.


syncpathoptional

Initiates a synchronous API call. If the sync is set to 'True', the call will return when it is completed. Available values are True or False (default).


Start simulation

Panel
borderColorlightgrey
borderWidth1

client.start(<simulation_id>)

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
simulation_idpathoptional

The ID of a specific simulation.

Note

If the simulation_id is not specified, the pyST client will use the simulation_id of the last simulation run.



Start simulation and get results

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescriptionOptions
projectpathrequiredThe Teamwork Cloud project name or ID.NA
versionpathoptionalThe Teamwork Cloud project version.NA
branchpathoptionalThe project branch name or ID. If the branch is omitted, the trunk is used instead.NA
elementpathoptionalThe qualified name or server ID of the element to be executed.NA
configpathoptionalThe Simulation Configuration name or server ID.NA
commit_results pathoptional

A new project version is committed with the simulation results. Available values are True or False (default).

NA
verificationpathoptional

Returns the selected verification results. Available values are:

    • All - all verification results are returned.
    • None - no verification results are returned.
    • Fail - verification results with the fail status are returned including the main status and the status of requirements and constraints.

If the verification value is not specified, only the verification results with the fail status are returned when the get_results endpoint is called.

NA
datapathoptionalA set of output parameters, which will be obtained after the simulation is complete.NA
simconfig bodyoptionalThe set of simulation configuration properties along with their corresponding values. The simulation configuration options you specify will take precedence over the initial configuration option from a model.
  • "ALLOW_CONCURRENT_ALLOCATED_ACTIVITIES": true,
  • "AUTOMATIC_PARAMETRIC_RECALCULATION": true,
  • "AUTO_CONVERT_UNITS": true,
  • "AUTO_CREATE_FUML_OBJECT_OF_OUTPUT_PIN": true,
  • "AUTO_START": true,
  • "AUTO_START_ACTIVE_OPTIONS": true,
  • "AUTO_TERMINATE": true,
  • "CLOCK_RATIO": 1,
  • "CLONE_REFERENCES": true,
  • "COMPLETION_EVENTS_AND_TRANSITIONS": true,
  • "CONSTRAINT_FAILURE_AS_BREAKPOINT": true,
  • "DECIMAL_PLACES": 4,
  • "DEFAULT_LANGUAGE": "JavaScript Rhino",
  • "DURATION_SIMULATION_MODE": "MIN", // possible values: MIN, MAX, AVERAGE, RANDOM
  • "ENDTIME": 0,
  • "ENGINES_PRIORITY": "[on] fUML Engine\n[on] Interaction Engine\n[on] SCXML Engine",
  • "INITIALIZE_NUMERICAL_VALUE": false,
  • "INITIALIZE_REFERENCES": true,
  • "NUMBER_OF_RUNS": 0,
  • "NUMBER_OF_STEPS": 0,
  • "PASS_CALLER_CONTEXT": true,
  • "RECORD_TIMESTAMP": false,
  • "REMEMBER_FAILURE_STATUS": true,
  • "RESULT_LOCATION": "Results",
  • "RUN_FORKS_IN_PARALLEL": true,
  • "SOLVE_AFTER_INITIALIZATION": true,
  • "START_TIME": 0,
  • "STATE_ACTIVATION_SEMANTICS": "BEFORE_ENTRY", // possible values: "BEFORE_ENTRY", "AFTER_ENTRY"
  • "STEP_DELAY": 0,
  • "STEP_SIZE": 0,
  • "TERMINATE_BEHAVIOR_ON_EXCEPTION_THROWN": true,
  • "TERMINATE_NESTED_BEHAVIORS": true,
  • "TERMINATE_STREAMING_BEHAVIORS_BY_OUTPUT_PARAMETER_MULTIPLICITY": false,
  • "TIME_UNIT": "MILLISECOND",
  • "TIME_VALUE": "Model-based Clock Test::Clock::time",
  • "TIME_VARIABLE_NAME": "simtime",
  • "TREAT_ALL_CLASSIFIERS_AS_ACTIVE": true,
  • "USE_FUML_DECISION_SEMANTICS": false


Code Block
titleRequest and response examples
 # SpaceCraftMassRollup sample

parameters = {
    "inputs":
   {
       "telecom.antenna.me":10,
        "telecom.amplifier.me":20
   },
 "outputs": 
    [ 
        "me",
        "propulsion.me",
        "propulsion.tank.me",
        "propulsion.thruster.me",
        "telecom.me",
        "telecom.antenna.me",
        "telecom.amplifier.me"
    ] 
}
        
client.simulate('SpacecraftMassRollup_SimWeb', config='spacecraft mass analysis', commit_results=False, data=json.dumps(parameters))

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
simulation_idpathoptional

The ID of a specific simulation.

Note

If the simulation_id is not specified, the pyST client will use the simulation_id of the last simulation run.



Code Block
titleRequest and response examples
client.get_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']}


client.get_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}
 
 
client.get_status('b7bdf933-f58d-4e7e-b73b-8370c60485cd')
 
{'state': 'QUEUED',
 'queueNumber': 3,
 'simulationId': 'b7bdf933-f58d-4e7e-b73b-8370c60485cd',
 'simulationTime': '0 ms',
 'project': 'CarBrakingAnalysis',
 'elapsedTime': 52}

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
simulation_idpathoptional

The ID of the running simulation.

Note

If the simulation_id is not specified, the pyST client will use the simulation_id of the last simulation run.


variablespathoptionalThe set of simulation variables that should be obtained. If no variables are specified, the values of all simulation variables are returned.

Set simulation variables

Panel
borderColorlightgrey
borderWidth1
borderStylesolid

client.set_variables(<simulation_id>, variables=json.dumps(<parameters>), context=<context ID>, property_path=<property path>)

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
simulation_idpathoptional

The ID of the running simulation.

Note

If the simulation_id is not specified, the pyST client will use the simulation_id of the last simulation run.


variablespathrequiredThe set of simulation variables with values that should be used during the current simulation.
contextpathoptionalThe context ID.
property_pathpathoptionalThe property path of the context specified using property names or IDs.


Code Block
titleRequest and response examples
var = {
 "variables":
 {
 "position": 40
 }
}

client.set_variables('23ceff24-28fa-47e4-b29f-b6b60b4b12e3', variables=json.dumps(var))
Note
titleAlternative method to set a single simulation variable


A simplified Set Simulation Variable method can be used when setting a single value, which does not require constructing a JSON.

Panel

client.set_variable(<name>, <value>, <simulation_id> (optional), <context> (optional), <propertyPath> (optional)). 

For example, set_variable(name="mass", value=100, propertyPath = "car.engine").

You can also omit parameter names if the parameters are in the correct sequence, for example, client.set_variable("mass", 100).


Pause simulation

Panel
borderColorlightgrey
borderWidth1
borderStylesolid

client.pause(<simulation_id>)

...

The following table describes the parameters used in the REST API request:

ParameterInRequired or optionalDescription
simulation_idpathoptional

The ID of the running simulation.

Note

If the simulation_id is not specified, the pyST client will use the simulation_id of the last simulation run.



Resume simulation

Panel
borderColorlightgrey
borderWidth1
borderStylesolid

client.resume(<simulation_id>)

...

The following table describes the parameters used in the REST API request:

ParameterInRequired or optionalDescription
simulation_idpathoptional

The ID of the running simulation.

Note

If the simulation_id is not specified, the pyST client will use the simulation_id of the last simulation run.



Get simulation results

Panel
borderColorlightgrey
borderWidth1
borderStylesolid

client.get_result(<simulation_id>)

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
simulation_idpathoptional

The ID of the running simulation.

Note

If the simulation_id is not specified, the pyST client will use the simulation_id of the last simulation run.



Get the list of running simulations

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
simulation_idpathoptional

The ID of a specific simulation.

Note

If the simulation_id is not specified, the pyST client will use the simulation_id of the last simulation run.


syncpathoptional

Initiates a synchronous API call. If the sync is set to 'True', the call will return when it is completed. Available values are True or False (default).


Check for Simulation Configurations

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
projectpathrequiredThe Teamwork Cloud project name or ID.
versionpathoptionalThe Teamwork Cloud project version.
branchpathoptionalThe project branch name or ID. If the branch is omitted, the trunk is used instead.


Get Simulation Configurations

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
projectpathrequiredThe Teamwork Cloud project name or ID.
versionpathoptionalThe Teamwork Cloud project version.
branchpathoptionalThe project branch name or ID. If the branch is omitted, the trunk is used instead.
elementpathoptionalThe qualified name or server ID of the element to be executed.
filterpathoptional

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:

  • Frame
  • Table
  • TimeSeries chart
  • Timeline chart


Get Simulation Configuration descriptor

...

The following table describes the parameters used in the request:

ParameterInRequired or optionalDescription
projectpathrequiredThe Teamwork Cloud project name or ID.
versionpathoptionalThe Teamwork Cloud project version.
branchpathoptionalThe project branch name or ID. If the branch is omitted, the trunk is used instead.
configpathoptionalThe Simulation Configuration name or server ID.


Code Block
titleRequest and response examples
 client.get_descriptor('SpacecraftMassPollup_SimWeb', 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'}]}]}}


client.get_descriptor('BouncingBall', config='Run BouncingBall')


{'config': 'Run BouncingBall',
 'description': 'Simulation Config dedicated to run simulation with bouncingBall.fmu.',
 'model': 'bouncingBall',
 'timeStep': '10 ms' 
 }

...