Export an NQL
Export large datasets to S3 and track export status
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.
Identifier of the query which is going to be executed.
#my_query_idThe compression algorithm for the export. If not set, no compression is applied. Allowed values: NONE, ZSTD, GZIP.
ZSTDOptional free-text tag, up to 255 characters, that can be added to the request. Nexthink stores the tag in the platform logs. The tag helps to categorize requests, and to filter and analyze them in logs and in dashboards. If the tag is longer than 255 characters, a 400 error is returned.
daily-device-reportOK - Successful execution.
Export identifier to be used in the "status" operation to know the state of the export and to retrieve the URL of the file with the results.
Bad request - Invalid parameters, or the x-platform-log-custom-tag header is longer than 255 characters.
Unauthorized - No valid authentication credentials.
No permission - Not authorized to execute queries.
Not found - No query associated with that ID.
Internal server error.
Service unavailable.
GET /api/v1/nql/export?queryId=text HTTP/1.1
Host: instance.api.region.nexthink.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"exportId": "text"
}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.
Optional free-text tag, up to 255 characters, that can be added to the request. Nexthink stores the tag in the platform logs. The tag helps to categorize requests, and to filter and analyze them in logs and in dashboards. If the tag is longer than 255 characters, a 400 error is returned.
daily-device-reportIdentifier of the query which is going to be executed.
#my_query_idPattern: ^#[a-z0-9_]{2,255}$The compression algorithm for the export. If not set, no compression is applied.
ZSTDPossible values: OK - Successful execution.
Export identifier to be used in the "status" operation to know the state of the export and to retrieve the URL of the file with the results.
Bad request - Invalid parameters, or the x-platform-log-custom-tag header is longer than 255 characters.
Unauthorized - No valid authentication credentials.
No permission - Not authorized to execute queries
Not found - No query associated with that ID.
Internal server error.
Service unavailable.
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"
}Retrieve the status of an export given its identifier.
Export identifier
OK - Successful execution.
Partial Content - The query results were truncated because the maximum number of results allowed by the license was reached
Bad request - The export failed because of an invalid query or configuration.
Unauthorized - No valid authentication credentials.
No permission - Not authorized to execute queries.
Not found - No export associated with that ID.
Too many requests - The user has reached the daily request limit.
Internal server error.
Service unavailable.
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"
}Last updated
Was this helpful?

