@dynatrace-sdk/client-query 1.1.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -7
- package/README.md +12 -41
- package/cjs/index.js +16 -8
- package/docs/DOCS.md +255 -795
- package/dynatrace-metadata.json +3 -6
- package/esm/index.js +16 -8
- package/package.json +1 -1
- package/types/packages/client/query/src/lib/apis/query-assistance-api.d.ts +33 -0
- package/types/packages/client/query/src/lib/apis/query-execution-api.d.ts +34 -0
- package/types/packages/client/query/src/lib/models/grail-metadata.d.ts +4 -0
- package/types/packages/client/query/src/lib/models/grail-metadata.transformation.d.ts +1 -0
package/dynatrace-metadata.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dynagen": {
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.9",
|
|
4
4
|
"generatedAt": "",
|
|
5
5
|
"template": {
|
|
6
6
|
"name": "@dynatrace-sdk/template-typescript-client",
|
|
7
|
-
"version": "0.17.
|
|
7
|
+
"version": "0.17.4"
|
|
8
8
|
},
|
|
9
9
|
"featureFlags": {
|
|
10
10
|
"typeguards": true
|
|
@@ -12,10 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"spec": {
|
|
14
14
|
"title": "Storage – Query Service",
|
|
15
|
-
"version": "1.
|
|
15
|
+
"version": "1.1.0",
|
|
16
16
|
"baseUrl": "/platform/storage/query/v1"
|
|
17
|
-
},
|
|
18
|
-
"docs": {
|
|
19
|
-
"title": "Storage – Query Service"
|
|
20
17
|
}
|
|
21
18
|
}
|
package/esm/index.js
CHANGED
|
@@ -1972,7 +1972,8 @@ function isGrailMetadata(value) {
|
|
|
1972
1972
|
"locale",
|
|
1973
1973
|
"executionTimeMilliseconds",
|
|
1974
1974
|
"notifications",
|
|
1975
|
-
"queryId"
|
|
1975
|
+
"queryId",
|
|
1976
|
+
"sampled"
|
|
1976
1977
|
]);
|
|
1977
1978
|
const hasAdditionalProperties = false;
|
|
1978
1979
|
const requiredKeys = [];
|
|
@@ -1987,7 +1988,8 @@ function isGrailMetadata(value) {
|
|
|
1987
1988
|
"locale",
|
|
1988
1989
|
"executionTimeMilliseconds",
|
|
1989
1990
|
"notifications",
|
|
1990
|
-
"queryId"
|
|
1991
|
+
"queryId",
|
|
1992
|
+
"sampled"
|
|
1991
1993
|
];
|
|
1992
1994
|
const valKeys = new Set(Object.keys(value));
|
|
1993
1995
|
const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
|
|
@@ -2015,7 +2017,8 @@ function isJson22(value) {
|
|
|
2015
2017
|
"locale",
|
|
2016
2018
|
"executionTimeMilliseconds",
|
|
2017
2019
|
"notifications",
|
|
2018
|
-
"queryId"
|
|
2020
|
+
"queryId",
|
|
2021
|
+
"sampled"
|
|
2019
2022
|
]);
|
|
2020
2023
|
const hasAdditionalProperties = false;
|
|
2021
2024
|
const requiredKeys = [];
|
|
@@ -2030,7 +2033,8 @@ function isJson22(value) {
|
|
|
2030
2033
|
"locale",
|
|
2031
2034
|
"executionTimeMilliseconds",
|
|
2032
2035
|
"notifications",
|
|
2033
|
-
"queryId"
|
|
2036
|
+
"queryId",
|
|
2037
|
+
"sampled"
|
|
2034
2038
|
];
|
|
2035
2039
|
const valKeys = new Set(Object.keys(value));
|
|
2036
2040
|
const containsRequiredOrOptionalKeys = requiredKeys.length > 0 ? requiredKeys.every((reqKey) => valKeys.has(reqKey)) : optionalKeys.some((key) => valKeys.has(key)) || hasAdditionalProperties;
|
|
@@ -2049,7 +2053,8 @@ function fromJson22($model) {
|
|
|
2049
2053
|
locale,
|
|
2050
2054
|
executionTimeMilliseconds,
|
|
2051
2055
|
notifications,
|
|
2052
|
-
queryId
|
|
2056
|
+
queryId,
|
|
2057
|
+
sampled
|
|
2053
2058
|
} = $model;
|
|
2054
2059
|
return {
|
|
2055
2060
|
canonicalQuery,
|
|
@@ -2062,7 +2067,8 @@ function fromJson22($model) {
|
|
|
2062
2067
|
locale,
|
|
2063
2068
|
executionTimeMilliseconds,
|
|
2064
2069
|
notifications: notifications !== void 0 && notifications !== null ? notifications?.map((innerValue) => fromJson18(innerValue)) : void 0,
|
|
2065
|
-
queryId
|
|
2070
|
+
queryId,
|
|
2071
|
+
sampled
|
|
2066
2072
|
};
|
|
2067
2073
|
}
|
|
2068
2074
|
function toJson22($model) {
|
|
@@ -2077,7 +2083,8 @@ function toJson22($model) {
|
|
|
2077
2083
|
locale,
|
|
2078
2084
|
executionTimeMilliseconds,
|
|
2079
2085
|
notifications,
|
|
2080
|
-
queryId
|
|
2086
|
+
queryId,
|
|
2087
|
+
sampled
|
|
2081
2088
|
} = $model;
|
|
2082
2089
|
return {
|
|
2083
2090
|
canonicalQuery,
|
|
@@ -2090,7 +2097,8 @@ function toJson22($model) {
|
|
|
2090
2097
|
locale,
|
|
2091
2098
|
executionTimeMilliseconds,
|
|
2092
2099
|
notifications: notifications !== void 0 && notifications !== null ? notifications?.map((innerValue) => toJson18(innerValue)) : void 0,
|
|
2093
|
-
queryId
|
|
2100
|
+
queryId,
|
|
2101
|
+
sampled
|
|
2094
2102
|
};
|
|
2095
2103
|
}
|
|
2096
2104
|
|
package/package.json
CHANGED
|
@@ -19,11 +19,22 @@ export declare class QueryAssistanceClient {
|
|
|
19
19
|
/**
|
|
20
20
|
* Verifies a query without executing it.
|
|
21
21
|
*
|
|
22
|
+
* For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
|
|
23
|
+
*
|
|
22
24
|
* ## Overview
|
|
23
25
|
*
|
|
24
26
|
* Verifies the supplied query string and other query parameters for lack of any errors, but without actually
|
|
25
27
|
* submitting the query for execution.
|
|
28
|
+
*
|
|
26
29
|
* @returns Supplied query and parameters were verified.
|
|
30
|
+
*
|
|
31
|
+
* @example <caption>Code example</caption>
|
|
32
|
+
* import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
|
|
33
|
+
*
|
|
34
|
+
* const data = await queryAssistanceClient.queryVerify({
|
|
35
|
+
* authorization: "...",
|
|
36
|
+
* body: {} as VerifyRequest,
|
|
37
|
+
* });
|
|
27
38
|
*/
|
|
28
39
|
queryVerify(config: {
|
|
29
40
|
body: VerifyRequest;
|
|
@@ -33,6 +44,8 @@ export declare class QueryAssistanceClient {
|
|
|
33
44
|
/**
|
|
34
45
|
* Get a structured tree of the canonical form of the query.
|
|
35
46
|
*
|
|
47
|
+
* For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
|
|
48
|
+
*
|
|
36
49
|
* ## Overview
|
|
37
50
|
*
|
|
38
51
|
* Returns the parsed query as a tree, containing the structure of the canonical query. Tree-nodes can contain references to
|
|
@@ -222,7 +235,16 @@ export declare class QueryAssistanceClient {
|
|
|
222
235
|
* * `INFO` is present: usually if `CANONICAL` is not present (e.g. the parameter key for `FILTER a == 1`), there is an info node
|
|
223
236
|
* for `FILTER condition:a == 1`. This `condition:` was neither written by the user nor is it canonical; but it might be
|
|
224
237
|
* used to help the user understand what this parameter means.
|
|
238
|
+
*
|
|
225
239
|
* @returns A node containing more nodes, a node offering different (semantically equivalent) versions of the query parts, or a terminal node that shows the canonical form.
|
|
240
|
+
*
|
|
241
|
+
* @example <caption>Code example</caption>
|
|
242
|
+
* import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
|
|
243
|
+
*
|
|
244
|
+
* const data = await queryAssistanceClient.queryParse({
|
|
245
|
+
* authorization: "...",
|
|
246
|
+
* body: {} as ParseRequest,
|
|
247
|
+
* });
|
|
226
248
|
*/
|
|
227
249
|
queryParse(config: {
|
|
228
250
|
body: ParseRequest;
|
|
@@ -232,6 +254,8 @@ export declare class QueryAssistanceClient {
|
|
|
232
254
|
/**
|
|
233
255
|
* Get a structured list of suggestions for the query at the given position.
|
|
234
256
|
*
|
|
257
|
+
* For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
|
|
258
|
+
*
|
|
235
259
|
* ## Overview
|
|
236
260
|
*
|
|
237
261
|
* We provide a list of suggestions that may be used after the cursor position. The following queries will all provide the
|
|
@@ -265,7 +289,16 @@ export declare class QueryAssistanceClient {
|
|
|
265
289
|
*
|
|
266
290
|
* The `type` helps to treat specific parts of the suggestion different to others; either by a different visualization,
|
|
267
291
|
* a link to docs, etc.
|
|
292
|
+
*
|
|
268
293
|
* @returns A list of structured autocomplete suggestions.
|
|
294
|
+
*
|
|
295
|
+
* @example <caption>Code example</caption>
|
|
296
|
+
* import { queryAssistanceClient } from "@dynatrace-sdk/client-query";
|
|
297
|
+
*
|
|
298
|
+
* const data = await queryAssistanceClient.queryAutocomplete({
|
|
299
|
+
* authorization: "...",
|
|
300
|
+
* body: {} as AutocompleteRequest,
|
|
301
|
+
* });
|
|
269
302
|
*/
|
|
270
303
|
queryAutocomplete(config: {
|
|
271
304
|
body: AutocompleteRequest;
|
|
@@ -16,6 +16,8 @@ export declare class QueryExecutionClient {
|
|
|
16
16
|
/**
|
|
17
17
|
* Retrieves query status and final result from Grail.
|
|
18
18
|
*
|
|
19
|
+
* For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
|
|
20
|
+
*
|
|
19
21
|
* ### Overview:
|
|
20
22
|
*
|
|
21
23
|
* Polls the status of a Grail query. Returns the status of the query, including the result if the query finished.
|
|
@@ -46,7 +48,17 @@ export declare class QueryExecutionClient {
|
|
|
46
48
|
* the new record field types will be placed.
|
|
47
49
|
* It is guaranteed that every field of every record will have a corresponding type.
|
|
48
50
|
* **Clients should always take the included types into account when consuming records!**
|
|
51
|
+
*
|
|
49
52
|
* @returns The current status and results of the supplied query.
|
|
53
|
+
*
|
|
54
|
+
* @example <caption>Code example</caption>
|
|
55
|
+
* import { queryExecutionClient } from "@dynatrace-sdk/client-query";
|
|
56
|
+
*
|
|
57
|
+
* const data = await queryExecutionClient.queryPoll({
|
|
58
|
+
* requestToken: "...",
|
|
59
|
+
* requestTimeoutMilliseconds: 60,
|
|
60
|
+
* enrich: "metric-metadata",
|
|
61
|
+
* });
|
|
50
62
|
*/
|
|
51
63
|
queryPoll(config: {
|
|
52
64
|
/** The request-token of the query. */ requestToken: string;
|
|
@@ -57,6 +69,8 @@ export declare class QueryExecutionClient {
|
|
|
57
69
|
/**
|
|
58
70
|
* Starts a Grail query.
|
|
59
71
|
*
|
|
72
|
+
* For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
|
|
73
|
+
*
|
|
60
74
|
* ### Overview:
|
|
61
75
|
*
|
|
62
76
|
* Executes a query and returns a list of records.
|
|
@@ -90,7 +104,17 @@ export declare class QueryExecutionClient {
|
|
|
90
104
|
* the new record field types will be placed.
|
|
91
105
|
* It is guaranteed that every field of every record will have a corresponding type.
|
|
92
106
|
* **Clients should always take the included types into account when consuming records!**
|
|
107
|
+
*
|
|
93
108
|
* @returns The final status and results of the supplied query if it finished within a supplied requestTimeoutMilliseconds. | The status of the query to start.
|
|
109
|
+
*
|
|
110
|
+
* @example <caption>Code example</caption>
|
|
111
|
+
* import { queryExecutionClient } from "@dynatrace-sdk/client-query";
|
|
112
|
+
*
|
|
113
|
+
* const data = await queryExecutionClient.queryExecute({
|
|
114
|
+
* enrich: "metric-metadata",
|
|
115
|
+
* authorization: "...",
|
|
116
|
+
* body: {} as ExecuteRequest,
|
|
117
|
+
* });
|
|
94
118
|
*/
|
|
95
119
|
queryExecute(config: {
|
|
96
120
|
body: ExecuteRequest;
|
|
@@ -101,6 +125,8 @@ export declare class QueryExecutionClient {
|
|
|
101
125
|
/**
|
|
102
126
|
* Cancels the query and returns the result if the query was already finished, otherwise discards it.
|
|
103
127
|
*
|
|
128
|
+
* For information about the required permissions see the [Bucket and table permissions in Grail documentation](https://www.dynatrace.com/support/help/platform/grail/assign-permissions-in-grail).
|
|
129
|
+
*
|
|
104
130
|
* ### Overview:
|
|
105
131
|
*
|
|
106
132
|
* Cancels a running Grail query and returns a list of records if the query already finished.
|
|
@@ -133,7 +159,15 @@ export declare class QueryExecutionClient {
|
|
|
133
159
|
* the new record field types will be placed.
|
|
134
160
|
* It is guaranteed that every field of every record will have a corresponding type.
|
|
135
161
|
* **Clients should always take the included types into account when consuming records!**
|
|
162
|
+
*
|
|
136
163
|
* @returns The query already finished.
|
|
164
|
+
*
|
|
165
|
+
* @example <caption>Code example</caption>
|
|
166
|
+
* import { queryExecutionClient } from "@dynatrace-sdk/client-query";
|
|
167
|
+
*
|
|
168
|
+
* const data = await queryExecutionClient.queryCancel({
|
|
169
|
+
* requestToken: "...",
|
|
170
|
+
* });
|
|
137
171
|
*/
|
|
138
172
|
queryCancel(config: {
|
|
139
173
|
/** The request-token of the query. */ requestToken: string;
|
|
@@ -13,6 +13,7 @@ export interface AsJson {
|
|
|
13
13
|
executionTimeMilliseconds?: number;
|
|
14
14
|
notifications?: _MetadataNotificationTransformation.AsJson[];
|
|
15
15
|
queryId?: string;
|
|
16
|
+
sampled?: boolean;
|
|
16
17
|
}
|
|
17
18
|
export declare function isGrailMetadata(value: any): value is GrailMetadata;
|
|
18
19
|
export declare function isJson(value: any): value is AsJson;
|