/
TimestreamQuery.ts
522 lines (508 loc) · 22.3 KB
/
TimestreamQuery.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
// smithy-typescript generated code
import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
import { CancelQueryCommand, CancelQueryCommandInput, CancelQueryCommandOutput } from "./commands/CancelQueryCommand";
import {
CreateScheduledQueryCommand,
CreateScheduledQueryCommandInput,
CreateScheduledQueryCommandOutput,
} from "./commands/CreateScheduledQueryCommand";
import {
DeleteScheduledQueryCommand,
DeleteScheduledQueryCommandInput,
DeleteScheduledQueryCommandOutput,
} from "./commands/DeleteScheduledQueryCommand";
import {
DescribeEndpointsCommand,
DescribeEndpointsCommandInput,
DescribeEndpointsCommandOutput,
} from "./commands/DescribeEndpointsCommand";
import {
DescribeScheduledQueryCommand,
DescribeScheduledQueryCommandInput,
DescribeScheduledQueryCommandOutput,
} from "./commands/DescribeScheduledQueryCommand";
import {
ExecuteScheduledQueryCommand,
ExecuteScheduledQueryCommandInput,
ExecuteScheduledQueryCommandOutput,
} from "./commands/ExecuteScheduledQueryCommand";
import {
ListScheduledQueriesCommand,
ListScheduledQueriesCommandInput,
ListScheduledQueriesCommandOutput,
} from "./commands/ListScheduledQueriesCommand";
import {
ListTagsForResourceCommand,
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import {
PrepareQueryCommand,
PrepareQueryCommandInput,
PrepareQueryCommandOutput,
} from "./commands/PrepareQueryCommand";
import { QueryCommand, QueryCommandInput, QueryCommandOutput } from "./commands/QueryCommand";
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import {
UntagResourceCommand,
UntagResourceCommandInput,
UntagResourceCommandOutput,
} from "./commands/UntagResourceCommand";
import {
UpdateScheduledQueryCommand,
UpdateScheduledQueryCommandInput,
UpdateScheduledQueryCommandOutput,
} from "./commands/UpdateScheduledQueryCommand";
import { TimestreamQueryClient } from "./TimestreamQueryClient";
/**
* <fullname>Amazon Timestream Query
* </fullname>
* <p></p>
*/
export class TimestreamQuery extends TimestreamQueryClient {
/**
* <p> Cancels a query that has been issued. Cancellation is provided only if the query has
* not completed running before the cancellation request was issued. Because cancellation
* is an idempotent operation, subsequent cancellation requests will return a
* <code>CancellationMessage</code>, indicating that the query has already been
* canceled. See <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.cancel-query.html">code
* sample</a> for details. </p>
*/
public cancelQuery(args: CancelQueryCommandInput, options?: __HttpHandlerOptions): Promise<CancelQueryCommandOutput>;
public cancelQuery(args: CancelQueryCommandInput, cb: (err: any, data?: CancelQueryCommandOutput) => void): void;
public cancelQuery(
args: CancelQueryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CancelQueryCommandOutput) => void
): void;
public cancelQuery(
args: CancelQueryCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CancelQueryCommandOutput) => void),
cb?: (err: any, data?: CancelQueryCommandOutput) => void
): Promise<CancelQueryCommandOutput> | void {
const command = new CancelQueryCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p> Create a scheduled query that will be run on your behalf at the configured schedule.
* Timestream assumes the execution role provided as part of the
* <code>ScheduledQueryExecutionRoleArn</code> parameter to run the query. You can use
* the <code>NotificationConfiguration</code> parameter to configure notification for your
* scheduled query operations.</p>
*/
public createScheduledQuery(
args: CreateScheduledQueryCommandInput,
options?: __HttpHandlerOptions
): Promise<CreateScheduledQueryCommandOutput>;
public createScheduledQuery(
args: CreateScheduledQueryCommandInput,
cb: (err: any, data?: CreateScheduledQueryCommandOutput) => void
): void;
public createScheduledQuery(
args: CreateScheduledQueryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: CreateScheduledQueryCommandOutput) => void
): void;
public createScheduledQuery(
args: CreateScheduledQueryCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateScheduledQueryCommandOutput) => void),
cb?: (err: any, data?: CreateScheduledQueryCommandOutput) => void
): Promise<CreateScheduledQueryCommandOutput> | void {
const command = new CreateScheduledQueryCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>Deletes a given scheduled query. This is an irreversible operation. </p>
*/
public deleteScheduledQuery(
args: DeleteScheduledQueryCommandInput,
options?: __HttpHandlerOptions
): Promise<DeleteScheduledQueryCommandOutput>;
public deleteScheduledQuery(
args: DeleteScheduledQueryCommandInput,
cb: (err: any, data?: DeleteScheduledQueryCommandOutput) => void
): void;
public deleteScheduledQuery(
args: DeleteScheduledQueryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DeleteScheduledQueryCommandOutput) => void
): void;
public deleteScheduledQuery(
args: DeleteScheduledQueryCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteScheduledQueryCommandOutput) => void),
cb?: (err: any, data?: DeleteScheduledQueryCommandOutput) => void
): Promise<DeleteScheduledQueryCommandOutput> | void {
const command = new DeleteScheduledQueryCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>DescribeEndpoints returns a list of available endpoints to make Timestream
* API calls against. This API is available through both Write and Query.</p>
* <p>Because the Timestream SDKs are designed to transparently work with the
* service’s architecture, including the management and mapping of the service endpoints,
* <i>it is not recommended that you use this API unless</i>:</p>
* <ul>
* <li>
* <p>You are using <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/VPCEndpoints">VPC endpoints (Amazon Web Services PrivateLink) with Timestream
* </a>
* </p>
* </li>
* <li>
* <p>Your application uses a programming language that does not yet have SDK
* support</p>
* </li>
* <li>
* <p>You require better control over the client-side implementation</p>
* </li>
* </ul>
* <p>For detailed information on how and when to use and implement DescribeEndpoints, see
* <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/Using.API.html#Using-API.endpoint-discovery">The Endpoint Discovery Pattern</a>.</p>
*/
public describeEndpoints(
args: DescribeEndpointsCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeEndpointsCommandOutput>;
public describeEndpoints(
args: DescribeEndpointsCommandInput,
cb: (err: any, data?: DescribeEndpointsCommandOutput) => void
): void;
public describeEndpoints(
args: DescribeEndpointsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeEndpointsCommandOutput) => void
): void;
public describeEndpoints(
args: DescribeEndpointsCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeEndpointsCommandOutput) => void),
cb?: (err: any, data?: DescribeEndpointsCommandOutput) => void
): Promise<DescribeEndpointsCommandOutput> | void {
const command = new DescribeEndpointsCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>Provides detailed information about a scheduled query.</p>
*/
public describeScheduledQuery(
args: DescribeScheduledQueryCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeScheduledQueryCommandOutput>;
public describeScheduledQuery(
args: DescribeScheduledQueryCommandInput,
cb: (err: any, data?: DescribeScheduledQueryCommandOutput) => void
): void;
public describeScheduledQuery(
args: DescribeScheduledQueryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeScheduledQueryCommandOutput) => void
): void;
public describeScheduledQuery(
args: DescribeScheduledQueryCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeScheduledQueryCommandOutput) => void),
cb?: (err: any, data?: DescribeScheduledQueryCommandOutput) => void
): Promise<DescribeScheduledQueryCommandOutput> | void {
const command = new DescribeScheduledQueryCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p> You can use this API to run a scheduled query manually. </p>
*/
public executeScheduledQuery(
args: ExecuteScheduledQueryCommandInput,
options?: __HttpHandlerOptions
): Promise<ExecuteScheduledQueryCommandOutput>;
public executeScheduledQuery(
args: ExecuteScheduledQueryCommandInput,
cb: (err: any, data?: ExecuteScheduledQueryCommandOutput) => void
): void;
public executeScheduledQuery(
args: ExecuteScheduledQueryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ExecuteScheduledQueryCommandOutput) => void
): void;
public executeScheduledQuery(
args: ExecuteScheduledQueryCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ExecuteScheduledQueryCommandOutput) => void),
cb?: (err: any, data?: ExecuteScheduledQueryCommandOutput) => void
): Promise<ExecuteScheduledQueryCommandOutput> | void {
const command = new ExecuteScheduledQueryCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>Gets a list of all scheduled queries in the caller's Amazon account and Region. <code>ListScheduledQueries</code> is eventually consistent. </p>
*/
public listScheduledQueries(
args: ListScheduledQueriesCommandInput,
options?: __HttpHandlerOptions
): Promise<ListScheduledQueriesCommandOutput>;
public listScheduledQueries(
args: ListScheduledQueriesCommandInput,
cb: (err: any, data?: ListScheduledQueriesCommandOutput) => void
): void;
public listScheduledQueries(
args: ListScheduledQueriesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListScheduledQueriesCommandOutput) => void
): void;
public listScheduledQueries(
args: ListScheduledQueriesCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListScheduledQueriesCommandOutput) => void),
cb?: (err: any, data?: ListScheduledQueriesCommandOutput) => void
): Promise<ListScheduledQueriesCommandOutput> | void {
const command = new ListScheduledQueriesCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>List all tags on a Timestream query resource.</p>
*/
public listTagsForResource(
args: ListTagsForResourceCommandInput,
options?: __HttpHandlerOptions
): Promise<ListTagsForResourceCommandOutput>;
public listTagsForResource(
args: ListTagsForResourceCommandInput,
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
): void;
public listTagsForResource(
args: ListTagsForResourceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
): void;
public listTagsForResource(
args: ListTagsForResourceCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListTagsForResourceCommandOutput) => void),
cb?: (err: any, data?: ListTagsForResourceCommandOutput) => void
): Promise<ListTagsForResourceCommandOutput> | void {
const command = new ListTagsForResourceCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>A synchronous operation that allows you to submit a query with parameters to be stored
* by Timestream for later running. Timestream only supports using this operation with the
* <code>PrepareQueryRequest$ValidateOnly</code> set to <code>true</code>. </p>
*/
public prepareQuery(
args: PrepareQueryCommandInput,
options?: __HttpHandlerOptions
): Promise<PrepareQueryCommandOutput>;
public prepareQuery(args: PrepareQueryCommandInput, cb: (err: any, data?: PrepareQueryCommandOutput) => void): void;
public prepareQuery(
args: PrepareQueryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PrepareQueryCommandOutput) => void
): void;
public prepareQuery(
args: PrepareQueryCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PrepareQueryCommandOutput) => void),
cb?: (err: any, data?: PrepareQueryCommandOutput) => void
): Promise<PrepareQueryCommandOutput> | void {
const command = new PrepareQueryCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>
* <code>Query</code> is a synchronous operation that enables you to run a query against
* your Amazon Timestream data. <code>Query</code> will time out after 60 seconds.
* You must update the default timeout in the SDK to support a timeout of 60 seconds. See
* the <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/code-samples.run-query.html">code
* sample</a> for details. </p>
* <p>Your query request will fail in the following cases:</p>
* <ul>
* <li>
* <p> If you submit a <code>Query</code> request with the same client token outside
* of the 5-minute idempotency window. </p>
* </li>
* <li>
* <p> If you submit a <code>Query</code> request with the same client token, but
* change other parameters, within the 5-minute idempotency window. </p>
* </li>
* <li>
* <p> If the size of the row (including the query metadata) exceeds 1 MB, then the
* query will fail with the following error message: </p>
* <p>
* <code>Query aborted as max page response size has been exceeded by the output
* result row</code>
* </p>
* </li>
* <li>
* <p> If the IAM principal of the query initiator and the result reader are not the
* same and/or the query initiator and the result reader do not have the same query
* string in the query requests, the query will fail with an <code>Invalid
* pagination token</code> error. </p>
* </li>
* </ul>
*/
public query(args: QueryCommandInput, options?: __HttpHandlerOptions): Promise<QueryCommandOutput>;
public query(args: QueryCommandInput, cb: (err: any, data?: QueryCommandOutput) => void): void;
public query(
args: QueryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: QueryCommandOutput) => void
): void;
public query(
args: QueryCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: QueryCommandOutput) => void),
cb?: (err: any, data?: QueryCommandOutput) => void
): Promise<QueryCommandOutput> | void {
const command = new QueryCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>Associate a set of tags with a Timestream resource. You can then activate these
* user-defined tags so that they appear on the Billing and Cost Management console for
* cost allocation tracking. </p>
*/
public tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
public tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
public tagResource(
args: TagResourceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: TagResourceCommandOutput) => void
): void;
public tagResource(
args: TagResourceCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: TagResourceCommandOutput) => void),
cb?: (err: any, data?: TagResourceCommandOutput) => void
): Promise<TagResourceCommandOutput> | void {
const command = new TagResourceCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>Removes the association of tags from a Timestream query resource.</p>
*/
public untagResource(
args: UntagResourceCommandInput,
options?: __HttpHandlerOptions
): Promise<UntagResourceCommandOutput>;
public untagResource(
args: UntagResourceCommandInput,
cb: (err: any, data?: UntagResourceCommandOutput) => void
): void;
public untagResource(
args: UntagResourceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UntagResourceCommandOutput) => void
): void;
public untagResource(
args: UntagResourceCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UntagResourceCommandOutput) => void),
cb?: (err: any, data?: UntagResourceCommandOutput) => void
): Promise<UntagResourceCommandOutput> | void {
const command = new UntagResourceCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
/**
* <p>Update a scheduled query.</p>
*/
public updateScheduledQuery(
args: UpdateScheduledQueryCommandInput,
options?: __HttpHandlerOptions
): Promise<UpdateScheduledQueryCommandOutput>;
public updateScheduledQuery(
args: UpdateScheduledQueryCommandInput,
cb: (err: any, data?: UpdateScheduledQueryCommandOutput) => void
): void;
public updateScheduledQuery(
args: UpdateScheduledQueryCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UpdateScheduledQueryCommandOutput) => void
): void;
public updateScheduledQuery(
args: UpdateScheduledQueryCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateScheduledQueryCommandOutput) => void),
cb?: (err: any, data?: UpdateScheduledQueryCommandOutput) => void
): Promise<UpdateScheduledQueryCommandOutput> | void {
const command = new UpdateScheduledQueryCommand(args);
if (typeof optionsOrCb === "function") {
this.send(command, optionsOrCb);
} else if (typeof cb === "function") {
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
this.send(command, optionsOrCb || {}, cb);
} else {
return this.send(command, optionsOrCb);
}
}
}