You can use the following REST API requests to evaluate Teamwork Cloud projects on the server.

Server-side evaluation is available only with the Teamwork Cloud Enterprise license.

Evaluate a parameter or expression

POST /api/projects/<projectID>/commits/<commitID>/evaluate?context=<contextPath>

This REST API request evaluates the specified Teamwork Cloud project parameter or expression.

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

ParameterInRequired or optionalDescription
projectspathrequiredThe Teamwork Cloud project ID.
commitspathoptionalThe commit ID of the Teamwork Cloud project. If the commit ID is not specified, the latest committed version is used instead.
contextpathoptionalThe context path of the outputs, inputs, and expressions used to evaluate and retrieve data, e.g., SpacecraftMassRollup::spaceCraft
inputsbodyoptionalThe set of inputs to be provided for the evaluation. Only inputs with initial values can be modified during evaluation.
outputsbodyoptionalThe set of outputs to be obtained after the evaluation. If no outputs are specified, all values are returned based on the specified context.
expressionsbodyoptional

The parameter or expression you want to evaluate.


Request and response example with the request body

POST /projects/dc8b24ee-462d-4874-8b52-b85978f242cc/evaluate?context=SpacecraftMassRollup::spaceCraft

{
  "inputs":
   {
        "propulsion.thruster.me":10,
        "telecom.amplifier.me":15
   },
 "outputs": 
    [ 
        "me",
        "propulsion.mee",
        "propulsion.tank.me",
        "propulsion.thruster.me",
        "telecom.me",
        "telecom.antenna.me",
        "telecom.amplifier.me"
    ]
}

Response:

{'outputs': 
 {'me': 144.0,
  'propulsion.tank.me': 100.0,
  'propulsion.thruster.me': 10.0,
  'telecom.me': 34.0,
  'telecom.amplifier.me': 15.0,
  'telecom.antenna.me': 19.0
 }
}
SHELL


Request and response example with the request body

POST /projects/fa6e7f27-f922-4718-aba4-6b909d6d1dcc/evaluate

{
  "inputs":
   {
        "TradeStudyAnalysis::VehicleAlternatives::vehicle_A.grossMass":2000,
        "TradeStudyAnalysis::VehicleAlternatives::vehicle_A.grossMass":1000
   }
 "expressions": 
    [ 
        "TradeStudyAnalysis::VehicleAlternatives::vehicle_A.stoppingDistance-TradeStudyAnalysis::VehicleAlternatives::vehicle_B.stoppingDistance"
    ]
}

=== Response ===

{
'expressions': 
 ['TradeStudyAnalysis::VehicleAlternatives::vehicle_A.stoppingDistance-TradeStudyAnalysis::VehicleAlternatives::vehicle_B.stoppingDistance':56.9344
 ]
}
CODE

Display an interactive HTML table

GET /projects/<projectID>/commits/<commitID>/evaluate/table-view?context=<contextPath>?params=<paramsList>?title=<tableTitle>?verification=<FAIL/ALL/NONE>

This REST API request returns a URL to an interactive HTML table that dynamically retrieves data based on the specified context, parameters and/or expressions.

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

ParameterInRequired or optionalDescription
projectspathrequiredThe Teamwork Cloud project ID.
commitspathoptionalThe commit ID of the Teamwork Cloud project. If the commit ID is not specified, the latest committed version is used instead.
contextpathoptionalThe context path of the table parameters and/or expressions used to evaluate and retrieve data, e.g. SpacecraftMassRollup::spaceCraft
paramspathoptionalA comma-separated list of the parameters and/or expressions to display. Use the keyword 'all' to include all available parameters based on the specified context.
titlepathoptionalThe title of the HML table.
verificationpathoptionalSpecify which verification results to display: FAIL - failing values are highlighted in red; ALL - both failing and passing values are highlighted in red and green, respectively; NONE - no verification results are displayed.


Request example

GET /projects/dc8b24ee-462d-4874-8b52-b85978f242cc/commits/3fa85f64-5717-4562-b3fc-2c963f66afa6/evaluate/table-view?context=SpacecraftMassRollup::spaceCraft&params=me,propulsion.tank.me,propulsion.thruster.me&title=SpaceCraftMassRollup
CODE


Request example

GET /projects/dc8b24ee-462d-4874-8b52-b85978f242cc/commits/3fa85f64-5717-4562-b3fc-2c963f66afa6/evaluate/table-view?context=SpacecraftMassRollup::spaceCraft&params=all&title=SpaceCraftMassRollup?verification=fail
CODE


Request example

GET /projects/dc8b24ee-462d-4874-8b52-b85978f242cc/evaluate/table-view?params=SpacecraftMassRollup::spaceCraft.me,SpacecraftMassRollup::spaceCraft.propulsion.tank.me&title=SpaceCraftMassRollup
CODE