From 8102bf6e622db8183360e55f0b8c2370601555ab Mon Sep 17 00:00:00 2001 From: awstools Date: Tue, 13 Jun 2023 18:16:01 +0000 Subject: [PATCH] feat(client-drs): Added APIs to support network replication and recovery using AWS Elastic Disaster Recovery. --- clients/client-drs/README.md | 78 +- clients/client-drs/src/Drs.ts | 184 ++ clients/client-drs/src/DrsClient.ts | 48 + .../AssociateSourceNetworkStackCommand.ts | 203 +++ .../CreateExtendedSourceServerCommand.ts | 1 + ...reateLaunchConfigurationTemplateCommand.ts | 2 + .../commands/CreateSourceNetworkCommand.ts | 172 ++ .../commands/DeleteSourceNetworkCommand.ts | 155 ++ .../commands/DescribeJobLogItemsCommand.ts | 8 + .../src/commands/DescribeJobsCommand.ts | 8 + ...ribeLaunchConfigurationTemplatesCommand.ts | 1 + .../commands/DescribeSourceNetworksCommand.ts | 187 ++ .../commands/DescribeSourceServersCommand.ts | 1 + .../commands/DisconnectSourceServerCommand.ts | 1 + .../ExportSourceNetworkCfnTemplateCommand.ts | 171 ++ .../commands/RetryDataReplicationCommand.ts | 1 + .../commands/StartFailbackLaunchCommand.ts | 8 + .../src/commands/StartRecoveryCommand.ts | 8 + .../src/commands/StartReplicationCommand.ts | 1 + .../StartSourceNetworkRecoveryCommand.ts | 203 +++ .../StartSourceNetworkReplicationCommand.ts | 187 ++ .../src/commands/StopReplicationCommand.ts | 1 + .../StopSourceNetworkReplicationCommand.ts | 190 ++ .../TerminateRecoveryInstancesCommand.ts | 8 + ...pdateLaunchConfigurationTemplateCommand.ts | 2 + clients/client-drs/src/commands/index.ts | 8 + clients/client-drs/src/models/models_0.ts | 1614 ++++++++++++----- .../DescribeSourceNetworksPaginator.ts | 50 + clients/client-drs/src/pagination/index.ts | 2 + .../client-drs/src/protocols/Aws_restJson1.ts | 864 ++++++++- 30 files changed, 3843 insertions(+), 524 deletions(-) create mode 100644 clients/client-drs/src/commands/AssociateSourceNetworkStackCommand.ts create mode 100644 clients/client-drs/src/commands/CreateSourceNetworkCommand.ts create mode 100644 clients/client-drs/src/commands/DeleteSourceNetworkCommand.ts create mode 100644 clients/client-drs/src/commands/DescribeSourceNetworksCommand.ts create mode 100644 clients/client-drs/src/commands/ExportSourceNetworkCfnTemplateCommand.ts create mode 100644 clients/client-drs/src/commands/StartSourceNetworkRecoveryCommand.ts create mode 100644 clients/client-drs/src/commands/StartSourceNetworkReplicationCommand.ts create mode 100644 clients/client-drs/src/commands/StopSourceNetworkReplicationCommand.ts create mode 100644 clients/client-drs/src/pagination/DescribeSourceNetworksPaginator.ts diff --git a/clients/client-drs/README.md b/clients/client-drs/README.md index 3f65f58cb9b6..348468171735 100644 --- a/clients/client-drs/README.md +++ b/clients/client-drs/README.md @@ -23,16 +23,16 @@ using your favorite package manager: The AWS SDK is modulized by clients and commands. To send a request, you only need to import the `DrsClient` and -the commands you need, for example `CreateExtendedSourceServerCommand`: +the commands you need, for example `AssociateSourceNetworkStackCommand`: ```js // ES5 example -const { DrsClient, CreateExtendedSourceServerCommand } = require("@aws-sdk/client-drs"); +const { DrsClient, AssociateSourceNetworkStackCommand } = require("@aws-sdk/client-drs"); ``` ```ts // ES6+ example -import { DrsClient, CreateExtendedSourceServerCommand } from "@aws-sdk/client-drs"; +import { DrsClient, AssociateSourceNetworkStackCommand } from "@aws-sdk/client-drs"; ``` ### Usage @@ -51,7 +51,7 @@ const client = new DrsClient({ region: "REGION" }); const params = { /** input parameters */ }; -const command = new CreateExtendedSourceServerCommand(params); +const command = new AssociateSourceNetworkStackCommand(params); ``` #### Async/await @@ -130,7 +130,7 @@ const client = new AWS.Drs({ region: "REGION" }); // async/await. try { - const data = await client.createExtendedSourceServer(params); + const data = await client.associateSourceNetworkStack(params); // process data. } catch (error) { // error handling. @@ -138,7 +138,7 @@ try { // Promises. client - .createExtendedSourceServer(params) + .associateSourceNetworkStack(params) .then((data) => { // process data. }) @@ -147,7 +147,7 @@ client }); // callbacks. -client.createExtendedSourceServer(params, (err, data) => { +client.associateSourceNetworkStack(params, (err, data) => { // process err and data. }); ``` @@ -203,6 +203,14 @@ see LICENSE for more information. ## Client Commands (Operations List) +
+ +AssociateSourceNetworkStack + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/associatesourcenetworkstackcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/associatesourcenetworkstackcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/associatesourcenetworkstackcommandoutput.html) + +
CreateExtendedSourceServer @@ -226,6 +234,14 @@ CreateReplicationConfigurationTemplate [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/createreplicationconfigurationtemplatecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/createreplicationconfigurationtemplatecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/createreplicationconfigurationtemplatecommandoutput.html) +
+
+ +CreateSourceNetwork + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/createsourcenetworkcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/createsourcenetworkcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/createsourcenetworkcommandoutput.html) +
@@ -258,6 +274,14 @@ DeleteReplicationConfigurationTemplate [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/deletereplicationconfigurationtemplatecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/deletereplicationconfigurationtemplatecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/deletereplicationconfigurationtemplatecommandoutput.html) +
+
+ +DeleteSourceNetwork + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/deletesourcenetworkcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/deletesourcenetworkcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/deletesourcenetworkcommandoutput.html) +
@@ -314,6 +338,14 @@ DescribeReplicationConfigurationTemplates [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/describereplicationconfigurationtemplatescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/describereplicationconfigurationtemplatescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/describereplicationconfigurationtemplatescommandoutput.html) +
+
+ +DescribeSourceNetworks + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/describesourcenetworkscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/describesourcenetworkscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/describesourcenetworkscommandoutput.html) +
@@ -338,6 +370,14 @@ DisconnectSourceServer [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/disconnectsourceservercommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/disconnectsourceservercommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/disconnectsourceservercommandoutput.html) +
+
+ +ExportSourceNetworkCfnTemplate + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/exportsourcenetworkcfntemplatecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/exportsourcenetworkcfntemplatecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/exportsourcenetworkcfntemplatecommandoutput.html) +
@@ -434,6 +474,22 @@ StartReplication [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/startreplicationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/startreplicationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/startreplicationcommandoutput.html) +
+
+ +StartSourceNetworkRecovery + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/startsourcenetworkrecoverycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/startsourcenetworkrecoverycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/startsourcenetworkrecoverycommandoutput.html) + +
+
+ +StartSourceNetworkReplication + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/startsourcenetworkreplicationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/startsourcenetworkreplicationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/startsourcenetworkreplicationcommandoutput.html) +
@@ -450,6 +506,14 @@ StopReplication [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/stopreplicationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/stopreplicationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/stopreplicationcommandoutput.html) +
+
+ +StopSourceNetworkReplication + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/classes/stopsourcenetworkreplicationcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/stopsourcenetworkreplicationcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-drs/interfaces/stopsourcenetworkreplicationcommandoutput.html) +
diff --git a/clients/client-drs/src/Drs.ts b/clients/client-drs/src/Drs.ts index 1cb76d4185e9..901a712f4892 100644 --- a/clients/client-drs/src/Drs.ts +++ b/clients/client-drs/src/Drs.ts @@ -2,6 +2,11 @@ import { createAggregatedClient } from "@aws-sdk/smithy-client"; import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types"; +import { + AssociateSourceNetworkStackCommand, + AssociateSourceNetworkStackCommandInput, + AssociateSourceNetworkStackCommandOutput, +} from "./commands/AssociateSourceNetworkStackCommand"; import { CreateExtendedSourceServerCommand, CreateExtendedSourceServerCommandInput, @@ -17,6 +22,11 @@ import { CreateReplicationConfigurationTemplateCommandInput, CreateReplicationConfigurationTemplateCommandOutput, } from "./commands/CreateReplicationConfigurationTemplateCommand"; +import { + CreateSourceNetworkCommand, + CreateSourceNetworkCommandInput, + CreateSourceNetworkCommandOutput, +} from "./commands/CreateSourceNetworkCommand"; import { DeleteJobCommand, DeleteJobCommandInput, DeleteJobCommandOutput } from "./commands/DeleteJobCommand"; import { DeleteLaunchConfigurationTemplateCommand, @@ -33,6 +43,11 @@ import { DeleteReplicationConfigurationTemplateCommandInput, DeleteReplicationConfigurationTemplateCommandOutput, } from "./commands/DeleteReplicationConfigurationTemplateCommand"; +import { + DeleteSourceNetworkCommand, + DeleteSourceNetworkCommandInput, + DeleteSourceNetworkCommandOutput, +} from "./commands/DeleteSourceNetworkCommand"; import { DeleteSourceServerCommand, DeleteSourceServerCommandInput, @@ -68,6 +83,11 @@ import { DescribeReplicationConfigurationTemplatesCommandInput, DescribeReplicationConfigurationTemplatesCommandOutput, } from "./commands/DescribeReplicationConfigurationTemplatesCommand"; +import { + DescribeSourceNetworksCommand, + DescribeSourceNetworksCommandInput, + DescribeSourceNetworksCommandOutput, +} from "./commands/DescribeSourceNetworksCommand"; import { DescribeSourceServersCommand, DescribeSourceServersCommandInput, @@ -83,6 +103,11 @@ import { DisconnectSourceServerCommandInput, DisconnectSourceServerCommandOutput, } from "./commands/DisconnectSourceServerCommand"; +import { + ExportSourceNetworkCfnTemplateCommand, + ExportSourceNetworkCfnTemplateCommandInput, + ExportSourceNetworkCfnTemplateCommandOutput, +} from "./commands/ExportSourceNetworkCfnTemplateCommand"; import { GetFailbackReplicationConfigurationCommand, GetFailbackReplicationConfigurationCommandInput, @@ -143,6 +168,16 @@ import { StartReplicationCommandInput, StartReplicationCommandOutput, } from "./commands/StartReplicationCommand"; +import { + StartSourceNetworkRecoveryCommand, + StartSourceNetworkRecoveryCommandInput, + StartSourceNetworkRecoveryCommandOutput, +} from "./commands/StartSourceNetworkRecoveryCommand"; +import { + StartSourceNetworkReplicationCommand, + StartSourceNetworkReplicationCommandInput, + StartSourceNetworkReplicationCommandOutput, +} from "./commands/StartSourceNetworkReplicationCommand"; import { StopFailbackCommand, StopFailbackCommandInput, @@ -153,6 +188,11 @@ import { StopReplicationCommandInput, StopReplicationCommandOutput, } from "./commands/StopReplicationCommand"; +import { + StopSourceNetworkReplicationCommand, + StopSourceNetworkReplicationCommandInput, + StopSourceNetworkReplicationCommandOutput, +} from "./commands/StopSourceNetworkReplicationCommand"; import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; import { TerminateRecoveryInstancesCommand, @@ -192,13 +232,16 @@ import { import { DrsClient, DrsClientConfig } from "./DrsClient"; const commands = { + AssociateSourceNetworkStackCommand, CreateExtendedSourceServerCommand, CreateLaunchConfigurationTemplateCommand, CreateReplicationConfigurationTemplateCommand, + CreateSourceNetworkCommand, DeleteJobCommand, DeleteLaunchConfigurationTemplateCommand, DeleteRecoveryInstanceCommand, DeleteReplicationConfigurationTemplateCommand, + DeleteSourceNetworkCommand, DeleteSourceServerCommand, DescribeJobLogItemsCommand, DescribeJobsCommand, @@ -206,9 +249,11 @@ const commands = { DescribeRecoveryInstancesCommand, DescribeRecoverySnapshotsCommand, DescribeReplicationConfigurationTemplatesCommand, + DescribeSourceNetworksCommand, DescribeSourceServersCommand, DisconnectRecoveryInstanceCommand, DisconnectSourceServerCommand, + ExportSourceNetworkCfnTemplateCommand, GetFailbackReplicationConfigurationCommand, GetLaunchConfigurationCommand, GetReplicationConfigurationCommand, @@ -221,8 +266,11 @@ const commands = { StartFailbackLaunchCommand, StartRecoveryCommand, StartReplicationCommand, + StartSourceNetworkRecoveryCommand, + StartSourceNetworkReplicationCommand, StopFailbackCommand, StopReplicationCommand, + StopSourceNetworkReplicationCommand, TagResourceCommand, TerminateRecoveryInstancesCommand, UntagResourceCommand, @@ -234,6 +282,23 @@ const commands = { }; export interface Drs { + /** + * @see {@link AssociateSourceNetworkStackCommand} + */ + associateSourceNetworkStack( + args: AssociateSourceNetworkStackCommandInput, + options?: __HttpHandlerOptions + ): Promise; + associateSourceNetworkStack( + args: AssociateSourceNetworkStackCommandInput, + cb: (err: any, data?: AssociateSourceNetworkStackCommandOutput) => void + ): void; + associateSourceNetworkStack( + args: AssociateSourceNetworkStackCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: AssociateSourceNetworkStackCommandOutput) => void + ): void; + /** * @see {@link CreateExtendedSourceServerCommand} */ @@ -285,6 +350,23 @@ export interface Drs { cb: (err: any, data?: CreateReplicationConfigurationTemplateCommandOutput) => void ): void; + /** + * @see {@link CreateSourceNetworkCommand} + */ + createSourceNetwork( + args: CreateSourceNetworkCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createSourceNetwork( + args: CreateSourceNetworkCommandInput, + cb: (err: any, data?: CreateSourceNetworkCommandOutput) => void + ): void; + createSourceNetwork( + args: CreateSourceNetworkCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateSourceNetworkCommandOutput) => void + ): void; + /** * @see {@link DeleteJobCommand} */ @@ -347,6 +429,23 @@ export interface Drs { cb: (err: any, data?: DeleteReplicationConfigurationTemplateCommandOutput) => void ): void; + /** + * @see {@link DeleteSourceNetworkCommand} + */ + deleteSourceNetwork( + args: DeleteSourceNetworkCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteSourceNetwork( + args: DeleteSourceNetworkCommandInput, + cb: (err: any, data?: DeleteSourceNetworkCommandOutput) => void + ): void; + deleteSourceNetwork( + args: DeleteSourceNetworkCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteSourceNetworkCommandOutput) => void + ): void; + /** * @see {@link DeleteSourceServerCommand} */ @@ -460,6 +559,23 @@ export interface Drs { cb: (err: any, data?: DescribeReplicationConfigurationTemplatesCommandOutput) => void ): void; + /** + * @see {@link DescribeSourceNetworksCommand} + */ + describeSourceNetworks( + args: DescribeSourceNetworksCommandInput, + options?: __HttpHandlerOptions + ): Promise; + describeSourceNetworks( + args: DescribeSourceNetworksCommandInput, + cb: (err: any, data?: DescribeSourceNetworksCommandOutput) => void + ): void; + describeSourceNetworks( + args: DescribeSourceNetworksCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DescribeSourceNetworksCommandOutput) => void + ): void; + /** * @see {@link DescribeSourceServersCommand} */ @@ -511,6 +627,23 @@ export interface Drs { cb: (err: any, data?: DisconnectSourceServerCommandOutput) => void ): void; + /** + * @see {@link ExportSourceNetworkCfnTemplateCommand} + */ + exportSourceNetworkCfnTemplate( + args: ExportSourceNetworkCfnTemplateCommandInput, + options?: __HttpHandlerOptions + ): Promise; + exportSourceNetworkCfnTemplate( + args: ExportSourceNetworkCfnTemplateCommandInput, + cb: (err: any, data?: ExportSourceNetworkCfnTemplateCommandOutput) => void + ): void; + exportSourceNetworkCfnTemplate( + args: ExportSourceNetworkCfnTemplateCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ExportSourceNetworkCfnTemplateCommandOutput) => void + ): void; + /** * @see {@link GetFailbackReplicationConfigurationCommand} */ @@ -709,6 +842,40 @@ export interface Drs { cb: (err: any, data?: StartReplicationCommandOutput) => void ): void; + /** + * @see {@link StartSourceNetworkRecoveryCommand} + */ + startSourceNetworkRecovery( + args: StartSourceNetworkRecoveryCommandInput, + options?: __HttpHandlerOptions + ): Promise; + startSourceNetworkRecovery( + args: StartSourceNetworkRecoveryCommandInput, + cb: (err: any, data?: StartSourceNetworkRecoveryCommandOutput) => void + ): void; + startSourceNetworkRecovery( + args: StartSourceNetworkRecoveryCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartSourceNetworkRecoveryCommandOutput) => void + ): void; + + /** + * @see {@link StartSourceNetworkReplicationCommand} + */ + startSourceNetworkReplication( + args: StartSourceNetworkReplicationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + startSourceNetworkReplication( + args: StartSourceNetworkReplicationCommandInput, + cb: (err: any, data?: StartSourceNetworkReplicationCommandOutput) => void + ): void; + startSourceNetworkReplication( + args: StartSourceNetworkReplicationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StartSourceNetworkReplicationCommandOutput) => void + ): void; + /** * @see {@link StopFailbackCommand} */ @@ -734,6 +901,23 @@ export interface Drs { cb: (err: any, data?: StopReplicationCommandOutput) => void ): void; + /** + * @see {@link StopSourceNetworkReplicationCommand} + */ + stopSourceNetworkReplication( + args: StopSourceNetworkReplicationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + stopSourceNetworkReplication( + args: StopSourceNetworkReplicationCommandInput, + cb: (err: any, data?: StopSourceNetworkReplicationCommandOutput) => void + ): void; + stopSourceNetworkReplication( + args: StopSourceNetworkReplicationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: StopSourceNetworkReplicationCommandOutput) => void + ): void; + /** * @see {@link TagResourceCommand} */ diff --git a/clients/client-drs/src/DrsClient.ts b/clients/client-drs/src/DrsClient.ts index 26ee4f3dc815..aa8dc862c83a 100644 --- a/clients/client-drs/src/DrsClient.ts +++ b/clients/client-drs/src/DrsClient.ts @@ -51,6 +51,10 @@ import { StreamCollector as __StreamCollector, } from "@smithy/types"; +import { + AssociateSourceNetworkStackCommandInput, + AssociateSourceNetworkStackCommandOutput, +} from "./commands/AssociateSourceNetworkStackCommand"; import { CreateExtendedSourceServerCommandInput, CreateExtendedSourceServerCommandOutput, @@ -63,6 +67,10 @@ import { CreateReplicationConfigurationTemplateCommandInput, CreateReplicationConfigurationTemplateCommandOutput, } from "./commands/CreateReplicationConfigurationTemplateCommand"; +import { + CreateSourceNetworkCommandInput, + CreateSourceNetworkCommandOutput, +} from "./commands/CreateSourceNetworkCommand"; import { DeleteJobCommandInput, DeleteJobCommandOutput } from "./commands/DeleteJobCommand"; import { DeleteLaunchConfigurationTemplateCommandInput, @@ -76,6 +84,10 @@ import { DeleteReplicationConfigurationTemplateCommandInput, DeleteReplicationConfigurationTemplateCommandOutput, } from "./commands/DeleteReplicationConfigurationTemplateCommand"; +import { + DeleteSourceNetworkCommandInput, + DeleteSourceNetworkCommandOutput, +} from "./commands/DeleteSourceNetworkCommand"; import { DeleteSourceServerCommandInput, DeleteSourceServerCommandOutput } from "./commands/DeleteSourceServerCommand"; import { DescribeJobLogItemsCommandInput, @@ -98,6 +110,10 @@ import { DescribeReplicationConfigurationTemplatesCommandInput, DescribeReplicationConfigurationTemplatesCommandOutput, } from "./commands/DescribeReplicationConfigurationTemplatesCommand"; +import { + DescribeSourceNetworksCommandInput, + DescribeSourceNetworksCommandOutput, +} from "./commands/DescribeSourceNetworksCommand"; import { DescribeSourceServersCommandInput, DescribeSourceServersCommandOutput, @@ -110,6 +126,10 @@ import { DisconnectSourceServerCommandInput, DisconnectSourceServerCommandOutput, } from "./commands/DisconnectSourceServerCommand"; +import { + ExportSourceNetworkCfnTemplateCommandInput, + ExportSourceNetworkCfnTemplateCommandOutput, +} from "./commands/ExportSourceNetworkCfnTemplateCommand"; import { GetFailbackReplicationConfigurationCommandInput, GetFailbackReplicationConfigurationCommandOutput, @@ -146,8 +166,20 @@ import { } from "./commands/StartFailbackLaunchCommand"; import { StartRecoveryCommandInput, StartRecoveryCommandOutput } from "./commands/StartRecoveryCommand"; import { StartReplicationCommandInput, StartReplicationCommandOutput } from "./commands/StartReplicationCommand"; +import { + StartSourceNetworkRecoveryCommandInput, + StartSourceNetworkRecoveryCommandOutput, +} from "./commands/StartSourceNetworkRecoveryCommand"; +import { + StartSourceNetworkReplicationCommandInput, + StartSourceNetworkReplicationCommandOutput, +} from "./commands/StartSourceNetworkReplicationCommand"; import { StopFailbackCommandInput, StopFailbackCommandOutput } from "./commands/StopFailbackCommand"; import { StopReplicationCommandInput, StopReplicationCommandOutput } from "./commands/StopReplicationCommand"; +import { + StopSourceNetworkReplicationCommandInput, + StopSourceNetworkReplicationCommandOutput, +} from "./commands/StopSourceNetworkReplicationCommand"; import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; import { TerminateRecoveryInstancesCommandInput, @@ -188,13 +220,16 @@ export { __Client }; * @public */ export type ServiceInputTypes = + | AssociateSourceNetworkStackCommandInput | CreateExtendedSourceServerCommandInput | CreateLaunchConfigurationTemplateCommandInput | CreateReplicationConfigurationTemplateCommandInput + | CreateSourceNetworkCommandInput | DeleteJobCommandInput | DeleteLaunchConfigurationTemplateCommandInput | DeleteRecoveryInstanceCommandInput | DeleteReplicationConfigurationTemplateCommandInput + | DeleteSourceNetworkCommandInput | DeleteSourceServerCommandInput | DescribeJobLogItemsCommandInput | DescribeJobsCommandInput @@ -202,9 +237,11 @@ export type ServiceInputTypes = | DescribeRecoveryInstancesCommandInput | DescribeRecoverySnapshotsCommandInput | DescribeReplicationConfigurationTemplatesCommandInput + | DescribeSourceNetworksCommandInput | DescribeSourceServersCommandInput | DisconnectRecoveryInstanceCommandInput | DisconnectSourceServerCommandInput + | ExportSourceNetworkCfnTemplateCommandInput | GetFailbackReplicationConfigurationCommandInput | GetLaunchConfigurationCommandInput | GetReplicationConfigurationCommandInput @@ -217,8 +254,11 @@ export type ServiceInputTypes = | StartFailbackLaunchCommandInput | StartRecoveryCommandInput | StartReplicationCommandInput + | StartSourceNetworkRecoveryCommandInput + | StartSourceNetworkReplicationCommandInput | StopFailbackCommandInput | StopReplicationCommandInput + | StopSourceNetworkReplicationCommandInput | TagResourceCommandInput | TerminateRecoveryInstancesCommandInput | UntagResourceCommandInput @@ -232,13 +272,16 @@ export type ServiceInputTypes = * @public */ export type ServiceOutputTypes = + | AssociateSourceNetworkStackCommandOutput | CreateExtendedSourceServerCommandOutput | CreateLaunchConfigurationTemplateCommandOutput | CreateReplicationConfigurationTemplateCommandOutput + | CreateSourceNetworkCommandOutput | DeleteJobCommandOutput | DeleteLaunchConfigurationTemplateCommandOutput | DeleteRecoveryInstanceCommandOutput | DeleteReplicationConfigurationTemplateCommandOutput + | DeleteSourceNetworkCommandOutput | DeleteSourceServerCommandOutput | DescribeJobLogItemsCommandOutput | DescribeJobsCommandOutput @@ -246,9 +289,11 @@ export type ServiceOutputTypes = | DescribeRecoveryInstancesCommandOutput | DescribeRecoverySnapshotsCommandOutput | DescribeReplicationConfigurationTemplatesCommandOutput + | DescribeSourceNetworksCommandOutput | DescribeSourceServersCommandOutput | DisconnectRecoveryInstanceCommandOutput | DisconnectSourceServerCommandOutput + | ExportSourceNetworkCfnTemplateCommandOutput | GetFailbackReplicationConfigurationCommandOutput | GetLaunchConfigurationCommandOutput | GetReplicationConfigurationCommandOutput @@ -261,8 +306,11 @@ export type ServiceOutputTypes = | StartFailbackLaunchCommandOutput | StartRecoveryCommandOutput | StartReplicationCommandOutput + | StartSourceNetworkRecoveryCommandOutput + | StartSourceNetworkReplicationCommandOutput | StopFailbackCommandOutput | StopReplicationCommandOutput + | StopSourceNetworkReplicationCommandOutput | TagResourceCommandOutput | TerminateRecoveryInstancesCommandOutput | UntagResourceCommandOutput diff --git a/clients/client-drs/src/commands/AssociateSourceNetworkStackCommand.ts b/clients/client-drs/src/commands/AssociateSourceNetworkStackCommand.ts new file mode 100644 index 000000000000..1b88d8339cda --- /dev/null +++ b/clients/client-drs/src/commands/AssociateSourceNetworkStackCommand.ts @@ -0,0 +1,203 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + AssociateSourceNetworkStackRequest, + AssociateSourceNetworkStackRequestFilterSensitiveLog, + AssociateSourceNetworkStackResponse, + AssociateSourceNetworkStackResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + de_AssociateSourceNetworkStackCommand, + se_AssociateSourceNetworkStackCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link AssociateSourceNetworkStackCommand}. + */ +export interface AssociateSourceNetworkStackCommandInput extends AssociateSourceNetworkStackRequest {} +/** + * @public + * + * The output of {@link AssociateSourceNetworkStackCommand}. + */ +export interface AssociateSourceNetworkStackCommandOutput + extends AssociateSourceNetworkStackResponse, + __MetadataBearer {} + +/** + * @public + *

Associate a Source Network to an existing CloudFormation Stack and modify launch templates to use this network. Can be used for reverting to previously deployed CloudFormation stacks.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, AssociateSourceNetworkStackCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, AssociateSourceNetworkStackCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // AssociateSourceNetworkStackRequest + * sourceNetworkID: "STRING_VALUE", // required + * cfnStackName: "STRING_VALUE", // required + * }; + * const command = new AssociateSourceNetworkStackCommand(input); + * const response = await client.send(command); + * // { // AssociateSourceNetworkStackResponse + * // job: { // Job + * // jobID: "STRING_VALUE", // required + * // arn: "STRING_VALUE", + * // type: "STRING_VALUE", + * // initiatedBy: "STRING_VALUE", + * // creationDateTime: "STRING_VALUE", + * // endDateTime: "STRING_VALUE", + * // status: "STRING_VALUE", + * // participatingServers: [ // ParticipatingServers + * // { // ParticipatingServer + * // sourceServerID: "STRING_VALUE", + * // recoveryInstanceID: "STRING_VALUE", + * // launchStatus: "STRING_VALUE", + * // }, + * // ], + * // tags: { // TagsMap + * // "": "STRING_VALUE", + * // }, + * // participatingResources: [ // ParticipatingResources + * // { // ParticipatingResource + * // participatingResourceID: { // ParticipatingResourceID Union: only one key present + * // sourceNetworkID: "STRING_VALUE", + * // }, + * // launchStatus: "STRING_VALUE", + * // }, + * // ], + * // }, + * // }; + * + * ``` + * + * @param AssociateSourceNetworkStackCommandInput - {@link AssociateSourceNetworkStackCommandInput} + * @returns {@link AssociateSourceNetworkStackCommandOutput} + * @see {@link AssociateSourceNetworkStackCommandInput} for command's `input` shape. + * @see {@link AssociateSourceNetworkStackCommandOutput} 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 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.

+ * + * @throws {@link DrsServiceException} + *

Base exception class for all service exceptions from Drs service.

+ * + */ +export class AssociateSourceNetworkStackCommand extends $Command< + AssociateSourceNetworkStackCommandInput, + AssociateSourceNetworkStackCommandOutput, + 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: AssociateSourceNetworkStackCommandInput) { + // 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, AssociateSourceNetworkStackCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "AssociateSourceNetworkStackCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: AssociateSourceNetworkStackRequestFilterSensitiveLog, + outputFilterSensitiveLog: AssociateSourceNetworkStackResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: AssociateSourceNetworkStackCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_AssociateSourceNetworkStackCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_AssociateSourceNetworkStackCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/CreateExtendedSourceServerCommand.ts b/clients/client-drs/src/commands/CreateExtendedSourceServerCommand.ts index 9e40027b23aa..532b90b5e034 100644 --- a/clients/client-drs/src/commands/CreateExtendedSourceServerCommand.ts +++ b/clients/client-drs/src/commands/CreateExtendedSourceServerCommand.ts @@ -157,6 +157,7 @@ export interface CreateExtendedSourceServerCommandOutput extends CreateExtendedS * // }, * // replicationDirection: "STRING_VALUE", * // reversedDirectionSourceServerArn: "STRING_VALUE", + * // sourceNetworkID: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-drs/src/commands/CreateLaunchConfigurationTemplateCommand.ts b/clients/client-drs/src/commands/CreateLaunchConfigurationTemplateCommand.ts index 1e584df5bfe2..809d6ed5fa56 100644 --- a/clients/client-drs/src/commands/CreateLaunchConfigurationTemplateCommand.ts +++ b/clients/client-drs/src/commands/CreateLaunchConfigurationTemplateCommand.ts @@ -64,6 +64,7 @@ export interface CreateLaunchConfigurationTemplateCommandOutput * licensing: { // Licensing * osByol: true || false, * }, + * exportBucketArn: "STRING_VALUE", * }; * const command = new CreateLaunchConfigurationTemplateCommand(input); * const response = await client.send(command); @@ -81,6 +82,7 @@ export interface CreateLaunchConfigurationTemplateCommandOutput * // licensing: { // Licensing * // osByol: true || false, * // }, + * // exportBucketArn: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-drs/src/commands/CreateSourceNetworkCommand.ts b/clients/client-drs/src/commands/CreateSourceNetworkCommand.ts new file mode 100644 index 000000000000..5d9e41dc1d0f --- /dev/null +++ b/clients/client-drs/src/commands/CreateSourceNetworkCommand.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 { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + CreateSourceNetworkRequest, + CreateSourceNetworkRequestFilterSensitiveLog, + CreateSourceNetworkResponse, +} from "../models/models_0"; +import { de_CreateSourceNetworkCommand, se_CreateSourceNetworkCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link CreateSourceNetworkCommand}. + */ +export interface CreateSourceNetworkCommandInput extends CreateSourceNetworkRequest {} +/** + * @public + * + * The output of {@link CreateSourceNetworkCommand}. + */ +export interface CreateSourceNetworkCommandOutput extends CreateSourceNetworkResponse, __MetadataBearer {} + +/** + * @public + *

Create a new Source Network resource for a provided VPC ID.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, CreateSourceNetworkCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, CreateSourceNetworkCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // CreateSourceNetworkRequest + * vpcID: "STRING_VALUE", // required + * originAccountID: "STRING_VALUE", // required + * originRegion: "STRING_VALUE", // required + * tags: { // TagsMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new CreateSourceNetworkCommand(input); + * const response = await client.send(command); + * // { // CreateSourceNetworkResponse + * // sourceNetworkID: "STRING_VALUE", + * // }; + * + * ``` + * + * @param CreateSourceNetworkCommandInput - {@link CreateSourceNetworkCommandInput} + * @returns {@link CreateSourceNetworkCommandOutput} + * @see {@link CreateSourceNetworkCommandInput} for command's `input` shape. + * @see {@link CreateSourceNetworkCommandOutput} 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 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.

+ * + * @throws {@link DrsServiceException} + *

Base exception class for all service exceptions from Drs service.

+ * + */ +export class CreateSourceNetworkCommand extends $Command< + CreateSourceNetworkCommandInput, + CreateSourceNetworkCommandOutput, + 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: CreateSourceNetworkCommandInput) { + // 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, CreateSourceNetworkCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "CreateSourceNetworkCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: CreateSourceNetworkRequestFilterSensitiveLog, + outputFilterSensitiveLog: (_: any) => _, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: CreateSourceNetworkCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_CreateSourceNetworkCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_CreateSourceNetworkCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/DeleteSourceNetworkCommand.ts b/clients/client-drs/src/commands/DeleteSourceNetworkCommand.ts new file mode 100644 index 000000000000..8b90f8b3d9ac --- /dev/null +++ b/clients/client-drs/src/commands/DeleteSourceNetworkCommand.ts @@ -0,0 +1,155 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { DeleteSourceNetworkRequest, DeleteSourceNetworkResponse } from "../models/models_0"; +import { de_DeleteSourceNetworkCommand, se_DeleteSourceNetworkCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DeleteSourceNetworkCommand}. + */ +export interface DeleteSourceNetworkCommandInput extends DeleteSourceNetworkRequest {} +/** + * @public + * + * The output of {@link DeleteSourceNetworkCommand}. + */ +export interface DeleteSourceNetworkCommandOutput extends DeleteSourceNetworkResponse, __MetadataBearer {} + +/** + * @public + *

Delete Source Network resource.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, DeleteSourceNetworkCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, DeleteSourceNetworkCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // DeleteSourceNetworkRequest + * sourceNetworkID: "STRING_VALUE", // required + * }; + * const command = new DeleteSourceNetworkCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param DeleteSourceNetworkCommandInput - {@link DeleteSourceNetworkCommandInput} + * @returns {@link DeleteSourceNetworkCommandOutput} + * @see {@link DeleteSourceNetworkCommandInput} for command's `input` shape. + * @see {@link DeleteSourceNetworkCommandOutput} 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.

+ * + * @throws {@link DrsServiceException} + *

Base exception class for all service exceptions from Drs service.

+ * + */ +export class DeleteSourceNetworkCommand extends $Command< + DeleteSourceNetworkCommandInput, + DeleteSourceNetworkCommandOutput, + 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: DeleteSourceNetworkCommandInput) { + // 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, DeleteSourceNetworkCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "DeleteSourceNetworkCommand"; + 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: DeleteSourceNetworkCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DeleteSourceNetworkCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DeleteSourceNetworkCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/DescribeJobLogItemsCommand.ts b/clients/client-drs/src/commands/DescribeJobLogItemsCommand.ts index 6c44ed31b12f..2c0a81deb788 100644 --- a/clients/client-drs/src/commands/DescribeJobLogItemsCommand.ts +++ b/clients/client-drs/src/commands/DescribeJobLogItemsCommand.ts @@ -73,6 +73,14 @@ export interface DescribeJobLogItemsCommandOutput extends DescribeJobLogItemsRes * // "": Number("long"), * // }, * // }, + * // eventResourceData: { // EventResourceData Union: only one key present + * // sourceNetworkData: { // SourceNetworkData + * // sourceNetworkID: "STRING_VALUE", + * // sourceVpc: "STRING_VALUE", + * // targetVpc: "STRING_VALUE", + * // stackName: "STRING_VALUE", + * // }, + * // }, * // }, * // }, * // ], diff --git a/clients/client-drs/src/commands/DescribeJobsCommand.ts b/clients/client-drs/src/commands/DescribeJobsCommand.ts index 9ee226b95295..f325c0014df9 100644 --- a/clients/client-drs/src/commands/DescribeJobsCommand.ts +++ b/clients/client-drs/src/commands/DescribeJobsCommand.ts @@ -76,6 +76,14 @@ export interface DescribeJobsCommandOutput extends DescribeJobsResponse, __Metad * // tags: { // TagsMap * // "": "STRING_VALUE", * // }, + * // participatingResources: [ // ParticipatingResources + * // { // ParticipatingResource + * // participatingResourceID: { // ParticipatingResourceID Union: only one key present + * // sourceNetworkID: "STRING_VALUE", + * // }, + * // launchStatus: "STRING_VALUE", + * // }, + * // ], * // }, * // ], * // nextToken: "STRING_VALUE", diff --git a/clients/client-drs/src/commands/DescribeLaunchConfigurationTemplatesCommand.ts b/clients/client-drs/src/commands/DescribeLaunchConfigurationTemplatesCommand.ts index 27849e8c92af..50f0562434ee 100644 --- a/clients/client-drs/src/commands/DescribeLaunchConfigurationTemplatesCommand.ts +++ b/clients/client-drs/src/commands/DescribeLaunchConfigurationTemplatesCommand.ts @@ -76,6 +76,7 @@ export interface DescribeLaunchConfigurationTemplatesCommandOutput * // licensing: { // Licensing * // osByol: true || false, * // }, + * // exportBucketArn: "STRING_VALUE", * // }, * // ], * // nextToken: "STRING_VALUE", diff --git a/clients/client-drs/src/commands/DescribeSourceNetworksCommand.ts b/clients/client-drs/src/commands/DescribeSourceNetworksCommand.ts new file mode 100644 index 000000000000..e67fd573dd73 --- /dev/null +++ b/clients/client-drs/src/commands/DescribeSourceNetworksCommand.ts @@ -0,0 +1,187 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + DescribeSourceNetworksRequest, + DescribeSourceNetworksResponse, + DescribeSourceNetworksResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_DescribeSourceNetworksCommand, se_DescribeSourceNetworksCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link DescribeSourceNetworksCommand}. + */ +export interface DescribeSourceNetworksCommandInput extends DescribeSourceNetworksRequest {} +/** + * @public + * + * The output of {@link DescribeSourceNetworksCommand}. + */ +export interface DescribeSourceNetworksCommandOutput extends DescribeSourceNetworksResponse, __MetadataBearer {} + +/** + * @public + *

Lists all Source Networks or multiple Source Networks filtered by ID.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, DescribeSourceNetworksCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, DescribeSourceNetworksCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // DescribeSourceNetworksRequest + * filters: { // DescribeSourceNetworksRequestFilters + * sourceNetworkIDs: [ // DescribeSourceNetworksRequestFiltersIDs + * "STRING_VALUE", + * ], + * originAccountID: "STRING_VALUE", + * originRegion: "STRING_VALUE", + * }, + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new DescribeSourceNetworksCommand(input); + * const response = await client.send(command); + * // { // DescribeSourceNetworksResponse + * // items: [ // SourceNetworksList + * // { // SourceNetwork + * // sourceNetworkID: "STRING_VALUE", + * // sourceVpcID: "STRING_VALUE", + * // arn: "STRING_VALUE", + * // tags: { // TagsMap + * // "": "STRING_VALUE", + * // }, + * // replicationStatus: "STRING_VALUE", + * // replicationStatusDetails: "STRING_VALUE", + * // cfnStackName: "STRING_VALUE", + * // sourceRegion: "STRING_VALUE", + * // sourceAccountID: "STRING_VALUE", + * // lastRecovery: { // RecoveryLifeCycle + * // apiCallDateTime: new Date("TIMESTAMP"), + * // jobID: "STRING_VALUE", + * // lastRecoveryResult: "STRING_VALUE", + * // }, + * // launchedVpcID: "STRING_VALUE", + * // }, + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param DescribeSourceNetworksCommandInput - {@link DescribeSourceNetworksCommandInput} + * @returns {@link DescribeSourceNetworksCommandOutput} + * @see {@link DescribeSourceNetworksCommandInput} for command's `input` shape. + * @see {@link DescribeSourceNetworksCommandOutput} 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 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.

+ * + * @throws {@link DrsServiceException} + *

Base exception class for all service exceptions from Drs service.

+ * + */ +export class DescribeSourceNetworksCommand extends $Command< + DescribeSourceNetworksCommandInput, + DescribeSourceNetworksCommandOutput, + 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: DescribeSourceNetworksCommandInput) { + // 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, DescribeSourceNetworksCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "DescribeSourceNetworksCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: DescribeSourceNetworksResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: DescribeSourceNetworksCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_DescribeSourceNetworksCommand(input, context); + } + + /** + * @internal + */ + private deserialize(output: __HttpResponse, context: __SerdeContext): Promise { + return de_DescribeSourceNetworksCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/DescribeSourceServersCommand.ts b/clients/client-drs/src/commands/DescribeSourceServersCommand.ts index 222e1261c5b3..88f526482c36 100644 --- a/clients/client-drs/src/commands/DescribeSourceServersCommand.ts +++ b/clients/client-drs/src/commands/DescribeSourceServersCommand.ts @@ -164,6 +164,7 @@ export interface DescribeSourceServersCommandOutput extends DescribeSourceServer * // }, * // replicationDirection: "STRING_VALUE", * // reversedDirectionSourceServerArn: "STRING_VALUE", + * // sourceNetworkID: "STRING_VALUE", * // }, * // ], * // nextToken: "STRING_VALUE", diff --git a/clients/client-drs/src/commands/DisconnectSourceServerCommand.ts b/clients/client-drs/src/commands/DisconnectSourceServerCommand.ts index 9b5423998f79..ee48ac45cc53 100644 --- a/clients/client-drs/src/commands/DisconnectSourceServerCommand.ts +++ b/clients/client-drs/src/commands/DisconnectSourceServerCommand.ts @@ -148,6 +148,7 @@ export interface DisconnectSourceServerCommandOutput extends SourceServer, __Met * // }, * // replicationDirection: "STRING_VALUE", * // reversedDirectionSourceServerArn: "STRING_VALUE", + * // sourceNetworkID: "STRING_VALUE", * // }; * * ``` diff --git a/clients/client-drs/src/commands/ExportSourceNetworkCfnTemplateCommand.ts b/clients/client-drs/src/commands/ExportSourceNetworkCfnTemplateCommand.ts new file mode 100644 index 000000000000..78456356a0f0 --- /dev/null +++ b/clients/client-drs/src/commands/ExportSourceNetworkCfnTemplateCommand.ts @@ -0,0 +1,171 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { ExportSourceNetworkCfnTemplateRequest, ExportSourceNetworkCfnTemplateResponse } from "../models/models_0"; +import { + de_ExportSourceNetworkCfnTemplateCommand, + se_ExportSourceNetworkCfnTemplateCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link ExportSourceNetworkCfnTemplateCommand}. + */ +export interface ExportSourceNetworkCfnTemplateCommandInput extends ExportSourceNetworkCfnTemplateRequest {} +/** + * @public + * + * The output of {@link ExportSourceNetworkCfnTemplateCommand}. + */ +export interface ExportSourceNetworkCfnTemplateCommandOutput + extends ExportSourceNetworkCfnTemplateResponse, + __MetadataBearer {} + +/** + * @public + *

Export the Source Network CloudFormation template to an S3 bucket.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, ExportSourceNetworkCfnTemplateCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, ExportSourceNetworkCfnTemplateCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // ExportSourceNetworkCfnTemplateRequest + * sourceNetworkID: "STRING_VALUE", // required + * }; + * const command = new ExportSourceNetworkCfnTemplateCommand(input); + * const response = await client.send(command); + * // { // ExportSourceNetworkCfnTemplateResponse + * // s3DestinationUrl: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ExportSourceNetworkCfnTemplateCommandInput - {@link ExportSourceNetworkCfnTemplateCommandInput} + * @returns {@link ExportSourceNetworkCfnTemplateCommandOutput} + * @see {@link ExportSourceNetworkCfnTemplateCommandInput} for command's `input` shape. + * @see {@link ExportSourceNetworkCfnTemplateCommandOutput} 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.

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

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

+ * + * @throws {@link DrsServiceException} + *

Base exception class for all service exceptions from Drs service.

+ * + */ +export class ExportSourceNetworkCfnTemplateCommand extends $Command< + ExportSourceNetworkCfnTemplateCommandInput, + ExportSourceNetworkCfnTemplateCommandOutput, + 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: ExportSourceNetworkCfnTemplateCommandInput) { + // 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, ExportSourceNetworkCfnTemplateCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "ExportSourceNetworkCfnTemplateCommand"; + 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: ExportSourceNetworkCfnTemplateCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return se_ExportSourceNetworkCfnTemplateCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_ExportSourceNetworkCfnTemplateCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/RetryDataReplicationCommand.ts b/clients/client-drs/src/commands/RetryDataReplicationCommand.ts index a4d5f24fb887..c4f0b31e35c0 100644 --- a/clients/client-drs/src/commands/RetryDataReplicationCommand.ts +++ b/clients/client-drs/src/commands/RetryDataReplicationCommand.ts @@ -152,6 +152,7 @@ export interface RetryDataReplicationCommandOutput extends SourceServer, __Metad * // }, * // replicationDirection: "STRING_VALUE", * // reversedDirectionSourceServerArn: "STRING_VALUE", + * // sourceNetworkID: "STRING_VALUE", * // }; * * ``` diff --git a/clients/client-drs/src/commands/StartFailbackLaunchCommand.ts b/clients/client-drs/src/commands/StartFailbackLaunchCommand.ts index b0c174d44520..fbc1cf19a6c8 100644 --- a/clients/client-drs/src/commands/StartFailbackLaunchCommand.ts +++ b/clients/client-drs/src/commands/StartFailbackLaunchCommand.ts @@ -77,6 +77,14 @@ export interface StartFailbackLaunchCommandOutput extends StartFailbackLaunchRes * // tags: { // TagsMap * // "": "STRING_VALUE", * // }, + * // participatingResources: [ // ParticipatingResources + * // { // ParticipatingResource + * // participatingResourceID: { // ParticipatingResourceID Union: only one key present + * // sourceNetworkID: "STRING_VALUE", + * // }, + * // launchStatus: "STRING_VALUE", + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-drs/src/commands/StartRecoveryCommand.ts b/clients/client-drs/src/commands/StartRecoveryCommand.ts index 94fe98240b1b..45a7b3e3a8e4 100644 --- a/clients/client-drs/src/commands/StartRecoveryCommand.ts +++ b/clients/client-drs/src/commands/StartRecoveryCommand.ts @@ -81,6 +81,14 @@ export interface StartRecoveryCommandOutput extends StartRecoveryResponse, __Met * // tags: { // TagsMap * // "": "STRING_VALUE", * // }, + * // participatingResources: [ // ParticipatingResources + * // { // ParticipatingResource + * // participatingResourceID: { // ParticipatingResourceID Union: only one key present + * // sourceNetworkID: "STRING_VALUE", + * // }, + * // launchStatus: "STRING_VALUE", + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-drs/src/commands/StartReplicationCommand.ts b/clients/client-drs/src/commands/StartReplicationCommand.ts index 7469e278a3a4..8eea4bfe729d 100644 --- a/clients/client-drs/src/commands/StartReplicationCommand.ts +++ b/clients/client-drs/src/commands/StartReplicationCommand.ts @@ -153,6 +153,7 @@ export interface StartReplicationCommandOutput extends StartReplicationResponse, * // }, * // replicationDirection: "STRING_VALUE", * // reversedDirectionSourceServerArn: "STRING_VALUE", + * // sourceNetworkID: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-drs/src/commands/StartSourceNetworkRecoveryCommand.ts b/clients/client-drs/src/commands/StartSourceNetworkRecoveryCommand.ts new file mode 100644 index 000000000000..41b83103998e --- /dev/null +++ b/clients/client-drs/src/commands/StartSourceNetworkRecoveryCommand.ts @@ -0,0 +1,203 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + StartSourceNetworkRecoveryRequest, + StartSourceNetworkRecoveryRequestFilterSensitiveLog, + StartSourceNetworkRecoveryResponse, + StartSourceNetworkRecoveryResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_StartSourceNetworkRecoveryCommand, se_StartSourceNetworkRecoveryCommand } from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link StartSourceNetworkRecoveryCommand}. + */ +export interface StartSourceNetworkRecoveryCommandInput extends StartSourceNetworkRecoveryRequest {} +/** + * @public + * + * The output of {@link StartSourceNetworkRecoveryCommand}. + */ +export interface StartSourceNetworkRecoveryCommandOutput extends StartSourceNetworkRecoveryResponse, __MetadataBearer {} + +/** + * @public + *

Deploy VPC for the specified Source Network and modify launch templates to use this network. The VPC will be deployed using a dedicated CloudFormation stack.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, StartSourceNetworkRecoveryCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, StartSourceNetworkRecoveryCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // StartSourceNetworkRecoveryRequest + * sourceNetworks: [ // StartSourceNetworkRecoveryRequestNetworkEntries // required + * { // StartSourceNetworkRecoveryRequestNetworkEntry + * sourceNetworkID: "STRING_VALUE", // required + * cfnStackName: "STRING_VALUE", + * }, + * ], + * deployAsNew: true || false, + * tags: { // TagsMap + * "": "STRING_VALUE", + * }, + * }; + * const command = new StartSourceNetworkRecoveryCommand(input); + * const response = await client.send(command); + * // { // StartSourceNetworkRecoveryResponse + * // job: { // Job + * // jobID: "STRING_VALUE", // required + * // arn: "STRING_VALUE", + * // type: "STRING_VALUE", + * // initiatedBy: "STRING_VALUE", + * // creationDateTime: "STRING_VALUE", + * // endDateTime: "STRING_VALUE", + * // status: "STRING_VALUE", + * // participatingServers: [ // ParticipatingServers + * // { // ParticipatingServer + * // sourceServerID: "STRING_VALUE", + * // recoveryInstanceID: "STRING_VALUE", + * // launchStatus: "STRING_VALUE", + * // }, + * // ], + * // tags: { // TagsMap + * // "": "STRING_VALUE", + * // }, + * // participatingResources: [ // ParticipatingResources + * // { // ParticipatingResource + * // participatingResourceID: { // ParticipatingResourceID Union: only one key present + * // sourceNetworkID: "STRING_VALUE", + * // }, + * // launchStatus: "STRING_VALUE", + * // }, + * // ], + * // }, + * // }; + * + * ``` + * + * @param StartSourceNetworkRecoveryCommandInput - {@link StartSourceNetworkRecoveryCommandInput} + * @returns {@link StartSourceNetworkRecoveryCommandOutput} + * @see {@link StartSourceNetworkRecoveryCommandInput} for command's `input` shape. + * @see {@link StartSourceNetworkRecoveryCommandOutput} 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 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.

+ * + * @throws {@link DrsServiceException} + *

Base exception class for all service exceptions from Drs service.

+ * + */ +export class StartSourceNetworkRecoveryCommand extends $Command< + StartSourceNetworkRecoveryCommandInput, + StartSourceNetworkRecoveryCommandOutput, + 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: StartSourceNetworkRecoveryCommandInput) { + // 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, StartSourceNetworkRecoveryCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "StartSourceNetworkRecoveryCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: StartSourceNetworkRecoveryRequestFilterSensitiveLog, + outputFilterSensitiveLog: StartSourceNetworkRecoveryResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: StartSourceNetworkRecoveryCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_StartSourceNetworkRecoveryCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_StartSourceNetworkRecoveryCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/StartSourceNetworkReplicationCommand.ts b/clients/client-drs/src/commands/StartSourceNetworkReplicationCommand.ts new file mode 100644 index 000000000000..4f659b40584d --- /dev/null +++ b/clients/client-drs/src/commands/StartSourceNetworkReplicationCommand.ts @@ -0,0 +1,187 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + StartSourceNetworkReplicationRequest, + StartSourceNetworkReplicationResponse, + StartSourceNetworkReplicationResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + de_StartSourceNetworkReplicationCommand, + se_StartSourceNetworkReplicationCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link StartSourceNetworkReplicationCommand}. + */ +export interface StartSourceNetworkReplicationCommandInput extends StartSourceNetworkReplicationRequest {} +/** + * @public + * + * The output of {@link StartSourceNetworkReplicationCommand}. + */ +export interface StartSourceNetworkReplicationCommandOutput + extends StartSourceNetworkReplicationResponse, + __MetadataBearer {} + +/** + * @public + *

Starts replication for a Source Network. This action would make the Source Network protected.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, StartSourceNetworkReplicationCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, StartSourceNetworkReplicationCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // StartSourceNetworkReplicationRequest + * sourceNetworkID: "STRING_VALUE", // required + * }; + * const command = new StartSourceNetworkReplicationCommand(input); + * const response = await client.send(command); + * // { // StartSourceNetworkReplicationResponse + * // sourceNetwork: { // SourceNetwork + * // sourceNetworkID: "STRING_VALUE", + * // sourceVpcID: "STRING_VALUE", + * // arn: "STRING_VALUE", + * // tags: { // TagsMap + * // "": "STRING_VALUE", + * // }, + * // replicationStatus: "STRING_VALUE", + * // replicationStatusDetails: "STRING_VALUE", + * // cfnStackName: "STRING_VALUE", + * // sourceRegion: "STRING_VALUE", + * // sourceAccountID: "STRING_VALUE", + * // lastRecovery: { // RecoveryLifeCycle + * // apiCallDateTime: new Date("TIMESTAMP"), + * // jobID: "STRING_VALUE", + * // lastRecoveryResult: "STRING_VALUE", + * // }, + * // launchedVpcID: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param StartSourceNetworkReplicationCommandInput - {@link StartSourceNetworkReplicationCommandInput} + * @returns {@link StartSourceNetworkReplicationCommandOutput} + * @see {@link StartSourceNetworkReplicationCommandInput} for command's `input` shape. + * @see {@link StartSourceNetworkReplicationCommandOutput} 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.

+ * + * @throws {@link DrsServiceException} + *

Base exception class for all service exceptions from Drs service.

+ * + */ +export class StartSourceNetworkReplicationCommand extends $Command< + StartSourceNetworkReplicationCommandInput, + StartSourceNetworkReplicationCommandOutput, + 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: StartSourceNetworkReplicationCommandInput) { + // 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, StartSourceNetworkReplicationCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "StartSourceNetworkReplicationCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: StartSourceNetworkReplicationResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: StartSourceNetworkReplicationCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_StartSourceNetworkReplicationCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_StartSourceNetworkReplicationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/StopReplicationCommand.ts b/clients/client-drs/src/commands/StopReplicationCommand.ts index 1b5c40095fb2..daef0b8d0fb5 100644 --- a/clients/client-drs/src/commands/StopReplicationCommand.ts +++ b/clients/client-drs/src/commands/StopReplicationCommand.ts @@ -153,6 +153,7 @@ export interface StopReplicationCommandOutput extends StopReplicationResponse, _ * // }, * // replicationDirection: "STRING_VALUE", * // reversedDirectionSourceServerArn: "STRING_VALUE", + * // sourceNetworkID: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-drs/src/commands/StopSourceNetworkReplicationCommand.ts b/clients/client-drs/src/commands/StopSourceNetworkReplicationCommand.ts new file mode 100644 index 000000000000..438b2ff8ac0a --- /dev/null +++ b/clients/client-drs/src/commands/StopSourceNetworkReplicationCommand.ts @@ -0,0 +1,190 @@ +// smithy-typescript generated code +import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint"; +import { getSerdePlugin } from "@aws-sdk/middleware-serde"; +import { Command as $Command } from "@aws-sdk/smithy-client"; +import { + FinalizeHandlerArguments, + Handler, + HandlerExecutionContext, + HttpHandlerOptions as __HttpHandlerOptions, + MetadataBearer as __MetadataBearer, + MiddlewareStack, +} from "@aws-sdk/types"; +import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; +import { SerdeContext as __SerdeContext } from "@smithy/types"; + +import { DrsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../DrsClient"; +import { + StopSourceNetworkReplicationRequest, + StopSourceNetworkReplicationResponse, + StopSourceNetworkReplicationResponseFilterSensitiveLog, +} from "../models/models_0"; +import { + de_StopSourceNetworkReplicationCommand, + se_StopSourceNetworkReplicationCommand, +} from "../protocols/Aws_restJson1"; + +/** + * @public + */ +export { __MetadataBearer, $Command }; +/** + * @public + * + * The input for {@link StopSourceNetworkReplicationCommand}. + */ +export interface StopSourceNetworkReplicationCommandInput extends StopSourceNetworkReplicationRequest {} +/** + * @public + * + * The output of {@link StopSourceNetworkReplicationCommand}. + */ +export interface StopSourceNetworkReplicationCommandOutput + extends StopSourceNetworkReplicationResponse, + __MetadataBearer {} + +/** + * @public + *

Stops replication for a Source Network. This action would make the Source Network unprotected.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { DrsClient, StopSourceNetworkReplicationCommand } from "@aws-sdk/client-drs"; // ES Modules import + * // const { DrsClient, StopSourceNetworkReplicationCommand } = require("@aws-sdk/client-drs"); // CommonJS import + * const client = new DrsClient(config); + * const input = { // StopSourceNetworkReplicationRequest + * sourceNetworkID: "STRING_VALUE", // required + * }; + * const command = new StopSourceNetworkReplicationCommand(input); + * const response = await client.send(command); + * // { // StopSourceNetworkReplicationResponse + * // sourceNetwork: { // SourceNetwork + * // sourceNetworkID: "STRING_VALUE", + * // sourceVpcID: "STRING_VALUE", + * // arn: "STRING_VALUE", + * // tags: { // TagsMap + * // "": "STRING_VALUE", + * // }, + * // replicationStatus: "STRING_VALUE", + * // replicationStatusDetails: "STRING_VALUE", + * // cfnStackName: "STRING_VALUE", + * // sourceRegion: "STRING_VALUE", + * // sourceAccountID: "STRING_VALUE", + * // lastRecovery: { // RecoveryLifeCycle + * // apiCallDateTime: new Date("TIMESTAMP"), + * // jobID: "STRING_VALUE", + * // lastRecoveryResult: "STRING_VALUE", + * // }, + * // launchedVpcID: "STRING_VALUE", + * // }, + * // }; + * + * ``` + * + * @param StopSourceNetworkReplicationCommandInput - {@link StopSourceNetworkReplicationCommandInput} + * @returns {@link StopSourceNetworkReplicationCommandOutput} + * @see {@link StopSourceNetworkReplicationCommandInput} for command's `input` shape. + * @see {@link StopSourceNetworkReplicationCommandOutput} 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.

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

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

+ * + * @throws {@link DrsServiceException} + *

Base exception class for all service exceptions from Drs service.

+ * + */ +export class StopSourceNetworkReplicationCommand extends $Command< + StopSourceNetworkReplicationCommandInput, + StopSourceNetworkReplicationCommandOutput, + 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: StopSourceNetworkReplicationCommandInput) { + // 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, StopSourceNetworkReplicationCommand.getEndpointParameterInstructions()) + ); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "DrsClient"; + const commandName = "StopSourceNetworkReplicationCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: (_: any) => _, + outputFilterSensitiveLog: StopSourceNetworkReplicationResponseFilterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + /** + * @internal + */ + private serialize(input: StopSourceNetworkReplicationCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return se_StopSourceNetworkReplicationCommand(input, context); + } + + /** + * @internal + */ + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return de_StopSourceNetworkReplicationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-drs/src/commands/TerminateRecoveryInstancesCommand.ts b/clients/client-drs/src/commands/TerminateRecoveryInstancesCommand.ts index 43525b74d4a5..b3bd7d53024f 100644 --- a/clients/client-drs/src/commands/TerminateRecoveryInstancesCommand.ts +++ b/clients/client-drs/src/commands/TerminateRecoveryInstancesCommand.ts @@ -73,6 +73,14 @@ export interface TerminateRecoveryInstancesCommandOutput extends TerminateRecove * // tags: { // TagsMap * // "": "STRING_VALUE", * // }, + * // participatingResources: [ // ParticipatingResources + * // { // ParticipatingResource + * // participatingResourceID: { // ParticipatingResourceID Union: only one key present + * // sourceNetworkID: "STRING_VALUE", + * // }, + * // launchStatus: "STRING_VALUE", + * // }, + * // ], * // }, * // }; * diff --git a/clients/client-drs/src/commands/UpdateLaunchConfigurationTemplateCommand.ts b/clients/client-drs/src/commands/UpdateLaunchConfigurationTemplateCommand.ts index 101bd9ddb78f..b901a5dd3464 100644 --- a/clients/client-drs/src/commands/UpdateLaunchConfigurationTemplateCommand.ts +++ b/clients/client-drs/src/commands/UpdateLaunchConfigurationTemplateCommand.ts @@ -61,6 +61,7 @@ export interface UpdateLaunchConfigurationTemplateCommandOutput * licensing: { // Licensing * osByol: true || false, * }, + * exportBucketArn: "STRING_VALUE", * }; * const command = new UpdateLaunchConfigurationTemplateCommand(input); * const response = await client.send(command); @@ -78,6 +79,7 @@ export interface UpdateLaunchConfigurationTemplateCommandOutput * // licensing: { // Licensing * // osByol: true || false, * // }, + * // exportBucketArn: "STRING_VALUE", * // }, * // }; * diff --git a/clients/client-drs/src/commands/index.ts b/clients/client-drs/src/commands/index.ts index 2f48911023d5..27a40d0c9b52 100644 --- a/clients/client-drs/src/commands/index.ts +++ b/clients/client-drs/src/commands/index.ts @@ -1,11 +1,14 @@ // smithy-typescript generated code +export * from "./AssociateSourceNetworkStackCommand"; export * from "./CreateExtendedSourceServerCommand"; export * from "./CreateLaunchConfigurationTemplateCommand"; export * from "./CreateReplicationConfigurationTemplateCommand"; +export * from "./CreateSourceNetworkCommand"; export * from "./DeleteJobCommand"; export * from "./DeleteLaunchConfigurationTemplateCommand"; export * from "./DeleteRecoveryInstanceCommand"; export * from "./DeleteReplicationConfigurationTemplateCommand"; +export * from "./DeleteSourceNetworkCommand"; export * from "./DeleteSourceServerCommand"; export * from "./DescribeJobLogItemsCommand"; export * from "./DescribeJobsCommand"; @@ -13,9 +16,11 @@ export * from "./DescribeLaunchConfigurationTemplatesCommand"; export * from "./DescribeRecoveryInstancesCommand"; export * from "./DescribeRecoverySnapshotsCommand"; export * from "./DescribeReplicationConfigurationTemplatesCommand"; +export * from "./DescribeSourceNetworksCommand"; export * from "./DescribeSourceServersCommand"; export * from "./DisconnectRecoveryInstanceCommand"; export * from "./DisconnectSourceServerCommand"; +export * from "./ExportSourceNetworkCfnTemplateCommand"; export * from "./GetFailbackReplicationConfigurationCommand"; export * from "./GetLaunchConfigurationCommand"; export * from "./GetReplicationConfigurationCommand"; @@ -28,8 +33,11 @@ export * from "./ReverseReplicationCommand"; export * from "./StartFailbackLaunchCommand"; export * from "./StartRecoveryCommand"; export * from "./StartReplicationCommand"; +export * from "./StartSourceNetworkRecoveryCommand"; +export * from "./StartSourceNetworkReplicationCommand"; export * from "./StopFailbackCommand"; export * from "./StopReplicationCommand"; +export * from "./StopSourceNetworkReplicationCommand"; export * from "./TagResourceCommand"; export * from "./TerminateRecoveryInstancesCommand"; export * from "./UntagResourceCommand"; diff --git a/clients/client-drs/src/models/models_0.ts b/clients/client-drs/src/models/models_0.ts index 5fde3086d71b..c41d7bbf1d9d 100644 --- a/clients/client-drs/src/models/models_0.ts +++ b/clients/client-drs/src/models/models_0.ts @@ -36,37 +36,491 @@ export interface Account { accountID?: string; } +/** + * @public + */ +export interface AssociateSourceNetworkStackRequest { + /** + *

The Source Network ID to associate with CloudFormation template.

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

CloudFormation template to associate with a Source Network.

+ */ + cfnStackName: string | undefined; +} + +/** + * @public + * @enum + */ +export const InitiatedBy = { + ASSOCIATE_NETWORK_RECOVERY: "ASSOCIATE_NETWORK_RECOVERY", + CREATE_NETWORK_RECOVERY: "CREATE_NETWORK_RECOVERY", + DIAGNOSTIC: "DIAGNOSTIC", + FAILBACK: "FAILBACK", + START_DRILL: "START_DRILL", + START_RECOVERY: "START_RECOVERY", + TARGET_ACCOUNT: "TARGET_ACCOUNT", + TERMINATE_RECOVERY_INSTANCES: "TERMINATE_RECOVERY_INSTANCES", + UPDATE_NETWORK_RECOVERY: "UPDATE_NETWORK_RECOVERY", +} as const; + +/** + * @public + */ +export type InitiatedBy = (typeof InitiatedBy)[keyof typeof InitiatedBy]; + +/** + * @public + * @enum + */ +export const LaunchStatus = { + FAILED: "FAILED", + IN_PROGRESS: "IN_PROGRESS", + LAUNCHED: "LAUNCHED", + PENDING: "PENDING", + TERMINATED: "TERMINATED", +} as const; + +/** + * @public + */ +export type LaunchStatus = (typeof LaunchStatus)[keyof typeof LaunchStatus]; + +/** + * @public + *

ID of a resource participating in an asynchronous Job.

+ */ +export type ParticipatingResourceID = + | ParticipatingResourceID.SourceNetworkIDMember + | ParticipatingResourceID.$UnknownMember; + +/** + * @public + */ +export namespace ParticipatingResourceID { + /** + *

Source Network ID.

+ */ + export interface SourceNetworkIDMember { + sourceNetworkID: string; + $unknown?: never; + } + + export interface $UnknownMember { + sourceNetworkID?: never; + $unknown: [string, any]; + } + + export interface Visitor { + sourceNetworkID: (value: string) => T; + _: (name: string, value: any) => T; + } + + export const visit = (value: ParticipatingResourceID, visitor: Visitor): T => { + if (value.sourceNetworkID !== undefined) return visitor.sourceNetworkID(value.sourceNetworkID); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; +} + +/** + * @public + *

Represents a resource participating in an asynchronous Job.

+ */ +export interface ParticipatingResource { + /** + *

The ID of a participating resource.

+ */ + participatingResourceID?: ParticipatingResourceID; + + /** + *

The launch status of a participating resource.

+ */ + launchStatus?: LaunchStatus | string; +} + +/** + * @public + *

Represents a server participating in an asynchronous Job.

+ */ +export interface ParticipatingServer { + /** + *

The Source Server ID of a participating server.

+ */ + sourceServerID?: string; + + /** + *

The Recovery Instance ID of a participating server.

+ */ + recoveryInstanceID?: string; + + /** + *

The launch status of a participating server.

+ */ + launchStatus?: LaunchStatus | string; +} + +/** + * @public + * @enum + */ +export const JobStatus = { + COMPLETED: "COMPLETED", + PENDING: "PENDING", + STARTED: "STARTED", +} as const; + +/** + * @public + */ +export type JobStatus = (typeof JobStatus)[keyof typeof JobStatus]; + +/** + * @public + * @enum + */ +export const JobType = { + CREATE_CONVERTED_SNAPSHOT: "CREATE_CONVERTED_SNAPSHOT", + LAUNCH: "LAUNCH", + TERMINATE: "TERMINATE", +} as const; + +/** + * @public + */ +export type JobType = (typeof JobType)[keyof typeof JobType]; + +/** + * @public + *

A job is an asynchronous workflow.

+ */ +export interface Job { + /** + *

The ID of the Job.

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

The ARN of a Job.

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

The type of the Job.

+ */ + type?: JobType | string; + + /** + *

A string representing who initiated the Job.

+ */ + initiatedBy?: InitiatedBy | string; + + /** + *

The date and time of when the Job was created.

+ */ + creationDateTime?: string; + + /** + *

The date and time of when the Job ended.

+ */ + endDateTime?: string; + + /** + *

The status of the Job.

+ */ + status?: JobStatus | string; + + /** + *

A list of servers that the Job is acting upon.

+ */ + participatingServers?: ParticipatingServer[]; + + /** + *

A list of tags associated with the Job.

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

A list of resources that the Job is acting upon.

+ */ + participatingResources?: ParticipatingResource[]; +} + +/** + * @public + */ +export interface AssociateSourceNetworkStackResponse { + /** + *

The Source Network association Job.

+ */ + job?: Job; +} + /** * @public *

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

*/ -export class ConflictException extends __BaseException { - readonly name: "ConflictException" = "ConflictException"; +export class ConflictException extends __BaseException { + readonly name: "ConflictException" = "ConflictException"; + readonly $fault: "client" = "client"; + code?: string; + /** + *

The ID of the resource.

+ */ + resourceId?: string; + + /** + *

The type of the resource.

+ */ + resourceType?: string; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ConflictException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ConflictException.prototype); + this.code = opts.code; + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + } +} + +/** + * @public + *

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

+ */ +export class InternalServerException extends __BaseException { + readonly name: "InternalServerException" = "InternalServerException"; + readonly $fault: "server" = "server"; + /** + *

The number of seconds after which the request should be safe to retry.

+ */ + retryAfterSeconds?: number; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InternalServerException.prototype); + this.retryAfterSeconds = opts.retryAfterSeconds; + } +} + +/** + * @public + *

The resource for this operation was not found.

+ */ +export class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; + readonly $fault: "client" = "client"; + code?: string; + /** + *

The ID of the resource.

+ */ + resourceId?: string; + + /** + *

The type of the resource.

+ */ + resourceType?: string; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + this.code = opts.code; + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + } +} + +/** + * @public + *

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

+ */ +export class ServiceQuotaExceededException extends __BaseException { + readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; + readonly $fault: "client" = "client"; + code?: string; + /** + *

The ID of the resource.

+ */ + resourceId?: string; + + /** + *

The type of the resource.

+ */ + resourceType?: string; + + /** + *

Service code.

+ */ + serviceCode?: string; + + /** + *

Quota code.

+ */ + quotaCode?: string; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceQuotaExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); + this.code = opts.code; + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + this.serviceCode = opts.serviceCode; + this.quotaCode = opts.quotaCode; + } +} + +/** + * @public + *

The request was denied due to request throttling.

+ */ +export class ThrottlingException extends __BaseException { + readonly name: "ThrottlingException" = "ThrottlingException"; + readonly $fault: "client" = "client"; + /** + *

Service code.

+ */ + serviceCode?: string; + + /** + *

Quota code.

+ */ + quotaCode?: string; + + /** + *

The number of seconds after which the request should be safe to retry.

+ */ + retryAfterSeconds?: string; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ThrottlingException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ThrottlingException.prototype); + this.serviceCode = opts.serviceCode; + this.quotaCode = opts.quotaCode; + this.retryAfterSeconds = opts.retryAfterSeconds; + } +} + +/** + * @public + *

The account performing the request has not been initialized.

+ */ +export class UninitializedAccountException extends __BaseException { + readonly name: "UninitializedAccountException" = "UninitializedAccountException"; + readonly $fault: "client" = "client"; + code?: string; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "UninitializedAccountException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, UninitializedAccountException.prototype); + this.code = opts.code; + } +} + +/** + * @public + *

Validate exception field.

+ */ +export interface ValidationExceptionField { + /** + *

Validate exception field name.

+ */ + name?: string; + + /** + *

Validate exception field message.

+ */ + message?: string; +} + +/** + * @public + * @enum + */ +export const ValidationExceptionReason = { + CANNOT_PARSE: "cannotParse", + FIELD_VALIDATION_FAILED: "fieldValidationFailed", + OTHER: "other", + UNKNOWN_OPERATION: "unknownOperation", +} as const; + +/** + * @public + */ +export type ValidationExceptionReason = (typeof ValidationExceptionReason)[keyof typeof ValidationExceptionReason]; + +/** + * @public + *

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

+ */ +export class ValidationException extends __BaseException { + readonly name: "ValidationException" = "ValidationException"; readonly $fault: "client" = "client"; code?: string; /** - *

The ID of the resource.

+ *

Validation exception reason.

*/ - resourceId?: string; + reason?: ValidationExceptionReason | string; /** - *

The type of the resource.

+ *

A list of fields that failed validation.

*/ - resourceType?: string; + fieldList?: ValidationExceptionField[]; /** * @internal */ - constructor(opts: __ExceptionOptionType) { + constructor(opts: __ExceptionOptionType) { super({ - name: "ConflictException", + name: "ValidationException", $fault: "client", ...opts, }); - Object.setPrototypeOf(this, ConflictException.prototype); + Object.setPrototypeOf(this, ValidationException.prototype); this.code = opts.code; - this.resourceId = opts.resourceId; - this.resourceType = opts.resourceType; + this.reason = opts.reason; + this.fieldList = opts.fieldList; } } @@ -398,23 +852,6 @@ export interface LifeCycleLastLaunchInitiated { type?: LastLaunchType | string; } -/** - * @public - * @enum - */ -export const LaunchStatus = { - FAILED: "FAILED", - IN_PROGRESS: "IN_PROGRESS", - LAUNCHED: "LAUNCHED", - PENDING: "PENDING", - TERMINATED: "TERMINATED", -} as const; - -/** - * @public - */ -export type LaunchStatus = (typeof LaunchStatus)[keyof typeof LaunchStatus]; - /** * @public *

An object containing information regarding the last launch of a Source Server.

@@ -686,291 +1123,64 @@ export interface SourceServer { tags?: Record; /** - *

The ID of the Recovery Instance associated with this Source Server.

- */ - recoveryInstanceId?: string; - - /** - *

The status of the last recovery launch of this Source Server.

- */ - lastLaunchResult?: LastLaunchResult | string; - - /** - *

The Data Replication Info of the Source Server.

- */ - dataReplicationInfo?: DataReplicationInfo; - - /** - *

The lifecycle information of this Source Server.

- */ - lifeCycle?: LifeCycle; - - /** - *

The source properties of the Source Server.

- */ - sourceProperties?: SourceProperties; - - /** - *

The staging area of the source server.

- */ - stagingArea?: StagingArea; - - /** - *

Source cloud properties of the Source Server.

- */ - sourceCloudProperties?: SourceCloudProperties; - - /** - *

Replication direction of the Source Server.

- */ - replicationDirection?: ReplicationDirection | string; - - /** - *

For EC2-originated Source Servers which have been failed over and then failed back, this value will mean the ARN of the Source Server on the opposite replication direction.

- */ - reversedDirectionSourceServerArn?: string; -} - -/** - * @public - */ -export interface CreateExtendedSourceServerResponse { - /** - *

Created extended source server.

- */ - sourceServer?: SourceServer; -} - -/** - * @public - *

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

- */ -export class InternalServerException extends __BaseException { - readonly name: "InternalServerException" = "InternalServerException"; - readonly $fault: "server" = "server"; - /** - *

The number of seconds after which the request should be safe to retry.

- */ - retryAfterSeconds?: number; - - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "InternalServerException", - $fault: "server", - ...opts, - }); - Object.setPrototypeOf(this, InternalServerException.prototype); - this.retryAfterSeconds = opts.retryAfterSeconds; - } -} - -/** - * @public - *

The resource for this operation was not found.

- */ -export class ResourceNotFoundException extends __BaseException { - readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; - readonly $fault: "client" = "client"; - code?: string; - /** - *

The ID of the resource.

- */ - resourceId?: string; - - /** - *

The type of the resource.

- */ - resourceType?: string; - - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ResourceNotFoundException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ResourceNotFoundException.prototype); - this.code = opts.code; - this.resourceId = opts.resourceId; - this.resourceType = opts.resourceType; - } -} - -/** - * @public - *

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

- */ -export class ServiceQuotaExceededException extends __BaseException { - readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; - readonly $fault: "client" = "client"; - code?: string; - /** - *

The ID of the resource.

- */ - resourceId?: string; - - /** - *

The type of the resource.

- */ - resourceType?: string; - - /** - *

Service code.

- */ - serviceCode?: string; - - /** - *

Quota code.

- */ - quotaCode?: string; - - /** - * @internal - */ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ServiceQuotaExceededException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); - this.code = opts.code; - this.resourceId = opts.resourceId; - this.resourceType = opts.resourceType; - this.serviceCode = opts.serviceCode; - this.quotaCode = opts.quotaCode; - } -} - -/** - * @public - *

The request was denied due to request throttling.

- */ -export class ThrottlingException extends __BaseException { - readonly name: "ThrottlingException" = "ThrottlingException"; - readonly $fault: "client" = "client"; - /** - *

Service code.

- */ - serviceCode?: string; - - /** - *

Quota code.

+ *

The ID of the Recovery Instance associated with this Source Server.

*/ - quotaCode?: string; + recoveryInstanceId?: string; /** - *

The number of seconds after which the request should be safe to retry.

+ *

The status of the last recovery launch of this Source Server.

*/ - retryAfterSeconds?: string; + lastLaunchResult?: LastLaunchResult | string; /** - * @internal + *

The Data Replication Info of the Source Server.

*/ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ThrottlingException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ThrottlingException.prototype); - this.serviceCode = opts.serviceCode; - this.quotaCode = opts.quotaCode; - this.retryAfterSeconds = opts.retryAfterSeconds; - } -} + dataReplicationInfo?: DataReplicationInfo; -/** - * @public - *

The account performing the request has not been initialized.

- */ -export class UninitializedAccountException extends __BaseException { - readonly name: "UninitializedAccountException" = "UninitializedAccountException"; - readonly $fault: "client" = "client"; - code?: string; /** - * @internal + *

The lifecycle information of this Source Server.

*/ - constructor(opts: __ExceptionOptionType) { - super({ - name: "UninitializedAccountException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, UninitializedAccountException.prototype); - this.code = opts.code; - } -} + lifeCycle?: LifeCycle; -/** - * @public - *

Validate exception field.

- */ -export interface ValidationExceptionField { /** - *

Validate exception field name.

+ *

The source properties of the Source Server.

*/ - name?: string; + sourceProperties?: SourceProperties; /** - *

Validate exception field message.

+ *

The staging area of the source server.

*/ - message?: string; -} + stagingArea?: StagingArea; -/** - * @public - * @enum - */ -export const ValidationExceptionReason = { - CANNOT_PARSE: "cannotParse", - FIELD_VALIDATION_FAILED: "fieldValidationFailed", - OTHER: "other", - UNKNOWN_OPERATION: "unknownOperation", -} as const; + /** + *

Source cloud properties of the Source Server.

+ */ + sourceCloudProperties?: SourceCloudProperties; -/** - * @public - */ -export type ValidationExceptionReason = (typeof ValidationExceptionReason)[keyof typeof ValidationExceptionReason]; + /** + *

Replication direction of the Source Server.

+ */ + replicationDirection?: ReplicationDirection | string; -/** - * @public - *

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

- */ -export class ValidationException extends __BaseException { - readonly name: "ValidationException" = "ValidationException"; - readonly $fault: "client" = "client"; - code?: string; /** - *

Validation exception reason.

+ *

For EC2-originated Source Servers which have been failed over and then failed back, this value will mean the ARN of the Source Server on the opposite replication direction.

*/ - reason?: ValidationExceptionReason | string; + reversedDirectionSourceServerArn?: string; /** - *

A list of fields that failed validation.

+ *

ID of the Source Network which is protecting this Source Server's network.

*/ - fieldList?: ValidationExceptionField[]; + sourceNetworkID?: string; +} +/** + * @public + */ +export interface CreateExtendedSourceServerResponse { /** - * @internal + *

Created extended source server.

*/ - constructor(opts: __ExceptionOptionType) { - super({ - name: "ValidationException", - $fault: "client", - ...opts, - }); - Object.setPrototypeOf(this, ValidationException.prototype); - this.code = opts.code; - this.reason = opts.reason; - this.fieldList = opts.fieldList; - } + sourceServer?: SourceServer; } /** @@ -1046,6 +1256,11 @@ export interface CreateLaunchConfigurationTemplateRequest { *

Licensing.

*/ licensing?: Licensing; + + /** + *

S3 bucket ARN to export Source Network templates.

+ */ + exportBucketArn?: string; } /** @@ -1092,6 +1307,11 @@ export interface LaunchConfigurationTemplate { *

Licensing.

*/ licensing?: Licensing; + + /** + *

S3 bucket ARN to export Source Network templates.

+ */ + exportBucketArn?: string; } /** @@ -1143,6 +1363,7 @@ export type ReplicationConfigurationDefaultLargeStagingDiskType = export const ReplicationConfigurationEbsEncryption = { CUSTOM: "CUSTOM", DEFAULT: "DEFAULT", + NONE: "NONE", } as const; /** @@ -1367,6 +1588,41 @@ export interface ReplicationConfigurationTemplate { autoReplicateNewDisks?: boolean; } +/** + * @public + */ +export interface CreateSourceNetworkRequest { + /** + *

Which VPC ID to protect.

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

Account containing the VPC to protect.

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

Region containing the VPC to protect.

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

A set of tags to be associated with the Source Network resource.

+ */ + tags?: Record; +} + +/** + * @public + */ +export interface CreateSourceNetworkResponse { + /** + *

ID of the created Source Network.

+ */ + sourceNetworkID?: string; +} + /** * @public */ @@ -1422,6 +1678,21 @@ export interface DeleteReplicationConfigurationTemplateRequest { */ export interface DeleteReplicationConfigurationTemplateResponse {} +/** + * @public + */ +export interface DeleteSourceNetworkRequest { + /** + *

ID of the Source Network to delete.

+ */ + sourceNetworkID: string | undefined; +} + +/** + * @public + */ +export interface DeleteSourceNetworkResponse {} + /** * @public */ @@ -1468,15 +1739,25 @@ export const JobLogEvent = { CONVERSION_END: "CONVERSION_END", CONVERSION_FAIL: "CONVERSION_FAIL", CONVERSION_START: "CONVERSION_START", + DEPLOY_NETWORK_CONFIGURATION_END: "DEPLOY_NETWORK_CONFIGURATION_END", + DEPLOY_NETWORK_CONFIGURATION_FAILED: "DEPLOY_NETWORK_CONFIGURATION_FAILED", + DEPLOY_NETWORK_CONFIGURATION_START: "DEPLOY_NETWORK_CONFIGURATION_START", JOB_CANCEL: "JOB_CANCEL", JOB_END: "JOB_END", JOB_START: "JOB_START", LAUNCH_FAILED: "LAUNCH_FAILED", LAUNCH_START: "LAUNCH_START", + NETWORK_RECOVERY_FAIL: "NETWORK_RECOVERY_FAIL", SERVER_SKIPPED: "SERVER_SKIPPED", SNAPSHOT_END: "SNAPSHOT_END", SNAPSHOT_FAIL: "SNAPSHOT_FAIL", SNAPSHOT_START: "SNAPSHOT_START", + UPDATE_LAUNCH_TEMPLATE_END: "UPDATE_LAUNCH_TEMPLATE_END", + UPDATE_LAUNCH_TEMPLATE_FAILED: "UPDATE_LAUNCH_TEMPLATE_FAILED", + UPDATE_LAUNCH_TEMPLATE_START: "UPDATE_LAUNCH_TEMPLATE_START", + UPDATE_NETWORK_CONFIGURATION_END: "UPDATE_NETWORK_CONFIGURATION_END", + UPDATE_NETWORK_CONFIGURATION_FAILED: "UPDATE_NETWORK_CONFIGURATION_FAILED", + UPDATE_NETWORK_CONFIGURATION_START: "UPDATE_NETWORK_CONFIGURATION_START", USING_PREVIOUS_SNAPSHOT: "USING_PREVIOUS_SNAPSHOT", USING_PREVIOUS_SNAPSHOT_FAILED: "USING_PREVIOUS_SNAPSHOT_FAILED", } as const; @@ -1488,230 +1769,175 @@ export type JobLogEvent = (typeof JobLogEvent)[keyof typeof JobLogEvent]; /** * @public - *

Metadata associated with a Job log.

+ *

Properties of Source Network related to a job event.

*/ -export interface JobLogEventData { - /** - *

The ID of a Source Server.

- */ - sourceServerID?: string; - +export interface SourceNetworkData { /** - *

The ID of a conversion server.

+ *

Source Network ID.

*/ - conversionServerID?: string; + sourceNetworkID?: string; /** - *

The ID of a Recovery Instance.

+ *

VPC ID protected by the Source Network.

*/ - targetInstanceID?: string; + sourceVpc?: string; /** - *

A string representing a job error.

+ *

ID of the recovered VPC following Source Network recovery.

*/ - rawError?: string; + targetVpc?: string; /** - *

Properties of a conversion job

+ *

CloudFormation stack name that was deployed for recovering the Source Network.

*/ - conversionProperties?: ConversionProperties; + stackName?: string; } /** * @public - *

A log outputted by a Job.

+ *

Properties of resource related to a job event.

*/ -export interface JobLog { - /** - *

The date and time the log was taken.

- */ - logDateTime?: string; - - /** - *

The event represents the type of a log.

- */ - event?: JobLogEvent | string; - - /** - *

Metadata associated with a Job log.

- */ - eventData?: JobLogEventData; -} +export type EventResourceData = EventResourceData.SourceNetworkDataMember | EventResourceData.$UnknownMember; /** * @public */ -export interface DescribeJobLogItemsResponse { - /** - *

An array of Job log items.

- */ - items?: JobLog[]; - +export namespace EventResourceData { /** - *

The token of the next Job log items to retrieve.

+ *

Source Network properties.

*/ - nextToken?: string; -} + export interface SourceNetworkDataMember { + sourceNetworkData: SourceNetworkData; + $unknown?: never; + } -/** - * @public - *

A set of filters by which to return Jobs.

- */ -export interface DescribeJobsRequestFilters { - /** - *

An array of Job IDs that should be returned. An empty array means all jobs.

- */ - jobIDs?: string[]; + export interface $UnknownMember { + sourceNetworkData?: never; + $unknown: [string, any]; + } - /** - *

The start date in a date range query.

- */ - fromDate?: string; + export interface Visitor { + sourceNetworkData: (value: SourceNetworkData) => T; + _: (name: string, value: any) => T; + } - /** - *

The end date in a date range query.

- */ - toDate?: string; + export const visit = (value: EventResourceData, visitor: Visitor): T => { + if (value.sourceNetworkData !== undefined) return visitor.sourceNetworkData(value.sourceNetworkData); + return visitor._(value.$unknown[0], value.$unknown[1]); + }; } /** * @public + *

Metadata associated with a Job log.

*/ -export interface DescribeJobsRequest { +export interface JobLogEventData { /** - *

A set of filters by which to return Jobs.

+ *

The ID of a Source Server.

*/ - filters?: DescribeJobsRequestFilters; + sourceServerID?: string; /** - *

Maximum number of Jobs to retrieve.

+ *

The ID of a conversion server.

*/ - maxResults?: number; + conversionServerID?: string; /** - *

The token of the next Job to retrieve.

- */ - nextToken?: string; -} - -/** - * @public - * @enum - */ -export const InitiatedBy = { - DIAGNOSTIC: "DIAGNOSTIC", - FAILBACK: "FAILBACK", - START_DRILL: "START_DRILL", - START_RECOVERY: "START_RECOVERY", - TARGET_ACCOUNT: "TARGET_ACCOUNT", - TERMINATE_RECOVERY_INSTANCES: "TERMINATE_RECOVERY_INSTANCES", -} as const; - -/** - * @public - */ -export type InitiatedBy = (typeof InitiatedBy)[keyof typeof InitiatedBy]; - -/** - * @public - *

Represents a server participating in an asynchronous Job.

- */ -export interface ParticipatingServer { + *

The ID of a Recovery Instance.

+ */ + targetInstanceID?: string; + /** - *

The Source Server ID of a participating server.

+ *

A string representing a job error.

*/ - sourceServerID?: string; + rawError?: string; /** - *

The Recovery Instance ID of a participating server.

+ *

Properties of a conversion job

*/ - recoveryInstanceID?: string; + conversionProperties?: ConversionProperties; /** - *

The launch status of a participating server.

+ *

Properties of resource related to a job event.

*/ - launchStatus?: LaunchStatus | string; + eventResourceData?: EventResourceData; } /** * @public - * @enum - */ -export const JobStatus = { - COMPLETED: "COMPLETED", - PENDING: "PENDING", - STARTED: "STARTED", -} as const; - -/** - * @public + *

A log outputted by a Job.

*/ -export type JobStatus = (typeof JobStatus)[keyof typeof JobStatus]; +export interface JobLog { + /** + *

The date and time the log was taken.

+ */ + logDateTime?: string; -/** - * @public - * @enum - */ -export const JobType = { - CREATE_CONVERTED_SNAPSHOT: "CREATE_CONVERTED_SNAPSHOT", - LAUNCH: "LAUNCH", - TERMINATE: "TERMINATE", -} as const; + /** + *

The event represents the type of a log.

+ */ + event?: JobLogEvent | string; -/** - * @public - */ -export type JobType = (typeof JobType)[keyof typeof JobType]; + /** + *

Metadata associated with a Job log.

+ */ + eventData?: JobLogEventData; +} /** * @public - *

A job is an asynchronous workflow.

*/ -export interface Job { - /** - *

The ID of the Job.

- */ - jobID: string | undefined; - +export interface DescribeJobLogItemsResponse { /** - *

The ARN of a Job.

+ *

An array of Job log items.

*/ - arn?: string; + items?: JobLog[]; /** - *

The type of the Job.

+ *

The token of the next Job log items to retrieve.

*/ - type?: JobType | string; + nextToken?: string; +} +/** + * @public + *

A set of filters by which to return Jobs.

+ */ +export interface DescribeJobsRequestFilters { /** - *

A string representing who initiated the Job.

+ *

An array of Job IDs that should be returned. An empty array means all jobs.

*/ - initiatedBy?: InitiatedBy | string; + jobIDs?: string[]; /** - *

The date and time of when the Job was created.

+ *

The start date in a date range query.

*/ - creationDateTime?: string; + fromDate?: string; /** - *

The date and time of when the Job ended.

+ *

The end date in a date range query.

*/ - endDateTime?: string; + toDate?: string; +} +/** + * @public + */ +export interface DescribeJobsRequest { /** - *

The status of the Job.

+ *

A set of filters by which to return Jobs.

*/ - status?: JobStatus | string; + filters?: DescribeJobsRequestFilters; /** - *

A list of servers that the Job is acting upon.

+ *

Maximum number of Jobs to retrieve.

*/ - participatingServers?: ParticipatingServer[]; + maxResults?: number; /** - *

A list of tags associated with the Job.

+ *

The token of the next Job to retrieve.

*/ - tags?: Record; + nextToken?: string; } /** @@ -2279,168 +2505,345 @@ export interface RecoveryInstance { isDrill?: boolean; /** - *

Environment (On Premises / AWS) of the instance that the recovery instance originated from.

+ *

Environment (On Premises / AWS) of the instance that the recovery instance originated from.

+ */ + originEnvironment?: OriginEnvironment | string; + + /** + *

AWS availability zone associated with the recovery instance.

+ */ + originAvailabilityZone?: string; +} + +/** + * @public + */ +export interface DescribeRecoveryInstancesResponse { + /** + *

The token of the next Recovery Instance to retrieve.

+ */ + nextToken?: string; + + /** + *

An array of Recovery Instances.

+ */ + items?: RecoveryInstance[]; +} + +/** + * @public + *

A set of filters by which to return Recovery Snapshots.

+ */ +export interface DescribeRecoverySnapshotsRequestFilters { + /** + *

The start date in a date range query.

+ */ + fromDateTime?: string; + + /** + *

The end date in a date range query.

+ */ + toDateTime?: string; +} + +/** + * @public + * @enum + */ +export const RecoverySnapshotsOrder = { + ASC: "ASC", + DESC: "DESC", +} as const; + +/** + * @public + */ +export type RecoverySnapshotsOrder = (typeof RecoverySnapshotsOrder)[keyof typeof RecoverySnapshotsOrder]; + +/** + * @public + */ +export interface DescribeRecoverySnapshotsRequest { + /** + *

Filter Recovery Snapshots by Source Server ID.

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

A set of filters by which to return Recovery Snapshots.

+ */ + filters?: DescribeRecoverySnapshotsRequestFilters; + + /** + *

The sorted ordering by which to return Recovery Snapshots.

+ */ + order?: RecoverySnapshotsOrder | string; + + /** + *

Maximum number of Recovery Snapshots to retrieve.

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

The token of the next Recovery Snapshot to retrieve.

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

A snapshot of a Source Server used during recovery.

+ */ +export interface RecoverySnapshot { + /** + *

The ID of the Recovery Snapshot.

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

The ID of the Source Server that the snapshot was taken for.

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

The timestamp of when we expect the snapshot to be taken.

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

The actual timestamp that the snapshot was taken.

+ */ + timestamp?: string; + + /** + *

A list of EBS snapshots.

+ */ + ebsSnapshots?: string[]; +} + +/** + * @public + */ +export interface DescribeRecoverySnapshotsResponse { + /** + *

An array of Recovery Snapshots.

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

The token of the next Recovery Snapshot to retrieve.

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

The IDs of the Replication Configuration Templates to retrieve. An empty list means all Replication Configuration Templates.

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

Maximum number of Replication Configuration Templates to retrieve.

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

The token of the next Replication Configuration Template to retrieve.

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

An array of Replication Configuration Templates.

*/ - originEnvironment?: OriginEnvironment | string; + items?: ReplicationConfigurationTemplate[]; /** - *

AWS availability zone associated with the recovery instance.

+ *

The token of the next Replication Configuration Template to retrieve.

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

A set of filters by which to return Source Networks.

*/ -export interface DescribeRecoveryInstancesResponse { +export interface DescribeSourceNetworksRequestFilters { /** - *

The token of the next Recovery Instance to retrieve.

+ *

An array of Source Network IDs that should be returned. An empty array means all Source Networks.

*/ - nextToken?: string; + sourceNetworkIDs?: string[]; /** - *

An array of Recovery Instances.

+ *

Filter Source Networks by account ID containing the protected VPCs.

*/ - items?: RecoveryInstance[]; + originAccountID?: string; + + /** + *

Filter Source Networks by the region containing the protected VPCs.

+ */ + originRegion?: string; } /** * @public - *

A set of filters by which to return Recovery Snapshots.

*/ -export interface DescribeRecoverySnapshotsRequestFilters { +export interface DescribeSourceNetworksRequest { /** - *

The start date in a date range query.

+ *

A set of filters by which to return Source Networks.

*/ - fromDateTime?: string; + filters?: DescribeSourceNetworksRequestFilters; /** - *

The end date in a date range query.

+ *

Maximum number of Source Networks to retrieve.

*/ - toDateTime?: string; + maxResults?: number; + + /** + *

The token of the next Source Networks to retrieve.

+ */ + nextToken?: string; } /** * @public * @enum */ -export const RecoverySnapshotsOrder = { - ASC: "ASC", - DESC: "DESC", +export const RecoveryResult = { + ASSOCIATE_FAIL: "ASSOCIATE_FAIL", + ASSOCIATE_SUCCESS: "ASSOCIATE_SUCCESS", + FAIL: "FAIL", + IN_PROGRESS: "IN_PROGRESS", + NOT_STARTED: "NOT_STARTED", + PARTIAL_SUCCESS: "PARTIAL_SUCCESS", + SUCCESS: "SUCCESS", } as const; /** * @public */ -export type RecoverySnapshotsOrder = (typeof RecoverySnapshotsOrder)[keyof typeof RecoverySnapshotsOrder]; +export type RecoveryResult = (typeof RecoveryResult)[keyof typeof RecoveryResult]; /** * @public + *

An object representing the Source Network recovery Lifecycle.

*/ -export interface DescribeRecoverySnapshotsRequest { +export interface RecoveryLifeCycle { /** - *

Filter Recovery Snapshots by Source Server ID.

+ *

The date and time the last Source Network recovery was initiated.

*/ - sourceServerID: string | undefined; + apiCallDateTime?: Date; /** - *

A set of filters by which to return Recovery Snapshots.

+ *

The ID of the Job that was used to last recover the Source Network.

*/ - filters?: DescribeRecoverySnapshotsRequestFilters; + jobID?: string; /** - *

The sorted ordering by which to return Recovery Snapshots.

+ *

The status of the last recovery status of this Source Network.

*/ - order?: RecoverySnapshotsOrder | string; + lastRecoveryResult?: RecoveryResult | string; +} - /** - *

Maximum number of Recovery Snapshots to retrieve.

- */ - maxResults?: number; +/** + * @public + * @enum + */ +export const ReplicationStatus = { + ERROR: "ERROR", + IN_PROGRESS: "IN_PROGRESS", + PROTECTED: "PROTECTED", + STOPPED: "STOPPED", +} as const; - /** - *

The token of the next Recovery Snapshot to retrieve.

- */ - nextToken?: string; -} +/** + * @public + */ +export type ReplicationStatus = (typeof ReplicationStatus)[keyof typeof ReplicationStatus]; /** * @public - *

A snapshot of a Source Server used during recovery.

+ *

The ARN of the Source Network.

*/ -export interface RecoverySnapshot { +export interface SourceNetwork { /** - *

The ID of the Recovery Snapshot.

+ *

Source Network ID.

*/ - snapshotID: string | undefined; + sourceNetworkID?: string; /** - *

The ID of the Source Server that the snapshot was taken for.

+ *

VPC ID protected by the Source Network.

*/ - sourceServerID: string | undefined; + sourceVpcID?: string; /** - *

The timestamp of when we expect the snapshot to be taken.

+ *

The ARN of the Source Network.

*/ - expectedTimestamp: string | undefined; + arn?: string; /** - *

The actual timestamp that the snapshot was taken.

+ *

A list of tags associated with the Source Network.

*/ - timestamp?: string; + tags?: Record; /** - *

A list of EBS snapshots.

+ *

Status of Source Network Replication. Possible values: + * (a) STOPPED - Source Network is not replicating. + * (b) IN_PROGRESS - Source Network is being replicated. + * (c) PROTECTED - Source Network was replicated successfully and is being synchronized for changes. + * (d) ERROR - Source Network replication has failed

*/ - ebsSnapshots?: string[]; -} + replicationStatus?: ReplicationStatus | string; -/** - * @public - */ -export interface DescribeRecoverySnapshotsResponse { /** - *

An array of Recovery Snapshots.

+ *

Error details in case Source Network replication status is ERROR.

*/ - items?: RecoverySnapshot[]; + replicationStatusDetails?: string; /** - *

The token of the next Recovery Snapshot to retrieve.

+ *

CloudFormation stack name that was deployed for recovering the Source Network.

*/ - nextToken?: string; -} + cfnStackName?: string; -/** - * @public - */ -export interface DescribeReplicationConfigurationTemplatesRequest { /** - *

The IDs of the Replication Configuration Templates to retrieve. An empty list means all Replication Configuration Templates.

+ *

Region containing the VPC protected by the Source Network.

*/ - replicationConfigurationTemplateIDs?: string[]; + sourceRegion?: string; /** - *

Maximum number of Replication Configuration Templates to retrieve.

+ *

Account ID containing the VPC protected by the Source Network.

*/ - maxResults?: number; + sourceAccountID?: string; /** - *

The token of the next Replication Configuration Template to retrieve.

+ *

An object containing information regarding the last recovery of the Source Network.

*/ - nextToken?: string; + lastRecovery?: RecoveryLifeCycle; + + /** + *

ID of the recovered VPC following Source Network recovery.

+ */ + launchedVpcID?: string; } /** * @public */ -export interface DescribeReplicationConfigurationTemplatesResponse { +export interface DescribeSourceNetworksResponse { /** - *

An array of Replication Configuration Templates.

+ *

An array of Source Networks.

*/ - items?: ReplicationConfigurationTemplate[]; + items?: SourceNetwork[]; /** - *

The token of the next Replication Configuration Template to retrieve.

+ *

The token of the next Source Networks to retrieve.

*/ nextToken?: string; } @@ -2564,6 +2967,11 @@ export interface UpdateLaunchConfigurationTemplateRequest { *

Licensing.

*/ licensing?: Licensing; + + /** + *

S3 bucket ARN to export Source Network templates.

+ */ + exportBucketArn?: string; } /** @@ -2902,6 +3310,112 @@ export interface UpdateReplicationConfigurationTemplateRequest { autoReplicateNewDisks?: boolean; } +/** + * @public + */ +export interface ExportSourceNetworkCfnTemplateRequest { + /** + *

The Source Network ID to export its CloudFormation template to an S3 bucket.

+ */ + sourceNetworkID: string | undefined; +} + +/** + * @public + */ +export interface ExportSourceNetworkCfnTemplateResponse { + /** + *

S3 bucket URL where the Source Network CloudFormation template was exported to.

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

An object representing the Source Network to recover.

+ */ +export interface StartSourceNetworkRecoveryRequestNetworkEntry { + /** + *

The ID of the Source Network you want to recover.

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

CloudFormation stack name to be used for recovering the network.

+ */ + cfnStackName?: string; +} + +/** + * @public + */ +export interface StartSourceNetworkRecoveryRequest { + /** + *

The Source Networks that we want to start a Recovery Job for.

+ */ + sourceNetworks: StartSourceNetworkRecoveryRequestNetworkEntry[] | undefined; + + /** + *

Don't update existing CloudFormation Stack, recover the network using a new stack.

+ */ + deployAsNew?: boolean; + + /** + *

The tags to be associated with the Source Network recovery Job.

+ */ + tags?: Record; +} + +/** + * @public + */ +export interface StartSourceNetworkRecoveryResponse { + /** + *

The Source Network recovery Job.

+ */ + job?: Job; +} + +/** + * @public + */ +export interface StartSourceNetworkReplicationRequest { + /** + *

ID of the Source Network to replicate.

+ */ + sourceNetworkID: string | undefined; +} + +/** + * @public + */ +export interface StartSourceNetworkReplicationResponse { + /** + *

Source Network which was requested for replication.

+ */ + sourceNetwork?: SourceNetwork; +} + +/** + * @public + */ +export interface StopSourceNetworkReplicationRequest { + /** + *

ID of the Source Network to stop replication.

+ */ + sourceNetworkID: string | undefined; +} + +/** + * @public + */ +export interface StopSourceNetworkReplicationResponse { + /** + *

Source Network which was requested to stop replication.

+ */ + sourceNetwork?: SourceNetwork; +} + /** * @public */ @@ -3369,6 +3883,33 @@ export interface UntagResourceRequest { tagKeys: string[] | undefined; } +/** + * @internal + */ +export const AssociateSourceNetworkStackRequestFilterSensitiveLog = (obj: AssociateSourceNetworkStackRequest): any => ({ + ...obj, + ...(obj.cfnStackName && { cfnStackName: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const JobFilterSensitiveLog = (obj: Job): any => ({ + ...obj, + ...(obj.tags && { tags: SENSITIVE_STRING }), + ...(obj.participatingResources && { participatingResources: obj.participatingResources.map((item) => item) }), +}); + +/** + * @internal + */ +export const AssociateSourceNetworkStackResponseFilterSensitiveLog = ( + obj: AssociateSourceNetworkStackResponse +): any => ({ + ...obj, + ...(obj.job && { job: JobFilterSensitiveLog(obj.job) }), +}); + /** * @internal */ @@ -3446,7 +3987,7 @@ export const ReplicationConfigurationTemplateFilterSensitiveLog = (obj: Replicat /** * @internal */ -export const JobFilterSensitiveLog = (obj: Job): any => ({ +export const CreateSourceNetworkRequestFilterSensitiveLog = (obj: CreateSourceNetworkRequest): any => ({ ...obj, ...(obj.tags && { tags: SENSITIVE_STRING }), }); @@ -3495,6 +4036,24 @@ export const DescribeReplicationConfigurationTemplatesResponseFilterSensitiveLog ...(obj.items && { items: obj.items.map((item) => ReplicationConfigurationTemplateFilterSensitiveLog(item)) }), }); +/** + * @internal + */ +export const SourceNetworkFilterSensitiveLog = (obj: SourceNetwork): any => ({ + ...obj, + ...(obj.tags && { tags: SENSITIVE_STRING }), + ...(obj.replicationStatusDetails && { replicationStatusDetails: SENSITIVE_STRING }), + ...(obj.cfnStackName && { cfnStackName: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const DescribeSourceNetworksResponseFilterSensitiveLog = (obj: DescribeSourceNetworksResponse): any => ({ + ...obj, + ...(obj.items && { items: obj.items.map((item) => SourceNetworkFilterSensitiveLog(item)) }), +}); + /** * @internal */ @@ -3575,6 +4134,57 @@ export const UpdateReplicationConfigurationTemplateRequestFilterSensitiveLog = ( ...(obj.stagingAreaTags && { stagingAreaTags: SENSITIVE_STRING }), }); +/** + * @internal + */ +export const StartSourceNetworkRecoveryRequestNetworkEntryFilterSensitiveLog = ( + obj: StartSourceNetworkRecoveryRequestNetworkEntry +): any => ({ + ...obj, + ...(obj.cfnStackName && { cfnStackName: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const StartSourceNetworkRecoveryRequestFilterSensitiveLog = (obj: StartSourceNetworkRecoveryRequest): any => ({ + ...obj, + ...(obj.sourceNetworks && { + sourceNetworks: obj.sourceNetworks.map((item) => + StartSourceNetworkRecoveryRequestNetworkEntryFilterSensitiveLog(item) + ), + }), + ...(obj.tags && { tags: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const StartSourceNetworkRecoveryResponseFilterSensitiveLog = (obj: StartSourceNetworkRecoveryResponse): any => ({ + ...obj, + ...(obj.job && { job: JobFilterSensitiveLog(obj.job) }), +}); + +/** + * @internal + */ +export const StartSourceNetworkReplicationResponseFilterSensitiveLog = ( + obj: StartSourceNetworkReplicationResponse +): any => ({ + ...obj, + ...(obj.sourceNetwork && { sourceNetwork: SourceNetworkFilterSensitiveLog(obj.sourceNetwork) }), +}); + +/** + * @internal + */ +export const StopSourceNetworkReplicationResponseFilterSensitiveLog = ( + obj: StopSourceNetworkReplicationResponse +): any => ({ + ...obj, + ...(obj.sourceNetwork && { sourceNetwork: SourceNetworkFilterSensitiveLog(obj.sourceNetwork) }), +}); + /** * @internal */ diff --git a/clients/client-drs/src/pagination/DescribeSourceNetworksPaginator.ts b/clients/client-drs/src/pagination/DescribeSourceNetworksPaginator.ts new file mode 100644 index 000000000000..aa4860f396ec --- /dev/null +++ b/clients/client-drs/src/pagination/DescribeSourceNetworksPaginator.ts @@ -0,0 +1,50 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + DescribeSourceNetworksCommand, + DescribeSourceNetworksCommandInput, + DescribeSourceNetworksCommandOutput, +} from "../commands/DescribeSourceNetworksCommand"; +import { DrsClient } from "../DrsClient"; +import { DrsPaginationConfiguration } from "./Interfaces"; + +/** + * @internal + */ +const makePagedClientRequest = async ( + client: DrsClient, + input: DescribeSourceNetworksCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new DescribeSourceNetworksCommand(input), ...args); +}; +/** + * @public + */ +export async function* paginateDescribeSourceNetworks( + config: DrsPaginationConfiguration, + input: DescribeSourceNetworksCommandInput, + ...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: DescribeSourceNetworksCommandOutput; + 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 c04b7c0f336b..12110d966dd4 100644 --- a/clients/client-drs/src/pagination/index.ts +++ b/clients/client-drs/src/pagination/index.ts @@ -10,6 +10,8 @@ export * from "./DescribeRecoverySnapshotsPaginator"; export * from "./DescribeReplicationConfigurationTemplatesPaginator"; +export * from "./DescribeSourceNetworksPaginator"; + export * from "./DescribeSourceServersPaginator"; // smithy-typescript generated code export * from "./Interfaces"; diff --git a/clients/client-drs/src/protocols/Aws_restJson1.ts b/clients/client-drs/src/protocols/Aws_restJson1.ts index d2de9de48266..11bce6a208f2 100644 --- a/clients/client-drs/src/protocols/Aws_restJson1.ts +++ b/clients/client-drs/src/protocols/Aws_restJson1.ts @@ -9,6 +9,7 @@ import { expectString as __expectString, extendedEncodeURIComponent as __extendedEncodeURIComponent, map, + parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, strictParseLong as __strictParseLong, take, @@ -18,6 +19,10 @@ import { ResponseMetadata as __ResponseMetadata } from "@aws-sdk/types"; import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http"; import { Endpoint as __Endpoint, SerdeContext as __SerdeContext } from "@smithy/types"; +import { + AssociateSourceNetworkStackCommandInput, + AssociateSourceNetworkStackCommandOutput, +} from "../commands/AssociateSourceNetworkStackCommand"; import { CreateExtendedSourceServerCommandInput, CreateExtendedSourceServerCommandOutput, @@ -30,6 +35,10 @@ import { CreateReplicationConfigurationTemplateCommandInput, CreateReplicationConfigurationTemplateCommandOutput, } from "../commands/CreateReplicationConfigurationTemplateCommand"; +import { + CreateSourceNetworkCommandInput, + CreateSourceNetworkCommandOutput, +} from "../commands/CreateSourceNetworkCommand"; import { DeleteJobCommandInput, DeleteJobCommandOutput } from "../commands/DeleteJobCommand"; import { DeleteLaunchConfigurationTemplateCommandInput, @@ -43,6 +52,10 @@ import { DeleteReplicationConfigurationTemplateCommandInput, DeleteReplicationConfigurationTemplateCommandOutput, } from "../commands/DeleteReplicationConfigurationTemplateCommand"; +import { + DeleteSourceNetworkCommandInput, + DeleteSourceNetworkCommandOutput, +} from "../commands/DeleteSourceNetworkCommand"; import { DeleteSourceServerCommandInput, DeleteSourceServerCommandOutput } from "../commands/DeleteSourceServerCommand"; import { DescribeJobLogItemsCommandInput, @@ -65,6 +78,10 @@ import { DescribeReplicationConfigurationTemplatesCommandInput, DescribeReplicationConfigurationTemplatesCommandOutput, } from "../commands/DescribeReplicationConfigurationTemplatesCommand"; +import { + DescribeSourceNetworksCommandInput, + DescribeSourceNetworksCommandOutput, +} from "../commands/DescribeSourceNetworksCommand"; import { DescribeSourceServersCommandInput, DescribeSourceServersCommandOutput, @@ -77,6 +94,10 @@ import { DisconnectSourceServerCommandInput, DisconnectSourceServerCommandOutput, } from "../commands/DisconnectSourceServerCommand"; +import { + ExportSourceNetworkCfnTemplateCommandInput, + ExportSourceNetworkCfnTemplateCommandOutput, +} from "../commands/ExportSourceNetworkCfnTemplateCommand"; import { GetFailbackReplicationConfigurationCommandInput, GetFailbackReplicationConfigurationCommandOutput, @@ -113,8 +134,20 @@ import { } from "../commands/StartFailbackLaunchCommand"; import { StartRecoveryCommandInput, StartRecoveryCommandOutput } from "../commands/StartRecoveryCommand"; import { StartReplicationCommandInput, StartReplicationCommandOutput } from "../commands/StartReplicationCommand"; +import { + StartSourceNetworkRecoveryCommandInput, + StartSourceNetworkRecoveryCommandOutput, +} from "../commands/StartSourceNetworkRecoveryCommand"; +import { + StartSourceNetworkReplicationCommandInput, + StartSourceNetworkReplicationCommandOutput, +} from "../commands/StartSourceNetworkReplicationCommand"; import { StopFailbackCommandInput, StopFailbackCommandOutput } from "../commands/StopFailbackCommand"; import { StopReplicationCommandInput, StopReplicationCommandOutput } from "../commands/StopReplicationCommand"; +import { + StopSourceNetworkReplicationCommandInput, + StopSourceNetworkReplicationCommandOutput, +} from "../commands/StopSourceNetworkReplicationCommand"; import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; import { TerminateRecoveryInstancesCommandInput, @@ -148,19 +181,54 @@ import { DescribeJobsRequestFilters, DescribeRecoveryInstancesRequestFilters, DescribeRecoverySnapshotsRequestFilters, + DescribeSourceNetworksRequestFilters, DescribeSourceServersRequestFilters, InternalServerException, Licensing, PITPolicyRule, + RecoveryLifeCycle, ReplicationConfigurationReplicatedDisk, ResourceNotFoundException, ServiceQuotaExceededException, + SourceNetwork, StartRecoveryRequestSourceServer, + StartSourceNetworkRecoveryRequestNetworkEntry, ThrottlingException, UninitializedAccountException, ValidationException, } from "../models/models_0"; +/** + * serializeAws_restJson1AssociateSourceNetworkStackCommand + */ +export const se_AssociateSourceNetworkStackCommand = async ( + input: AssociateSourceNetworkStackCommandInput, + 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 || ""}` + "/AssociateSourceNetworkStack"; + let body: any; + body = JSON.stringify( + take(input, { + cfnStackName: [], + sourceNetworkID: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1CreateExtendedSourceServerCommand */ @@ -210,6 +278,7 @@ export const se_CreateLaunchConfigurationTemplateCommand = async ( take(input, { copyPrivateIp: [], copyTags: [], + exportBucketArn: [], launchDisposition: [], licensing: (_) => _json(_), tags: (_) => _json(_), @@ -271,6 +340,38 @@ export const se_CreateReplicationConfigurationTemplateCommand = async ( }); }; +/** + * serializeAws_restJson1CreateSourceNetworkCommand + */ +export const se_CreateSourceNetworkCommand = async ( + input: CreateSourceNetworkCommandInput, + 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 || ""}` + "/CreateSourceNetwork"; + let body: any; + body = JSON.stringify( + take(input, { + originAccountID: [], + originRegion: [], + tags: (_) => _json(_), + vpcID: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1DeleteJobCommand */ @@ -390,6 +491,35 @@ export const se_DeleteReplicationConfigurationTemplateCommand = async ( }); }; +/** + * serializeAws_restJson1DeleteSourceNetworkCommand + */ +export const se_DeleteSourceNetworkCommand = async ( + input: DeleteSourceNetworkCommandInput, + 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 || ""}` + "/DeleteSourceNetwork"; + let body: any; + body = JSON.stringify( + take(input, { + sourceNetworkID: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1DeleteSourceServerCommand */ @@ -612,6 +742,38 @@ export const se_DescribeReplicationConfigurationTemplatesCommand = async ( }); }; +/** + * serializeAws_restJson1DescribeSourceNetworksCommand + */ +export const se_DescribeSourceNetworksCommand = async ( + input: DescribeSourceNetworksCommandInput, + 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 || ""}` + "/DescribeSourceNetworks"; + let body: any; + body = JSON.stringify( + take(input, { + filters: (_) => _json(_), + maxResults: [], + nextToken: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1DescribeSourceServersCommand */ @@ -703,6 +865,36 @@ export const se_DisconnectSourceServerCommand = async ( }); }; +/** + * serializeAws_restJson1ExportSourceNetworkCfnTemplateCommand + */ +export const se_ExportSourceNetworkCfnTemplateCommand = async ( + input: ExportSourceNetworkCfnTemplateCommandInput, + 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 || ""}` + "/ExportSourceNetworkCfnTemplate"; + let body: any; + body = JSON.stringify( + take(input, { + sourceNetworkID: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1GetFailbackReplicationConfigurationCommand */ @@ -1048,6 +1240,68 @@ export const se_StartReplicationCommand = async ( }); }; +/** + * serializeAws_restJson1StartSourceNetworkRecoveryCommand + */ +export const se_StartSourceNetworkRecoveryCommand = async ( + input: StartSourceNetworkRecoveryCommandInput, + 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 || ""}` + "/StartSourceNetworkRecovery"; + let body: any; + body = JSON.stringify( + take(input, { + deployAsNew: [], + sourceNetworks: (_) => _json(_), + tags: (_) => _json(_), + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + +/** + * serializeAws_restJson1StartSourceNetworkReplicationCommand + */ +export const se_StartSourceNetworkReplicationCommand = async ( + input: StartSourceNetworkReplicationCommandInput, + 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 || ""}` + "/StartSourceNetworkReplication"; + let body: any; + body = JSON.stringify( + take(input, { + sourceNetworkID: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1StopFailbackCommand */ @@ -1106,6 +1360,36 @@ export const se_StopReplicationCommand = async ( }); }; +/** + * serializeAws_restJson1StopSourceNetworkReplicationCommand + */ +export const se_StopSourceNetworkReplicationCommand = async ( + input: StopSourceNetworkReplicationCommandInput, + 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 || ""}` + "/StopSourceNetworkReplication"; + let body: any; + body = JSON.stringify( + take(input, { + sourceNetworkID: [], + }) + ); + return new __HttpRequest({ + protocol, + hostname, + port, + method: "POST", + headers, + path: resolvedPath, + body, + }); +}; + /** * serializeAws_restJson1TagResourceCommand */ @@ -1283,6 +1567,7 @@ export const se_UpdateLaunchConfigurationTemplateCommand = async ( take(input, { copyPrivateIp: [], copyTags: [], + exportBucketArn: [], launchConfigurationTemplateID: [], launchDisposition: [], licensing: (_) => _json(_), @@ -1391,6 +1676,71 @@ export const se_UpdateReplicationConfigurationTemplateCommand = async ( }); }; +/** + * deserializeAws_restJson1AssociateSourceNetworkStackCommand + */ +export const de_AssociateSourceNetworkStackCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_AssociateSourceNetworkStackCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + job: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1AssociateSourceNetworkStackCommandError + */ +const de_AssociateSourceNetworkStackCommandError = 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 "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_restJson1CreateExtendedSourceServerCommand */ @@ -1596,6 +1946,71 @@ const de_CreateReplicationConfigurationTemplateCommandError = async ( } }; +/** + * deserializeAws_restJson1CreateSourceNetworkCommand + */ +export const de_CreateSourceNetworkCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 201 && output.statusCode >= 300) { + return de_CreateSourceNetworkCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + sourceNetworkID: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1CreateSourceNetworkCommandError + */ +const de_CreateSourceNetworkCommandError = 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 "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_restJson1DeleteJobCommand */ @@ -1816,6 +2231,61 @@ const de_DeleteReplicationConfigurationTemplateCommandError = async ( } }; +/** + * deserializeAws_restJson1DeleteSourceNetworkCommand + */ +export const de_DeleteSourceNetworkCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 204 && output.statusCode >= 300) { + return de_DeleteSourceNetworkCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + await collectBody(output.body, context); + return contents; +}; + +/** + * deserializeAws_restJson1DeleteSourceNetworkCommandError + */ +const de_DeleteSourceNetworkCommandError = 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_restJson1DeleteSourceServerCommand */ @@ -2130,19 +2600,79 @@ export const de_DescribeRecoverySnapshotsCommand = async ( const de_DescribeRecoverySnapshotsCommandError = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): 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 "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_restJson1DescribeReplicationConfigurationTemplatesCommand + */ +export const de_DescribeReplicationConfigurationTemplatesCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_DescribeReplicationConfigurationTemplatesCommandError(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_restJson1DescribeReplicationConfigurationTemplatesCommandError + */ +const de_DescribeReplicationConfigurationTemplatesCommandError = 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); @@ -2163,21 +2693,21 @@ const de_DescribeRecoverySnapshotsCommandError = async ( }; /** - * deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommand + * deserializeAws_restJson1DescribeSourceNetworksCommand */ -export const de_DescribeReplicationConfigurationTemplatesCommand = async ( +export const de_DescribeSourceNetworksCommand = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { if (output.statusCode !== 200 && output.statusCode >= 300) { - return de_DescribeReplicationConfigurationTemplatesCommandError(output, context); + return de_DescribeSourceNetworksCommandError(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, + items: (_) => de_SourceNetworksList(_, context), nextToken: __expectString, }); Object.assign(contents, doc); @@ -2185,12 +2715,12 @@ export const de_DescribeReplicationConfigurationTemplatesCommand = async ( }; /** - * deserializeAws_restJson1DescribeReplicationConfigurationTemplatesCommandError + * deserializeAws_restJson1DescribeSourceNetworksCommandError */ -const de_DescribeReplicationConfigurationTemplatesCommandError = async ( +const de_DescribeSourceNetworksCommandError = async ( output: __HttpResponse, context: __SerdeContext -): Promise => { +): Promise => { const parsedOutput: any = { ...output, body: await parseErrorBody(output.body, context), @@ -2200,9 +2730,6 @@ const de_DescribeReplicationConfigurationTemplatesCommandError = async ( 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); @@ -2360,6 +2887,7 @@ export const de_DisconnectSourceServerCommand = async ( replicationDirection: __expectString, reversedDirectionSourceServerArn: __expectString, sourceCloudProperties: _json, + sourceNetworkID: __expectString, sourceProperties: _json, sourceServerID: __expectString, stagingArea: _json, @@ -2407,6 +2935,68 @@ const de_DisconnectSourceServerCommandError = async ( } }; +/** + * deserializeAws_restJson1ExportSourceNetworkCfnTemplateCommand + */ +export const de_ExportSourceNetworkCfnTemplateCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_ExportSourceNetworkCfnTemplateCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + s3DestinationUrl: __expectString, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1ExportSourceNetworkCfnTemplateCommandError + */ +const de_ExportSourceNetworkCfnTemplateCommandError = 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); + case "ValidationException": + case "com.amazonaws.drs#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1GetFailbackReplicationConfigurationCommand */ @@ -2858,6 +3448,7 @@ export const de_RetryDataReplicationCommand = async ( replicationDirection: __expectString, reversedDirectionSourceServerArn: __expectString, sourceCloudProperties: _json, + sourceNetworkID: __expectString, sourceProperties: _json, sourceServerID: __expectString, stagingArea: _json, @@ -3150,6 +3741,127 @@ const de_StartReplicationCommandError = async ( } }; +/** + * deserializeAws_restJson1StartSourceNetworkRecoveryCommand + */ +export const de_StartSourceNetworkRecoveryCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 202 && output.statusCode >= 300) { + return de_StartSourceNetworkRecoveryCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + job: _json, + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1StartSourceNetworkRecoveryCommandError + */ +const de_StartSourceNetworkRecoveryCommandError = 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 "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_restJson1StartSourceNetworkReplicationCommand + */ +export const de_StartSourceNetworkReplicationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_StartSourceNetworkReplicationCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + sourceNetwork: (_) => de_SourceNetwork(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1StartSourceNetworkReplicationCommandError + */ +const de_StartSourceNetworkReplicationCommandError = 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_restJson1StopFailbackCommand */ @@ -3261,6 +3973,68 @@ const de_StopReplicationCommandError = async ( } }; +/** + * deserializeAws_restJson1StopSourceNetworkReplicationCommand + */ +export const de_StopSourceNetworkReplicationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode !== 200 && output.statusCode >= 300) { + return de_StopSourceNetworkReplicationCommandError(output, context); + } + const contents: any = map({ + $metadata: deserializeMetadata(output), + }); + const data: Record = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body"); + const doc = take(data, { + sourceNetwork: (_) => de_SourceNetwork(_, context), + }); + Object.assign(contents, doc); + return contents; +}; + +/** + * deserializeAws_restJson1StopSourceNetworkReplicationCommandError + */ +const de_StopSourceNetworkReplicationCommandError = 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); + case "ValidationException": + case "com.amazonaws.drs#ValidationException": + throw await de_ValidationExceptionRes(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + return throwDefaultError({ + output, + parsedBody, + errorCode, + }); + } +}; + /** * deserializeAws_restJson1TagResourceCommand */ @@ -3962,6 +4736,10 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_DescribeRecoverySnapshotsRequestFilters omitted. +// se_DescribeSourceNetworksRequestFilters omitted. + +// se_DescribeSourceNetworksRequestFiltersIDs omitted. + // se_DescribeSourceServersRequestFilters omitted. // se_DescribeSourceServersRequestFiltersIDs omitted. @@ -3994,6 +4772,10 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // se_StartRecoveryRequestSourceServers omitted. +// se_StartSourceNetworkRecoveryRequestNetworkEntries omitted. + +// se_StartSourceNetworkRecoveryRequestNetworkEntry omitted. + // se_TagsMap omitted. // de_Account omitted. @@ -4030,6 +4812,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // de_EbsSnapshotsList omitted. +// de_EventResourceData omitted. + // de_IdentificationHints omitted. // de_IPsList omitted. @@ -4062,6 +4846,12 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // de_OS omitted. +// de_ParticipatingResource omitted. + +// de_ParticipatingResourceID omitted. + +// de_ParticipatingResources omitted. + // de_ParticipatingServer omitted. // de_ParticipatingServers omitted. @@ -4094,6 +4884,17 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // de_RecoveryInstanceProperties omitted. +/** + * deserializeAws_restJson1RecoveryLifeCycle + */ +const de_RecoveryLifeCycle = (output: any, context: __SerdeContext): RecoveryLifeCycle => { + return take(output, { + apiCallDateTime: (_: any) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)), + jobID: __expectString, + lastRecoveryResult: __expectString, + }) as any; +}; + // de_RecoverySnapshot omitted. // de_RecoverySnapshotsList omitted. @@ -4110,6 +4911,39 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont // de_SourceCloudProperties omitted. +/** + * deserializeAws_restJson1SourceNetwork + */ +const de_SourceNetwork = (output: any, context: __SerdeContext): SourceNetwork => { + return take(output, { + arn: __expectString, + cfnStackName: __expectString, + lastRecovery: (_: any) => de_RecoveryLifeCycle(_, context), + launchedVpcID: __expectString, + replicationStatus: __expectString, + replicationStatusDetails: __expectString, + sourceAccountID: __expectString, + sourceNetworkID: __expectString, + sourceRegion: __expectString, + sourceVpcID: __expectString, + tags: _json, + }) as any; +}; + +// de_SourceNetworkData omitted. + +/** + * deserializeAws_restJson1SourceNetworksList + */ +const de_SourceNetworksList = (output: any, context: __SerdeContext): SourceNetwork[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_SourceNetwork(entry, context); + }); + return retVal; +}; + // de_SourceProperties omitted. // de_SourceServer omitted.