v1

latestOpenAPI 3.1.02026-07-24239123562.1 KB
Commands

Create command

Use this endpoint to create a new command for an on-premises connector/agent. It also automatically sends command to SQS queue for execution. Once it is in the queue, the connector/agent listening on the target queue picks up the command, tries to execute it, and sends the response back to the command service. The maximum create command request size is 10 MB.

post/v1/commands

Request body

targetIdstring required

Agent or Connector ID for which command should be created

actionstring required

Action label, such as TetraScience.Connector.sdc.CreateMeasurementOrder

expiresAtstring required

Command expiration time (ISO timestamp). Must be at least 60 seconds from the current time.

metadataobject

Metadata key-value pairs

payloadobject required

Request body for the command

payloadDelivery'embedded' | 'referenced'

The delivery method for the command payload. When "embedded" is specified the command body is included in the SQS message payload. When "referenced" is specified the command body is stored in S3 and only a reference to the S3 object is included in the SQS message payload. In case no value is passed and payload is small enough to be transferred over SQS "embedded" is used, otherwise "referenced" is used.

Response

200

idstring
orgSlugstring
targetIdstring
actionstring
expiresAtstring
metadataobject
statusstring
{"stackTrail":"paths:/v1/commands:post:responses:200:content:application/json:schema:properties:responseBody","oasType":"schema","type":"unknown"}
requestPayloadDelivery'embedded' | 'referenced'
createdByEntitystring
createdBystring
createdAtstring
updatedAtstring

Example response

{
  "id": "7992e5d6-15bf-4f5b-af06-47f3380ca75a",
  "orgSlug": "tetrascience",
  "targetId": "b143e7c5-90ae-4b69-895a-decf0b1dfb38",
  "action": "TetraScience.Connector.gdc.HttpRequest",
  "expiresAt": "2021-01-31T23:58:43.749Z",
  "status": "PENDING",
  "requestBody": {
    "body": {
      "url": "https://sdc.test.com:9005/SDC/Smartreports/ExportedMeasurements",
      "body": {
        "raw": "{\"InterfaceId\":\"1\",\"LastInterfaceResultId\":\"0\"}",
        "mode": "raw"
      },
      "method": "POST",
      "headers": [
        {
          "Authorization": "Basic ..."
        }
      ],
      "ignore_tls_certificate": true
    },
    "action": "TetraScience.Connector.gdc.HttpRequest",
    "targetId": "b143e7c5-90ae-4b69-895a-decf0b1dfb38",
    "commandId": "7992e5d6-15bf-4f5b-af06-47f3380ca75a",
    "createdAt": "2021-01-20T10:25:02.807Z",
    "expiresAt": "2021-01-31T23:58:43.749Z"
  },
  "requestPayloadDelivery": "embedded",
  "createdByEntity": "user",
  "createdBy": "59eb8bd4-8b10-43b3-ac57-fe3ab86c05fd",
  "createdAt": "2021-01-20T10:25:02.807Z",
  "updatedAt": "2021-01-20T10:25:02.872Z"
}