Skip to content

Commit 2bfac29

Browse files
author
awstools
committed
feat(client-outposts): This release adds the new StartOutpostDecommission API, which starts the decommission process to return Outposts racks or servers.
1 parent c3b83d4 commit 2bfac29

File tree

9 files changed

+436
-4
lines changed

9 files changed

+436
-4
lines changed

clients/client-outposts/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,14 @@ StartConnection
430430

431431
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/outposts/command/StartConnectionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/StartConnectionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/StartConnectionCommandOutput/)
432432

433+
</details>
434+
<details>
435+
<summary>
436+
StartOutpostDecommission
437+
</summary>
438+
439+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/outposts/command/StartOutpostDecommissionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/StartOutpostDecommissionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-outposts/Interface/StartOutpostDecommissionCommandOutput/)
440+
433441
</details>
434442
<details>
435443
<summary>

clients/client-outposts/src/Outposts.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ import {
102102
StartConnectionCommandInput,
103103
StartConnectionCommandOutput,
104104
} from "./commands/StartConnectionCommand";
105+
import {
106+
StartOutpostDecommissionCommand,
107+
StartOutpostDecommissionCommandInput,
108+
StartOutpostDecommissionCommandOutput,
109+
} from "./commands/StartOutpostDecommissionCommand";
105110
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
106111
import {
107112
UntagResourceCommand,
@@ -155,6 +160,7 @@ const commands = {
155160
ListTagsForResourceCommand,
156161
StartCapacityTaskCommand,
157162
StartConnectionCommand,
163+
StartOutpostDecommissionCommand,
158164
TagResourceCommand,
159165
UntagResourceCommand,
160166
UpdateOutpostCommand,
@@ -549,6 +555,23 @@ export interface Outposts {
549555
cb: (err: any, data?: StartConnectionCommandOutput) => void
550556
): void;
551557

558+
/**
559+
* @see {@link StartOutpostDecommissionCommand}
560+
*/
561+
startOutpostDecommission(
562+
args: StartOutpostDecommissionCommandInput,
563+
options?: __HttpHandlerOptions
564+
): Promise<StartOutpostDecommissionCommandOutput>;
565+
startOutpostDecommission(
566+
args: StartOutpostDecommissionCommandInput,
567+
cb: (err: any, data?: StartOutpostDecommissionCommandOutput) => void
568+
): void;
569+
startOutpostDecommission(
570+
args: StartOutpostDecommissionCommandInput,
571+
options: __HttpHandlerOptions,
572+
cb: (err: any, data?: StartOutpostDecommissionCommandOutput) => void
573+
): void;
574+
552575
/**
553576
* @see {@link TagResourceCommand}
554577
*/

clients/client-outposts/src/OutpostsClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ import {
9696
} from "./commands/ListTagsForResourceCommand";
9797
import { StartCapacityTaskCommandInput, StartCapacityTaskCommandOutput } from "./commands/StartCapacityTaskCommand";
9898
import { StartConnectionCommandInput, StartConnectionCommandOutput } from "./commands/StartConnectionCommand";
99+
import {
100+
StartOutpostDecommissionCommandInput,
101+
StartOutpostDecommissionCommandOutput,
102+
} from "./commands/StartOutpostDecommissionCommand";
99103
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
100104
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
101105
import { UpdateOutpostCommandInput, UpdateOutpostCommandOutput } from "./commands/UpdateOutpostCommand";
@@ -148,6 +152,7 @@ export type ServiceInputTypes =
148152
| ListTagsForResourceCommandInput
149153
| StartCapacityTaskCommandInput
150154
| StartConnectionCommandInput
155+
| StartOutpostDecommissionCommandInput
151156
| TagResourceCommandInput
152157
| UntagResourceCommandInput
153158
| UpdateOutpostCommandInput
@@ -187,6 +192,7 @@ export type ServiceOutputTypes =
187192
| ListTagsForResourceCommandOutput
188193
| StartCapacityTaskCommandOutput
189194
| StartConnectionCommandOutput
195+
| StartOutpostDecommissionCommandOutput
190196
| TagResourceCommandOutput
191197
| UntagResourceCommandOutput
192198
| UpdateOutpostCommandOutput

clients/client-outposts/src/commands/CreateOrderCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface CreateOrderCommandOutput extends CreateOrderOutput, __MetadataB
3939
* const client = new OutpostsClient(config);
4040
* const input = { // CreateOrderInput
4141
* OutpostIdentifier: "STRING_VALUE", // required
42-
* LineItems: [ // LineItemRequestListDefinition // required
42+
* LineItems: [ // LineItemRequestListDefinition
4343
* { // LineItemRequest
4444
* CatalogItemId: "STRING_VALUE",
4545
* Quantity: Number("int"),
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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 { StartOutpostDecommissionInput, StartOutpostDecommissionOutput } from "../models/models_0";
9+
import { OutpostsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../OutpostsClient";
10+
import { de_StartOutpostDecommissionCommand, se_StartOutpostDecommissionCommand } 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 StartOutpostDecommissionCommand}.
21+
*/
22+
export interface StartOutpostDecommissionCommandInput extends StartOutpostDecommissionInput {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link StartOutpostDecommissionCommand}.
27+
*/
28+
export interface StartOutpostDecommissionCommandOutput extends StartOutpostDecommissionOutput, __MetadataBearer {}
29+
30+
/**
31+
* <p>Starts the decommission process to return the Outposts racks or servers.</p>
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { OutpostsClient, StartOutpostDecommissionCommand } from "@aws-sdk/client-outposts"; // ES Modules import
36+
* // const { OutpostsClient, StartOutpostDecommissionCommand } = require("@aws-sdk/client-outposts"); // CommonJS import
37+
* // import type { OutpostsClientConfig } from "@aws-sdk/client-outposts";
38+
* const config = {}; // type is OutpostsClientConfig
39+
* const client = new OutpostsClient(config);
40+
* const input = { // StartOutpostDecommissionInput
41+
* OutpostIdentifier: "STRING_VALUE", // required
42+
* ValidateOnly: true || false,
43+
* };
44+
* const command = new StartOutpostDecommissionCommand(input);
45+
* const response = await client.send(command);
46+
* // { // StartOutpostDecommissionOutput
47+
* // Status: "SKIPPED" || "BLOCKED" || "REQUESTED",
48+
* // BlockingResourceTypes: [ // BlockingResourceTypeList
49+
* // "EC2_INSTANCE" || "OUTPOST_RAM_SHARE" || "LGW_ROUTING_DOMAIN" || "LGW_ROUTE_TABLE" || "LGW_VIRTUAL_INTERFACE_GROUP" || "OUTPOST_ORDER_CANCELLABLE" || "OUTPOST_ORDER_INTERVENTION_REQUIRED",
50+
* // ],
51+
* // };
52+
*
53+
* ```
54+
*
55+
* @param StartOutpostDecommissionCommandInput - {@link StartOutpostDecommissionCommandInput}
56+
* @returns {@link StartOutpostDecommissionCommandOutput}
57+
* @see {@link StartOutpostDecommissionCommandInput} for command's `input` shape.
58+
* @see {@link StartOutpostDecommissionCommandOutput} for command's `response` shape.
59+
* @see {@link OutpostsClientResolvedConfig | config} for OutpostsClient's `config` shape.
60+
*
61+
* @throws {@link AccessDeniedException} (client fault)
62+
* <p>You do not have permission to perform this operation.</p>
63+
*
64+
* @throws {@link ConflictException} (client fault)
65+
* <p>Updating or deleting this resource can cause an inconsistent state.</p>
66+
*
67+
* @throws {@link InternalServerException} (server fault)
68+
* <p>An internal error has occurred.</p>
69+
*
70+
* @throws {@link NotFoundException} (client fault)
71+
* <p>The specified request is not valid.</p>
72+
*
73+
* @throws {@link ValidationException} (client fault)
74+
* <p>A parameter is not valid.</p>
75+
*
76+
* @throws {@link OutpostsServiceException}
77+
* <p>Base exception class for all service exceptions from Outposts service.</p>
78+
*
79+
*
80+
* @public
81+
*/
82+
export class StartOutpostDecommissionCommand extends $Command
83+
.classBuilder<
84+
StartOutpostDecommissionCommandInput,
85+
StartOutpostDecommissionCommandOutput,
86+
OutpostsClientResolvedConfig,
87+
ServiceInputTypes,
88+
ServiceOutputTypes
89+
>()
90+
.ep(commonParams)
91+
.m(function (this: any, Command: any, cs: any, config: OutpostsClientResolvedConfig, o: any) {
92+
return [
93+
getSerdePlugin(config, this.serialize, this.deserialize),
94+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
95+
];
96+
})
97+
.s("OutpostsOlafService", "StartOutpostDecommission", {})
98+
.n("OutpostsClient", "StartOutpostDecommissionCommand")
99+
.f(void 0, void 0)
100+
.ser(se_StartOutpostDecommissionCommand)
101+
.de(de_StartOutpostDecommissionCommand)
102+
.build() {
103+
/** @internal type navigation helper, not in runtime. */
104+
protected declare static __types: {
105+
api: {
106+
input: StartOutpostDecommissionInput;
107+
output: StartOutpostDecommissionOutput;
108+
};
109+
sdk: {
110+
input: StartOutpostDecommissionCommandInput;
111+
output: StartOutpostDecommissionCommandOutput;
112+
};
113+
};
114+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export * from "./ListSitesCommand";
2727
export * from "./ListTagsForResourceCommand";
2828
export * from "./StartCapacityTaskCommand";
2929
export * from "./StartConnectionCommand";
30+
export * from "./StartOutpostDecommissionCommand";
3031
export * from "./TagResourceCommand";
3132
export * from "./UntagResourceCommand";
3233
export * from "./UpdateOutpostCommand";

clients/client-outposts/src/models/models_0.ts

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,25 @@ export interface BlockingInstance {
354354
AwsServiceName?: AWSServiceName | undefined;
355355
}
356356

357+
/**
358+
* @public
359+
* @enum
360+
*/
361+
export const BlockingResourceType = {
362+
EC2_INSTANCE: "EC2_INSTANCE",
363+
LGW_ROUTE_TABLE: "LGW_ROUTE_TABLE",
364+
LGW_ROUTING_DOMAIN: "LGW_ROUTING_DOMAIN",
365+
LGW_VIRTUAL_INTERFACE_GROUP: "LGW_VIRTUAL_INTERFACE_GROUP",
366+
OUTPOST_ORDER_CANCELLABLE: "OUTPOST_ORDER_CANCELLABLE",
367+
OUTPOST_ORDER_INTERVENTION_REQUIRED: "OUTPOST_ORDER_INTERVENTION_REQUIRED",
368+
OUTPOST_RAM_SHARE: "OUTPOST_RAM_SHARE",
369+
} as const;
370+
371+
/**
372+
* @public
373+
*/
374+
export type BlockingResourceType = (typeof BlockingResourceType)[keyof typeof BlockingResourceType];
375+
357376
/**
358377
* @public
359378
*/
@@ -834,7 +853,7 @@ export interface CreateOrderInput {
834853
* <p>The line items that make up the order.</p>
835854
* @public
836855
*/
837-
LineItems: LineItemRequest[] | undefined;
856+
LineItems?: LineItemRequest[] | undefined;
838857

839858
/**
840859
* <p>The payment option.</p>
@@ -1653,6 +1672,21 @@ export interface CreateSiteOutput {
16531672
Site?: Site | undefined;
16541673
}
16551674

1675+
/**
1676+
* @public
1677+
* @enum
1678+
*/
1679+
export const DecommissionRequestStatus = {
1680+
BLOCKED: "BLOCKED",
1681+
REQUESTED: "REQUESTED",
1682+
SKIPPED: "SKIPPED",
1683+
} as const;
1684+
1685+
/**
1686+
* @public
1687+
*/
1688+
export type DecommissionRequestStatus = (typeof DecommissionRequestStatus)[keyof typeof DecommissionRequestStatus];
1689+
16561690
/**
16571691
* @public
16581692
*/
@@ -3050,6 +3084,40 @@ export interface StartConnectionResponse {
30503084
UnderlayIpAddress?: string | undefined;
30513085
}
30523086

3087+
/**
3088+
* @public
3089+
*/
3090+
export interface StartOutpostDecommissionInput {
3091+
/**
3092+
* <p>The ID or ARN of the Outpost that you want to decommission.</p>
3093+
* @public
3094+
*/
3095+
OutpostIdentifier: string | undefined;
3096+
3097+
/**
3098+
* <p>Validates the request without starting the decommission process.</p>
3099+
* @public
3100+
*/
3101+
ValidateOnly?: boolean | undefined;
3102+
}
3103+
3104+
/**
3105+
* @public
3106+
*/
3107+
export interface StartOutpostDecommissionOutput {
3108+
/**
3109+
* <p>The status of the decommission request.</p>
3110+
* @public
3111+
*/
3112+
Status?: DecommissionRequestStatus | undefined;
3113+
3114+
/**
3115+
* <p>The resources still associated with the Outpost that you are decommissioning.</p>
3116+
* @public
3117+
*/
3118+
BlockingResourceTypes?: BlockingResourceType[] | undefined;
3119+
}
3120+
30533121
/**
30543122
* @public
30553123
*/

clients/client-outposts/src/protocols/Aws_restJson1.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ import {
7070
} from "../commands/ListTagsForResourceCommand";
7171
import { StartCapacityTaskCommandInput, StartCapacityTaskCommandOutput } from "../commands/StartCapacityTaskCommand";
7272
import { StartConnectionCommandInput, StartConnectionCommandOutput } from "../commands/StartConnectionCommand";
73+
import {
74+
StartOutpostDecommissionCommandInput,
75+
StartOutpostDecommissionCommandOutput,
76+
} from "../commands/StartOutpostDecommissionCommand";
7377
import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
7478
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
7579
import { UpdateOutpostCommandInput, UpdateOutpostCommandOutput } from "../commands/UpdateOutpostCommand";
@@ -669,6 +673,29 @@ export const se_StartConnectionCommand = async (
669673
return b.build();
670674
};
671675

676+
/**
677+
* serializeAws_restJson1StartOutpostDecommissionCommand
678+
*/
679+
export const se_StartOutpostDecommissionCommand = async (
680+
input: StartOutpostDecommissionCommandInput,
681+
context: __SerdeContext
682+
): Promise<__HttpRequest> => {
683+
const b = rb(input, context);
684+
const headers: any = {
685+
"content-type": "application/json",
686+
};
687+
b.bp("/outposts/{OutpostIdentifier}/decommission");
688+
b.p("OutpostIdentifier", () => input.OutpostIdentifier!, "{OutpostIdentifier}", false);
689+
let body: any;
690+
body = JSON.stringify(
691+
take(input, {
692+
ValidateOnly: [],
693+
})
694+
);
695+
b.m("POST").h(headers).b(body);
696+
return b.build();
697+
};
698+
672699
/**
673700
* serializeAws_restJson1TagResourceCommand
674701
*/
@@ -1430,6 +1457,28 @@ export const de_StartConnectionCommand = async (
14301457
return contents;
14311458
};
14321459

1460+
/**
1461+
* deserializeAws_restJson1StartOutpostDecommissionCommand
1462+
*/
1463+
export const de_StartOutpostDecommissionCommand = async (
1464+
output: __HttpResponse,
1465+
context: __SerdeContext
1466+
): Promise<StartOutpostDecommissionCommandOutput> => {
1467+
if (output.statusCode !== 200 && output.statusCode >= 300) {
1468+
return de_CommandError(output, context);
1469+
}
1470+
const contents: any = map({
1471+
$metadata: deserializeMetadata(output),
1472+
});
1473+
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1474+
const doc = take(data, {
1475+
BlockingResourceTypes: _json,
1476+
Status: __expectString,
1477+
});
1478+
Object.assign(contents, doc);
1479+
return contents;
1480+
};
1481+
14331482
/**
14341483
* deserializeAws_restJson1TagResourceCommand
14351484
*/
@@ -1775,6 +1824,8 @@ const de_AssetLocation = (output: any, context: __SerdeContext): AssetLocation =
17751824

17761825
// de_BlockingInstancesList omitted.
17771826

1827+
// de_BlockingResourceTypeList omitted.
1828+
17781829
// de_CapacityTaskFailure omitted.
17791830

17801831
/**

0 commit comments

Comments
 (0)