Skip to content

Commit 864e50e

Browse files
author
awstools
committed
feat(client-eks): Add support for cluster insights, new EKS capability that surfaces potentially upgrade impacting issues.
1 parent ff9baa6 commit 864e50e

File tree

10 files changed

+1159
-5
lines changed

10 files changed

+1159
-5
lines changed

clients/client-eks/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,14 @@ DescribeIdentityProviderConfig
418418

419419
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/eks/command/DescribeIdentityProviderConfigCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/DescribeIdentityProviderConfigCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/DescribeIdentityProviderConfigCommandOutput/)
420420

421+
</details>
422+
<details>
423+
<summary>
424+
DescribeInsight
425+
</summary>
426+
427+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/eks/command/DescribeInsightCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/DescribeInsightCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/DescribeInsightCommandOutput/)
428+
421429
</details>
422430
<details>
423431
<summary>
@@ -522,6 +530,14 @@ ListIdentityProviderConfigs
522530

523531
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/eks/command/ListIdentityProviderConfigsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/ListIdentityProviderConfigsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/ListIdentityProviderConfigsCommandOutput/)
524532

533+
</details>
534+
<details>
535+
<summary>
536+
ListInsights
537+
</summary>
538+
539+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/eks/command/ListInsightsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/ListInsightsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/ListInsightsCommandOutput/)
540+
525541
</details>
526542
<details>
527543
<summary>

clients/client-eks/src/EKS.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ import {
124124
DescribeIdentityProviderConfigCommandInput,
125125
DescribeIdentityProviderConfigCommandOutput,
126126
} from "./commands/DescribeIdentityProviderConfigCommand";
127+
import {
128+
DescribeInsightCommand,
129+
DescribeInsightCommandInput,
130+
DescribeInsightCommandOutput,
131+
} from "./commands/DescribeInsightCommand";
127132
import {
128133
DescribeNodegroupCommand,
129134
DescribeNodegroupCommandInput,
@@ -185,6 +190,11 @@ import {
185190
ListIdentityProviderConfigsCommandInput,
186191
ListIdentityProviderConfigsCommandOutput,
187192
} from "./commands/ListIdentityProviderConfigsCommand";
193+
import {
194+
ListInsightsCommand,
195+
ListInsightsCommandInput,
196+
ListInsightsCommandOutput,
197+
} from "./commands/ListInsightsCommand";
188198
import {
189199
ListNodegroupsCommand,
190200
ListNodegroupsCommandInput,
@@ -277,6 +287,7 @@ const commands = {
277287
DescribeEksAnywhereSubscriptionCommand,
278288
DescribeFargateProfileCommand,
279289
DescribeIdentityProviderConfigCommand,
290+
DescribeInsightCommand,
280291
DescribeNodegroupCommand,
281292
DescribePodIdentityAssociationCommand,
282293
DescribeUpdateCommand,
@@ -290,6 +301,7 @@ const commands = {
290301
ListEksAnywhereSubscriptionsCommand,
291302
ListFargateProfilesCommand,
292303
ListIdentityProviderConfigsCommand,
304+
ListInsightsCommand,
293305
ListNodegroupsCommand,
294306
ListPodIdentityAssociationsCommand,
295307
ListTagsForResourceCommand,
@@ -711,6 +723,20 @@ export interface EKS {
711723
cb: (err: any, data?: DescribeIdentityProviderConfigCommandOutput) => void
712724
): void;
713725

726+
/**
727+
* @see {@link DescribeInsightCommand}
728+
*/
729+
describeInsight(
730+
args: DescribeInsightCommandInput,
731+
options?: __HttpHandlerOptions
732+
): Promise<DescribeInsightCommandOutput>;
733+
describeInsight(args: DescribeInsightCommandInput, cb: (err: any, data?: DescribeInsightCommandOutput) => void): void;
734+
describeInsight(
735+
args: DescribeInsightCommandInput,
736+
options: __HttpHandlerOptions,
737+
cb: (err: any, data?: DescribeInsightCommandOutput) => void
738+
): void;
739+
714740
/**
715741
* @see {@link DescribeNodegroupCommand}
716742
*/
@@ -917,6 +943,17 @@ export interface EKS {
917943
cb: (err: any, data?: ListIdentityProviderConfigsCommandOutput) => void
918944
): void;
919945

946+
/**
947+
* @see {@link ListInsightsCommand}
948+
*/
949+
listInsights(args: ListInsightsCommandInput, options?: __HttpHandlerOptions): Promise<ListInsightsCommandOutput>;
950+
listInsights(args: ListInsightsCommandInput, cb: (err: any, data?: ListInsightsCommandOutput) => void): void;
951+
listInsights(
952+
args: ListInsightsCommandInput,
953+
options: __HttpHandlerOptions,
954+
cb: (err: any, data?: ListInsightsCommandOutput) => void
955+
): void;
956+
920957
/**
921958
* @see {@link ListNodegroupsCommand}
922959
*/

clients/client-eks/src/EKSClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ import {
119119
DescribeIdentityProviderConfigCommandInput,
120120
DescribeIdentityProviderConfigCommandOutput,
121121
} from "./commands/DescribeIdentityProviderConfigCommand";
122+
import { DescribeInsightCommandInput, DescribeInsightCommandOutput } from "./commands/DescribeInsightCommand";
122123
import { DescribeNodegroupCommandInput, DescribeNodegroupCommandOutput } from "./commands/DescribeNodegroupCommand";
123124
import {
124125
DescribePodIdentityAssociationCommandInput,
@@ -153,6 +154,7 @@ import {
153154
ListIdentityProviderConfigsCommandInput,
154155
ListIdentityProviderConfigsCommandOutput,
155156
} from "./commands/ListIdentityProviderConfigsCommand";
157+
import { ListInsightsCommandInput, ListInsightsCommandOutput } from "./commands/ListInsightsCommand";
156158
import { ListNodegroupsCommandInput, ListNodegroupsCommandOutput } from "./commands/ListNodegroupsCommand";
157159
import {
158160
ListPodIdentityAssociationsCommandInput,
@@ -233,6 +235,7 @@ export type ServiceInputTypes =
233235
| DescribeEksAnywhereSubscriptionCommandInput
234236
| DescribeFargateProfileCommandInput
235237
| DescribeIdentityProviderConfigCommandInput
238+
| DescribeInsightCommandInput
236239
| DescribeNodegroupCommandInput
237240
| DescribePodIdentityAssociationCommandInput
238241
| DescribeUpdateCommandInput
@@ -246,6 +249,7 @@ export type ServiceInputTypes =
246249
| ListEksAnywhereSubscriptionsCommandInput
247250
| ListFargateProfilesCommandInput
248251
| ListIdentityProviderConfigsCommandInput
252+
| ListInsightsCommandInput
249253
| ListNodegroupsCommandInput
250254
| ListPodIdentityAssociationsCommandInput
251255
| ListTagsForResourceCommandInput
@@ -292,6 +296,7 @@ export type ServiceOutputTypes =
292296
| DescribeEksAnywhereSubscriptionCommandOutput
293297
| DescribeFargateProfileCommandOutput
294298
| DescribeIdentityProviderConfigCommandOutput
299+
| DescribeInsightCommandOutput
295300
| DescribeNodegroupCommandOutput
296301
| DescribePodIdentityAssociationCommandOutput
297302
| DescribeUpdateCommandOutput
@@ -305,6 +310,7 @@ export type ServiceOutputTypes =
305310
| ListEksAnywhereSubscriptionsCommandOutput
306311
| ListFargateProfilesCommandOutput
307312
| ListIdentityProviderConfigsCommandOutput
313+
| ListInsightsCommandOutput
308314
| ListNodegroupsCommandOutput
309315
| ListPodIdentityAssociationsCommandOutput
310316
| ListTagsForResourceCommandOutput
Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
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+
SMITHY_CONTEXT_KEY,
15+
} from "@smithy/types";
16+
17+
import { EKSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EKSClient";
18+
import { DescribeInsightRequest, DescribeInsightResponse } from "../models/models_0";
19+
import { de_DescribeInsightCommand, se_DescribeInsightCommand } from "../protocols/Aws_restJson1";
20+
21+
/**
22+
* @public
23+
*/
24+
export { __MetadataBearer, $Command };
25+
/**
26+
* @public
27+
*
28+
* The input for {@link DescribeInsightCommand}.
29+
*/
30+
export interface DescribeInsightCommandInput extends DescribeInsightRequest {}
31+
/**
32+
* @public
33+
*
34+
* The output of {@link DescribeInsightCommand}.
35+
*/
36+
export interface DescribeInsightCommandOutput extends DescribeInsightResponse, __MetadataBearer {}
37+
38+
/**
39+
* @public
40+
* <p>Returns details about an insight that you specify using its ID.</p>
41+
* @example
42+
* Use a bare-bones client and the command you need to make an API call.
43+
* ```javascript
44+
* import { EKSClient, DescribeInsightCommand } from "@aws-sdk/client-eks"; // ES Modules import
45+
* // const { EKSClient, DescribeInsightCommand } = require("@aws-sdk/client-eks"); // CommonJS import
46+
* const client = new EKSClient(config);
47+
* const input = { // DescribeInsightRequest
48+
* clusterName: "STRING_VALUE", // required
49+
* id: "STRING_VALUE", // required
50+
* };
51+
* const command = new DescribeInsightCommand(input);
52+
* const response = await client.send(command);
53+
* // { // DescribeInsightResponse
54+
* // insight: { // Insight
55+
* // id: "STRING_VALUE",
56+
* // name: "STRING_VALUE",
57+
* // category: "UPGRADE_READINESS",
58+
* // kubernetesVersion: "STRING_VALUE",
59+
* // lastRefreshTime: new Date("TIMESTAMP"),
60+
* // lastTransitionTime: new Date("TIMESTAMP"),
61+
* // description: "STRING_VALUE",
62+
* // insightStatus: { // InsightStatus
63+
* // status: "PASSING" || "WARNING" || "ERROR" || "UNKNOWN",
64+
* // reason: "STRING_VALUE",
65+
* // },
66+
* // recommendation: "STRING_VALUE",
67+
* // additionalInfo: { // AdditionalInfoMap
68+
* // "<keys>": "STRING_VALUE",
69+
* // },
70+
* // resources: [ // InsightResourceDetails
71+
* // { // InsightResourceDetail
72+
* // insightStatus: {
73+
* // status: "PASSING" || "WARNING" || "ERROR" || "UNKNOWN",
74+
* // reason: "STRING_VALUE",
75+
* // },
76+
* // kubernetesResourceUri: "STRING_VALUE",
77+
* // arn: "STRING_VALUE",
78+
* // },
79+
* // ],
80+
* // categorySpecificSummary: { // InsightCategorySpecificSummary
81+
* // deprecationDetails: [ // DeprecationDetails
82+
* // { // DeprecationDetail
83+
* // usage: "STRING_VALUE",
84+
* // replacedWith: "STRING_VALUE",
85+
* // stopServingVersion: "STRING_VALUE",
86+
* // startServingReplacementVersion: "STRING_VALUE",
87+
* // clientStats: [ // ClientStats
88+
* // { // ClientStat
89+
* // userAgent: "STRING_VALUE",
90+
* // numberOfRequestsLast30Days: Number("int"),
91+
* // lastRequestTime: new Date("TIMESTAMP"),
92+
* // },
93+
* // ],
94+
* // },
95+
* // ],
96+
* // },
97+
* // },
98+
* // };
99+
*
100+
* ```
101+
*
102+
* @param DescribeInsightCommandInput - {@link DescribeInsightCommandInput}
103+
* @returns {@link DescribeInsightCommandOutput}
104+
* @see {@link DescribeInsightCommandInput} for command's `input` shape.
105+
* @see {@link DescribeInsightCommandOutput} for command's `response` shape.
106+
* @see {@link EKSClientResolvedConfig | config} for EKSClient's `config` shape.
107+
*
108+
* @throws {@link InvalidParameterException} (client fault)
109+
* <p>The specified parameter is invalid. Review the available parameters for the API
110+
* request.</p>
111+
*
112+
* @throws {@link InvalidRequestException} (client fault)
113+
* <p>The request is invalid given the state of the cluster. Check the state of the cluster
114+
* and the associated operations.</p>
115+
*
116+
* @throws {@link ResourceNotFoundException} (client fault)
117+
* <p>The specified resource could not be found. You can view your available clusters with
118+
* <code>ListClusters</code>. You can view your available managed node groups with
119+
* <code>ListNodegroups</code>. Amazon EKS clusters and node groups are Amazon Web Services Region specific.</p>
120+
*
121+
* @throws {@link ServerException} (server fault)
122+
* <p>These errors are usually caused by a server-side issue.</p>
123+
*
124+
* @throws {@link EKSServiceException}
125+
* <p>Base exception class for all service exceptions from EKS service.</p>
126+
*
127+
*/
128+
export class DescribeInsightCommand extends $Command<
129+
DescribeInsightCommandInput,
130+
DescribeInsightCommandOutput,
131+
EKSClientResolvedConfig
132+
> {
133+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
134+
return {
135+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
136+
Endpoint: { type: "builtInParams", name: "endpoint" },
137+
Region: { type: "builtInParams", name: "region" },
138+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
139+
};
140+
}
141+
142+
/**
143+
* @public
144+
*/
145+
constructor(readonly input: DescribeInsightCommandInput) {
146+
super();
147+
}
148+
149+
/**
150+
* @internal
151+
*/
152+
resolveMiddleware(
153+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
154+
configuration: EKSClientResolvedConfig,
155+
options?: __HttpHandlerOptions
156+
): Handler<DescribeInsightCommandInput, DescribeInsightCommandOutput> {
157+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
158+
this.middlewareStack.use(
159+
getEndpointPlugin(configuration, DescribeInsightCommand.getEndpointParameterInstructions())
160+
);
161+
162+
const stack = clientStack.concat(this.middlewareStack);
163+
164+
const { logger } = configuration;
165+
const clientName = "EKSClient";
166+
const commandName = "DescribeInsightCommand";
167+
const handlerExecutionContext: HandlerExecutionContext = {
168+
logger,
169+
clientName,
170+
commandName,
171+
inputFilterSensitiveLog: (_: any) => _,
172+
outputFilterSensitiveLog: (_: any) => _,
173+
[SMITHY_CONTEXT_KEY]: {
174+
service: "AWSWesleyFrontend",
175+
operation: "DescribeInsight",
176+
},
177+
};
178+
const { requestHandler } = configuration;
179+
return stack.resolve(
180+
(request: FinalizeHandlerArguments<any>) =>
181+
requestHandler.handle(request.request as __HttpRequest, options || {}),
182+
handlerExecutionContext
183+
);
184+
}
185+
186+
/**
187+
* @internal
188+
*/
189+
private serialize(input: DescribeInsightCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
190+
return se_DescribeInsightCommand(input, context);
191+
}
192+
193+
/**
194+
* @internal
195+
*/
196+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<DescribeInsightCommandOutput> {
197+
return de_DescribeInsightCommand(output, context);
198+
}
199+
}

0 commit comments

Comments
 (0)