Skip to content

Commit 58d1b48

Browse files
author
awstools
committed
feat(client-health): Adds new API DescribeEntityAggregatesForOrganization that retrieves entity aggregates across your organization. Also adds support for resource status filtering in DescribeAffectedEntitiesForOrganization, resource status aggregates in the DescribeEntityAggregates response, and new resource statuses.
1 parent 5152c34 commit 58d1b48

File tree

12 files changed

+886
-252
lines changed

12 files changed

+886
-252
lines changed

clients/client-health/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,14 @@ DescribeEntityAggregates
277277

278278
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-health/classes/describeentityaggregatescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-health/interfaces/describeentityaggregatescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-health/interfaces/describeentityaggregatescommandoutput.html)
279279

280+
</details>
281+
<details>
282+
<summary>
283+
DescribeEntityAggregatesForOrganization
284+
</summary>
285+
286+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-health/classes/describeentityaggregatesfororganizationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-health/interfaces/describeentityaggregatesfororganizationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-health/interfaces/describeentityaggregatesfororganizationcommandoutput.html)
287+
280288
</details>
281289
<details>
282290
<summary>

clients/client-health/src/Health.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ import {
2222
DescribeEntityAggregatesCommandInput,
2323
DescribeEntityAggregatesCommandOutput,
2424
} from "./commands/DescribeEntityAggregatesCommand";
25+
import {
26+
DescribeEntityAggregatesForOrganizationCommand,
27+
DescribeEntityAggregatesForOrganizationCommandInput,
28+
DescribeEntityAggregatesForOrganizationCommandOutput,
29+
} from "./commands/DescribeEntityAggregatesForOrganizationCommand";
2530
import {
2631
DescribeEventAggregatesCommand,
2732
DescribeEventAggregatesCommandInput,
@@ -74,6 +79,7 @@ const commands = {
7479
DescribeAffectedEntitiesCommand,
7580
DescribeAffectedEntitiesForOrganizationCommand,
7681
DescribeEntityAggregatesCommand,
82+
DescribeEntityAggregatesForOrganizationCommand,
7783
DescribeEventAggregatesCommand,
7884
DescribeEventDetailsCommand,
7985
DescribeEventDetailsForOrganizationCommand,
@@ -154,6 +160,23 @@ export interface Health {
154160
cb: (err: any, data?: DescribeEntityAggregatesCommandOutput) => void
155161
): void;
156162

163+
/**
164+
* @see {@link DescribeEntityAggregatesForOrganizationCommand}
165+
*/
166+
describeEntityAggregatesForOrganization(
167+
args: DescribeEntityAggregatesForOrganizationCommandInput,
168+
options?: __HttpHandlerOptions
169+
): Promise<DescribeEntityAggregatesForOrganizationCommandOutput>;
170+
describeEntityAggregatesForOrganization(
171+
args: DescribeEntityAggregatesForOrganizationCommandInput,
172+
cb: (err: any, data?: DescribeEntityAggregatesForOrganizationCommandOutput) => void
173+
): void;
174+
describeEntityAggregatesForOrganization(
175+
args: DescribeEntityAggregatesForOrganizationCommandInput,
176+
options: __HttpHandlerOptions,
177+
cb: (err: any, data?: DescribeEntityAggregatesForOrganizationCommandOutput) => void
178+
): void;
179+
157180
/**
158181
* @see {@link DescribeEventAggregatesCommand}
159182
*/

clients/client-health/src/HealthClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ import {
6666
DescribeEntityAggregatesCommandInput,
6767
DescribeEntityAggregatesCommandOutput,
6868
} from "./commands/DescribeEntityAggregatesCommand";
69+
import {
70+
DescribeEntityAggregatesForOrganizationCommandInput,
71+
DescribeEntityAggregatesForOrganizationCommandOutput,
72+
} from "./commands/DescribeEntityAggregatesForOrganizationCommand";
6973
import {
7074
DescribeEventAggregatesCommandInput,
7175
DescribeEventAggregatesCommandOutput,
@@ -115,6 +119,7 @@ export type ServiceInputTypes =
115119
| DescribeAffectedEntitiesCommandInput
116120
| DescribeAffectedEntitiesForOrganizationCommandInput
117121
| DescribeEntityAggregatesCommandInput
122+
| DescribeEntityAggregatesForOrganizationCommandInput
118123
| DescribeEventAggregatesCommandInput
119124
| DescribeEventDetailsCommandInput
120125
| DescribeEventDetailsForOrganizationCommandInput
@@ -133,6 +138,7 @@ export type ServiceOutputTypes =
133138
| DescribeAffectedEntitiesCommandOutput
134139
| DescribeAffectedEntitiesForOrganizationCommandOutput
135140
| DescribeEntityAggregatesCommandOutput
141+
| DescribeEntityAggregatesForOrganizationCommandOutput
136142
| DescribeEventAggregatesCommandOutput
137143
| DescribeEventDetailsCommandOutput
138144
| DescribeEventDetailsForOrganizationCommandOutput

clients/client-health/src/commands/DescribeAffectedEntitiesCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export interface DescribeAffectedEntitiesCommandOutput extends DescribeAffectedE
8282
* },
8383
* ],
8484
* statusCodes: [ // entityStatusCodeList
85-
* "IMPAIRED" || "UNIMPAIRED" || "UNKNOWN",
85+
* "IMPAIRED" || "UNIMPAIRED" || "UNKNOWN" || "PENDING" || "RESOLVED",
8686
* ],
8787
* },
8888
* locale: "STRING_VALUE",
@@ -100,7 +100,7 @@ export interface DescribeAffectedEntitiesCommandOutput extends DescribeAffectedE
100100
* // entityUrl: "STRING_VALUE",
101101
* // awsAccountId: "STRING_VALUE",
102102
* // lastUpdatedTime: new Date("TIMESTAMP"),
103-
* // statusCode: "IMPAIRED" || "UNIMPAIRED" || "UNKNOWN",
103+
* // statusCode: "IMPAIRED" || "UNIMPAIRED" || "UNKNOWN" || "PENDING" || "RESOLVED",
104104
* // tags: { // tagSet
105105
* // "<keys>": "STRING_VALUE",
106106
* // },

clients/client-health/src/commands/DescribeAffectedEntitiesForOrganizationCommand.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export interface DescribeAffectedEntitiesForOrganizationCommandOutput
7171
* // const { HealthClient, DescribeAffectedEntitiesForOrganizationCommand } = require("@aws-sdk/client-health"); // CommonJS import
7272
* const client = new HealthClient(config);
7373
* const input = { // DescribeAffectedEntitiesForOrganizationRequest
74-
* organizationEntityFilters: [ // OrganizationEntityFiltersList // required
74+
* organizationEntityFilters: [ // OrganizationEntityFiltersList
7575
* { // EventAccountFilter
7676
* eventArn: "STRING_VALUE", // required
7777
* awsAccountId: "STRING_VALUE",
@@ -80,6 +80,15 @@ export interface DescribeAffectedEntitiesForOrganizationCommandOutput
8080
* locale: "STRING_VALUE",
8181
* nextToken: "STRING_VALUE",
8282
* maxResults: Number("int"),
83+
* organizationEntityAccountFilters: [ // OrganizationEntityAccountFiltersList
84+
* { // EntityAccountFilter
85+
* eventArn: "STRING_VALUE", // required
86+
* awsAccountId: "STRING_VALUE",
87+
* statusCodes: [ // entityStatusCodeList
88+
* "IMPAIRED" || "UNIMPAIRED" || "UNKNOWN" || "PENDING" || "RESOLVED",
89+
* ],
90+
* },
91+
* ],
8392
* };
8493
* const command = new DescribeAffectedEntitiesForOrganizationCommand(input);
8594
* const response = await client.send(command);
@@ -92,7 +101,7 @@ export interface DescribeAffectedEntitiesForOrganizationCommandOutput
92101
* // entityUrl: "STRING_VALUE",
93102
* // awsAccountId: "STRING_VALUE",
94103
* // lastUpdatedTime: new Date("TIMESTAMP"),
95-
* // statusCode: "IMPAIRED" || "UNIMPAIRED" || "UNKNOWN",
104+
* // statusCode: "IMPAIRED" || "UNIMPAIRED" || "UNKNOWN" || "PENDING" || "RESOLVED",
96105
* // tags: { // tagSet
97106
* // "<keys>": "STRING_VALUE",
98107
* // },

clients/client-health/src/commands/DescribeEntityAggregatesCommand.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ export interface DescribeEntityAggregatesCommandOutput extends DescribeEntityAgg
5555
* // { // EntityAggregate
5656
* // eventArn: "STRING_VALUE",
5757
* // count: Number("int"),
58+
* // statuses: { // entityStatuses
59+
* // "<keys>": Number("int"),
60+
* // },
5861
* // },
5962
* // ],
6063
* // };
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
5+
import { Command as $Command } from "@smithy/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@smithy/types";
15+
16+
import { HealthClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../HealthClient";
17+
import {
18+
DescribeEntityAggregatesForOrganizationRequest,
19+
DescribeEntityAggregatesForOrganizationResponse,
20+
} from "../models/models_0";
21+
import {
22+
de_DescribeEntityAggregatesForOrganizationCommand,
23+
se_DescribeEntityAggregatesForOrganizationCommand,
24+
} from "../protocols/Aws_json1_1";
25+
26+
/**
27+
* @public
28+
*/
29+
export { __MetadataBearer, $Command };
30+
/**
31+
* @public
32+
*
33+
* The input for {@link DescribeEntityAggregatesForOrganizationCommand}.
34+
*/
35+
export interface DescribeEntityAggregatesForOrganizationCommandInput
36+
extends DescribeEntityAggregatesForOrganizationRequest {}
37+
/**
38+
* @public
39+
*
40+
* The output of {@link DescribeEntityAggregatesForOrganizationCommand}.
41+
*/
42+
export interface DescribeEntityAggregatesForOrganizationCommandOutput
43+
extends DescribeEntityAggregatesForOrganizationResponse,
44+
__MetadataBearer {}
45+
46+
/**
47+
* @public
48+
* <p>Returns a list of entity aggregates for your Organizations that are affected by each of the specified events.</p>
49+
* @example
50+
* Use a bare-bones client and the command you need to make an API call.
51+
* ```javascript
52+
* import { HealthClient, DescribeEntityAggregatesForOrganizationCommand } from "@aws-sdk/client-health"; // ES Modules import
53+
* // const { HealthClient, DescribeEntityAggregatesForOrganizationCommand } = require("@aws-sdk/client-health"); // CommonJS import
54+
* const client = new HealthClient(config);
55+
* const input = { // DescribeEntityAggregatesForOrganizationRequest
56+
* eventArns: [ // OrganizationEventArnsList // required
57+
* "STRING_VALUE",
58+
* ],
59+
* awsAccountIds: [ // OrganizationAccountIdsList
60+
* "STRING_VALUE",
61+
* ],
62+
* };
63+
* const command = new DescribeEntityAggregatesForOrganizationCommand(input);
64+
* const response = await client.send(command);
65+
* // { // DescribeEntityAggregatesForOrganizationResponse
66+
* // organizationEntityAggregates: [ // OrganizationEntityAggregatesList
67+
* // { // OrganizationEntityAggregate
68+
* // eventArn: "STRING_VALUE",
69+
* // count: Number("int"),
70+
* // statuses: { // entityStatuses
71+
* // "<keys>": Number("int"),
72+
* // },
73+
* // accounts: [ // AccountEntityAggregatesList
74+
* // { // AccountEntityAggregate
75+
* // accountId: "STRING_VALUE",
76+
* // count: Number("int"),
77+
* // statuses: {
78+
* // "<keys>": Number("int"),
79+
* // },
80+
* // },
81+
* // ],
82+
* // },
83+
* // ],
84+
* // };
85+
*
86+
* ```
87+
*
88+
* @param DescribeEntityAggregatesForOrganizationCommandInput - {@link DescribeEntityAggregatesForOrganizationCommandInput}
89+
* @returns {@link DescribeEntityAggregatesForOrganizationCommandOutput}
90+
* @see {@link DescribeEntityAggregatesForOrganizationCommandInput} for command's `input` shape.
91+
* @see {@link DescribeEntityAggregatesForOrganizationCommandOutput} for command's `response` shape.
92+
* @see {@link HealthClientResolvedConfig | config} for HealthClient's `config` shape.
93+
*
94+
* @throws {@link HealthServiceException}
95+
* <p>Base exception class for all service exceptions from Health service.</p>
96+
*
97+
*/
98+
export class DescribeEntityAggregatesForOrganizationCommand extends $Command<
99+
DescribeEntityAggregatesForOrganizationCommandInput,
100+
DescribeEntityAggregatesForOrganizationCommandOutput,
101+
HealthClientResolvedConfig
102+
> {
103+
// Start section: command_properties
104+
// End section: command_properties
105+
106+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
107+
return {
108+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
109+
Endpoint: { type: "builtInParams", name: "endpoint" },
110+
Region: { type: "builtInParams", name: "region" },
111+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
112+
};
113+
}
114+
115+
/**
116+
* @public
117+
*/
118+
constructor(readonly input: DescribeEntityAggregatesForOrganizationCommandInput) {
119+
// Start section: command_constructor
120+
super();
121+
// End section: command_constructor
122+
}
123+
124+
/**
125+
* @internal
126+
*/
127+
resolveMiddleware(
128+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
129+
configuration: HealthClientResolvedConfig,
130+
options?: __HttpHandlerOptions
131+
): Handler<
132+
DescribeEntityAggregatesForOrganizationCommandInput,
133+
DescribeEntityAggregatesForOrganizationCommandOutput
134+
> {
135+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
136+
this.middlewareStack.use(
137+
getEndpointPlugin(
138+
configuration,
139+
DescribeEntityAggregatesForOrganizationCommand.getEndpointParameterInstructions()
140+
)
141+
);
142+
143+
const stack = clientStack.concat(this.middlewareStack);
144+
145+
const { logger } = configuration;
146+
const clientName = "HealthClient";
147+
const commandName = "DescribeEntityAggregatesForOrganizationCommand";
148+
const handlerExecutionContext: HandlerExecutionContext = {
149+
logger,
150+
clientName,
151+
commandName,
152+
inputFilterSensitiveLog: (_: any) => _,
153+
outputFilterSensitiveLog: (_: any) => _,
154+
};
155+
const { requestHandler } = configuration;
156+
return stack.resolve(
157+
(request: FinalizeHandlerArguments<any>) =>
158+
requestHandler.handle(request.request as __HttpRequest, options || {}),
159+
handlerExecutionContext
160+
);
161+
}
162+
163+
/**
164+
* @internal
165+
*/
166+
private serialize(
167+
input: DescribeEntityAggregatesForOrganizationCommandInput,
168+
context: __SerdeContext
169+
): Promise<__HttpRequest> {
170+
return se_DescribeEntityAggregatesForOrganizationCommand(input, context);
171+
}
172+
173+
/**
174+
* @internal
175+
*/
176+
private deserialize(
177+
output: __HttpResponse,
178+
context: __SerdeContext
179+
): Promise<DescribeEntityAggregatesForOrganizationCommandOutput> {
180+
return de_DescribeEntityAggregatesForOrganizationCommand(output, context);
181+
}
182+
183+
// Start section: command_body_extra
184+
// End section: command_body_extra
185+
}

clients/client-health/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export * from "./DescribeAffectedAccountsForOrganizationCommand";
33
export * from "./DescribeAffectedEntitiesCommand";
44
export * from "./DescribeAffectedEntitiesForOrganizationCommand";
55
export * from "./DescribeEntityAggregatesCommand";
6+
export * from "./DescribeEntityAggregatesForOrganizationCommand";
67
export * from "./DescribeEventAggregatesCommand";
78
export * from "./DescribeEventDetailsCommand";
89
export * from "./DescribeEventDetailsForOrganizationCommand";

clients/client-health/src/endpoint/ruleset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@ q={[v]:"booleanEquals",[w]:[true,{[v]:"getAttr",[w]:[{[x]:e},"supportsDualStack"
3030
r=[l],
3131
s=[m],
3232
t=[o];
33-
const _data={version:"1.0",parameters:{Region:i,UseDualStack:j,UseFIPS:j,Endpoint:i},rules:[{conditions:[{[v]:a,[w]:[k]}],type:b,rules:[{conditions:r,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{type:b,rules:[{conditions:s,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:k,properties:n,headers:n},type:d}]}]},{type:b,rules:[{conditions:[{[v]:a,[w]:t}],type:b,rules:[{conditions:[{[v]:"aws.partition",[w]:t,assign:e}],type:b,rules:[{conditions:[l,m],type:b,rules:[{conditions:[p,q],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://health-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:d}]}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:r,type:b,rules:[{conditions:[p],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://health-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:d}]}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:s,type:b,rules:[{conditions:[q],type:b,rules:[{type:b,rules:[{endpoint:{url:"https://health.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:d}]}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{type:b,rules:[{conditions:[{[v]:f,[w]:[o,"aws-global"]}],endpoint:{url:"https://global.health.amazonaws.com",properties:{authSchemes:[{name:g,signingName:h,signingRegion:"us-east-1"}]},headers:n},type:d},{conditions:[{[v]:f,[w]:[o,"aws-cn-global"]}],endpoint:{url:"https://global.health.amazonaws.com.cn",properties:{authSchemes:[{name:g,signingName:h,signingRegion:"cn-northwest-1"}]},headers:n},type:d},{endpoint:{url:"https://health.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:d}]}]}]},{error:"Invalid Configuration: Missing Region",type:c}]}]};
33+
const _data={version:"1.0",parameters:{Region:i,UseDualStack:j,UseFIPS:j,Endpoint:i},rules:[{conditions:[{[v]:a,[w]:[k]}],type:b,rules:[{conditions:r,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:c},{conditions:s,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:c},{endpoint:{url:k,properties:n,headers:n},type:d}]},{conditions:[{[v]:a,[w]:t}],type:b,rules:[{conditions:[{[v]:"aws.partition",[w]:t,assign:e}],type:b,rules:[{conditions:[l,m],type:b,rules:[{conditions:[p,q],type:b,rules:[{endpoint:{url:"https://health-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:d}]},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:c}]},{conditions:r,type:b,rules:[{conditions:[p],type:b,rules:[{endpoint:{url:"https://health-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:d}]},{error:"FIPS is enabled but this partition does not support FIPS",type:c}]},{conditions:s,type:b,rules:[{conditions:[q],type:b,rules:[{endpoint:{url:"https://health.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:d}]},{error:"DualStack is enabled but this partition does not support DualStack",type:c}]},{conditions:[{[v]:f,[w]:[o,"aws-global"]}],endpoint:{url:"https://global.health.amazonaws.com",properties:{authSchemes:[{name:g,signingName:h,signingRegion:"us-east-1"}]},headers:n},type:d},{conditions:[{[v]:f,[w]:[o,"aws-cn-global"]}],endpoint:{url:"https://global.health.amazonaws.com.cn",properties:{authSchemes:[{name:g,signingName:h,signingRegion:"cn-northwest-1"}]},headers:n},type:d},{endpoint:{url:"https://health.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:d}]}]},{error:"Invalid Configuration: Missing Region",type:c}]};
3434
export const ruleSet: RuleSetObject = _data;

0 commit comments

Comments
 (0)