Skip to content

Commit 9b9b9f4

Browse files
author
awstools
committed
feat(client-eks): Add support for on-demand refresh of EKS cluster insights
1 parent 272f942 commit 9b9b9f4

File tree

9 files changed

+644
-0
lines changed

9 files changed

+644
-0
lines changed

clients/client-eks/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,14 @@ DescribeInsight
435435

436436
[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/)
437437

438+
</details>
439+
<details>
440+
<summary>
441+
DescribeInsightsRefresh
442+
</summary>
443+
444+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/eks/command/DescribeInsightsRefreshCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/DescribeInsightsRefreshCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/DescribeInsightsRefreshCommandOutput/)
445+
438446
</details>
439447
<details>
440448
<summary>
@@ -587,6 +595,14 @@ RegisterCluster
587595

588596
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/eks/command/RegisterClusterCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/RegisterClusterCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/RegisterClusterCommandOutput/)
589597

598+
</details>
599+
<details>
600+
<summary>
601+
StartInsightsRefresh
602+
</summary>
603+
604+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/eks/command/StartInsightsRefreshCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/StartInsightsRefreshCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-eks/Interface/StartInsightsRefreshCommandOutput/)
605+
590606
</details>
591607
<details>
592608
<summary>

clients/client-eks/src/EKS.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ import {
134134
DescribeInsightCommandInput,
135135
DescribeInsightCommandOutput,
136136
} from "./commands/DescribeInsightCommand";
137+
import {
138+
DescribeInsightsRefreshCommand,
139+
DescribeInsightsRefreshCommandInput,
140+
DescribeInsightsRefreshCommandOutput,
141+
} from "./commands/DescribeInsightsRefreshCommand";
137142
import {
138143
DescribeNodegroupCommand,
139144
DescribeNodegroupCommandInput,
@@ -221,6 +226,11 @@ import {
221226
RegisterClusterCommandInput,
222227
RegisterClusterCommandOutput,
223228
} from "./commands/RegisterClusterCommand";
229+
import {
230+
StartInsightsRefreshCommand,
231+
StartInsightsRefreshCommandInput,
232+
StartInsightsRefreshCommandOutput,
233+
} from "./commands/StartInsightsRefreshCommand";
224234
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
225235
import {
226236
UntagResourceCommand,
@@ -294,6 +304,7 @@ const commands = {
294304
DescribeFargateProfileCommand,
295305
DescribeIdentityProviderConfigCommand,
296306
DescribeInsightCommand,
307+
DescribeInsightsRefreshCommand,
297308
DescribeNodegroupCommand,
298309
DescribePodIdentityAssociationCommand,
299310
DescribeUpdateCommand,
@@ -313,6 +324,7 @@ const commands = {
313324
ListTagsForResourceCommand,
314325
ListUpdatesCommand,
315326
RegisterClusterCommand,
327+
StartInsightsRefreshCommand,
316328
TagResourceCommand,
317329
UntagResourceCommand,
318330
UpdateAccessEntryCommand,
@@ -762,6 +774,23 @@ export interface EKS {
762774
cb: (err: any, data?: DescribeInsightCommandOutput) => void
763775
): void;
764776

777+
/**
778+
* @see {@link DescribeInsightsRefreshCommand}
779+
*/
780+
describeInsightsRefresh(
781+
args: DescribeInsightsRefreshCommandInput,
782+
options?: __HttpHandlerOptions
783+
): Promise<DescribeInsightsRefreshCommandOutput>;
784+
describeInsightsRefresh(
785+
args: DescribeInsightsRefreshCommandInput,
786+
cb: (err: any, data?: DescribeInsightsRefreshCommandOutput) => void
787+
): void;
788+
describeInsightsRefresh(
789+
args: DescribeInsightsRefreshCommandInput,
790+
options: __HttpHandlerOptions,
791+
cb: (err: any, data?: DescribeInsightsRefreshCommandOutput) => void
792+
): void;
793+
765794
/**
766795
* @see {@link DescribeNodegroupCommand}
767796
*/
@@ -1055,6 +1084,23 @@ export interface EKS {
10551084
cb: (err: any, data?: RegisterClusterCommandOutput) => void
10561085
): void;
10571086

1087+
/**
1088+
* @see {@link StartInsightsRefreshCommand}
1089+
*/
1090+
startInsightsRefresh(
1091+
args: StartInsightsRefreshCommandInput,
1092+
options?: __HttpHandlerOptions
1093+
): Promise<StartInsightsRefreshCommandOutput>;
1094+
startInsightsRefresh(
1095+
args: StartInsightsRefreshCommandInput,
1096+
cb: (err: any, data?: StartInsightsRefreshCommandOutput) => void
1097+
): void;
1098+
startInsightsRefresh(
1099+
args: StartInsightsRefreshCommandInput,
1100+
options: __HttpHandlerOptions,
1101+
cb: (err: any, data?: StartInsightsRefreshCommandOutput) => void
1102+
): void;
1103+
10581104
/**
10591105
* @see {@link TagResourceCommand}
10601106
*/

clients/client-eks/src/EKSClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ import {
129129
DescribeIdentityProviderConfigCommandOutput,
130130
} from "./commands/DescribeIdentityProviderConfigCommand";
131131
import { DescribeInsightCommandInput, DescribeInsightCommandOutput } from "./commands/DescribeInsightCommand";
132+
import {
133+
DescribeInsightsRefreshCommandInput,
134+
DescribeInsightsRefreshCommandOutput,
135+
} from "./commands/DescribeInsightsRefreshCommand";
132136
import { DescribeNodegroupCommandInput, DescribeNodegroupCommandOutput } from "./commands/DescribeNodegroupCommand";
133137
import {
134138
DescribePodIdentityAssociationCommandInput,
@@ -175,6 +179,10 @@ import {
175179
} from "./commands/ListTagsForResourceCommand";
176180
import { ListUpdatesCommandInput, ListUpdatesCommandOutput } from "./commands/ListUpdatesCommand";
177181
import { RegisterClusterCommandInput, RegisterClusterCommandOutput } from "./commands/RegisterClusterCommand";
182+
import {
183+
StartInsightsRefreshCommandInput,
184+
StartInsightsRefreshCommandOutput,
185+
} from "./commands/StartInsightsRefreshCommand";
178186
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
179187
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
180188
import { UpdateAccessEntryCommandInput, UpdateAccessEntryCommandOutput } from "./commands/UpdateAccessEntryCommand";
@@ -246,6 +254,7 @@ export type ServiceInputTypes =
246254
| DescribeFargateProfileCommandInput
247255
| DescribeIdentityProviderConfigCommandInput
248256
| DescribeInsightCommandInput
257+
| DescribeInsightsRefreshCommandInput
249258
| DescribeNodegroupCommandInput
250259
| DescribePodIdentityAssociationCommandInput
251260
| DescribeUpdateCommandInput
@@ -265,6 +274,7 @@ export type ServiceInputTypes =
265274
| ListTagsForResourceCommandInput
266275
| ListUpdatesCommandInput
267276
| RegisterClusterCommandInput
277+
| StartInsightsRefreshCommandInput
268278
| TagResourceCommandInput
269279
| UntagResourceCommandInput
270280
| UpdateAccessEntryCommandInput
@@ -308,6 +318,7 @@ export type ServiceOutputTypes =
308318
| DescribeFargateProfileCommandOutput
309319
| DescribeIdentityProviderConfigCommandOutput
310320
| DescribeInsightCommandOutput
321+
| DescribeInsightsRefreshCommandOutput
311322
| DescribeNodegroupCommandOutput
312323
| DescribePodIdentityAssociationCommandOutput
313324
| DescribeUpdateCommandOutput
@@ -327,6 +338,7 @@ export type ServiceOutputTypes =
327338
| ListTagsForResourceCommandOutput
328339
| ListUpdatesCommandOutput
329340
| RegisterClusterCommandOutput
341+
| StartInsightsRefreshCommandOutput
330342
| TagResourceCommandOutput
331343
| UntagResourceCommandOutput
332344
| UpdateAccessEntryCommandOutput
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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 { EKSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EKSClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { DescribeInsightsRefreshRequest, DescribeInsightsRefreshResponse } from "../models/models_0";
10+
import { de_DescribeInsightsRefreshCommand, se_DescribeInsightsRefreshCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link DescribeInsightsRefreshCommand}.
21+
*/
22+
export interface DescribeInsightsRefreshCommandInput extends DescribeInsightsRefreshRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link DescribeInsightsRefreshCommand}.
27+
*/
28+
export interface DescribeInsightsRefreshCommandOutput extends DescribeInsightsRefreshResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Returns the status of the latest on-demand cluster insights refresh operation.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { EKSClient, DescribeInsightsRefreshCommand } from "@aws-sdk/client-eks"; // ES Modules import
36+
* // const { EKSClient, DescribeInsightsRefreshCommand } = require("@aws-sdk/client-eks"); // CommonJS import
37+
* const client = new EKSClient(config);
38+
* const input = { // DescribeInsightsRefreshRequest
39+
* clusterName: "STRING_VALUE", // required
40+
* };
41+
* const command = new DescribeInsightsRefreshCommand(input);
42+
* const response = await client.send(command);
43+
* // { // DescribeInsightsRefreshResponse
44+
* // message: "STRING_VALUE",
45+
* // status: "IN_PROGRESS" || "FAILED" || "COMPLETED",
46+
* // startedAt: new Date("TIMESTAMP"),
47+
* // endedAt: new Date("TIMESTAMP"),
48+
* // };
49+
*
50+
* ```
51+
*
52+
* @param DescribeInsightsRefreshCommandInput - {@link DescribeInsightsRefreshCommandInput}
53+
* @returns {@link DescribeInsightsRefreshCommandOutput}
54+
* @see {@link DescribeInsightsRefreshCommandInput} for command's `input` shape.
55+
* @see {@link DescribeInsightsRefreshCommandOutput} for command's `response` shape.
56+
* @see {@link EKSClientResolvedConfig | config} for EKSClient's `config` shape.
57+
*
58+
* @throws {@link InvalidParameterException} (client fault)
59+
* <p>The specified parameter is invalid. Review the available parameters for the API
60+
* request.</p>
61+
*
62+
* @throws {@link InvalidRequestException} (client fault)
63+
* <p>The request is invalid given the state of the cluster. Check the state of the cluster
64+
* and the associated operations.</p>
65+
*
66+
* @throws {@link ResourceNotFoundException} (client fault)
67+
* <p>The specified resource could not be found. You can view your available clusters with
68+
* <code>ListClusters</code>. You can view your available managed node groups with
69+
* <code>ListNodegroups</code>. Amazon EKS clusters and node groups are Amazon Web Services Region
70+
* specific.</p>
71+
*
72+
* @throws {@link ServerException} (server fault)
73+
* <p>These errors are usually caused by a server-side issue.</p>
74+
*
75+
* @throws {@link EKSServiceException}
76+
* <p>Base exception class for all service exceptions from EKS service.</p>
77+
*
78+
*
79+
* @public
80+
*/
81+
export class DescribeInsightsRefreshCommand extends $Command
82+
.classBuilder<
83+
DescribeInsightsRefreshCommandInput,
84+
DescribeInsightsRefreshCommandOutput,
85+
EKSClientResolvedConfig,
86+
ServiceInputTypes,
87+
ServiceOutputTypes
88+
>()
89+
.ep(commonParams)
90+
.m(function (this: any, Command: any, cs: any, config: EKSClientResolvedConfig, o: any) {
91+
return [
92+
getSerdePlugin(config, this.serialize, this.deserialize),
93+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
94+
];
95+
})
96+
.s("AWSWesleyFrontend", "DescribeInsightsRefresh", {})
97+
.n("EKSClient", "DescribeInsightsRefreshCommand")
98+
.f(void 0, void 0)
99+
.ser(se_DescribeInsightsRefreshCommand)
100+
.de(de_DescribeInsightsRefreshCommand)
101+
.build() {
102+
/** @internal type navigation helper, not in runtime. */
103+
protected declare static __types: {
104+
api: {
105+
input: DescribeInsightsRefreshRequest;
106+
output: DescribeInsightsRefreshResponse;
107+
};
108+
sdk: {
109+
input: DescribeInsightsRefreshCommandInput;
110+
output: DescribeInsightsRefreshCommandOutput;
111+
};
112+
};
113+
}
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
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 { EKSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../EKSClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { StartInsightsRefreshRequest, StartInsightsRefreshResponse } from "../models/models_0";
10+
import { de_StartInsightsRefreshCommand, se_StartInsightsRefreshCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link StartInsightsRefreshCommand}.
21+
*/
22+
export interface StartInsightsRefreshCommandInput extends StartInsightsRefreshRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link StartInsightsRefreshCommand}.
27+
*/
28+
export interface StartInsightsRefreshCommandOutput extends StartInsightsRefreshResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Initiates an on-demand refresh operation for cluster insights, getting the latest analysis outside of the standard refresh schedule.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { EKSClient, StartInsightsRefreshCommand } from "@aws-sdk/client-eks"; // ES Modules import
36+
* // const { EKSClient, StartInsightsRefreshCommand } = require("@aws-sdk/client-eks"); // CommonJS import
37+
* const client = new EKSClient(config);
38+
* const input = { // StartInsightsRefreshRequest
39+
* clusterName: "STRING_VALUE", // required
40+
* };
41+
* const command = new StartInsightsRefreshCommand(input);
42+
* const response = await client.send(command);
43+
* // { // StartInsightsRefreshResponse
44+
* // message: "STRING_VALUE",
45+
* // status: "IN_PROGRESS" || "FAILED" || "COMPLETED",
46+
* // };
47+
*
48+
* ```
49+
*
50+
* @param StartInsightsRefreshCommandInput - {@link StartInsightsRefreshCommandInput}
51+
* @returns {@link StartInsightsRefreshCommandOutput}
52+
* @see {@link StartInsightsRefreshCommandInput} for command's `input` shape.
53+
* @see {@link StartInsightsRefreshCommandOutput} for command's `response` shape.
54+
* @see {@link EKSClientResolvedConfig | config} for EKSClient's `config` shape.
55+
*
56+
* @throws {@link InvalidParameterException} (client fault)
57+
* <p>The specified parameter is invalid. Review the available parameters for the API
58+
* request.</p>
59+
*
60+
* @throws {@link InvalidRequestException} (client fault)
61+
* <p>The request is invalid given the state of the cluster. Check the state of the cluster
62+
* and the associated operations.</p>
63+
*
64+
* @throws {@link ResourceNotFoundException} (client fault)
65+
* <p>The specified resource could not be found. You can view your available clusters with
66+
* <code>ListClusters</code>. You can view your available managed node groups with
67+
* <code>ListNodegroups</code>. Amazon EKS clusters and node groups are Amazon Web Services Region
68+
* specific.</p>
69+
*
70+
* @throws {@link ServerException} (server fault)
71+
* <p>These errors are usually caused by a server-side issue.</p>
72+
*
73+
* @throws {@link EKSServiceException}
74+
* <p>Base exception class for all service exceptions from EKS service.</p>
75+
*
76+
*
77+
* @public
78+
*/
79+
export class StartInsightsRefreshCommand extends $Command
80+
.classBuilder<
81+
StartInsightsRefreshCommandInput,
82+
StartInsightsRefreshCommandOutput,
83+
EKSClientResolvedConfig,
84+
ServiceInputTypes,
85+
ServiceOutputTypes
86+
>()
87+
.ep(commonParams)
88+
.m(function (this: any, Command: any, cs: any, config: EKSClientResolvedConfig, o: any) {
89+
return [
90+
getSerdePlugin(config, this.serialize, this.deserialize),
91+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
92+
];
93+
})
94+
.s("AWSWesleyFrontend", "StartInsightsRefresh", {})
95+
.n("EKSClient", "StartInsightsRefreshCommand")
96+
.f(void 0, void 0)
97+
.ser(se_StartInsightsRefreshCommand)
98+
.de(de_StartInsightsRefreshCommand)
99+
.build() {
100+
/** @internal type navigation helper, not in runtime. */
101+
protected declare static __types: {
102+
api: {
103+
input: StartInsightsRefreshRequest;
104+
output: StartInsightsRefreshResponse;
105+
};
106+
sdk: {
107+
input: StartInsightsRefreshCommandInput;
108+
output: StartInsightsRefreshCommandOutput;
109+
};
110+
};
111+
}

0 commit comments

Comments
 (0)