Skip to content

Commit 90ed85b

Browse files
author
awstools
committed
feat(client-devops-guru): Added new APIs for log anomaly detection feature.
1 parent ed39bc2 commit 90ed85b

File tree

11 files changed

+1725
-5
lines changed

11 files changed

+1725
-5
lines changed

clients/client-devops-guru/src/DevOpsGuru.ts

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,22 @@ import {
8181
ListAnomaliesForInsightCommandInput,
8282
ListAnomaliesForInsightCommandOutput,
8383
} from "./commands/ListAnomaliesForInsightCommand";
84+
import {
85+
ListAnomalousLogGroupsCommand,
86+
ListAnomalousLogGroupsCommandInput,
87+
ListAnomalousLogGroupsCommandOutput,
88+
} from "./commands/ListAnomalousLogGroupsCommand";
8489
import { ListEventsCommand, ListEventsCommandInput, ListEventsCommandOutput } from "./commands/ListEventsCommand";
8590
import {
8691
ListInsightsCommand,
8792
ListInsightsCommandInput,
8893
ListInsightsCommandOutput,
8994
} from "./commands/ListInsightsCommand";
95+
import {
96+
ListMonitoredResourcesCommand,
97+
ListMonitoredResourcesCommandInput,
98+
ListMonitoredResourcesCommandOutput,
99+
} from "./commands/ListMonitoredResourcesCommand";
90100
import {
91101
ListNotificationChannelsCommand,
92102
ListNotificationChannelsCommandInput,
@@ -706,6 +716,40 @@ export class DevOpsGuru extends DevOpsGuruClient {
706716
}
707717
}
708718

719+
/**
720+
* <p>
721+
* Returns the list of log groups that contain log anomalies.
722+
* </p>
723+
*/
724+
public listAnomalousLogGroups(
725+
args: ListAnomalousLogGroupsCommandInput,
726+
options?: __HttpHandlerOptions
727+
): Promise<ListAnomalousLogGroupsCommandOutput>;
728+
public listAnomalousLogGroups(
729+
args: ListAnomalousLogGroupsCommandInput,
730+
cb: (err: any, data?: ListAnomalousLogGroupsCommandOutput) => void
731+
): void;
732+
public listAnomalousLogGroups(
733+
args: ListAnomalousLogGroupsCommandInput,
734+
options: __HttpHandlerOptions,
735+
cb: (err: any, data?: ListAnomalousLogGroupsCommandOutput) => void
736+
): void;
737+
public listAnomalousLogGroups(
738+
args: ListAnomalousLogGroupsCommandInput,
739+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListAnomalousLogGroupsCommandOutput) => void),
740+
cb?: (err: any, data?: ListAnomalousLogGroupsCommandOutput) => void
741+
): Promise<ListAnomalousLogGroupsCommandOutput> | void {
742+
const command = new ListAnomalousLogGroupsCommand(args);
743+
if (typeof optionsOrCb === "function") {
744+
this.send(command, optionsOrCb);
745+
} else if (typeof cb === "function") {
746+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
747+
this.send(command, optionsOrCb || {}, cb);
748+
} else {
749+
return this.send(command, optionsOrCb);
750+
}
751+
}
752+
709753
/**
710754
* <p> Returns a list of the events emitted by the resources that are evaluated by DevOps Guru.
711755
* You can use filters to specify which events are returned. </p>
@@ -764,6 +808,40 @@ export class DevOpsGuru extends DevOpsGuruClient {
764808
}
765809
}
766810

811+
/**
812+
* <p>
813+
* Returns the list of all log groups that are being monitored and tagged by DevOps Guru.
814+
* </p>
815+
*/
816+
public listMonitoredResources(
817+
args: ListMonitoredResourcesCommandInput,
818+
options?: __HttpHandlerOptions
819+
): Promise<ListMonitoredResourcesCommandOutput>;
820+
public listMonitoredResources(
821+
args: ListMonitoredResourcesCommandInput,
822+
cb: (err: any, data?: ListMonitoredResourcesCommandOutput) => void
823+
): void;
824+
public listMonitoredResources(
825+
args: ListMonitoredResourcesCommandInput,
826+
options: __HttpHandlerOptions,
827+
cb: (err: any, data?: ListMonitoredResourcesCommandOutput) => void
828+
): void;
829+
public listMonitoredResources(
830+
args: ListMonitoredResourcesCommandInput,
831+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListMonitoredResourcesCommandOutput) => void),
832+
cb?: (err: any, data?: ListMonitoredResourcesCommandOutput) => void
833+
): Promise<ListMonitoredResourcesCommandOutput> | void {
834+
const command = new ListMonitoredResourcesCommand(args);
835+
if (typeof optionsOrCb === "function") {
836+
this.send(command, optionsOrCb);
837+
} else if (typeof cb === "function") {
838+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
839+
this.send(command, optionsOrCb || {}, cb);
840+
} else {
841+
return this.send(command, optionsOrCb);
842+
}
843+
}
844+
767845
/**
768846
* <p> Returns a list of notification channels configured for DevOps Guru. Each notification
769847
* channel is used to notify you when DevOps Guru generates an insight that contains information

clients/client-devops-guru/src/DevOpsGuruClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,16 @@ import {
102102
ListAnomaliesForInsightCommandInput,
103103
ListAnomaliesForInsightCommandOutput,
104104
} from "./commands/ListAnomaliesForInsightCommand";
105+
import {
106+
ListAnomalousLogGroupsCommandInput,
107+
ListAnomalousLogGroupsCommandOutput,
108+
} from "./commands/ListAnomalousLogGroupsCommand";
105109
import { ListEventsCommandInput, ListEventsCommandOutput } from "./commands/ListEventsCommand";
106110
import { ListInsightsCommandInput, ListInsightsCommandOutput } from "./commands/ListInsightsCommand";
111+
import {
112+
ListMonitoredResourcesCommandInput,
113+
ListMonitoredResourcesCommandOutput,
114+
} from "./commands/ListMonitoredResourcesCommand";
107115
import {
108116
ListNotificationChannelsCommandInput,
109117
ListNotificationChannelsCommandOutput,
@@ -161,8 +169,10 @@ export type ServiceInputTypes =
161169
| GetCostEstimationCommandInput
162170
| GetResourceCollectionCommandInput
163171
| ListAnomaliesForInsightCommandInput
172+
| ListAnomalousLogGroupsCommandInput
164173
| ListEventsCommandInput
165174
| ListInsightsCommandInput
175+
| ListMonitoredResourcesCommandInput
166176
| ListNotificationChannelsCommandInput
167177
| ListOrganizationInsightsCommandInput
168178
| ListRecommendationsCommandInput
@@ -192,8 +202,10 @@ export type ServiceOutputTypes =
192202
| GetCostEstimationCommandOutput
193203
| GetResourceCollectionCommandOutput
194204
| ListAnomaliesForInsightCommandOutput
205+
| ListAnomalousLogGroupsCommandOutput
195206
| ListEventsCommandOutput
196207
| ListInsightsCommandOutput
208+
| ListMonitoredResourcesCommandOutput
197209
| ListNotificationChannelsCommandOutput
198210
| ListOrganizationInsightsCommandOutput
199211
| ListRecommendationsCommandOutput
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { DevOpsGuruClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DevOpsGuruClient";
16+
import { ListAnomalousLogGroupsRequest, ListAnomalousLogGroupsResponse } from "../models/models_0";
17+
import {
18+
deserializeAws_restJson1ListAnomalousLogGroupsCommand,
19+
serializeAws_restJson1ListAnomalousLogGroupsCommand,
20+
} from "../protocols/Aws_restJson1";
21+
22+
export interface ListAnomalousLogGroupsCommandInput extends ListAnomalousLogGroupsRequest {}
23+
export interface ListAnomalousLogGroupsCommandOutput extends ListAnomalousLogGroupsResponse, __MetadataBearer {}
24+
25+
/**
26+
* <p>
27+
* Returns the list of log groups that contain log anomalies.
28+
* </p>
29+
* @example
30+
* Use a bare-bones client and the command you need to make an API call.
31+
* ```javascript
32+
* import { DevOpsGuruClient, ListAnomalousLogGroupsCommand } from "@aws-sdk/client-devops-guru"; // ES Modules import
33+
* // const { DevOpsGuruClient, ListAnomalousLogGroupsCommand } = require("@aws-sdk/client-devops-guru"); // CommonJS import
34+
* const client = new DevOpsGuruClient(config);
35+
* const command = new ListAnomalousLogGroupsCommand(input);
36+
* const response = await client.send(command);
37+
* ```
38+
*
39+
* @see {@link ListAnomalousLogGroupsCommandInput} for command's `input` shape.
40+
* @see {@link ListAnomalousLogGroupsCommandOutput} for command's `response` shape.
41+
* @see {@link DevOpsGuruClientResolvedConfig | config} for DevOpsGuruClient's `config` shape.
42+
*
43+
*/
44+
export class ListAnomalousLogGroupsCommand extends $Command<
45+
ListAnomalousLogGroupsCommandInput,
46+
ListAnomalousLogGroupsCommandOutput,
47+
DevOpsGuruClientResolvedConfig
48+
> {
49+
// Start section: command_properties
50+
// End section: command_properties
51+
52+
constructor(readonly input: ListAnomalousLogGroupsCommandInput) {
53+
// Start section: command_constructor
54+
super();
55+
// End section: command_constructor
56+
}
57+
58+
/**
59+
* @internal
60+
*/
61+
resolveMiddleware(
62+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
63+
configuration: DevOpsGuruClientResolvedConfig,
64+
options?: __HttpHandlerOptions
65+
): Handler<ListAnomalousLogGroupsCommandInput, ListAnomalousLogGroupsCommandOutput> {
66+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
67+
68+
const stack = clientStack.concat(this.middlewareStack);
69+
70+
const { logger } = configuration;
71+
const clientName = "DevOpsGuruClient";
72+
const commandName = "ListAnomalousLogGroupsCommand";
73+
const handlerExecutionContext: HandlerExecutionContext = {
74+
logger,
75+
clientName,
76+
commandName,
77+
inputFilterSensitiveLog: ListAnomalousLogGroupsRequest.filterSensitiveLog,
78+
outputFilterSensitiveLog: ListAnomalousLogGroupsResponse.filterSensitiveLog,
79+
};
80+
const { requestHandler } = configuration;
81+
return stack.resolve(
82+
(request: FinalizeHandlerArguments<any>) =>
83+
requestHandler.handle(request.request as __HttpRequest, options || {}),
84+
handlerExecutionContext
85+
);
86+
}
87+
88+
private serialize(input: ListAnomalousLogGroupsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
89+
return serializeAws_restJson1ListAnomalousLogGroupsCommand(input, context);
90+
}
91+
92+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListAnomalousLogGroupsCommandOutput> {
93+
return deserializeAws_restJson1ListAnomalousLogGroupsCommand(output, context);
94+
}
95+
96+
// Start section: command_body_extra
97+
// End section: command_body_extra
98+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { DevOpsGuruClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DevOpsGuruClient";
16+
import { ListMonitoredResourcesRequest, ListMonitoredResourcesResponse } from "../models/models_0";
17+
import {
18+
deserializeAws_restJson1ListMonitoredResourcesCommand,
19+
serializeAws_restJson1ListMonitoredResourcesCommand,
20+
} from "../protocols/Aws_restJson1";
21+
22+
export interface ListMonitoredResourcesCommandInput extends ListMonitoredResourcesRequest {}
23+
export interface ListMonitoredResourcesCommandOutput extends ListMonitoredResourcesResponse, __MetadataBearer {}
24+
25+
/**
26+
* <p>
27+
* Returns the list of all log groups that are being monitored and tagged by DevOps Guru.
28+
* </p>
29+
* @example
30+
* Use a bare-bones client and the command you need to make an API call.
31+
* ```javascript
32+
* import { DevOpsGuruClient, ListMonitoredResourcesCommand } from "@aws-sdk/client-devops-guru"; // ES Modules import
33+
* // const { DevOpsGuruClient, ListMonitoredResourcesCommand } = require("@aws-sdk/client-devops-guru"); // CommonJS import
34+
* const client = new DevOpsGuruClient(config);
35+
* const command = new ListMonitoredResourcesCommand(input);
36+
* const response = await client.send(command);
37+
* ```
38+
*
39+
* @see {@link ListMonitoredResourcesCommandInput} for command's `input` shape.
40+
* @see {@link ListMonitoredResourcesCommandOutput} for command's `response` shape.
41+
* @see {@link DevOpsGuruClientResolvedConfig | config} for DevOpsGuruClient's `config` shape.
42+
*
43+
*/
44+
export class ListMonitoredResourcesCommand extends $Command<
45+
ListMonitoredResourcesCommandInput,
46+
ListMonitoredResourcesCommandOutput,
47+
DevOpsGuruClientResolvedConfig
48+
> {
49+
// Start section: command_properties
50+
// End section: command_properties
51+
52+
constructor(readonly input: ListMonitoredResourcesCommandInput) {
53+
// Start section: command_constructor
54+
super();
55+
// End section: command_constructor
56+
}
57+
58+
/**
59+
* @internal
60+
*/
61+
resolveMiddleware(
62+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
63+
configuration: DevOpsGuruClientResolvedConfig,
64+
options?: __HttpHandlerOptions
65+
): Handler<ListMonitoredResourcesCommandInput, ListMonitoredResourcesCommandOutput> {
66+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
67+
68+
const stack = clientStack.concat(this.middlewareStack);
69+
70+
const { logger } = configuration;
71+
const clientName = "DevOpsGuruClient";
72+
const commandName = "ListMonitoredResourcesCommand";
73+
const handlerExecutionContext: HandlerExecutionContext = {
74+
logger,
75+
clientName,
76+
commandName,
77+
inputFilterSensitiveLog: ListMonitoredResourcesRequest.filterSensitiveLog,
78+
outputFilterSensitiveLog: ListMonitoredResourcesResponse.filterSensitiveLog,
79+
};
80+
const { requestHandler } = configuration;
81+
return stack.resolve(
82+
(request: FinalizeHandlerArguments<any>) =>
83+
requestHandler.handle(request.request as __HttpRequest, options || {}),
84+
handlerExecutionContext
85+
);
86+
}
87+
88+
private serialize(input: ListMonitoredResourcesCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
89+
return serializeAws_restJson1ListMonitoredResourcesCommand(input, context);
90+
}
91+
92+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListMonitoredResourcesCommandOutput> {
93+
return deserializeAws_restJson1ListMonitoredResourcesCommand(output, context);
94+
}
95+
96+
// Start section: command_body_extra
97+
// End section: command_body_extra
98+
}

clients/client-devops-guru/src/commands/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ export * from "./DescribeServiceIntegrationCommand";
1515
export * from "./GetCostEstimationCommand";
1616
export * from "./GetResourceCollectionCommand";
1717
export * from "./ListAnomaliesForInsightCommand";
18+
export * from "./ListAnomalousLogGroupsCommand";
1819
export * from "./ListEventsCommand";
1920
export * from "./ListInsightsCommand";
21+
export * from "./ListMonitoredResourcesCommand";
2022
export * from "./ListNotificationChannelsCommand";
2123
export * from "./ListOrganizationInsightsCommand";
2224
export * from "./ListRecommendationsCommand";

0 commit comments

Comments
 (0)