Skip to content

Commit 467947d

Browse files
author
awstools
committed
feat(client-cloudwatch-logs): CloudWatch Logs updates: Added capability to setup a recurring schedule for log insights queries. Logs introduced Scheduled Queries (managed through Create/Update/Get/Delete/List/History Scheduled Query APIs). For more information, see CloudWatch Logs API documentation.
1 parent 6da7a3d commit 467947d

28 files changed

+5111
-1813
lines changed

clients/client-cloudwatch-logs/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,14 @@ CreateLogStream
292292

293293
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/CreateLogStreamCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/CreateLogStreamCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/CreateLogStreamCommandOutput/)
294294

295+
</details>
296+
<details>
297+
<summary>
298+
CreateScheduledQuery
299+
</summary>
300+
301+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/CreateScheduledQueryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/CreateScheduledQueryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/CreateScheduledQueryCommandOutput/)
302+
295303
</details>
296304
<details>
297305
<summary>
@@ -420,6 +428,14 @@ DeleteRetentionPolicy
420428

421429
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/DeleteRetentionPolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/DeleteRetentionPolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/DeleteRetentionPolicyCommandOutput/)
422430

431+
</details>
432+
<details>
433+
<summary>
434+
DeleteScheduledQuery
435+
</summary>
436+
437+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/DeleteScheduledQueryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/DeleteScheduledQueryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/DeleteScheduledQueryCommandOutput/)
438+
423439
</details>
424440
<details>
425441
<summary>
@@ -676,6 +692,22 @@ GetQueryResults
676692

677693
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/GetQueryResultsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/GetQueryResultsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/GetQueryResultsCommandOutput/)
678694

695+
</details>
696+
<details>
697+
<summary>
698+
GetScheduledQuery
699+
</summary>
700+
701+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/GetScheduledQueryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/GetScheduledQueryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/GetScheduledQueryCommandOutput/)
702+
703+
</details>
704+
<details>
705+
<summary>
706+
GetScheduledQueryHistory
707+
</summary>
708+
709+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/GetScheduledQueryHistoryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/GetScheduledQueryHistoryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/GetScheduledQueryHistoryCommandOutput/)
710+
679711
</details>
680712
<details>
681713
<summary>
@@ -724,6 +756,14 @@ ListLogGroupsForQuery
724756

725757
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/ListLogGroupsForQueryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/ListLogGroupsForQueryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/ListLogGroupsForQueryCommandOutput/)
726758

759+
</details>
760+
<details>
761+
<summary>
762+
ListScheduledQueries
763+
</summary>
764+
765+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/ListScheduledQueriesCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/ListScheduledQueriesCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/ListScheduledQueriesCommandOutput/)
766+
727767
</details>
728768
<details>
729769
<summary>
@@ -965,3 +1005,11 @@ UpdateLogAnomalyDetector
9651005
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/UpdateLogAnomalyDetectorCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/UpdateLogAnomalyDetectorCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/UpdateLogAnomalyDetectorCommandOutput/)
9661006

9671007
</details>
1008+
<details>
1009+
<summary>
1010+
UpdateScheduledQuery
1011+
</summary>
1012+
1013+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/UpdateScheduledQueryCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/UpdateScheduledQueryCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/UpdateScheduledQueryCommandOutput/)
1014+
1015+
</details>

clients/client-cloudwatch-logs/src/CloudWatchLogs.ts

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ import {
3838
CreateLogStreamCommandInput,
3939
CreateLogStreamCommandOutput,
4040
} from "./commands/CreateLogStreamCommand";
41+
import {
42+
CreateScheduledQueryCommand,
43+
CreateScheduledQueryCommandInput,
44+
CreateScheduledQueryCommandOutput,
45+
} from "./commands/CreateScheduledQueryCommand";
4146
import {
4247
DeleteAccountPolicyCommand,
4348
DeleteAccountPolicyCommandInput,
@@ -118,6 +123,11 @@ import {
118123
DeleteRetentionPolicyCommandInput,
119124
DeleteRetentionPolicyCommandOutput,
120125
} from "./commands/DeleteRetentionPolicyCommand";
126+
import {
127+
DeleteScheduledQueryCommand,
128+
DeleteScheduledQueryCommandInput,
129+
DeleteScheduledQueryCommandOutput,
130+
} from "./commands/DeleteScheduledQueryCommand";
121131
import {
122132
DeleteSubscriptionFilterCommand,
123133
DeleteSubscriptionFilterCommandInput,
@@ -274,6 +284,16 @@ import {
274284
GetQueryResultsCommandInput,
275285
GetQueryResultsCommandOutput,
276286
} from "./commands/GetQueryResultsCommand";
287+
import {
288+
GetScheduledQueryCommand,
289+
GetScheduledQueryCommandInput,
290+
GetScheduledQueryCommandOutput,
291+
} from "./commands/GetScheduledQueryCommand";
292+
import {
293+
GetScheduledQueryHistoryCommand,
294+
GetScheduledQueryHistoryCommandInput,
295+
GetScheduledQueryHistoryCommandOutput,
296+
} from "./commands/GetScheduledQueryHistoryCommand";
277297
import {
278298
GetTransformerCommand,
279299
GetTransformerCommandInput,
@@ -304,6 +324,11 @@ import {
304324
ListLogGroupsForQueryCommandInput,
305325
ListLogGroupsForQueryCommandOutput,
306326
} from "./commands/ListLogGroupsForQueryCommand";
327+
import {
328+
ListScheduledQueriesCommand,
329+
ListScheduledQueriesCommandInput,
330+
ListScheduledQueriesCommandOutput,
331+
} from "./commands/ListScheduledQueriesCommand";
307332
import {
308333
ListTagsForResourceCommand,
309334
ListTagsForResourceCommandInput,
@@ -438,6 +463,11 @@ import {
438463
UpdateLogAnomalyDetectorCommandInput,
439464
UpdateLogAnomalyDetectorCommandOutput,
440465
} from "./commands/UpdateLogAnomalyDetectorCommand";
466+
import {
467+
UpdateScheduledQueryCommand,
468+
UpdateScheduledQueryCommandInput,
469+
UpdateScheduledQueryCommandOutput,
470+
} from "./commands/UpdateScheduledQueryCommand";
441471

442472
const commands = {
443473
AssociateKmsKeyCommand,
@@ -447,6 +477,7 @@ const commands = {
447477
CreateLogAnomalyDetectorCommand,
448478
CreateLogGroupCommand,
449479
CreateLogStreamCommand,
480+
CreateScheduledQueryCommand,
450481
DeleteAccountPolicyCommand,
451482
DeleteDataProtectionPolicyCommand,
452483
DeleteDeliveryCommand,
@@ -463,6 +494,7 @@ const commands = {
463494
DeleteQueryDefinitionCommand,
464495
DeleteResourcePolicyCommand,
465496
DeleteRetentionPolicyCommand,
497+
DeleteScheduledQueryCommand,
466498
DeleteSubscriptionFilterCommand,
467499
DeleteTransformerCommand,
468500
DescribeAccountPoliciesCommand,
@@ -495,12 +527,15 @@ const commands = {
495527
GetLogObjectCommand,
496528
GetLogRecordCommand,
497529
GetQueryResultsCommand,
530+
GetScheduledQueryCommand,
531+
GetScheduledQueryHistoryCommand,
498532
GetTransformerCommand,
499533
ListAnomaliesCommand,
500534
ListIntegrationsCommand,
501535
ListLogAnomalyDetectorsCommand,
502536
ListLogGroupsCommand,
503537
ListLogGroupsForQueryCommand,
538+
ListScheduledQueriesCommand,
504539
ListTagsForResourceCommand,
505540
ListTagsLogGroupCommand,
506541
PutAccountPolicyCommand,
@@ -531,6 +566,7 @@ const commands = {
531566
UpdateAnomalyCommand,
532567
UpdateDeliveryConfigurationCommand,
533568
UpdateLogAnomalyDetectorCommand,
569+
UpdateScheduledQueryCommand,
534570
};
535571

536572
export interface CloudWatchLogs {
@@ -641,6 +677,23 @@ export interface CloudWatchLogs {
641677
cb: (err: any, data?: CreateLogStreamCommandOutput) => void
642678
): void;
643679

680+
/**
681+
* @see {@link CreateScheduledQueryCommand}
682+
*/
683+
createScheduledQuery(
684+
args: CreateScheduledQueryCommandInput,
685+
options?: __HttpHandlerOptions
686+
): Promise<CreateScheduledQueryCommandOutput>;
687+
createScheduledQuery(
688+
args: CreateScheduledQueryCommandInput,
689+
cb: (err: any, data?: CreateScheduledQueryCommandOutput) => void
690+
): void;
691+
createScheduledQuery(
692+
args: CreateScheduledQueryCommandInput,
693+
options: __HttpHandlerOptions,
694+
cb: (err: any, data?: CreateScheduledQueryCommandOutput) => void
695+
): void;
696+
644697
/**
645698
* @see {@link DeleteAccountPolicyCommand}
646699
*/
@@ -905,6 +958,23 @@ export interface CloudWatchLogs {
905958
cb: (err: any, data?: DeleteRetentionPolicyCommandOutput) => void
906959
): void;
907960

961+
/**
962+
* @see {@link DeleteScheduledQueryCommand}
963+
*/
964+
deleteScheduledQuery(
965+
args: DeleteScheduledQueryCommandInput,
966+
options?: __HttpHandlerOptions
967+
): Promise<DeleteScheduledQueryCommandOutput>;
968+
deleteScheduledQuery(
969+
args: DeleteScheduledQueryCommandInput,
970+
cb: (err: any, data?: DeleteScheduledQueryCommandOutput) => void
971+
): void;
972+
deleteScheduledQuery(
973+
args: DeleteScheduledQueryCommandInput,
974+
options: __HttpHandlerOptions,
975+
cb: (err: any, data?: DeleteScheduledQueryCommandOutput) => void
976+
): void;
977+
908978
/**
909979
* @see {@link DeleteSubscriptionFilterCommand}
910980
*/
@@ -1428,6 +1498,40 @@ export interface CloudWatchLogs {
14281498
cb: (err: any, data?: GetQueryResultsCommandOutput) => void
14291499
): void;
14301500

1501+
/**
1502+
* @see {@link GetScheduledQueryCommand}
1503+
*/
1504+
getScheduledQuery(
1505+
args: GetScheduledQueryCommandInput,
1506+
options?: __HttpHandlerOptions
1507+
): Promise<GetScheduledQueryCommandOutput>;
1508+
getScheduledQuery(
1509+
args: GetScheduledQueryCommandInput,
1510+
cb: (err: any, data?: GetScheduledQueryCommandOutput) => void
1511+
): void;
1512+
getScheduledQuery(
1513+
args: GetScheduledQueryCommandInput,
1514+
options: __HttpHandlerOptions,
1515+
cb: (err: any, data?: GetScheduledQueryCommandOutput) => void
1516+
): void;
1517+
1518+
/**
1519+
* @see {@link GetScheduledQueryHistoryCommand}
1520+
*/
1521+
getScheduledQueryHistory(
1522+
args: GetScheduledQueryHistoryCommandInput,
1523+
options?: __HttpHandlerOptions
1524+
): Promise<GetScheduledQueryHistoryCommandOutput>;
1525+
getScheduledQueryHistory(
1526+
args: GetScheduledQueryHistoryCommandInput,
1527+
cb: (err: any, data?: GetScheduledQueryHistoryCommandOutput) => void
1528+
): void;
1529+
getScheduledQueryHistory(
1530+
args: GetScheduledQueryHistoryCommandInput,
1531+
options: __HttpHandlerOptions,
1532+
cb: (err: any, data?: GetScheduledQueryHistoryCommandOutput) => void
1533+
): void;
1534+
14311535
/**
14321536
* @see {@link GetTransformerCommand}
14331537
*/
@@ -1519,6 +1623,24 @@ export interface CloudWatchLogs {
15191623
cb: (err: any, data?: ListLogGroupsForQueryCommandOutput) => void
15201624
): void;
15211625

1626+
/**
1627+
* @see {@link ListScheduledQueriesCommand}
1628+
*/
1629+
listScheduledQueries(): Promise<ListScheduledQueriesCommandOutput>;
1630+
listScheduledQueries(
1631+
args: ListScheduledQueriesCommandInput,
1632+
options?: __HttpHandlerOptions
1633+
): Promise<ListScheduledQueriesCommandOutput>;
1634+
listScheduledQueries(
1635+
args: ListScheduledQueriesCommandInput,
1636+
cb: (err: any, data?: ListScheduledQueriesCommandOutput) => void
1637+
): void;
1638+
listScheduledQueries(
1639+
args: ListScheduledQueriesCommandInput,
1640+
options: __HttpHandlerOptions,
1641+
cb: (err: any, data?: ListScheduledQueriesCommandOutput) => void
1642+
): void;
1643+
15221644
/**
15231645
* @see {@link ListTagsForResourceCommand}
15241646
*/
@@ -1957,6 +2079,23 @@ export interface CloudWatchLogs {
19572079
options: __HttpHandlerOptions,
19582080
cb: (err: any, data?: UpdateLogAnomalyDetectorCommandOutput) => void
19592081
): void;
2082+
2083+
/**
2084+
* @see {@link UpdateScheduledQueryCommand}
2085+
*/
2086+
updateScheduledQuery(
2087+
args: UpdateScheduledQueryCommandInput,
2088+
options?: __HttpHandlerOptions
2089+
): Promise<UpdateScheduledQueryCommandOutput>;
2090+
updateScheduledQuery(
2091+
args: UpdateScheduledQueryCommandInput,
2092+
cb: (err: any, data?: UpdateScheduledQueryCommandOutput) => void
2093+
): void;
2094+
updateScheduledQuery(
2095+
args: UpdateScheduledQueryCommandInput,
2096+
options: __HttpHandlerOptions,
2097+
cb: (err: any, data?: UpdateScheduledQueryCommandOutput) => void
2098+
): void;
19602099
}
19612100

19622101
/**

0 commit comments

Comments
 (0)