Skip to content

Commit 3b9d480

Browse files
author
awstools
committed
feat(client-pcs): Added the UpdateCluster API action to modify cluster configurations, and Slurm custom settings for queues.
1 parent 8b79cdc commit 3b9d480

File tree

13 files changed

+689
-31
lines changed

13 files changed

+689
-31
lines changed

clients/client-pcs/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,14 @@ UntagResource
330330

331331
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/pcs/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pcs/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pcs/Interface/UntagResourceCommandOutput/)
332332

333+
</details>
334+
<details>
335+
<summary>
336+
UpdateCluster
337+
</summary>
338+
339+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/pcs/command/UpdateClusterCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pcs/Interface/UpdateClusterCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-pcs/Interface/UpdateClusterCommandOutput/)
340+
333341
</details>
334342
<details>
335343
<summary>

clients/client-pcs/src/PCS.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ import {
5858
UntagResourceCommandInput,
5959
UntagResourceCommandOutput,
6060
} from "./commands/UntagResourceCommand";
61+
import {
62+
UpdateClusterCommand,
63+
UpdateClusterCommandInput,
64+
UpdateClusterCommandOutput,
65+
} from "./commands/UpdateClusterCommand";
6166
import {
6267
UpdateComputeNodeGroupCommand,
6368
UpdateComputeNodeGroupCommandInput,
@@ -83,6 +88,7 @@ const commands = {
8388
RegisterComputeNodeGroupInstanceCommand,
8489
TagResourceCommand,
8590
UntagResourceCommand,
91+
UpdateClusterCommand,
8692
UpdateComputeNodeGroupCommand,
8793
UpdateQueueCommand,
8894
};
@@ -301,6 +307,17 @@ export interface PCS {
301307
cb: (err: any, data?: UntagResourceCommandOutput) => void
302308
): void;
303309

310+
/**
311+
* @see {@link UpdateClusterCommand}
312+
*/
313+
updateCluster(args: UpdateClusterCommandInput, options?: __HttpHandlerOptions): Promise<UpdateClusterCommandOutput>;
314+
updateCluster(args: UpdateClusterCommandInput, cb: (err: any, data?: UpdateClusterCommandOutput) => void): void;
315+
updateCluster(
316+
args: UpdateClusterCommandInput,
317+
options: __HttpHandlerOptions,
318+
cb: (err: any, data?: UpdateClusterCommandOutput) => void
319+
): void;
320+
304321
/**
305322
* @see {@link UpdateComputeNodeGroupCommand}
306323
*/

clients/client-pcs/src/PCSClient.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ import {
8787
} from "./commands/RegisterComputeNodeGroupInstanceCommand";
8888
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
8989
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
90+
import { UpdateClusterCommandInput, UpdateClusterCommandOutput } from "./commands/UpdateClusterCommand";
9091
import {
9192
UpdateComputeNodeGroupCommandInput,
9293
UpdateComputeNodeGroupCommandOutput,
@@ -123,6 +124,7 @@ export type ServiceInputTypes =
123124
| RegisterComputeNodeGroupInstanceCommandInput
124125
| TagResourceCommandInput
125126
| UntagResourceCommandInput
127+
| UpdateClusterCommandInput
126128
| UpdateComputeNodeGroupCommandInput
127129
| UpdateQueueCommandInput;
128130

@@ -146,6 +148,7 @@ export type ServiceOutputTypes =
146148
| RegisterComputeNodeGroupInstanceCommandOutput
147149
| TagResourceCommandOutput
148150
| UntagResourceCommandOutput
151+
| UpdateClusterCommandOutput
149152
| UpdateComputeNodeGroupCommandOutput
150153
| UpdateQueueCommandOutput;
151154

clients/client-pcs/src/commands/CreateClusterCommand.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ export interface CreateClusterCommandOutput extends CreateClusterResponse, __Met
6262
* },
6363
* ],
6464
* accounting: { // AccountingRequest
65-
* mode: "STANDARD" || "NONE", // required
6665
* defaultPurgeTimeInDays: Number("int"),
66+
* mode: "STANDARD" || "NONE", // required
6767
* },
6868
* },
6969
* clientToken: "STRING_VALUE",
@@ -99,8 +99,8 @@ export interface CreateClusterCommandOutput extends CreateClusterResponse, __Met
9999
* // secretVersion: "STRING_VALUE", // required
100100
* // },
101101
* // accounting: { // Accounting
102-
* // mode: "STANDARD" || "NONE", // required
103102
* // defaultPurgeTimeInDays: Number("int"),
103+
* // mode: "STANDARD" || "NONE", // required
104104
* // },
105105
* // },
106106
* // networking: { // Networking

clients/client-pcs/src/commands/CreateQueueCommand.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ export interface CreateQueueCommandOutput extends CreateQueueResponse, __Metadat
4545
* computeNodeGroupId: "STRING_VALUE",
4646
* },
4747
* ],
48+
* slurmConfiguration: { // QueueSlurmConfigurationRequest
49+
* slurmCustomSettings: [ // SlurmCustomSettings
50+
* { // SlurmCustomSetting
51+
* parameterName: "STRING_VALUE", // required
52+
* parameterValue: "STRING_VALUE", // required
53+
* },
54+
* ],
55+
* },
4856
* clientToken: "STRING_VALUE",
4957
* tags: { // RequestTagMap
5058
* "<keys>": "STRING_VALUE",
@@ -66,6 +74,14 @@ export interface CreateQueueCommandOutput extends CreateQueueResponse, __Metadat
6674
* // computeNodeGroupId: "STRING_VALUE",
6775
* // },
6876
* // ],
77+
* // slurmConfiguration: { // QueueSlurmConfiguration
78+
* // slurmCustomSettings: [ // SlurmCustomSettings
79+
* // { // SlurmCustomSetting
80+
* // parameterName: "STRING_VALUE", // required
81+
* // parameterValue: "STRING_VALUE", // required
82+
* // },
83+
* // ],
84+
* // },
6985
* // errorInfo: [ // ErrorInfoList
7086
* // { // ErrorInfo
7187
* // code: "STRING_VALUE",

clients/client-pcs/src/commands/GetClusterCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export interface GetClusterCommandOutput extends GetClusterResponse, __MetadataB
6868
* // secretVersion: "STRING_VALUE", // required
6969
* // },
7070
* // accounting: { // Accounting
71-
* // mode: "STANDARD" || "NONE", // required
7271
* // defaultPurgeTimeInDays: Number("int"),
72+
* // mode: "STANDARD" || "NONE", // required
7373
* // },
7474
* // },
7575
* // networking: { // Networking

clients/client-pcs/src/commands/GetQueueCommand.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,14 @@ export interface GetQueueCommandOutput extends GetQueueResponse, __MetadataBeare
5757
* // computeNodeGroupId: "STRING_VALUE",
5858
* // },
5959
* // ],
60+
* // slurmConfiguration: { // QueueSlurmConfiguration
61+
* // slurmCustomSettings: [ // SlurmCustomSettings
62+
* // { // SlurmCustomSetting
63+
* // parameterName: "STRING_VALUE", // required
64+
* // parameterValue: "STRING_VALUE", // required
65+
* // },
66+
* // ],
67+
* // },
6068
* // errorInfo: [ // ErrorInfoList
6169
* // { // ErrorInfo
6270
* // code: "STRING_VALUE",
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
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 { commonParams } from "../endpoint/EndpointParameters";
8+
import { UpdateClusterRequest, UpdateClusterResponse } from "../models/models_0";
9+
import { PCSClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../PCSClient";
10+
import { de_UpdateClusterCommand, se_UpdateClusterCommand } from "../protocols/Aws_json1_0";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link UpdateClusterCommand}.
21+
*/
22+
export interface UpdateClusterCommandInput extends UpdateClusterRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link UpdateClusterCommand}.
27+
*/
28+
export interface UpdateClusterCommandOutput extends UpdateClusterResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Updates a cluster configuration. You can modify Slurm scheduler settings, accounting configuration, and security groups for an existing cluster. </p> <note> <p>You can only update clusters that are in <code>ACTIVE</code>, <code>UPDATE_FAILED</code>, or <code>SUSPENDED</code> state. All associated resources (queues and compute node groups) must be in <code>ACTIVE</code> state before you can update the cluster.</p> </note>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { PCSClient, UpdateClusterCommand } from "@aws-sdk/client-pcs"; // ES Modules import
36+
* // const { PCSClient, UpdateClusterCommand } = require("@aws-sdk/client-pcs"); // CommonJS import
37+
* // import type { PCSClientConfig } from "@aws-sdk/client-pcs";
38+
* const config = {}; // type is PCSClientConfig
39+
* const client = new PCSClient(config);
40+
* const input = { // UpdateClusterRequest
41+
* clusterIdentifier: "STRING_VALUE", // required
42+
* clientToken: "STRING_VALUE",
43+
* slurmConfiguration: { // UpdateClusterSlurmConfigurationRequest
44+
* scaleDownIdleTimeInSeconds: Number("int"),
45+
* slurmCustomSettings: [ // SlurmCustomSettings
46+
* { // SlurmCustomSetting
47+
* parameterName: "STRING_VALUE", // required
48+
* parameterValue: "STRING_VALUE", // required
49+
* },
50+
* ],
51+
* accounting: { // UpdateAccountingRequest
52+
* defaultPurgeTimeInDays: Number("int"),
53+
* mode: "STANDARD" || "NONE",
54+
* },
55+
* },
56+
* };
57+
* const command = new UpdateClusterCommand(input);
58+
* const response = await client.send(command);
59+
* // { // UpdateClusterResponse
60+
* // cluster: { // Cluster
61+
* // name: "STRING_VALUE", // required
62+
* // id: "STRING_VALUE", // required
63+
* // arn: "STRING_VALUE", // required
64+
* // status: "CREATING" || "ACTIVE" || "UPDATING" || "DELETING" || "CREATE_FAILED" || "DELETE_FAILED" || "UPDATE_FAILED" || "SUSPENDING" || "SUSPENDED", // required
65+
* // createdAt: new Date("TIMESTAMP"), // required
66+
* // modifiedAt: new Date("TIMESTAMP"), // required
67+
* // scheduler: { // Scheduler
68+
* // type: "SLURM", // required
69+
* // version: "STRING_VALUE", // required
70+
* // },
71+
* // size: "SMALL" || "MEDIUM" || "LARGE", // required
72+
* // slurmConfiguration: { // ClusterSlurmConfiguration
73+
* // scaleDownIdleTimeInSeconds: Number("int"),
74+
* // slurmCustomSettings: [ // SlurmCustomSettings
75+
* // { // SlurmCustomSetting
76+
* // parameterName: "STRING_VALUE", // required
77+
* // parameterValue: "STRING_VALUE", // required
78+
* // },
79+
* // ],
80+
* // authKey: { // SlurmAuthKey
81+
* // secretArn: "STRING_VALUE", // required
82+
* // secretVersion: "STRING_VALUE", // required
83+
* // },
84+
* // accounting: { // Accounting
85+
* // defaultPurgeTimeInDays: Number("int"),
86+
* // mode: "STANDARD" || "NONE", // required
87+
* // },
88+
* // },
89+
* // networking: { // Networking
90+
* // subnetIds: [ // SubnetIdList
91+
* // "STRING_VALUE",
92+
* // ],
93+
* // securityGroupIds: [ // SecurityGroupIdList
94+
* // "STRING_VALUE",
95+
* // ],
96+
* // networkType: "IPV4" || "IPV6",
97+
* // },
98+
* // endpoints: [ // Endpoints
99+
* // { // Endpoint
100+
* // type: "SLURMCTLD" || "SLURMDBD", // required
101+
* // privateIpAddress: "STRING_VALUE", // required
102+
* // publicIpAddress: "STRING_VALUE",
103+
* // ipv6Address: "STRING_VALUE",
104+
* // port: "STRING_VALUE", // required
105+
* // },
106+
* // ],
107+
* // errorInfo: [ // ErrorInfoList
108+
* // { // ErrorInfo
109+
* // code: "STRING_VALUE",
110+
* // message: "STRING_VALUE",
111+
* // },
112+
* // ],
113+
* // },
114+
* // };
115+
*
116+
* ```
117+
*
118+
* @param UpdateClusterCommandInput - {@link UpdateClusterCommandInput}
119+
* @returns {@link UpdateClusterCommandOutput}
120+
* @see {@link UpdateClusterCommandInput} for command's `input` shape.
121+
* @see {@link UpdateClusterCommandOutput} for command's `response` shape.
122+
* @see {@link PCSClientResolvedConfig | config} for PCSClient's `config` shape.
123+
*
124+
* @throws {@link AccessDeniedException} (client fault)
125+
* <p>You don't have permission to perform the action.</p> <p> <u>Examples</u> </p> <ul> <li> <p>The launch template instance profile doesn't pass <code>iam:PassRole</code> verification.</p> </li> <li> <p>There is a mismatch between the account ID and cluster ID.</p> </li> <li> <p>The cluster ID doesn't exist.</p> </li> <li> <p>The EC2 instance isn't present.</p> </li> </ul>
126+
*
127+
* @throws {@link ConflictException} (client fault)
128+
* <p>Your request has conflicting operations. This can occur if you're trying to perform more than 1 operation on the same resource at the same time.</p> <p> <u>Examples</u> </p> <ul> <li> <p>A cluster with the same name already exists.</p> </li> <li> <p>A cluster isn't in <code>ACTIVE</code> status.</p> </li> <li> <p>A cluster to delete is in an unstable state. For example, because it still has <code>ACTIVE</code> node groups or queues.</p> </li> <li> <p>A queue already exists in a cluster.</p> </li> </ul>
129+
*
130+
* @throws {@link InternalServerException} (server fault)
131+
* <p>PCS can't process your request right now. Try again later.</p>
132+
*
133+
* @throws {@link ResourceNotFoundException} (client fault)
134+
* <p>The requested resource can't be found. The cluster, node group, or queue you're attempting to get, update, list, or delete doesn't exist.</p> <p> <u>Examples</u> </p>
135+
*
136+
* @throws {@link ThrottlingException} (client fault)
137+
* <p>Your request exceeded a request rate quota. Check the resource's request rate quota and try again.</p>
138+
*
139+
* @throws {@link ValidationException} (client fault)
140+
* <p>The request isn't valid.</p> <p> <u>Examples</u> </p> <ul> <li> <p>Your request contains malformed JSON or unsupported characters.</p> </li> <li> <p>The scheduler version isn't supported.</p> </li> <li> <p>There are networking related errors, such as network validation failure.</p> </li> <li> <p>AMI type is <code>CUSTOM</code> and the launch template doesn't define the AMI ID, or the AMI type is AL2 and the launch template defines the AMI.</p> </li> </ul>
141+
*
142+
* @throws {@link PCSServiceException}
143+
* <p>Base exception class for all service exceptions from PCS service.</p>
144+
*
145+
*
146+
* @public
147+
*/
148+
export class UpdateClusterCommand extends $Command
149+
.classBuilder<
150+
UpdateClusterCommandInput,
151+
UpdateClusterCommandOutput,
152+
PCSClientResolvedConfig,
153+
ServiceInputTypes,
154+
ServiceOutputTypes
155+
>()
156+
.ep(commonParams)
157+
.m(function (this: any, Command: any, cs: any, config: PCSClientResolvedConfig, o: any) {
158+
return [
159+
getSerdePlugin(config, this.serialize, this.deserialize),
160+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
161+
];
162+
})
163+
.s("AWSParallelComputingService", "UpdateCluster", {})
164+
.n("PCSClient", "UpdateClusterCommand")
165+
.f(void 0, void 0)
166+
.ser(se_UpdateClusterCommand)
167+
.de(de_UpdateClusterCommand)
168+
.build() {
169+
/** @internal type navigation helper, not in runtime. */
170+
protected declare static __types: {
171+
api: {
172+
input: UpdateClusterRequest;
173+
output: UpdateClusterResponse;
174+
};
175+
sdk: {
176+
input: UpdateClusterCommandInput;
177+
output: UpdateClusterCommandOutput;
178+
};
179+
};
180+
}

clients/client-pcs/src/commands/UpdateQueueCommand.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ export interface UpdateQueueCommandOutput extends UpdateQueueResponse, __Metadat
4545
* computeNodeGroupId: "STRING_VALUE",
4646
* },
4747
* ],
48+
* slurmConfiguration: { // UpdateQueueSlurmConfigurationRequest
49+
* slurmCustomSettings: [ // SlurmCustomSettings
50+
* { // SlurmCustomSetting
51+
* parameterName: "STRING_VALUE", // required
52+
* parameterValue: "STRING_VALUE", // required
53+
* },
54+
* ],
55+
* },
4856
* clientToken: "STRING_VALUE",
4957
* };
5058
* const command = new UpdateQueueCommand(input);
@@ -63,6 +71,14 @@ export interface UpdateQueueCommandOutput extends UpdateQueueResponse, __Metadat
6371
* // computeNodeGroupId: "STRING_VALUE",
6472
* // },
6573
* // ],
74+
* // slurmConfiguration: { // QueueSlurmConfiguration
75+
* // slurmCustomSettings: [ // SlurmCustomSettings
76+
* // { // SlurmCustomSetting
77+
* // parameterName: "STRING_VALUE", // required
78+
* // parameterValue: "STRING_VALUE", // required
79+
* // },
80+
* // ],
81+
* // },
6682
* // errorInfo: [ // ErrorInfoList
6783
* // { // ErrorInfo
6884
* // code: "STRING_VALUE",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ export * from "./ListTagsForResourceCommand";
1515
export * from "./RegisterComputeNodeGroupInstanceCommand";
1616
export * from "./TagResourceCommand";
1717
export * from "./UntagResourceCommand";
18+
export * from "./UpdateClusterCommand";
1819
export * from "./UpdateComputeNodeGroupCommand";
1920
export * from "./UpdateQueueCommand";

0 commit comments

Comments
 (0)