From c1349f2280ea701328bfabdf49871983dcaae69c Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 17 Apr 2023 18:16:19 +0000 Subject: [PATCH] feat(client-drs): Changed existing APIs and added new APIs to support using an account-level launch configuration template with AWS Elastic Disaster Recovery. --- clients/client-drs/README.md | 32 + clients/client-drs/src/Drs.ts | 152 +++++ clients/client-drs/src/DrsClient.ts | 24 + ...reateLaunchConfigurationTemplateCommand.ts | 175 +++++ ...eleteLaunchConfigurationTemplateCommand.ts | 161 +++++ ...ribeLaunchConfigurationTemplatesCommand.ts | 166 +++++ ...pdateLaunchConfigurationTemplateCommand.ts | 172 +++++ clients/client-drs/src/commands/index.ts | 4 + clients/client-drs/src/models/models_0.ts | 323 +++++++-- ...beLaunchConfigurationTemplatesPaginator.ts | 50 ++ clients/client-drs/src/pagination/index.ts | 2 + .../client-drs/src/protocols/Aws_restJson1.ts | 393 +++++++++++ codegen/sdk-codegen/aws-models/drs.json | 646 ++++++++++++++++-- 13 files changed, 2185 insertions(+), 115 deletions(-) create mode 100644 clients/client-drs/src/commands/CreateLaunchConfigurationTemplateCommand.ts create mode 100644 clients/client-drs/src/commands/DeleteLaunchConfigurationTemplateCommand.ts create mode 100644 clients/client-drs/src/commands/DescribeLaunchConfigurationTemplatesCommand.ts create mode 100644 clients/client-drs/src/commands/UpdateLaunchConfigurationTemplateCommand.ts create mode 100644 clients/client-drs/src/pagination/DescribeLaunchConfigurationTemplatesPaginator.ts diff --git a/clients/client-drs/README.md b/clients/client-drs/README.md index 4ee04b42551e..fb2053a0e214 100644 --- a/clients/client-drs/README.md +++ b/clients/client-drs/README.md @@ -213,6 +213,14 @@ CreateExtendedSourceServer [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/createextendedsourceservercommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/createextendedsourceservercommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/createextendedsourceservercommandoutput.html) + +
+ +CreateLaunchConfigurationTemplate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/createlaunchconfigurationtemplatecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/createlaunchconfigurationtemplatecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/createlaunchconfigurationtemplatecommandoutput.html) +
@@ -229,6 +237,14 @@ DeleteJob [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/deletejobcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/deletejobcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/deletejobcommandoutput.html) +
+
+ +DeleteLaunchConfigurationTemplate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/deletelaunchconfigurationtemplatecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/deletelaunchconfigurationtemplatecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/deletelaunchconfigurationtemplatecommandoutput.html) +
@@ -269,6 +285,14 @@ DescribeJobs [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/describejobscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/describejobscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/describejobscommandoutput.html) +
+
+ +DescribeLaunchConfigurationTemplates + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/describelaunchconfigurationtemplatescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/describelaunchconfigurationtemplatescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/describelaunchconfigurationtemplatescommandoutput.html) +
@@ -469,6 +493,14 @@ UpdateLaunchConfiguration [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/updatelaunchconfigurationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/updatelaunchconfigurationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/updatelaunchconfigurationcommandoutput.html) +
+
+ +UpdateLaunchConfigurationTemplate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/updatelaunchconfigurationtemplatecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/updatelaunchconfigurationtemplatecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/updatelaunchconfigurationtemplatecommandoutput.html) +
diff --git a/clients/client-drs/src/Drs.ts b/clients/client-drs/src/Drs.ts index 452b02ffd22b..90d2754559ef 100644 --- a/clients/client-drs/src/Drs.ts +++ b/clients/client-drs/src/Drs.ts @@ -6,12 +6,22 @@ import { CreateExtendedSourceServerCommandInput, CreateExtendedSourceServerCommandOutput, } from "./commands/CreateExtendedSourceServerCommand"; +import { + CreateLaunchConfigurationTemplateCommand, + CreateLaunchConfigurationTemplateCommandInput, + CreateLaunchConfigurationTemplateCommandOutput, +} from "./commands/CreateLaunchConfigurationTemplateCommand"; import { CreateReplicationConfigurationTemplateCommand, CreateReplicationConfigurationTemplateCommandInput, CreateReplicationConfigurationTemplateCommandOutput, } from "./commands/CreateReplicationConfigurationTemplateCommand"; import { DeleteJobCommand, DeleteJobCommandInput, DeleteJobCommandOutput } from "./commands/DeleteJobCommand"; +import { + DeleteLaunchConfigurationTemplateCommand, + DeleteLaunchConfigurationTemplateCommandInput, + DeleteLaunchConfigurationTemplateCommandOutput, +} from "./commands/DeleteLaunchConfigurationTemplateCommand"; import { DeleteRecoveryInstanceCommand, DeleteRecoveryInstanceCommandInput, @@ -37,6 +47,11 @@ import { DescribeJobsCommandInput, DescribeJobsCommandOutput, } from "./commands/DescribeJobsCommand"; +import { + DescribeLaunchConfigurationTemplatesCommand, + DescribeLaunchConfigurationTemplatesCommandInput, + DescribeLaunchConfigurationTemplatesCommandOutput, +} from "./commands/DescribeLaunchConfigurationTemplatesCommand"; import { DescribeRecoveryInstancesCommand, DescribeRecoveryInstancesCommandInput, @@ -158,6 +173,11 @@ import { UpdateLaunchConfigurationCommandInput, UpdateLaunchConfigurationCommandOutput, } from "./commands/UpdateLaunchConfigurationCommand"; +import { + UpdateLaunchConfigurationTemplateCommand, + UpdateLaunchConfigurationTemplateCommandInput, + UpdateLaunchConfigurationTemplateCommandOutput, +} from "./commands/UpdateLaunchConfigurationTemplateCommand"; import { UpdateReplicationConfigurationCommand, UpdateReplicationConfigurationCommandInput, @@ -208,6 +228,39 @@ export class Drs extends DrsClient { } } + /** + * @public + *

Creates a new Launch Configuration Template.

+ */ + public createLaunchConfigurationTemplate( + args: CreateLaunchConfigurationTemplateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createLaunchConfigurationTemplate( + args: CreateLaunchConfigurationTemplateCommandInput, + cb: (err: any, data?: CreateLaunchConfigurationTemplateCommandOutput) => void + ): void; + public createLaunchConfigurationTemplate( + args: CreateLaunchConfigurationTemplateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateLaunchConfigurationTemplateCommandOutput) => void + ): void; + public createLaunchConfigurationTemplate( + args: CreateLaunchConfigurationTemplateCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateLaunchConfigurationTemplateCommandOutput) => void), + cb?: (err: any, data?: CreateLaunchConfigurationTemplateCommandOutput) => void + ): Promise | void { + const command = new CreateLaunchConfigurationTemplateCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** * @public *

Creates a new ReplicationConfigurationTemplate.

@@ -270,6 +323,39 @@ export class Drs extends DrsClient { } } + /** + * @public + *

Deletes a single Launch Configuration Template by ID.

+ */ + public deleteLaunchConfigurationTemplate( + args: DeleteLaunchConfigurationTemplateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteLaunchConfigurationTemplate( + args: DeleteLaunchConfigurationTemplateCommandInput, + cb: (err: any, data?: DeleteLaunchConfigurationTemplateCommandOutput) => void + ): void; + public deleteLaunchConfigurationTemplate( + args: DeleteLaunchConfigurationTemplateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteLaunchConfigurationTemplateCommandOutput) => void + ): void; + public deleteLaunchConfigurationTemplate( + args: DeleteLaunchConfigurationTemplateCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteLaunchConfigurationTemplateCommandOutput) => void), + cb?: (err: any, data?: DeleteLaunchConfigurationTemplateCommandOutput) => void + ): Promise | void { + const command = new DeleteLaunchConfigurationTemplateCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** * @public *

Deletes a single Recovery Instance by ID. This deletes the Recovery Instance resource from Elastic Disaster Recovery. The Recovery Instance must be disconnected first in order to delete it.

@@ -434,6 +520,39 @@ export class Drs extends DrsClient { } } + /** + * @public + *

Lists all Launch Configuration Templates, filtered by Launch Configuration Template IDs

+ */ + public describeLaunchConfigurationTemplates( + args: DescribeLaunchConfigurationTemplatesCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public describeLaunchConfigurationTemplates( + args: DescribeLaunchConfigurationTemplatesCommandInput, + cb: (err: any, data?: DescribeLaunchConfigurationTemplatesCommandOutput) => void + ): void; + public describeLaunchConfigurationTemplates( + args: DescribeLaunchConfigurationTemplatesCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeLaunchConfigurationTemplatesCommandOutput) => void + ): void; + public describeLaunchConfigurationTemplates( + args: DescribeLaunchConfigurationTemplatesCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeLaunchConfigurationTemplatesCommandOutput) => void), + cb?: (err: any, data?: DescribeLaunchConfigurationTemplatesCommandOutput) => void + ): Promise | void { + const command = new DescribeLaunchConfigurationTemplatesCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** * @public *

Lists all Recovery Instances or multiple Recovery Instances by ID.

@@ -1264,6 +1383,39 @@ export class Drs extends DrsClient { } } + /** + * @public + *

Updates an existing Launch Configuration Template by ID.

+ */ + public updateLaunchConfigurationTemplate( + args: UpdateLaunchConfigurationTemplateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateLaunchConfigurationTemplate( + args: UpdateLaunchConfigurationTemplateCommandInput, + cb: (err: any, data?: UpdateLaunchConfigurationTemplateCommandOutput) => void + ): void; + public updateLaunchConfigurationTemplate( + args: UpdateLaunchConfigurationTemplateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateLaunchConfigurationTemplateCommandOutput) => void + ): void; + public updateLaunchConfigurationTemplate( + args: UpdateLaunchConfigurationTemplateCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateLaunchConfigurationTemplateCommandOutput) => void), + cb?: (err: any, data?: UpdateLaunchConfigurationTemplateCommandOutput) => void + ): Promise | void { + const command = new UpdateLaunchConfigurationTemplateCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** * @public *

Allows you to update a ReplicationConfiguration by Source Server ID.

diff --git a/clients/client-drs/src/DrsClient.ts b/clients/client-drs/src/DrsClient.ts index f331c06f2b50..b8a168b05079 100644 --- a/clients/client-drs/src/DrsClient.ts +++ b/clients/client-drs/src/DrsClient.ts @@ -53,11 +53,19 @@ import { CreateExtendedSourceServerCommandInput, CreateExtendedSourceServerCommandOutput, } from "./commands/CreateExtendedSourceServerCommand"; +import { + CreateLaunchConfigurationTemplateCommandInput, + CreateLaunchConfigurationTemplateCommandOutput, +} from "./commands/CreateLaunchConfigurationTemplateCommand"; import { CreateReplicationConfigurationTemplateCommandInput, CreateReplicationConfigurationTemplateCommandOutput, } from "./commands/CreateReplicationConfigurationTemplateCommand"; import { DeleteJobCommandInput, DeleteJobCommandOutput } from "./commands/DeleteJobCommand"; +import { + DeleteLaunchConfigurationTemplateCommandInput, + DeleteLaunchConfigurationTemplateCommandOutput, +} from "./commands/DeleteLaunchConfigurationTemplateCommand"; import { DeleteRecoveryInstanceCommandInput, DeleteRecoveryInstanceCommandOutput, @@ -72,6 +80,10 @@ import { DescribeJobLogItemsCommandOutput, } from "./commands/DescribeJobLogItemsCommand"; import { DescribeJobsCommandInput, DescribeJobsCommandOutput } from "./commands/DescribeJobsCommand"; +import { + DescribeLaunchConfigurationTemplatesCommandInput, + DescribeLaunchConfigurationTemplatesCommandOutput, +} from "./commands/DescribeLaunchConfigurationTemplatesCommand"; import { DescribeRecoveryInstancesCommandInput, DescribeRecoveryInstancesCommandOutput, @@ -148,6 +160,10 @@ import { UpdateLaunchConfigurationCommandInput, UpdateLaunchConfigurationCommandOutput, } from "./commands/UpdateLaunchConfigurationCommand"; +import { + UpdateLaunchConfigurationTemplateCommandInput, + UpdateLaunchConfigurationTemplateCommandOutput, +} from "./commands/UpdateLaunchConfigurationTemplateCommand"; import { UpdateReplicationConfigurationCommandInput, UpdateReplicationConfigurationCommandOutput, @@ -169,13 +185,16 @@ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig"; */ export type ServiceInputTypes = | CreateExtendedSourceServerCommandInput + | CreateLaunchConfigurationTemplateCommandInput | CreateReplicationConfigurationTemplateCommandInput | DeleteJobCommandInput + | DeleteLaunchConfigurationTemplateCommandInput | DeleteRecoveryInstanceCommandInput | DeleteReplicationConfigurationTemplateCommandInput | DeleteSourceServerCommandInput | DescribeJobLogItemsCommandInput | DescribeJobsCommandInput + | DescribeLaunchConfigurationTemplatesCommandInput | DescribeRecoveryInstancesCommandInput | DescribeRecoverySnapshotsCommandInput | DescribeReplicationConfigurationTemplatesCommandInput @@ -201,6 +220,7 @@ export type ServiceInputTypes = | UntagResourceCommandInput | UpdateFailbackReplicationConfigurationCommandInput | UpdateLaunchConfigurationCommandInput + | UpdateLaunchConfigurationTemplateCommandInput | UpdateReplicationConfigurationCommandInput | UpdateReplicationConfigurationTemplateCommandInput; @@ -209,13 +229,16 @@ export type ServiceInputTypes = */ export type ServiceOutputTypes = | CreateExtendedSourceServerCommandOutput + | CreateLaunchConfigurationTemplateCommandOutput | CreateReplicationConfigurationTemplateCommandOutput | DeleteJobCommandOutput + | DeleteLaunchConfigurationTemplateCommandOutput | DeleteRecoveryInstanceCommandOutput | DeleteReplicationConfigurationTemplateCommandOutput | DeleteSourceServerCommandOutput | DescribeJobLogItemsCommandOutput | DescribeJobsCommandOutput + | DescribeLaunchConfigurationTemplatesCommandOutput | DescribeRecoveryInstancesCommandOutput | DescribeRecoverySnapshotsCommandOutput | DescribeReplicationConfigurationTemplatesCommandOutput @@ -241,6 +264,7 @@ export type ServiceOutputTypes = | UntagResourceCommandOutput | UpdateFailbackReplicationConfigurationCommandOutput | UpdateLaunchConfigurationCommandOutput + | UpdateLaunchConfigurationTemplateCommandOutput | UpdateReplicationConfigurationCommandOutput | UpdateReplicationConfigurationTemplateCommandOutput; diff --git a/clients/client-drs/src/commands/CreateLaunchConfigurationTemplateCommand.ts b/clients/client-drs/src/commands/CreateLaunchConfigurationTemplateCommand.ts new file mode 100644 index 000000000000..f15d48920ea3 --- /dev/null +++ b/clients/client-drs/src/commands/CreateLaunchConfigurationTemplateCommand.ts @@ -0,0 +1,175 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + CreateLaunchConfigurationTemplateRequest, + CreateLaunchConfigurationTemplateRequestFilterSensitiveLog, + CreateLaunchConfigurationTemplateResponse, + CreateLaunchConfigurationTemplateResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + de_CreateLaunchConfigurationTemplateCommand, + se_CreateLaunchConfigurationTemplateCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + * + * The input for {@link CreateLaunchConfigurationTemplateCommand}. + */ +export interface CreateLaunchConfigurationTemplateCommandInput extends CreateLaunchConfigurationTemplateRequest {} +/** + * @public + * + * The output of {@link CreateLaunchConfigurationTemplateCommand}. + */ +export interface CreateLaunchConfigurationTemplateCommandOutput + extends CreateLaunchConfigurationTemplateResponse, + __MetadataBearer {} + +/** + * @public + *

Creates a new Launch Configuration Template.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, CreateLaunchConfigurationTemplateCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, CreateLaunchConfigurationTemplateCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // CreateLaunchConfigurationTemplateRequest + * tags: { // TagsMap + * "": "STRING_VALUE", + * }, + * launchDisposition: "STRING_VALUE", + * targetInstanceTypeRightSizingMethod: "STRING_VALUE", + * copyPrivateIp: true || false, + * copyTags: true || false, + * licensing: { // Licensing + * osByol: true || false, + * }, + * }; + * const command = new CreateLaunchConfigurationTemplateCommand(input); + * const response = await client.send(command); + * ``` + * + * @param CreateLaunchConfigurationTemplateCommandInput - {@link CreateLaunchConfigurationTemplateCommandInput} + * @returns {@link CreateLaunchConfigurationTemplateCommandOutput} + * @see {@link CreateLaunchConfigurationTemplateCommandInput} for command's `input` shape. + * @see {@link CreateLaunchConfigurationTemplateCommandOutput} for command's `response` shape. + * @see {@link DrsClientResolvedConfig | config} for DrsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

The request could not be completed because its exceeded the service quota.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling.

+ * + * @throws {@link UninitializedAccountException} (client fault) + *

The account performing the request has not been initialized.

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by the AWS service.

+ * + * + */ +export class CreateLaunchConfigurationTemplateCommand extends $Command< + CreateLaunchConfigurationTemplateCommandInput, + CreateLaunchConfigurationTemplateCommandOutput, + DrsClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: CreateLaunchConfigurationTemplateCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: DrsClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, CreateLaunchConfigurationTemplateCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "CreateLaunchConfigurationTemplateCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: CreateLaunchConfigurationTemplateRequestFilterSensitiveLog, + outputFilterSensitiveLog: CreateLaunchConfigurationTemplateResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: CreateLaunchConfigurationTemplateCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_CreateLaunchConfigurationTemplateCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_CreateLaunchConfigurationTemplateCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/DeleteLaunchConfigurationTemplateCommand.ts b/clients/client-drs/src/commands/DeleteLaunchConfigurationTemplateCommand.ts new file mode 100644 index 000000000000..88e57b0ea436 --- /dev/null +++ b/clients/client-drs/src/commands/DeleteLaunchConfigurationTemplateCommand.ts @@ -0,0 +1,161 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + DeleteLaunchConfigurationTemplateRequest, + DeleteLaunchConfigurationTemplateResponse, +} from "../models/models_0"; +import { + de_DeleteLaunchConfigurationTemplateCommand, + se_DeleteLaunchConfigurationTemplateCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + * + * The input for {@link DeleteLaunchConfigurationTemplateCommand}. + */ +export interface DeleteLaunchConfigurationTemplateCommandInput extends DeleteLaunchConfigurationTemplateRequest {} +/** + * @public + * + * The output of {@link DeleteLaunchConfigurationTemplateCommand}. + */ +export interface DeleteLaunchConfigurationTemplateCommandOutput + extends DeleteLaunchConfigurationTemplateResponse, + __MetadataBearer {} + +/** + * @public + *

Deletes a single Launch Configuration Template by ID.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, DeleteLaunchConfigurationTemplateCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, DeleteLaunchConfigurationTemplateCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // DeleteLaunchConfigurationTemplateRequest + * launchConfigurationTemplateID: "STRING_VALUE", // required + * }; + * const command = new DeleteLaunchConfigurationTemplateCommand(input); + * const response = await client.send(command); + * ``` + * + * @param DeleteLaunchConfigurationTemplateCommandInput - {@link DeleteLaunchConfigurationTemplateCommandInput} + * @returns {@link DeleteLaunchConfigurationTemplateCommandOutput} + * @see {@link DeleteLaunchConfigurationTemplateCommandInput} for command's `input` shape. + * @see {@link DeleteLaunchConfigurationTemplateCommandOutput} for command's `response` shape. + * @see {@link DrsClientResolvedConfig | config} for DrsClient's `config` shape. + * + * @throws {@link ConflictException} (client fault) + *

The request could not be completed due to a conflict with the current state of the target resource.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The resource for this operation was not found.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling.

+ * + * @throws {@link UninitializedAccountException} (client fault) + *

The account performing the request has not been initialized.

+ * + * + */ +export class DeleteLaunchConfigurationTemplateCommand extends $Command< + DeleteLaunchConfigurationTemplateCommandInput, + DeleteLaunchConfigurationTemplateCommandOutput, + DrsClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DeleteLaunchConfigurationTemplateCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: DrsClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DeleteLaunchConfigurationTemplateCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "DeleteLaunchConfigurationTemplateCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: DeleteLaunchConfigurationTemplateCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_DeleteLaunchConfigurationTemplateCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_DeleteLaunchConfigurationTemplateCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/DescribeLaunchConfigurationTemplatesCommand.ts b/clients/client-drs/src/commands/DescribeLaunchConfigurationTemplatesCommand.ts new file mode 100644 index 000000000000..dd35c216e045 --- /dev/null +++ b/clients/client-drs/src/commands/DescribeLaunchConfigurationTemplatesCommand.ts @@ -0,0 +1,166 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + DescribeLaunchConfigurationTemplatesRequest, + DescribeLaunchConfigurationTemplatesResponse, + DescribeLaunchConfigurationTemplatesResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + de_DescribeLaunchConfigurationTemplatesCommand, + se_DescribeLaunchConfigurationTemplatesCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + * + * The input for {@link DescribeLaunchConfigurationTemplatesCommand}. + */ +export interface DescribeLaunchConfigurationTemplatesCommandInput extends DescribeLaunchConfigurationTemplatesRequest {} +/** + * @public + * + * The output of {@link DescribeLaunchConfigurationTemplatesCommand}. + */ +export interface DescribeLaunchConfigurationTemplatesCommandOutput + extends DescribeLaunchConfigurationTemplatesResponse, + __MetadataBearer {} + +/** + * @public + *

Lists all Launch Configuration Templates, filtered by Launch Configuration Template IDs

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, DescribeLaunchConfigurationTemplatesCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, DescribeLaunchConfigurationTemplatesCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // DescribeLaunchConfigurationTemplatesRequest + * launchConfigurationTemplateIDs: [ // LaunchConfigurationTemplateIDs + * "STRING_VALUE", + * ], + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new DescribeLaunchConfigurationTemplatesCommand(input); + * const response = await client.send(command); + * ``` + * + * @param DescribeLaunchConfigurationTemplatesCommandInput - {@link DescribeLaunchConfigurationTemplatesCommandInput} + * @returns {@link DescribeLaunchConfigurationTemplatesCommandOutput} + * @see {@link DescribeLaunchConfigurationTemplatesCommandInput} for command's `input` shape. + * @see {@link DescribeLaunchConfigurationTemplatesCommandOutput} for command's `response` shape. + * @see {@link DrsClientResolvedConfig | config} for DrsClient's `config` shape. + * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The resource for this operation was not found.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling.

+ * + * @throws {@link UninitializedAccountException} (client fault) + *

The account performing the request has not been initialized.

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by the AWS service.

+ * + * + */ +export class DescribeLaunchConfigurationTemplatesCommand extends $Command< + DescribeLaunchConfigurationTemplatesCommandInput, + DescribeLaunchConfigurationTemplatesCommandOutput, + DrsClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: DescribeLaunchConfigurationTemplatesCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: DrsClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, DescribeLaunchConfigurationTemplatesCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "DescribeLaunchConfigurationTemplatesCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: DescribeLaunchConfigurationTemplatesResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: DescribeLaunchConfigurationTemplatesCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_DescribeLaunchConfigurationTemplatesCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_DescribeLaunchConfigurationTemplatesCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/UpdateLaunchConfigurationTemplateCommand.ts b/clients/client-drs/src/commands/UpdateLaunchConfigurationTemplateCommand.ts new file mode 100644 index 000000000000..44db85e8bdf2 --- /dev/null +++ b/clients/client-drs/src/commands/UpdateLaunchConfigurationTemplateCommand.ts @@ -0,0 +1,172 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, + SerdeContext as __SerdeContext, +} from "@aws-sdk/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + UpdateLaunchConfigurationTemplateRequest, + UpdateLaunchConfigurationTemplateResponse, + UpdateLaunchConfigurationTemplateResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + de_UpdateLaunchConfigurationTemplateCommand, + se_UpdateLaunchConfigurationTemplateCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + * + * The input for {@link UpdateLaunchConfigurationTemplateCommand}. + */ +export interface UpdateLaunchConfigurationTemplateCommandInput extends UpdateLaunchConfigurationTemplateRequest {} +/** + * @public + * + * The output of {@link UpdateLaunchConfigurationTemplateCommand}. + */ +export interface UpdateLaunchConfigurationTemplateCommandOutput + extends UpdateLaunchConfigurationTemplateResponse, + __MetadataBearer {} + +/** + * @public + *

Updates an existing Launch Configuration Template by ID.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, UpdateLaunchConfigurationTemplateCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, UpdateLaunchConfigurationTemplateCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // UpdateLaunchConfigurationTemplateRequest + * launchConfigurationTemplateID: "STRING_VALUE", // required + * launchDisposition: "STRING_VALUE", + * targetInstanceTypeRightSizingMethod: "STRING_VALUE", + * copyPrivateIp: true || false, + * copyTags: true || false, + * licensing: { // Licensing + * osByol: true || false, + * }, + * }; + * const command = new UpdateLaunchConfigurationTemplateCommand(input); + * const response = await client.send(command); + * ``` + * + * @param UpdateLaunchConfigurationTemplateCommandInput - {@link UpdateLaunchConfigurationTemplateCommandInput} + * @returns {@link UpdateLaunchConfigurationTemplateCommandOutput} + * @see {@link UpdateLaunchConfigurationTemplateCommandInput} for command's `input` shape. + * @see {@link UpdateLaunchConfigurationTemplateCommandOutput} for command's `response` shape. + * @see {@link DrsClientResolvedConfig | config} for DrsClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You do not have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing has failed because of an unknown error, exception or failure.

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

The resource for this operation was not found.

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling.

+ * + * @throws {@link UninitializedAccountException} (client fault) + *

The account performing the request has not been initialized.

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by the AWS service.

+ * + * + */ +export class UpdateLaunchConfigurationTemplateCommand extends $Command< + UpdateLaunchConfigurationTemplateCommandInput, + UpdateLaunchConfigurationTemplateCommandOutput, + DrsClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + public static getEndpointParameterInstructions(): EndpointParameterInstructions { + return { + UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" }, + Endpoint: { type: "builtInParams", name: "endpoint" }, + Region: { type: "builtInParams", name: "region" }, + UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }, + }; + } + + /** + * @public + */ + constructor(readonly input: UpdateLaunchConfigurationTemplateCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: DrsClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + this.middlewareStack.use( + getEndpointPlugin(configuration, UpdateLaunchConfigurationTemplateCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "UpdateLaunchConfigurationTemplateCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: UpdateLaunchConfigurationTemplateResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize( + input: UpdateLaunchConfigurationTemplateCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_UpdateLaunchConfigurationTemplateCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_UpdateLaunchConfigurationTemplateCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/index.ts b/clients/client-drs/src/commands/index.ts index 1197919f16f0..2f48911023d5 100644 --- a/clients/client-drs/src/commands/index.ts +++ b/clients/client-drs/src/commands/index.ts @@ -1,12 +1,15 @@ // smithy-typescript generated code export * from "./CreateExtendedSourceServerCommand"; +export * from "./CreateLaunchConfigurationTemplateCommand"; export * from "./CreateReplicationConfigurationTemplateCommand"; export * from "./DeleteJobCommand"; +export * from "./DeleteLaunchConfigurationTemplateCommand"; export * from "./DeleteRecoveryInstanceCommand"; export * from "./DeleteReplicationConfigurationTemplateCommand"; export * from "./DeleteSourceServerCommand"; export * from "./DescribeJobLogItemsCommand"; export * from "./DescribeJobsCommand"; +export * from "./DescribeLaunchConfigurationTemplatesCommand"; export * from "./DescribeRecoveryInstancesCommand"; export * from "./DescribeRecoverySnapshotsCommand"; export * from "./DescribeReplicationConfigurationTemplatesCommand"; @@ -32,5 +35,6 @@ export * from "./TerminateRecoveryInstancesCommand"; export * from "./UntagResourceCommand"; export * from "./UpdateFailbackReplicationConfigurationCommand"; export * from "./UpdateLaunchConfigurationCommand"; +export * from "./UpdateLaunchConfigurationTemplateCommand"; export * from "./UpdateReplicationConfigurationCommand"; export * from "./UpdateReplicationConfigurationTemplateCommand"; diff --git a/clients/client-drs/src/models/models_0.ts b/clients/client-drs/src/models/models_0.ts index f65de1dab018..5fde3086d71b 100644 --- a/clients/client-drs/src/models/models_0.ts +++ b/clients/client-drs/src/models/models_0.ts @@ -615,6 +615,11 @@ export interface SourceProperties { *

Operating system.

*/ os?: OS; + + /** + *

Are EC2 nitro instance types supported when recovering the Source Server.

+ */ + supportsNitroInstances?: boolean; } /** @@ -968,6 +973,137 @@ export class ValidationException extends __BaseException { } } +/** + * @public + * @enum + */ +export const LaunchDisposition = { + STARTED: "STARTED", + STOPPED: "STOPPED", +} as const; + +/** + * @public + */ +export type LaunchDisposition = (typeof LaunchDisposition)[keyof typeof LaunchDisposition]; + +/** + * @public + *

Configuration of a machine's license.

+ */ +export interface Licensing { + /** + *

Whether to enable "Bring your own license" or not.

+ */ + osByol?: boolean; +} + +/** + * @public + * @enum + */ +export const TargetInstanceTypeRightSizingMethod = { + BASIC: "BASIC", + NONE: "NONE", +} as const; + +/** + * @public + */ +export type TargetInstanceTypeRightSizingMethod = + (typeof TargetInstanceTypeRightSizingMethod)[keyof typeof TargetInstanceTypeRightSizingMethod]; + +/** + * @public + */ +export interface CreateLaunchConfigurationTemplateRequest { + /** + *

Request to associate tags during creation of a Launch Configuration Template.

+ */ + tags?: Record; + + /** + *

Launch disposition.

+ */ + launchDisposition?: LaunchDisposition | string; + + /** + *

Target instance type right-sizing method.

+ */ + targetInstanceTypeRightSizingMethod?: TargetInstanceTypeRightSizingMethod | string; + + /** + *

Copy private IP.

+ */ + copyPrivateIp?: boolean; + + /** + *

Copy tags.

+ */ + copyTags?: boolean; + + /** + *

Licensing.

+ */ + licensing?: Licensing; +} + +/** + * @public + *

Account level Launch Configuration Template.

+ */ +export interface LaunchConfigurationTemplate { + /** + *

ID of the Launch Configuration Template.

+ */ + launchConfigurationTemplateID?: string; + + /** + *

ARN of the Launch Configuration Template.

+ */ + arn?: string; + + /** + *

Tags of the Launch Configuration Template.

+ */ + tags?: Record; + + /** + *

Launch disposition.

+ */ + launchDisposition?: LaunchDisposition | string; + + /** + *

Target instance type right-sizing method.

+ */ + targetInstanceTypeRightSizingMethod?: TargetInstanceTypeRightSizingMethod | string; + + /** + *

Copy private IP.

+ */ + copyPrivateIp?: boolean; + + /** + *

Copy tags.

+ */ + copyTags?: boolean; + + /** + *

Licensing.

+ */ + licensing?: Licensing; +} + +/** + * @public + */ +export interface CreateLaunchConfigurationTemplateResponse { + /** + *

Created Launch Configuration Template.

+ */ + launchConfigurationTemplate?: LaunchConfigurationTemplate; +} + /** * @public * @enum @@ -1246,6 +1382,21 @@ export interface DeleteJobRequest { */ export interface DeleteJobResponse {} +/** + * @public + */ +export interface DeleteLaunchConfigurationTemplateRequest { + /** + *

The ID of the Launch Configuration Template to be deleted.

+ */ + launchConfigurationTemplateID: string | undefined; +} + +/** + * @public + */ +export interface DeleteLaunchConfigurationTemplateResponse {} + /** * @public */ @@ -1578,6 +1729,41 @@ export interface DescribeJobsResponse { nextToken?: string; } +/** + * @public + */ +export interface DescribeLaunchConfigurationTemplatesRequest { + /** + *

Request to filter Launch Configuration Templates list by Launch Configuration Template ID.

+ */ + launchConfigurationTemplateIDs?: string[]; + + /** + *

Maximum results to be returned in DescribeLaunchConfigurationTemplates.

+ */ + maxResults?: number; + + /** + *

The token of the next Launch Configuration Template to retrieve.

+ */ + nextToken?: string; +} + +/** + * @public + */ +export interface DescribeLaunchConfigurationTemplatesResponse { + /** + *

List of items returned by DescribeLaunchConfigurationTemplates.

+ */ + items?: LaunchConfigurationTemplate[]; + + /** + *

The token of the next Launch Configuration Template to retrieve.

+ */ + nextToken?: string; +} + /** * @public *

A set of filters by which to return Recovery Instances.

@@ -2345,6 +2531,51 @@ export interface InitializeServiceRequest {} */ export interface InitializeServiceResponse {} +/** + * @public + */ +export interface UpdateLaunchConfigurationTemplateRequest { + /** + *

Launch Configuration Template ID.

+ */ + launchConfigurationTemplateID: string | undefined; + + /** + *

Launch disposition.

+ */ + launchDisposition?: LaunchDisposition | string; + + /** + *

Target instance type right-sizing method.

+ */ + targetInstanceTypeRightSizingMethod?: TargetInstanceTypeRightSizingMethod | string; + + /** + *

Copy private IP.

+ */ + copyPrivateIp?: boolean; + + /** + *

Copy tags.

+ */ + copyTags?: boolean; + + /** + *

Licensing.

+ */ + licensing?: Licensing; +} + +/** + * @public + */ +export interface UpdateLaunchConfigurationTemplateResponse { + /** + *

Updated Launch Configuration Template.

+ */ + launchConfigurationTemplate?: LaunchConfigurationTemplate; +} + /** * @public */ @@ -2681,46 +2912,6 @@ export interface GetLaunchConfigurationRequest { sourceServerID: string | undefined; } -/** - * @public - * @enum - */ -export const LaunchDisposition = { - STARTED: "STARTED", - STOPPED: "STOPPED", -} as const; - -/** - * @public - */ -export type LaunchDisposition = (typeof LaunchDisposition)[keyof typeof LaunchDisposition]; - -/** - * @public - *

Configuration of a machine's license.

- */ -export interface Licensing { - /** - *

Whether to enable "Bring your own license" or not.

- */ - osByol?: boolean; -} - -/** - * @public - * @enum - */ -export const TargetInstanceTypeRightSizingMethod = { - BASIC: "BASIC", - NONE: "NONE", -} as const; - -/** - * @public - */ -export type TargetInstanceTypeRightSizingMethod = - (typeof TargetInstanceTypeRightSizingMethod)[keyof typeof TargetInstanceTypeRightSizingMethod]; - /** * @public */ @@ -3202,6 +3393,36 @@ export const CreateExtendedSourceServerResponseFilterSensitiveLog = (obj: Create ...(obj.sourceServer && { sourceServer: SourceServerFilterSensitiveLog(obj.sourceServer) }), }); +/** + * @internal + */ +export const CreateLaunchConfigurationTemplateRequestFilterSensitiveLog = ( + obj: CreateLaunchConfigurationTemplateRequest +): any => ({ + ...obj, + ...(obj.tags && { tags: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const LaunchConfigurationTemplateFilterSensitiveLog = (obj: LaunchConfigurationTemplate): any => ({ + ...obj, + ...(obj.tags && { tags: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const CreateLaunchConfigurationTemplateResponseFilterSensitiveLog = ( + obj: CreateLaunchConfigurationTemplateResponse +): any => ({ + ...obj, + ...(obj.launchConfigurationTemplate && { + launchConfigurationTemplate: LaunchConfigurationTemplateFilterSensitiveLog(obj.launchConfigurationTemplate), + }), +}); + /** * @internal */ @@ -3238,6 +3459,16 @@ export const DescribeJobsResponseFilterSensitiveLog = (obj: DescribeJobsResponse ...(obj.items && { items: obj.items.map((item) => JobFilterSensitiveLog(item)) }), }); +/** + * @internal + */ +export const DescribeLaunchConfigurationTemplatesResponseFilterSensitiveLog = ( + obj: DescribeLaunchConfigurationTemplatesResponse +): any => ({ + ...obj, + ...(obj.items && { items: obj.items.map((item) => LaunchConfigurationTemplateFilterSensitiveLog(item)) }), +}); + /** * @internal */ @@ -3272,6 +3503,18 @@ export const DescribeSourceServersResponseFilterSensitiveLog = (obj: DescribeSou ...(obj.items && { items: obj.items.map((item) => SourceServerFilterSensitiveLog(item)) }), }); +/** + * @internal + */ +export const UpdateLaunchConfigurationTemplateResponseFilterSensitiveLog = ( + obj: UpdateLaunchConfigurationTemplateResponse +): any => ({ + ...obj, + ...(obj.launchConfigurationTemplate && { + launchConfigurationTemplate: LaunchConfigurationTemplateFilterSensitiveLog(obj.launchConfigurationTemplate), + }), +}); + /** * @internal */ diff --git a/clients/client-drs/src/pagination/DescribeLaunchConfigurationTemplatesPaginator.ts b/clients/client-drs/src/pagination/DescribeLaunchConfigurationTemplatesPaginator.ts new file mode 100644 index 000000000000..4740a0e48b92 --- /dev/null +++ b/clients/client-drs/src/pagination/DescribeLaunchConfigurationTemplatesPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + DescribeLaunchConfigurationTemplatesCommand, + DescribeLaunchConfigurationTemplatesCommandInput, + DescribeLaunchConfigurationTemplatesCommandOutput, +} from "../commands/DescribeLaunchConfigurationTemplatesCommand"; +import { DrsClient } from "../DrsClient"; +import { DrsPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: DrsClient, + input: DescribeLaunchConfigurationTemplatesCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeLaunchConfigurationTemplatesCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateDescribeLaunchConfigurationTemplates( + config: DrsPaginationConfiguration, + input: DescribeLaunchConfigurationTemplatesCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.nextToken + let token: typeof input.nextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: DescribeLaunchConfigurationTemplatesCommandOutput; + while (hasNext) { + input.nextToken = token; + input["maxResults"] = config.pageSize; + if (config.client instanceof DrsClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected Drs | DrsClient"); + } + yield page; + const prevToken = token; + token = page.nextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-drs/src/pagination/index.ts b/clients/client-drs/src/pagination/index.ts index 20178213bfe4..c04b7c0f336b 100644 --- a/clients/client-drs/src/pagination/index.ts +++ b/clients/client-drs/src/pagination/index.ts @@ -2,6 +2,8 @@ export * from "./DescribeJobLogItemsPaginator"; export * from "./DescribeJobsPaginator"; +export * from "./DescribeLaunchConfigurationTemplatesPaginator"; + export * from "./DescribeRecoveryInstancesPaginator"; export * from "./DescribeRecoverySnapshotsPaginator"; diff --git a/clients/client-drs/src/protocols/Aws_restJson1.ts b/clients/client-drs/src/protocols/Aws_restJson1.ts index eafc4806f119..c7cb6f9117eb 100644 --- a/clients/client-drs/src/protocols/Aws_restJson1.ts +++ b/clients/client-drs/src/protocols/Aws_restJson1.ts @@ -25,11 +25,19 @@ import { CreateExtendedSourceServerCommandInput, CreateExtendedSourceServerCommandOutput, } from "../commands/CreateExtendedSourceServerCommand"; +import { + CreateLaunchConfigurationTemplateCommandInput, + CreateLaunchConfigurationTemplateCommandOutput, +} from "../commands/CreateLaunchConfigurationTemplateCommand"; import { CreateReplicationConfigurationTemplateCommandInput, CreateReplicationConfigurationTemplateCommandOutput, } from "../commands/CreateReplicationConfigurationTemplateCommand"; import { DeleteJobCommandInput, DeleteJobCommandOutput } from "../commands/DeleteJobCommand"; +import { + DeleteLaunchConfigurationTemplateCommandInput, + DeleteLaunchConfigurationTemplateCommandOutput, +} from "../commands/DeleteLaunchConfigurationTemplateCommand"; import { DeleteRecoveryInstanceCommandInput, DeleteRecoveryInstanceCommandOutput, @@ -44,6 +52,10 @@ import { DescribeJobLogItemsCommandOutput, } from "../commands/DescribeJobLogItemsCommand"; import { DescribeJobsCommandInput, DescribeJobsCommandOutput } from "../commands/DescribeJobsCommand"; +import { + DescribeLaunchConfigurationTemplatesCommandInput, + DescribeLaunchConfigurationTemplatesCommandOutput, +} from "../commands/DescribeLaunchConfigurationTemplatesCommand"; import { DescribeRecoveryInstancesCommandInput, DescribeRecoveryInstancesCommandOutput, @@ -120,6 +132,10 @@ import { UpdateLaunchConfigurationCommandInput, UpdateLaunchConfigurationCommandOutput, } from "../commands/UpdateLaunchConfigurationCommand"; +import { + UpdateLaunchConfigurationTemplateCommandInput, + UpdateLaunchConfigurationTemplateCommandOutput, +} from "../commands/UpdateLaunchConfigurationTemplateCommand"; import { UpdateReplicationConfigurationCommandInput, UpdateReplicationConfigurationCommandOutput, @@ -179,6 +195,41 @@ export const se_CreateExtendedSourceServerCommand = async ( }); }; +/** + * serializeAws_restJson1CreateLaunchConfigurationTemplateCommand + */ +export const se_CreateLaunchConfigurationTemplateCommand = async ( + input: CreateLaunchConfigurationTemplateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/CreateLaunchConfigurationTemplate"; + let body: any; + body = JSON.stringify( + take(input, { + copyPrivateIp: [], + copyTags: [], + launchDisposition: [], + licensing: (_) => _json(_), + tags: (_) => _json(_), + targetInstanceTypeRightSizingMethod: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1CreateReplicationConfigurationTemplateCommand */ @@ -252,6 +303,36 @@ export const se_DeleteJobCommand = async ( }); }; +/** + * serializeAws_restJson1DeleteLaunchConfigurationTemplateCommand + */ +export const se_DeleteLaunchConfigurationTemplateCommand = async ( + input: DeleteLaunchConfigurationTemplateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DeleteLaunchConfigurationTemplate"; + let body: any; + body = JSON.stringify( + take(input, { + launchConfigurationTemplateID: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1DeleteRecoveryInstanceCommand */ @@ -403,6 +484,38 @@ export const se_DescribeJobsCommand = async ( }); }; +/** + * serializeAws_restJson1DescribeLaunchConfigurationTemplatesCommand + */ +export const se_DescribeLaunchConfigurationTemplatesCommand = async ( + input: DescribeLaunchConfigurationTemplatesCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/DescribeLaunchConfigurationTemplates"; + let body: any; + body = JSON.stringify( + take(input, { + launchConfigurationTemplateIDs: (_) => _json(_), + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1DescribeRecoveryInstancesCommand */ @@ -1155,6 +1268,41 @@ export const se_UpdateLaunchConfigurationCommand = async ( }); }; +/** + * serializeAws_restJson1UpdateLaunchConfigurationTemplateCommand + */ +export const se_UpdateLaunchConfigurationTemplateCommand = async ( + input: UpdateLaunchConfigurationTemplateCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const { hostname, protocol = "https", port, path: basePath } = await context.endpoint(); + const headers: any = { + "content-type": "application/json", + }; + const resolvedPath = + `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/UpdateLaunchConfigurationTemplate"; + let body: any; + body = JSON.stringify( + take(input, { + copyPrivateIp: [], + copyTags: [], + launchConfigurationTemplateID: [], + launchDisposition: [], + licensing: (_) => _json(_), + targetInstanceTypeRightSizingMethod: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1UpdateReplicationConfigurationCommand */ @@ -1311,6 +1459,68 @@ const de_CreateExtendedSourceServerCommandError = async ( } }; +/** + * deserializeAws_restJson1CreateLaunchConfigurationTemplateCommand + */ +export const de_CreateLaunchConfigurationTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CreateLaunchConfigurationTemplateCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + launchConfigurationTemplate: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateLaunchConfigurationTemplateCommandError + */ +const de_CreateLaunchConfigurationTemplateCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.drs#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.drs#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.drs#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.drs#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "UninitializedAccountException": + case "com.amazonaws.drs#UninitializedAccountException": + throw await de_UninitializedAccountExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.drs#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1CreateReplicationConfigurationTemplateCommand */ @@ -1444,6 +1654,61 @@ const de_DeleteJobCommandError = async ( } }; +/** + * deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommand + */ +export const de_DeleteLaunchConfigurationTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_DeleteLaunchConfigurationTemplateCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteLaunchConfigurationTemplateCommandError + */ +const de_DeleteLaunchConfigurationTemplateCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "ConflictException": + case "com.amazonaws.drs#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.drs#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.drs#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.drs#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "UninitializedAccountException": + case "com.amazonaws.drs#UninitializedAccountException": + throw await de_UninitializedAccountExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1DeleteRecoveryInstanceCommand */ @@ -1723,6 +1988,66 @@ const de_DescribeJobsCommandError = async ( } }; +/** + * deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommand + */ +export const de_DescribeLaunchConfigurationTemplatesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_DescribeLaunchConfigurationTemplatesCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + items: _json, + nextToken: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1DescribeLaunchConfigurationTemplatesCommandError + */ +const de_DescribeLaunchConfigurationTemplatesCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InternalServerException": + case "com.amazonaws.drs#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.drs#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.drs#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "UninitializedAccountException": + case "com.amazonaws.drs#UninitializedAccountException": + throw await de_UninitializedAccountExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.drs#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1DescribeRecoveryInstancesCommand */ @@ -3232,6 +3557,68 @@ const de_UpdateLaunchConfigurationCommandError = async ( } }; +/** + * deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommand + */ +export const de_UpdateLaunchConfigurationTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_UpdateLaunchConfigurationTemplateCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + launchConfigurationTemplate: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1UpdateLaunchConfigurationTemplateCommandError + */ +const de_UpdateLaunchConfigurationTemplateCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseErrorBody(output.body, context), + }; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "AccessDeniedException": + case "com.amazonaws.drs#AccessDeniedException": + throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "InternalServerException": + case "com.amazonaws.drs#InternalServerException": + throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.drs#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); + case "ThrottlingException": + case "com.amazonaws.drs#ThrottlingException": + throw await de_ThrottlingExceptionRes(parsedOutput, context); + case "UninitializedAccountException": + case "com.amazonaws.drs#UninitializedAccountException": + throw await de_UninitializedAccountExceptionRes(parsedOutput, context); + case "ValidationException": + case "com.amazonaws.drs#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1UpdateReplicationConfigurationCommand */ @@ -3582,6 +3969,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_DescribeSourceServersRequestFiltersIDs omitted. +// se_LaunchConfigurationTemplateIDs omitted. + // se_Licensing omitted. // se_PITPolicy omitted. @@ -3658,6 +4047,10 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // de_JobsList omitted. +// de_LaunchConfigurationTemplate omitted. + +// de_LaunchConfigurationTemplates omitted. + // de_Licensing omitted. // de_LifeCycle omitted. diff --git a/codegen/sdk-codegen/aws-models/drs.json b/codegen/sdk-codegen/aws-models/drs.json index 2cd443049c37..91f6dca1f16c 100644 --- a/codegen/sdk-codegen/aws-models/drs.json +++ b/codegen/sdk-codegen/aws-models/drs.json @@ -292,6 +292,95 @@ } } }, + "com.amazonaws.drs#CreateLaunchConfigurationTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.drs#CreateLaunchConfigurationTemplateRequest" + }, + "output": { + "target": "com.amazonaws.drs#CreateLaunchConfigurationTemplateResponse" + }, + "errors": [ + { + "target": "com.amazonaws.drs#AccessDeniedException" + }, + { + "target": "com.amazonaws.drs#InternalServerException" + }, + { + "target": "com.amazonaws.drs#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.drs#ThrottlingException" + }, + { + "target": "com.amazonaws.drs#UninitializedAccountException" + }, + { + "target": "com.amazonaws.drs#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates a new Launch Configuration Template.

", + "smithy.api#http": { + "uri": "/CreateLaunchConfigurationTemplate", + "method": "POST", + "code": 201 + } + } + }, + "com.amazonaws.drs#CreateLaunchConfigurationTemplateRequest": { + "type": "structure", + "members": { + "tags": { + "target": "com.amazonaws.drs#TagsMap", + "traits": { + "smithy.api#documentation": "

Request to associate tags during creation of a Launch Configuration Template.

" + } + }, + "launchDisposition": { + "target": "com.amazonaws.drs#LaunchDisposition", + "traits": { + "smithy.api#documentation": "

Launch disposition.

" + } + }, + "targetInstanceTypeRightSizingMethod": { + "target": "com.amazonaws.drs#TargetInstanceTypeRightSizingMethod", + "traits": { + "smithy.api#documentation": "

Target instance type right-sizing method.

" + } + }, + "copyPrivateIp": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Copy private IP.

" + } + }, + "copyTags": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Copy tags.

" + } + }, + "licensing": { + "target": "com.amazonaws.drs#Licensing", + "traits": { + "smithy.api#documentation": "

Licensing.

" + } + } + } + }, + "com.amazonaws.drs#CreateLaunchConfigurationTemplateResponse": { + "type": "structure", + "members": { + "launchConfigurationTemplate": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplate", + "traits": { + "smithy.api#documentation": "

Created Launch Configuration Template.

" + } + } + } + }, "com.amazonaws.drs#CreateReplicationConfigurationTemplate": { "type": "operation", "input": { @@ -852,6 +941,57 @@ "type": "structure", "members": {} }, + "com.amazonaws.drs#DeleteLaunchConfigurationTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.drs#DeleteLaunchConfigurationTemplateRequest" + }, + "output": { + "target": "com.amazonaws.drs#DeleteLaunchConfigurationTemplateResponse" + }, + "errors": [ + { + "target": "com.amazonaws.drs#ConflictException" + }, + { + "target": "com.amazonaws.drs#InternalServerException" + }, + { + "target": "com.amazonaws.drs#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.drs#ThrottlingException" + }, + { + "target": "com.amazonaws.drs#UninitializedAccountException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes a single Launch Configuration Template by ID.

", + "smithy.api#http": { + "uri": "/DeleteLaunchConfigurationTemplate", + "method": "POST", + "code": 204 + }, + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.drs#DeleteLaunchConfigurationTemplateRequest": { + "type": "structure", + "members": { + "launchConfigurationTemplateID": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplateID", + "traits": { + "smithy.api#documentation": "

The ID of the Launch Configuration Template to be deleted.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.drs#DeleteLaunchConfigurationTemplateResponse": { + "type": "structure", + "members": {} + }, "com.amazonaws.drs#DeleteRecoveryInstance": { "type": "operation", "input": { @@ -1197,6 +1337,88 @@ } } }, + "com.amazonaws.drs#DescribeLaunchConfigurationTemplates": { + "type": "operation", + "input": { + "target": "com.amazonaws.drs#DescribeLaunchConfigurationTemplatesRequest" + }, + "output": { + "target": "com.amazonaws.drs#DescribeLaunchConfigurationTemplatesResponse" + }, + "errors": [ + { + "target": "com.amazonaws.drs#InternalServerException" + }, + { + "target": "com.amazonaws.drs#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.drs#ThrottlingException" + }, + { + "target": "com.amazonaws.drs#UninitializedAccountException" + }, + { + "target": "com.amazonaws.drs#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists all Launch Configuration Templates, filtered by Launch Configuration Template IDs

", + "smithy.api#http": { + "uri": "/DescribeLaunchConfigurationTemplates", + "method": "POST", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "items" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.drs#DescribeLaunchConfigurationTemplatesRequest": { + "type": "structure", + "members": { + "launchConfigurationTemplateIDs": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplateIDs", + "traits": { + "smithy.api#documentation": "

Request to filter Launch Configuration Templates list by Launch Configuration Template ID.

" + } + }, + "maxResults": { + "target": "com.amazonaws.drs#MaxResultsType", + "traits": { + "smithy.api#default": 0, + "smithy.api#documentation": "

Maximum results to be returned in DescribeLaunchConfigurationTemplates.

" + } + }, + "nextToken": { + "target": "com.amazonaws.drs#PaginationToken", + "traits": { + "smithy.api#documentation": "

The token of the next Launch Configuration Template to retrieve.

" + } + } + } + }, + "com.amazonaws.drs#DescribeLaunchConfigurationTemplatesResponse": { + "type": "structure", + "members": { + "items": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplates", + "traits": { + "smithy.api#documentation": "

List of items returned by DescribeLaunchConfigurationTemplates.

" + } + }, + "nextToken": { + "target": "com.amazonaws.drs#PaginationToken", + "traits": { + "smithy.api#documentation": "

The token of the next Launch Configuration Template to retrieve.

" + } + } + } + }, "com.amazonaws.drs#DescribeRecoveryInstances": { "type": "operation", "input": { @@ -1854,6 +2076,9 @@ { "target": "com.amazonaws.drs#JobResource" }, + { + "target": "com.amazonaws.drs#LaunchConfigurationTemplateResource" + }, { "target": "com.amazonaws.drs#RecoveryInstanceResource" }, @@ -2247,9 +2472,9 @@ } }, "params": { + "Region": "af-south-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "af-south-1" + "UseDualStack": false } }, { @@ -2260,9 +2485,9 @@ } }, "params": { + "Region": "ap-east-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "ap-east-1" + "UseDualStack": false } }, { @@ -2273,9 +2498,9 @@ } }, "params": { + "Region": "ap-northeast-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "ap-northeast-1" + "UseDualStack": false } }, { @@ -2286,9 +2511,9 @@ } }, "params": { + "Region": "ap-northeast-2", "UseFIPS": false, - "UseDualStack": false, - "Region": "ap-northeast-2" + "UseDualStack": false } }, { @@ -2299,9 +2524,9 @@ } }, "params": { + "Region": "ap-northeast-3", "UseFIPS": false, - "UseDualStack": false, - "Region": "ap-northeast-3" + "UseDualStack": false } }, { @@ -2312,9 +2537,9 @@ } }, "params": { + "Region": "ap-south-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "ap-south-1" + "UseDualStack": false } }, { @@ -2325,9 +2550,9 @@ } }, "params": { + "Region": "ap-southeast-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "ap-southeast-1" + "UseDualStack": false } }, { @@ -2338,9 +2563,9 @@ } }, "params": { + "Region": "ap-southeast-2", "UseFIPS": false, - "UseDualStack": false, - "Region": "ap-southeast-2" + "UseDualStack": false } }, { @@ -2351,9 +2576,9 @@ } }, "params": { + "Region": "ca-central-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "ca-central-1" + "UseDualStack": false } }, { @@ -2364,9 +2589,9 @@ } }, "params": { + "Region": "eu-central-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "eu-central-1" + "UseDualStack": false } }, { @@ -2377,9 +2602,9 @@ } }, "params": { + "Region": "eu-north-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "eu-north-1" + "UseDualStack": false } }, { @@ -2390,9 +2615,9 @@ } }, "params": { + "Region": "eu-south-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "eu-south-1" + "UseDualStack": false } }, { @@ -2403,9 +2628,9 @@ } }, "params": { + "Region": "eu-west-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "eu-west-1" + "UseDualStack": false } }, { @@ -2416,9 +2641,9 @@ } }, "params": { + "Region": "eu-west-2", "UseFIPS": false, - "UseDualStack": false, - "Region": "eu-west-2" + "UseDualStack": false } }, { @@ -2429,9 +2654,9 @@ } }, "params": { + "Region": "eu-west-3", "UseFIPS": false, - "UseDualStack": false, - "Region": "eu-west-3" + "UseDualStack": false } }, { @@ -2442,9 +2667,9 @@ } }, "params": { + "Region": "me-south-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "me-south-1" + "UseDualStack": false } }, { @@ -2455,9 +2680,9 @@ } }, "params": { + "Region": "sa-east-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "sa-east-1" + "UseDualStack": false } }, { @@ -2468,9 +2693,9 @@ } }, "params": { + "Region": "us-east-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "us-east-1" + "UseDualStack": false } }, { @@ -2481,9 +2706,9 @@ } }, "params": { + "Region": "us-east-2", "UseFIPS": false, - "UseDualStack": false, - "Region": "us-east-2" + "UseDualStack": false } }, { @@ -2494,9 +2719,9 @@ } }, "params": { + "Region": "us-west-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "us-west-1" + "UseDualStack": false } }, { @@ -2507,9 +2732,9 @@ } }, "params": { + "Region": "us-west-2", "UseFIPS": false, - "UseDualStack": false, - "Region": "us-west-2" + "UseDualStack": false } }, { @@ -2520,9 +2745,9 @@ } }, "params": { + "Region": "us-east-1", "UseFIPS": true, - "UseDualStack": true, - "Region": "us-east-1" + "UseDualStack": true } }, { @@ -2533,9 +2758,9 @@ } }, "params": { + "Region": "us-east-1", "UseFIPS": true, - "UseDualStack": false, - "Region": "us-east-1" + "UseDualStack": false } }, { @@ -2546,9 +2771,9 @@ } }, "params": { + "Region": "us-east-1", "UseFIPS": false, - "UseDualStack": true, - "Region": "us-east-1" + "UseDualStack": true } }, { @@ -2559,9 +2784,9 @@ } }, "params": { + "Region": "cn-north-1", "UseFIPS": true, - "UseDualStack": true, - "Region": "cn-north-1" + "UseDualStack": true } }, { @@ -2572,9 +2797,9 @@ } }, "params": { + "Region": "cn-north-1", "UseFIPS": true, - "UseDualStack": false, - "Region": "cn-north-1" + "UseDualStack": false } }, { @@ -2585,9 +2810,9 @@ } }, "params": { + "Region": "cn-north-1", "UseFIPS": false, - "UseDualStack": true, - "Region": "cn-north-1" + "UseDualStack": true } }, { @@ -2598,9 +2823,9 @@ } }, "params": { + "Region": "cn-north-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "cn-north-1" + "UseDualStack": false } }, { @@ -2611,9 +2836,9 @@ } }, "params": { + "Region": "us-gov-east-1", "UseFIPS": true, - "UseDualStack": true, - "Region": "us-gov-east-1" + "UseDualStack": true } }, { @@ -2624,9 +2849,9 @@ } }, "params": { + "Region": "us-gov-east-1", "UseFIPS": true, - "UseDualStack": false, - "Region": "us-gov-east-1" + "UseDualStack": false } }, { @@ -2637,9 +2862,9 @@ } }, "params": { + "Region": "us-gov-east-1", "UseFIPS": false, - "UseDualStack": true, - "Region": "us-gov-east-1" + "UseDualStack": true } }, { @@ -2650,9 +2875,20 @@ } }, "params": { + "Region": "us-gov-east-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "us-gov-east-1" + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": true, + "UseDualStack": true } }, { @@ -2663,9 +2899,20 @@ } }, "params": { + "Region": "us-iso-east-1", "UseFIPS": true, - "UseDualStack": false, - "Region": "us-iso-east-1" + "UseDualStack": false + } + }, + { + "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-iso-east-1", + "UseFIPS": false, + "UseDualStack": true } }, { @@ -2676,9 +2923,20 @@ } }, "params": { + "Region": "us-iso-east-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "us-iso-east-1" + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", + "expect": { + "error": "FIPS and DualStack are enabled, but this partition does not support one or both" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": true, + "UseDualStack": true } }, { @@ -2689,9 +2947,20 @@ } }, "params": { + "Region": "us-isob-east-1", "UseFIPS": true, - "UseDualStack": false, - "Region": "us-isob-east-1" + "UseDualStack": false + } + }, + { + "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", + "expect": { + "error": "DualStack is enabled but this partition does not support DualStack" + }, + "params": { + "Region": "us-isob-east-1", + "UseFIPS": false, + "UseDualStack": true } }, { @@ -2702,9 +2971,9 @@ } }, "params": { + "Region": "us-isob-east-1", "UseFIPS": false, - "UseDualStack": false, - "Region": "us-isob-east-1" + "UseDualStack": false } }, { @@ -2715,9 +2984,9 @@ } }, "params": { + "Region": "us-east-1", "UseFIPS": false, "UseDualStack": false, - "Region": "us-east-1", "Endpoint": "https://example.com" } }, @@ -2740,9 +3009,9 @@ "error": "Invalid Configuration: FIPS and custom endpoint are not supported" }, "params": { + "Region": "us-east-1", "UseFIPS": true, "UseDualStack": false, - "Region": "us-east-1", "Endpoint": "https://example.com" } }, @@ -2752,11 +3021,17 @@ "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" }, "params": { + "Region": "us-east-1", "UseFIPS": false, "UseDualStack": true, - "Region": "us-east-1", "Endpoint": "https://example.com" } + }, + { + "documentation": "Missing region", + "expect": { + "error": "Invalid Configuration: Missing Region" + } } ], "version": "1.0" @@ -3634,6 +3909,121 @@ } } }, + "com.amazonaws.drs#LaunchConfigurationTemplate": { + "type": "structure", + "members": { + "launchConfigurationTemplateID": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplateID", + "traits": { + "smithy.api#documentation": "

ID of the Launch Configuration Template.

" + } + }, + "arn": { + "target": "com.amazonaws.drs#ARN", + "traits": { + "smithy.api#documentation": "

ARN of the Launch Configuration Template.

" + } + }, + "tags": { + "target": "com.amazonaws.drs#TagsMap", + "traits": { + "smithy.api#documentation": "

Tags of the Launch Configuration Template.

" + } + }, + "launchDisposition": { + "target": "com.amazonaws.drs#LaunchDisposition", + "traits": { + "smithy.api#documentation": "

Launch disposition.

" + } + }, + "targetInstanceTypeRightSizingMethod": { + "target": "com.amazonaws.drs#TargetInstanceTypeRightSizingMethod", + "traits": { + "smithy.api#documentation": "

Target instance type right-sizing method.

" + } + }, + "copyPrivateIp": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Copy private IP.

" + } + }, + "copyTags": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Copy tags.

" + } + }, + "licensing": { + "target": "com.amazonaws.drs#Licensing", + "traits": { + "smithy.api#documentation": "

Licensing.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Account level Launch Configuration Template.

" + } + }, + "com.amazonaws.drs#LaunchConfigurationTemplateID": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 21, + "max": 21 + }, + "smithy.api#pattern": "^lct-[0-9a-zA-Z]{17}$" + } + }, + "com.amazonaws.drs#LaunchConfigurationTemplateIDs": { + "type": "list", + "member": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplateID" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1 + } + } + }, + "com.amazonaws.drs#LaunchConfigurationTemplateResource": { + "type": "resource", + "identifiers": { + "launchConfigurationTemplateID": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplateID" + } + }, + "create": { + "target": "com.amazonaws.drs#CreateLaunchConfigurationTemplate" + }, + "update": { + "target": "com.amazonaws.drs#UpdateLaunchConfigurationTemplate" + }, + "delete": { + "target": "com.amazonaws.drs#DeleteLaunchConfigurationTemplate" + }, + "list": { + "target": "com.amazonaws.drs#DescribeLaunchConfigurationTemplates" + }, + "traits": { + "aws.api#arn": { + "template": "launch-configuration-template/{launchConfigurationTemplateID}" + } + } + }, + "com.amazonaws.drs#LaunchConfigurationTemplates": { + "type": "list", + "member": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplate" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, "com.amazonaws.drs#LaunchDisposition": { "type": "string", "traits": { @@ -4006,6 +4396,16 @@ } } }, + "com.amazonaws.drs#MaxResultsType": { + "type": "integer", + "traits": { + "smithy.api#default": 0, + "smithy.api#range": { + "min": 1, + "max": 1000 + } + } + }, "com.amazonaws.drs#NetworkInterface": { "type": "structure", "members": { @@ -5663,6 +6063,12 @@ "traits": { "smithy.api#documentation": "

Operating system.

" } + }, + "supportsNitroInstances": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Are EC2 nitro instance types supported when recovering the Source Server.

" + } } }, "traits": { @@ -6726,6 +7132,96 @@ } } }, + "com.amazonaws.drs#UpdateLaunchConfigurationTemplate": { + "type": "operation", + "input": { + "target": "com.amazonaws.drs#UpdateLaunchConfigurationTemplateRequest" + }, + "output": { + "target": "com.amazonaws.drs#UpdateLaunchConfigurationTemplateResponse" + }, + "errors": [ + { + "target": "com.amazonaws.drs#AccessDeniedException" + }, + { + "target": "com.amazonaws.drs#InternalServerException" + }, + { + "target": "com.amazonaws.drs#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.drs#ThrottlingException" + }, + { + "target": "com.amazonaws.drs#UninitializedAccountException" + }, + { + "target": "com.amazonaws.drs#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates an existing Launch Configuration Template by ID.

", + "smithy.api#http": { + "uri": "/UpdateLaunchConfigurationTemplate", + "method": "POST", + "code": 200 + } + } + }, + "com.amazonaws.drs#UpdateLaunchConfigurationTemplateRequest": { + "type": "structure", + "members": { + "launchConfigurationTemplateID": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplateID", + "traits": { + "smithy.api#documentation": "

Launch Configuration Template ID.

", + "smithy.api#required": {} + } + }, + "launchDisposition": { + "target": "com.amazonaws.drs#LaunchDisposition", + "traits": { + "smithy.api#documentation": "

Launch disposition.

" + } + }, + "targetInstanceTypeRightSizingMethod": { + "target": "com.amazonaws.drs#TargetInstanceTypeRightSizingMethod", + "traits": { + "smithy.api#documentation": "

Target instance type right-sizing method.

" + } + }, + "copyPrivateIp": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Copy private IP.

" + } + }, + "copyTags": { + "target": "smithy.api#Boolean", + "traits": { + "smithy.api#documentation": "

Copy tags.

" + } + }, + "licensing": { + "target": "com.amazonaws.drs#Licensing", + "traits": { + "smithy.api#documentation": "

Licensing.

" + } + } + } + }, + "com.amazonaws.drs#UpdateLaunchConfigurationTemplateResponse": { + "type": "structure", + "members": { + "launchConfigurationTemplate": { + "target": "com.amazonaws.drs#LaunchConfigurationTemplate", + "traits": { + "smithy.api#documentation": "

Updated Launch Configuration Template.

" + } + } + } + }, "com.amazonaws.drs#UpdateReplicationConfiguration": { "type": "operation", "input": {