Skip to content

Commit 9d801db

Browse files
author
awstools
committed
feat(client-cloudwatch-logs): This release adds a new API "ListLogGroups" and an improvement in API "DescribeLogGroups"
1 parent d56b489 commit 9d801db

File tree

9 files changed

+478
-12
lines changed

9 files changed

+478
-12
lines changed

clients/client-cloudwatch-logs/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,14 @@ ListLogAnomalyDetectors
700700

701701
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/ListLogAnomalyDetectorsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/ListLogAnomalyDetectorsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/ListLogAnomalyDetectorsCommandOutput/)
702702

703+
</details>
704+
<details>
705+
<summary>
706+
ListLogGroups
707+
</summary>
708+
709+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/cloudwatch-logs/command/ListLogGroupsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/ListLogGroupsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-cloudwatch-logs/Interface/ListLogGroupsCommandOutput/)
710+
703711
</details>
704712
<details>
705713
<summary>

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,11 @@ import {
289289
ListLogAnomalyDetectorsCommandInput,
290290
ListLogAnomalyDetectorsCommandOutput,
291291
} from "./commands/ListLogAnomalyDetectorsCommand";
292+
import {
293+
ListLogGroupsCommand,
294+
ListLogGroupsCommandInput,
295+
ListLogGroupsCommandOutput,
296+
} from "./commands/ListLogGroupsCommand";
292297
import {
293298
ListLogGroupsForQueryCommand,
294299
ListLogGroupsForQueryCommandInput,
@@ -488,6 +493,7 @@ const commands = {
488493
ListAnomaliesCommand,
489494
ListIntegrationsCommand,
490495
ListLogAnomalyDetectorsCommand,
496+
ListLogGroupsCommand,
491497
ListLogGroupsForQueryCommand,
492498
ListTagsForResourceCommand,
493499
ListTagsLogGroupCommand,
@@ -1467,6 +1473,18 @@ export interface CloudWatchLogs {
14671473
cb: (err: any, data?: ListLogAnomalyDetectorsCommandOutput) => void
14681474
): void;
14691475

1476+
/**
1477+
* @see {@link ListLogGroupsCommand}
1478+
*/
1479+
listLogGroups(): Promise<ListLogGroupsCommandOutput>;
1480+
listLogGroups(args: ListLogGroupsCommandInput, options?: __HttpHandlerOptions): Promise<ListLogGroupsCommandOutput>;
1481+
listLogGroups(args: ListLogGroupsCommandInput, cb: (err: any, data?: ListLogGroupsCommandOutput) => void): void;
1482+
listLogGroups(
1483+
args: ListLogGroupsCommandInput,
1484+
options: __HttpHandlerOptions,
1485+
cb: (err: any, data?: ListLogGroupsCommandOutput) => void
1486+
): void;
1487+
14701488
/**
14711489
* @see {@link ListLogGroupsForQueryCommand}
14721490
*/

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ import {
201201
ListLogAnomalyDetectorsCommandInput,
202202
ListLogAnomalyDetectorsCommandOutput,
203203
} from "./commands/ListLogAnomalyDetectorsCommand";
204+
import { ListLogGroupsCommandInput, ListLogGroupsCommandOutput } from "./commands/ListLogGroupsCommand";
204205
import {
205206
ListLogGroupsForQueryCommandInput,
206207
ListLogGroupsForQueryCommandOutput,
@@ -332,6 +333,7 @@ export type ServiceInputTypes =
332333
| ListAnomaliesCommandInput
333334
| ListIntegrationsCommandInput
334335
| ListLogAnomalyDetectorsCommandInput
336+
| ListLogGroupsCommandInput
335337
| ListLogGroupsForQueryCommandInput
336338
| ListTagsForResourceCommandInput
337339
| ListTagsLogGroupCommandInput
@@ -426,6 +428,7 @@ export type ServiceOutputTypes =
426428
| ListAnomaliesCommandOutput
427429
| ListIntegrationsCommandOutput
428430
| ListLogAnomalyDetectorsCommandOutput
431+
| ListLogGroupsCommandOutput
429432
| ListLogGroupsForQueryCommandOutput
430433
| ListTagsForResourceCommandOutput
431434
| ListTagsLogGroupCommandOutput

clients/client-cloudwatch-logs/src/commands/DescribeLogGroupsCommand.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface DescribeLogGroupsCommandInput extends DescribeLogGroupsRequest
2828
export interface DescribeLogGroupsCommandOutput extends DescribeLogGroupsResponse, __MetadataBearer {}
2929

3030
/**
31-
* <p>Lists the specified log groups. You can list all your log groups or filter the results by prefix.
31+
* <p>Returns information about log groups. You can return all your log groups or filter the results by prefix.
3232
* The results are ASCII-sorted by log group name.</p>
3333
* <p>CloudWatch Logs doesn't support IAM policies that control access to the <code>DescribeLogGroups</code> action by using the
3434
* <code>aws:ResourceTag/<i>key-name</i>
@@ -56,6 +56,9 @@ export interface DescribeLogGroupsCommandOutput extends DescribeLogGroupsRespons
5656
* limit: Number("int"),
5757
* includeLinkedAccounts: true || false,
5858
* logGroupClass: "STANDARD" || "INFREQUENT_ACCESS" || "DELIVERY",
59+
* logGroupIdentifiers: [ // DescribeLogGroupsLogGroupIdentifiers
60+
* "STRING_VALUE",
61+
* ],
5962
* };
6063
* const command = new DescribeLogGroupsCommand(input);
6164
* const response = await client.send(command);
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { CloudWatchLogsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CloudWatchLogsClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { ListLogGroupsRequest, ListLogGroupsResponse } from "../models/models_0";
10+
import { de_ListLogGroupsCommand, se_ListLogGroupsCommand } from "../protocols/Aws_json1_1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link ListLogGroupsCommand}.
21+
*/
22+
export interface ListLogGroupsCommandInput extends ListLogGroupsRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link ListLogGroupsCommand}.
27+
*/
28+
export interface ListLogGroupsCommandOutput extends ListLogGroupsResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns a list of log groups in the Region in your account. If you are performing this action in a monitoring account, you can
32+
* choose to also return log groups from source accounts that are linked to the monitoring account. For more information about using cross-account
33+
* observability to set up monitoring accounts and source accounts, see
34+
* <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html">
35+
* CloudWatch cross-account observability</a>.</p>
36+
* <p>You can optionally filter the list by log group class and by using regular expressions in your request to match strings in the log group names.</p>
37+
* <p>This operation is paginated. By default, your first use of this operation returns 50 results, and includes a token to use in a subsequent operation to return
38+
* more results.</p>
39+
* @example
40+
* Use a bare-bones client and the command you need to make an API call.
41+
* ```javascript
42+
* import { CloudWatchLogsClient, ListLogGroupsCommand } from "@aws-sdk/client-cloudwatch-logs"; // ES Modules import
43+
* // const { CloudWatchLogsClient, ListLogGroupsCommand } = require("@aws-sdk/client-cloudwatch-logs"); // CommonJS import
44+
* const client = new CloudWatchLogsClient(config);
45+
* const input = { // ListLogGroupsRequest
46+
* logGroupNamePattern: "STRING_VALUE",
47+
* logGroupClass: "STANDARD" || "INFREQUENT_ACCESS" || "DELIVERY",
48+
* includeLinkedAccounts: true || false,
49+
* accountIdentifiers: [ // AccountIds
50+
* "STRING_VALUE",
51+
* ],
52+
* nextToken: "STRING_VALUE",
53+
* limit: Number("int"),
54+
* };
55+
* const command = new ListLogGroupsCommand(input);
56+
* const response = await client.send(command);
57+
* // { // ListLogGroupsResponse
58+
* // logGroups: [ // LogGroupSummaries
59+
* // { // LogGroupSummary
60+
* // logGroupName: "STRING_VALUE",
61+
* // logGroupArn: "STRING_VALUE",
62+
* // logGroupClass: "STANDARD" || "INFREQUENT_ACCESS" || "DELIVERY",
63+
* // },
64+
* // ],
65+
* // nextToken: "STRING_VALUE",
66+
* // };
67+
*
68+
* ```
69+
*
70+
* @param ListLogGroupsCommandInput - {@link ListLogGroupsCommandInput}
71+
* @returns {@link ListLogGroupsCommandOutput}
72+
* @see {@link ListLogGroupsCommandInput} for command's `input` shape.
73+
* @see {@link ListLogGroupsCommandOutput} for command's `response` shape.
74+
* @see {@link CloudWatchLogsClientResolvedConfig | config} for CloudWatchLogsClient's `config` shape.
75+
*
76+
* @throws {@link InvalidParameterException} (client fault)
77+
* <p>A parameter is specified incorrectly.</p>
78+
*
79+
* @throws {@link ServiceUnavailableException} (server fault)
80+
* <p>The service cannot complete the request.</p>
81+
*
82+
* @throws {@link CloudWatchLogsServiceException}
83+
* <p>Base exception class for all service exceptions from CloudWatchLogs service.</p>
84+
*
85+
*
86+
* @public
87+
*/
88+
export class ListLogGroupsCommand extends $Command
89+
.classBuilder<
90+
ListLogGroupsCommandInput,
91+
ListLogGroupsCommandOutput,
92+
CloudWatchLogsClientResolvedConfig,
93+
ServiceInputTypes,
94+
ServiceOutputTypes
95+
>()
96+
.ep(commonParams)
97+
.m(function (this: any, Command: any, cs: any, config: CloudWatchLogsClientResolvedConfig, o: any) {
98+
return [
99+
getSerdePlugin(config, this.serialize, this.deserialize),
100+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
101+
];
102+
})
103+
.s("Logs_20140328", "ListLogGroups", {})
104+
.n("CloudWatchLogsClient", "ListLogGroupsCommand")
105+
.f(void 0, void 0)
106+
.ser(se_ListLogGroupsCommand)
107+
.de(de_ListLogGroupsCommand)
108+
.build() {
109+
/** @internal type navigation helper, not in runtime. */
110+
protected declare static __types: {
111+
api: {
112+
input: ListLogGroupsRequest;
113+
output: ListLogGroupsResponse;
114+
};
115+
sdk: {
116+
input: ListLogGroupsCommandInput;
117+
output: ListLogGroupsCommandOutput;
118+
};
119+
};
120+
}

clients/client-cloudwatch-logs/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export * from "./GetTransformerCommand";
5757
export * from "./ListAnomaliesCommand";
5858
export * from "./ListIntegrationsCommand";
5959
export * from "./ListLogAnomalyDetectorsCommand";
60+
export * from "./ListLogGroupsCommand";
6061
export * from "./ListLogGroupsForQueryCommand";
6162
export * from "./ListTagsForResourceCommand";
6263
export * from "./ListTagsLogGroupCommand";

0 commit comments

Comments
 (0)