Cancel a running Dynatrace Grail query and return its result if it already finished, using the Query API request token to identify it.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/storage/query/v1/query:cancel |
For information about the required permissions see the Bucket and table permissions in Grail documentation.
Cancels a running Grail query and returns a list of records if the query already finished.
If the query was already finished, a response body including the result will be returned. Otherwise the response will contain no body.
The result has three main sections:
Every record has an implicit 'index' according to the position in the 'records' JSON array.
The types section has a list of 1..N possible type 'buckets'. Each such bucket has an 'indexRange' which indicates which
records will find their field types in which bucket. The index range has two values start & end and can be thought of as [startIndex, endIndex).
A field part of a record with index 'i' will find its corresponding field type by first locating the bucket that satisfies:
startIndex <= i <= endIndex
Once the bucket is found the 'mappings' object has an entry for all the fields that are part of that record with index 'i'.
Since enforcement of a particular schema is absent at ingestion time, it is possible to have records that share the same field name but their values are of a different type. This phenomenon will hence forth be named as a "collision". When a collision does occur, we will create a new type 'bucket' that will have a different index range where the new record field types will be placed. It is guaranteed that every field of every record will have a corresponding type. Clients should always take the included types into account when consuming records!
To execute this request, you need a platform token or OAuth access token with one of the following scopes:
storage:bizevents:readstorage:buckets:readstorage:entities:readstorage:events:readstorage:fieldsets:readstorage:logs:readstorage:metrics:readstorage:spans:readstorage:system:readTo learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| request-token | string | The request-token of the query. | query | Required |
| enrich | string | If set additional data will be available in the metadata section. | query | Optional |
| dt-client-context | string | The dt-client-context header is an optional string parameter used for monitoring purposes. When included in a request, it helps retrieve information about the execution of the query. It shouldn't hold sensitive information. | header | Optional |
| Code | Type | Description |
|---|---|---|
| 200 | Query | The query already finished. |
| 202 | - | The query was still running and is now cancelled. |
| 400 | - | - |
| 401 | - | - |
| 403 | - | - |
| 404 | - | - |
| 405 | - | - |
| 410 | - | - |
| 415 | - | - |
| 429 | - | - |
| 500 | - | - |
| 503 | - | - |
| 504 | - | - |
QueryPollResponse objectThe response of GET query:execute call.
| Element | Type | Description |
|---|---|---|
| progress | integer | The progress of the query from 0 to 100. |
| result | Query | The result of the DQL query. |
| state | Query | Possible state of the query. The element can hold these values
|
| ttlSeconds | integer | Time to live in seconds. |
QueryResult objectThe result of the DQL query.
| Element | Type | Description |
|---|---|---|
| metadata | Metadata | Collects various bits of metadata information. |
| records | Result | List of records containing the result fields data. |
| types | Ranged | The data types for the result records. |
Metadata objectCollects various bits of metadata information.
| Element | Type | Description |
|---|---|---|
| grail | Grail | Collects various bits of metadata information. |
| metrics | Metric | - |
GrailMetadata objectCollects various bits of metadata information.
| Element | Type | Description |
|---|---|---|
| analysisTimeframe | Timeframe | DQL data type timeframe. |
| canonicalQuery | string | The canonical form of the query. It has normalized spaces and canonical constructs. |
| contributions | Contributions | - |
| dqlVersion | string | The version of DQL that was used to process the query request. |
| executionTimeMilliseconds | integer | The time it took to execute the query. |
| flags | string[] | Flags indicating specific properties of the query execution, such as CLASSIC_ENTITY_MIGRATION_ADVISED. |
| locale | string | Effective locale for the query. |
| notifications | Metadata | Collected messages during the execution of the query. |
| query | string | The submitted query. |
| queryId | string | The id of the query |
| sampled | boolean | True if sampling was used for at least one segment. |
| scannedBytes | integer | Number of scanned bytes during the query execution. |
| scannedDataPoints | integer | - |
| scannedRecords | integer | Number of scanned records during the query execution. |
| timezone | string | Effective timezone for the query. |
Timeframe objectDQL data type timeframe.
| Element | Type | Description |
|---|---|---|
| end | string | The end time of the timeframe. |
| start | string | The start time of the timeframe. |
Contributions object| Element | Type | Description |
|---|---|---|
| buckets | Bucket | - |
BucketContribution object| Element | Type | Description |
|---|---|---|
| matchedRecordsRatio | number | - |
| name | string | - |
| scannedBytes | integer | - |
| table | string | - |
MetadataNotification objectThe message that provides additional information about the execution of the query.
| Element | Type | Description |
|---|---|---|
| arguments | string[] | The arguments for the message format. |
| message | string | The complete message of the notification. |
| messageFormat | string | The message format of the notification, string.format based |
| messageFormatSpecifierTypes | string[] | The corresponding DQL format specifier types for each format specifier used in the error message format. |
| notificationType | string | The notification type, e.g. LIMIT_ADDED. |
| severity | string | The severity of the notification, currently: INFO, WARN, ERROR. |
| syntaxPosition | Token | The position of a token in a query string used for errors and notification to map the message to a specific part of the query. |
TokenPosition objectThe position of a token in a query string used for errors and notification to map the message to a specific part of the query.
| Element | Type | Description |
|---|---|---|
| end | Position | The exact position in the query string. |
| start | Position | The exact position in the query string. |
PositionInfo objectThe exact position in the query string.
| Element | Type | Description |
|---|---|---|
| column | integer | Query position column zero based index. |
| index | integer | Query position index. |
| line | integer | Query position line zero based index. |
MetricMetadata objectAn object that defines additional metric metadata.
| Element | Type | Description |
|---|---|---|
| aggregation | string | Metadata about the aggregation type. |
| description | string | The description of the metadata. |
| displayName | string | The display name of the metadata. |
| fieldName | string | The name of the associated field used in the query. |
| metric.key | string | The metric key. |
| rate | string | The specified rate normalization parameter. |
| rollup | string | Metadata about the rollup type. |
| scalar | boolean | Indicates whether the scalar parameter was set to true in the timeseries aggregation function. |
| shifted | boolean | Indicates if the shifted parameter was used. |
| unit | string | The unit used. |
ResultRecord objectSingle record that contains the result fields.
ResultRecordValue objectSingle result field of a record.
GeoPoint objectDQL data type representing a geolocation point.
| Element | Type | Description |
|---|---|---|
| latitude | number | The coordinate that specifies the north-south position of a point on the surface of the earth. |
| longitude | number | The coordinate that specifies the east-west position of a point on the surface of the earth. |
RangedFieldTypes objectThe field type in range.
| Element | Type | Description |
|---|---|---|
| indexRange | integer[] | The range of elements at use this type in arrays (null for records). |
| mappings | object | The mapping between the field name and data type. |
FieldType objectThe possible type of a field in DQL.
| Element | Type | Description |
|---|---|---|
| type | string | -The element can hold these values
|
| types | Ranged | - |
QueryState objectPossible state of the query.
{"metadata": {"grail": {"analysisTimeframe": {"end": "2023-03-10T11:02:00.705980000Z","start": "2023-03-10T09:02:00.705980000Z"},"dqlVersion": "V1_0","executionTimeMilliseconds": 18,"locale": "","query": "fetch ...","queryId": "92918dae-c2f9-4c98-b278-dc42adcc5954","timezone": "Z"}},"progress": 100,"result": {"records": [{"davis.status": "OPEN","davis.title": "Http monitor global outage","davis.underMaintenance": "false","timestamp": "2022-03-17T08:00:01.231000000Z"},{"davis.status": "OPEN","davis.title": "Http monitor global outage","davis.underMaintenance": "false","timestamp": "2022-03-17T08:00:01.231000000Z"},{"davis.status": "OPEN","davis.title": "Http monitor global outage","davis.underMaintenance": "false","timestamp": "2022-03-17T08:00:01.231000000Z"},{"davis.status": "OPEN","davis.title": "Http monitor global outage","davis.underMaintenance": "false","timestamp": "2022-03-17T08:00:01.231000000Z"}],"types": [{"indexRange": [0,3],"mappings": {"davis.status": {"type": "string"},"davis.title": {"type": "string"},"davis.underMaintenance": {"type": "string"},"timestamp": {"type": "timestamp"}}}]},"state": "SUCCEEDED"}