Export an NQL

Export large datasets to S3 and track export status

Export an NQL

get

Starts the execution of a query that will finish with the export of the results to a file in S3. The service response contains an identifier that can be used in the "status" operation to obtain the URL of the file with the results.

Authorizations
Query parameters
queryIdstringRequired

Identifier of the query which is going to be executed.

Example: #my_query_id
compressionstringOptional

The compression algorithm for the export. If not set, no compression is applied. Allowed values: NONE, ZSTD, GZIP.

Example: ZSTD
Header parameters
AuthorizationstringOptional
Responses
200

OK - Successful execution.

application/json
get
GET /api/v1/nql/export?queryId=text HTTP/1.1
Host: instance.api.region.nexthink.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "exportId": "text"
}

Export an NQL

post

Starts the execution of a query that will finish with the export of the results to a file in S3. The service response contains an identifier that can be used in the "status" operation to obtain the URL of the file with the results.

Authorizations
Header parameters
AuthorizationstringOptional
Body
queryIdstring · min: 1 · max: 255Required

Identifier of the query which is going to be executed.

Example: #my_query_idPattern: ^#[a-z0-9_]{2,255}$
compressionstring · enum | nullableOptional

The compression algorithm for the export. If not set, no compression is applied.

Example: ZSTDPossible values:
Responses
200

OK - Successful execution.

application/json
post
POST /api/v1/nql/export HTTP/1.1
Host: instance.api.region.nexthink.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 132

{
  "queryId": "#my_query_id",
  "parameters": {
    "parameterName1": "parameterValue1",
    "parameterName2": "parameterValue2"
  },
  "compression": "ZSTD"
}
{
  "exportId": "text"
}

Status of an export

get

Retrieve the status of an export given its identifier.

Authorizations
Path parameters
exportIdstringRequired

Export identifier

Header parameters
AuthorizationstringOptional
Responses
200

OK - Successful execution.

application/json
get
GET /api/v1/nql/status/{exportId} HTTP/1.1
Host: instance.api.region.nexthink.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "status": "SUBMITTED",
  "resultsFileUrl": "text",
  "errorDescription": "text"
}

Was this helpful?