v1

latestOpenAPI 3.1.02026-07-24239123562.1 KB
Commands

Search commands

Use this endpoint to search all on-premises commands based on various filters. This endpoint is useful when you want to filter out commands, get all successful, or unsuccessful commands, get all commands that are sent to some agent/connector, commands that are created within a certain time range and more.

get/v1/commands

Query parameters

targetIdstring

ID of the target that received and processed command(s). Supports one or more values, such as targetId=71003689-9619-43aa-809a-a693ede72e8b&targetId=740b1e83-eaf0-4e03-b134-97fb575a8c4c

actionstring

Action label, such as TetraScience.Connector.sdc.CreateMeasurementOrder. Supports one or more values, such as action=TetraScience.Connector.sdc.CreateMeasurementOrder&action=TetraScience.Connector.ValidateConfig

statusstring

Command status: CREATED, UNSENT, PENDING, EXPIRED, PURGED, ERROR, PROCESSING, REJECTED, SUCCESS, FAILURE. Supports one or more values, such as status=FAILURE&status=SUCCESS

fromDatestring

Deprecated name for createdAtAfter

toDatestring

Deprecated name for createdAtBefore

createdAtBeforestring

Commands created on or before a given date (ISO timestamp)

createdAtAfterstring

Commands created on or after a given date (ISO timestamp)

expiresAtBeforestring

Commands expiring on or before a given date (ISO timestamp)

expiresAtAfterstring

Commands expiring on or after a given date (ISO timestamp)

updatedAtBeforestring

Commands updated on or before a given date (ISO timestamp)

updatedAtAfterstring

Commands updated on or after a given date (ISO timestamp)

frominteger

Display commands started from specified number in the results array. By default, commands are displayed from the start of the array (the number 0). This parameter is included if the result set is large, pagination might be required. This parameter is typically used in conjunction with size.

sizeinteger

Indicates the number of results to return in the request. This parameter is included if the result set is large, pagination might be required. This parameter is typically used in conjunction with from.

sortBystring

Sort field: createdAt | updatedAt | expiresAt.

sortstring

Sort order: asc | desc

metadatastring

Metadata key-value pairs, such as metadata.vendor=tetra. Pairs must be exact matches of existing metadata values.

Response

200

hasNextboolean
frominteger
sizeinteger
sortstring

Example response

{
  "hits": [
    {
      "id": "013cf44b-e3ef-4757-84c2-ff19a133c955",
      "orgSlug": "mgtest",
      "targetId": "d7f4c013-26c3-4214-ae6c-f14467ad6848",
      "action": "TetraScience.Connector.gdc.HttpRequest",
      "expiresAt": "2021-01-10T23:58:43.749Z",
      "metadata": {
        "key1": "value1",
        "key2": "value2"
      },
      "status": "SUCCESS",
      "requestBody": {
        "body": {
          "url": "https://jsonplaceholder.typicode.com/posts",
          "body": {
            "raw": "{ \"title\": \"foo\", \"body\": \"bar\", \"userId\": 1 }",
            "mode": "raw"
          },
          "method": "POST",
          "ignore_tls_certificate": true
        },
        "action": "TetraScience.Connector.gdc.HttpRequest",
        "targetId": "d7f4c013-26c3-4214-ae6c-f14467ad6848",
        "commandId": "013cf44b-e3ef-4757-84c2-ff19a133c955",
        "createdAt": "2021-01-08T23:32:31.456Z",
        "expiresAt": "2021-01-10T23:58:43.749Z"
      },
      "responseBody": {
        "body": "{\"title\":\"foo\",\"body\":\"bar\",\"userId\":1,\"id\":101}",
        "headers": [
          {
            "date": "Fri, 08 Jan 2021 23:32:33 GMT"
          }
        ],
        "statusCode": 201
      },
      "requestPayloadDelivery": "embedded",
      "createdByEntity": "user",
      "createdBy": "59eb8bd4-8b10-43b3-ac57-fe3ab86c05fd",
      "createdAt": "2021-01-08T23:32:31.456Z",
      "updatedAt": "2021-01-08T23:32:34.219Z"
    }
  ],
  "size": 100,
  "sort": "desc"
}