Datasets API

This API allows you to create a dataset, list and delete datasets.


Get Datasets

GET /api/v1/datasets

All Datasets for your team may be retrieved by sending a GET request to /api/v1/datasets.

Example Request:

curl -X 'GET' \
  'https://cloud.axiom.co/api/v1/datasets' \
  -H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
  -H 'X-Axiom-Org-ID: <$ORG_ID>'

Example Response:

Response status should be 200, and the response body:

[
  {
    "created": "2022-07-26T02:07:46.349Z",
    "description": "string",
    "id": "string",
    "integrationConfigs": [
      "string"
    ],
    "name": "string",
    "who": "string"
  }
]

Post Dataset

POST /api/v1/datasets

Datasets are created by sending a POST request to /api/v1/datasets.

The body should be a JSON encoded object containing a name.

Response status should be 200, and the body.

Example Request:

curl -X 'POST' \
  'https://cloud.axiom.co/api/v1/datasets' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <$API_TOKEN or $PERSONAL_TOKEN>' \
  -H 'X-Axiom-Org-ID: <$ORG_ID>' \
  -d '{
  "description": "string",
  "name": "string"
}'

Example Response:

{
  "created": "2022-07-20T02:35:14.137Z",
  "description": "string",
  "id": "string",
  "integrationConfigs": [
    "string"
  ],
  "name": "string",
  "who": "string"
}

Post /datasets/_apl

POST /api/v1/datasets/_apl?format=legacy&nocache=true

Example Request:

curl -X 'POST' \
  'https://cloud.axiom.co/api/v1/datasets/_apl?format=legacy&nocache=true' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <$API_TOKEN or $PERSONAL_TOKEN>' \
  -H 'X-Axiom-Org-ID: <$ORG_ID>' \
  -d '{
  "apl": "string",
  "endTime": "string",
  "queryOptions": {
    "against": "string",
    "againstStart": "string",
    "againstTimestamp": "string",
    "caseSensitive": "string",
    "containsTimeFilter": "string",
    "datasets": "string",
    "displayNull": "string",
    "editorContent": "string",
    "endColumn": "string",
    "endLineNumber": "string",
    "endTime": "string",
    "integrationsFilter": "string",
    "openIntervals": "string",
    "quickRange": "string",
    "resolution": "string",
    "startColumn": "string",
    "startLineNumber": "string",
    "startTime": "string",
    "timeSeriesView": "string"
  },
  "startTime": "string"
}'

Example Response:

Response samples with code 200 and the body:

{
  "buckets": {
    "series": [
      {
        "endTime": "2022-07-26T02:48:46.931Z",
        "groups": [
          {
            "aggregations": [
              {
                "op": "string",
                "value": {}
              }
            ],
            "group": {
              "additionalProp1": {},
              "additionalProp2": {},
              "additionalProp3": {}
            },
            "id": 0
          }
        ],
        "startTime": "2022-07-26T02:48:46.931Z"
      }
    ],
    "totals": [
      {
        "aggregations": [
          {
            "op": "string",
            "value": {}
          }
        ],
        "group": {
          "additionalProp1": {},
          "additionalProp2": {},
          "additionalProp3": {}
        },
        "id": 0
      }
    ]
  },
  "datasetNames": [
    "string"
  ],
  "fieldsMetaMap": {
    "additionalProp1": [
      {
        "description": "string",
        "hidden": true,
        "name": "string",
        "type": "string",
        "unit": "string"
      }
    ],
    "additionalProp2": [
      {
        "description": "string",
        "hidden": true,
        "name": "string",
        "type": "string",
        "unit": "string"
      }
    ],
    "additionalProp3": [
      {
        "description": "string",
        "hidden": true,
        "name": "string",
        "type": "string",
        "unit": "string"
      }
    ]
  },
  "matches": [
    {
      "_rowId": "string",
      "_sysTime": "2022-07-26T02:48:46.931Z",
      "_time": "2022-07-26T02:48:46.931Z",
      "data": {
        "additionalProp1": {},
        "additionalProp2": {},
        "additionalProp3": {}
      }
    }
  ],
  "request": {
    "aggregations": [
      {
        "alias": "string",
        "argument": {},
        "field": "string",
        "op": "count"
      }
    ],
    "continuationToken": "string",
    "cursor": "string",
    "endTime": "string",
    "fieldsMeta": [
      {
        "description": "string",
        "hidden": true,
        "name": "string",
        "type": "string",
        "unit": "string"
      }
    ],
    "filter": {
      "caseSensitive": true,
      "children": ["string"],
      "field": "string",
      "op": "and",
      "value": {}
    },
    "groupBy": ["string"],
    "includeCursor": true,
    "limit": 0,
    "order": [
      {
        "desc": true,
        "field": "string"
      }
    ],
    "project": [
      {
        "alias": "string",
        "field": "string"
      }
    ],
    "resolution": "string",
    "startTime": "string",
    "virtualFields": [
      {
        "alias": "string",
        "expr": "string"
      }
    ]
  },
  "status": {
    "blocksExamined": 0,
    "cacheStatus": 0,
    "continuationToken": "string",
    "elapsedTime": 0,
    "isEstimate": true,
    "isPartial": true,
    "maxBlockTime": "2022-07-26T02:48:46.931Z",
    "messages": [
      {
        "code": "string",
        "count": 0,
        "msg": "string",
        "priority": "string"
      }
    ],
    "minBlockTime": "2022-07-26T02:48:46.931Z",
    "numGroups": 0,
    "rowsExamined": 0,
    "rowsMatched": 0
  }
}

DELETE /datasets/{id}

DELETE /api/v1/datasets/<dataset_id>

Example Request:

curl -X 'DELETE' \
  'https://cloud.axiom.co/api/v1/datasets/<dataset_id>' \
  -H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
  -H 'X-Axiom-Org-ID: <$ORG_ID>'

Example Response:

A successful response will have status code 204 and an empty body.

GET /datasets/{id}

GET /api/v1/datasets/<dataset_id>

Example Request:

curl -X 'GET' \
  'https://cloud.axiom.co/api/v1/datasets/<dataset_id>' \
  -H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
  -H 'X-Axiom-Org-ID: <$ORG_ID>'

Example Response:

Response samples with code 200 and body:

{
  "created": "2022-07-26T02:56:59.464Z",
  "description": "string",
  "id": "string",
  "integrationConfigs": [
    "string"
  ],
  "name": "string",
  "who": "string"
}

PUT /datasets/{id}

PUT /api/v1/datasets/<dataset_id>

Example Request:

curl -X 'PUT' \
  'https://cloud.axiom.co/api/v1/datasets/<dataset_id>' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <$PERSONAL_TOKEN>' \
  -H 'X-Axiom-Org-ID: <$ORG_ID>' \
  -d '{
  "description": "string"
}'

Example Response:

The API returns code 200 and the updated datasets as the body of the response:

{
  "created": "2022-07-26T02:58:22.585Z",
  "description": "string",
  "id": "string",
  "integrationConfigs": [
    "string"
  ],
  "name": "string",
  "who": "string"
}

POST /datasets/{id}/trim

POST /api/v1/datasets/<dataset_id>/trim

Example Request:

curl -X 'POST' \
  'https://cloud.axiom.co/api/v1/datasets/<dataset_id>/trim' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <$API_TOKEN or $PERSONAL_TOKEN>' \
  -H 'X-Axiom-Org-ID: <$ORG_ID>' \
  -d '{
  "maxDuration": "string"
}'

Example Response:

Response sample code 200 and the body:

{
  "numDeleted": 0
}

Was this page helpful?