Docs / Yamcs HTTP API / Instances / Control Instance

Control Instance

Control a Yamcs instance: -> Allows to control (start/stop/restart) a Yamcs instance:

Suggest to have “stop”, “restarted”… in fixed width character, see the Control Processor. Also the description should not be in bold.

POST /api/instances/:instance?state=:state

Parameters

Name Type Description
state string

It can be: stop/stopped, restarted or running.

stop/stopped - stop all services of the instance. The instance state will be OFFLINE. If the instance state is already OFFLINE, this call will do nothing.

restarted - if the instance state is RUNNING, the instance will be stopped and then restarted. Otherwise the instance will be started. Note that the Mission Database will be also reloaded before restart.

running - start the instance. If the instance is in the RUNNING state, this call will do nothing. Otherwise the instance will be started.

Example

POST /api/instances/simulator?state=stop

Response:

Status: 200 OK
{
  "name": "simulator",
  "missionDatabase": {
  },
  "missionTime": "2019-03-12T11:06:08.514Z",
  "state": "OFFLINE"
}

Other Example:

 POST /api/instances/simulator?state=running

Response:

Status: 200 OK
{
  "name": "simulator",
  "missionDatabase": {
    "name": "",
    "spaceSystem": [{
      "name": "yamcs",
      "qualifiedName": "/yamcs",
      "parameterCount": 0,
      "containerCount": 0,
      "commandCount": 0,
      "algorithmCount": 0,
      "sub": [{
        "name": "cmdHist",
        "qualifiedName": "/yamcs/cmdHist",
        "parameterCount": 1,
        "containerCount": 0,
        "commandCount": 0,
        "algorithmCount": 0
      }, {
        "name": "cmd",
        "qualifiedName": "/yamcs/cmd",
        "parameterCount": 0,
        "containerCount": 0,
        "commandCount": 0,
        "algorithmCount": 0,
        "sub": [{
          "name": "arg",
          "qualifiedName": "/yamcs/cmd/arg",
          "parameterCount": 1,
          "containerCount": 0,
          "commandCount": 0,
          "algorithmCount": 0
        }]
      }
      ...
}