Verify a DQL query in Dynatrace Query API without executing it, checking the query string and parameters for errors before submission.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/storage/query/v1/query:verify |
For information about the required permissions see the Bucket and table permissions in Grail documentation.
Verifies the supplied query string and other query parameters for lack of any errors, but without actually submitting the query for execution.
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 |
|---|---|---|---|---|
| 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 |
| body | Verify | All parameters have to be passed via JSON in the POST body. | body | Required |
VerifyRequest object| Element | Type | Description | Required |
|---|---|---|---|
| generateCanonicalQuery | boolean | - | Optional |
| locale | string | The query locale. If none specified, then a language/country neutral locale is chosen. The input values take the ISO-639 Language code with an optional ISO-3166 country code appended to it with an underscore. For instance, both values are valid 'en' or 'en_US'. | Optional |
| query | string | The full query string. | Required |
| queryOptions | Query | Query options enhance query functionality for Dynatrace internal services. | Optional |
| timezone | string | The query timezone. If none is specified, UTC is used as fallback. The list of valid input values matches that of the IANA Time Zone Database (TZDB). It accepts values in their canonical names like 'Europe/Paris', the abbreviated version like CET or the UTC offset format like '+01:00' | Optional |
QueryOptions objectQuery options enhance query functionality for Dynatrace internal services.
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"generateCanonicalQuery": false,"locale": "en_US","query": "fetch events \n| filter event.type == \"davis\" AND davis.status != \"CLOSED\" \n| fields timestamp, davis.title, davis.underMaintenance, davis.status \n| sort timestamp \n| limit 10","queryOptions": null,"timezone": "UTC"}
| Code | Type | Description |
|---|---|---|
| 200 | Verify | Supplied query and parameters were verified. |
| 400 | - | - |
| 401 | - | - |
| 403 | - | - |
| 405 | - | - |
| 415 | - | - |
| 500 | - | - |
| 503 | - | - |
| 504 | - | - |
VerifyResponse objectVerify response.
| Element | Type | Description |
|---|---|---|
| canonicalQuery | string | - |
| notifications | Metadata | The notifications related to the supplied DQL query string. |
| valid | boolean | True if the supplied DQL query string is valid. |
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. |
{"canonicalQuery": "string","notifications": [{"arguments": ["string"],"message": "string","messageFormat": "string","messageFormatSpecifierTypes": ["string"],"notificationType": "string","severity": "string","syntaxPosition": {"end": {"column": 1,"index": 1,"line": 1},"start": {}}}],"valid": true}