From f807e5a1668ca02275811ab63ff09ea8dd976c94 Mon Sep 17 00:00:00 2001 From: awstools Date: Mon, 27 Nov 2023 03:55:01 +0000 Subject: [PATCH] feat(client-workspaces): The release introduces Multi-Region Resilience one-way data replication that allows you to replicate data from your primary WorkSpace to a standby WorkSpace in another AWS Region. DescribeWorkspaces now returns the status of data replication. --- .../CreateStandbyWorkspacesCommand.ts | 2 + .../src/commands/CreateWorkspacesCommand.ts | 11 ++ .../src/commands/DescribeWorkspacesCommand.ts | 11 ++ .../ModifyWorkspacePropertiesCommand.ts | 1 + .../client-workspaces/src/models/models_0.ts | 84 ++++++++++++++- .../src/protocols/Aws_json1_1.ts | 101 ++++++++++++++++-- .../sdk-codegen/aws-models/workspaces.json | 96 ++++++++++++++++- 7 files changed, 297 insertions(+), 9 deletions(-) diff --git a/clients/client-workspaces/src/commands/CreateStandbyWorkspacesCommand.ts b/clients/client-workspaces/src/commands/CreateStandbyWorkspacesCommand.ts index cbaf244651cf0..cdf7425b3befb 100644 --- a/clients/client-workspaces/src/commands/CreateStandbyWorkspacesCommand.ts +++ b/clients/client-workspaces/src/commands/CreateStandbyWorkspacesCommand.ts @@ -57,6 +57,7 @@ export interface CreateStandbyWorkspacesCommandOutput extends CreateStandbyWorks * Value: "STRING_VALUE", * }, * ], + * DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE", * }, * ], * }; @@ -75,6 +76,7 @@ export interface CreateStandbyWorkspacesCommandOutput extends CreateStandbyWorks * // Value: "STRING_VALUE", * // }, * // ], + * // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE", * // }, * // ErrorCode: "STRING_VALUE", * // ErrorMessage: "STRING_VALUE", diff --git a/clients/client-workspaces/src/commands/CreateWorkspacesCommand.ts b/clients/client-workspaces/src/commands/CreateWorkspacesCommand.ts index 9da21ee037010..868ec31302645 100644 --- a/clients/client-workspaces/src/commands/CreateWorkspacesCommand.ts +++ b/clients/client-workspaces/src/commands/CreateWorkspacesCommand.ts @@ -162,6 +162,17 @@ export interface CreateWorkspacesCommandOutput extends CreateWorkspacesResult, _ * // Type: "PRIMARY" || "STANDBY", * // }, * // ], + * // DataReplicationSettings: { // DataReplicationSettings + * // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE", + * // RecoverySnapshotTime: new Date("TIMESTAMP"), + * // }, + * // StandbyWorkspacesProperties: [ // StandbyWorkspacesPropertiesList + * // { // StandbyWorkspacesProperties + * // StandbyWorkspaceId: "STRING_VALUE", + * // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE", + * // RecoverySnapshotTime: new Date("TIMESTAMP"), + * // }, + * // ], * // }, * // ], * // }; diff --git a/clients/client-workspaces/src/commands/DescribeWorkspacesCommand.ts b/clients/client-workspaces/src/commands/DescribeWorkspacesCommand.ts index 9007705276857..845a697555f92 100644 --- a/clients/client-workspaces/src/commands/DescribeWorkspacesCommand.ts +++ b/clients/client-workspaces/src/commands/DescribeWorkspacesCommand.ts @@ -99,6 +99,17 @@ export interface DescribeWorkspacesCommandOutput extends DescribeWorkspacesResul * // Type: "PRIMARY" || "STANDBY", * // }, * // ], + * // DataReplicationSettings: { // DataReplicationSettings + * // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE", + * // RecoverySnapshotTime: new Date("TIMESTAMP"), + * // }, + * // StandbyWorkspacesProperties: [ // StandbyWorkspacesPropertiesList + * // { // StandbyWorkspacesProperties + * // StandbyWorkspaceId: "STRING_VALUE", + * // DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE", + * // RecoverySnapshotTime: new Date("TIMESTAMP"), + * // }, + * // ], * // }, * // ], * // NextToken: "STRING_VALUE", diff --git a/clients/client-workspaces/src/commands/ModifyWorkspacePropertiesCommand.ts b/clients/client-workspaces/src/commands/ModifyWorkspacePropertiesCommand.ts index d154a60cdddca..282e890dc4960 100644 --- a/clients/client-workspaces/src/commands/ModifyWorkspacePropertiesCommand.ts +++ b/clients/client-workspaces/src/commands/ModifyWorkspacePropertiesCommand.ts @@ -65,6 +65,7 @@ export interface ModifyWorkspacePropertiesCommandOutput extends ModifyWorkspaceP * ], * OperatingSystemName: "AMAZON_LINUX_2" || "UBUNTU_18_04" || "UBUNTU_20_04" || "UBUNTU_22_04" || "UNKNOWN" || "WINDOWS_10" || "WINDOWS_11" || "WINDOWS_7" || "WINDOWS_SERVER_2016" || "WINDOWS_SERVER_2019" || "WINDOWS_SERVER_2022", * }, + * DataReplication: "NO_REPLICATION" || "PRIMARY_AS_SOURCE", * }; * const command = new ModifyWorkspacePropertiesCommand(input); * const response = await client.send(command); diff --git a/clients/client-workspaces/src/models/models_0.ts b/clients/client-workspaces/src/models/models_0.ts index ef06b7cf6a33d..ff03fba5abc24 100644 --- a/clients/client-workspaces/src/models/models_0.ts +++ b/clients/client-workspaces/src/models/models_0.ts @@ -1430,6 +1430,20 @@ export interface CreateIpGroupResult { GroupId?: string; } +/** + * @public + * @enum + */ +export const DataReplication = { + NO_REPLICATION: "NO_REPLICATION", + PRIMARY_AS_SOURCE: "PRIMARY_AS_SOURCE", +} as const; + +/** + * @public + */ +export type DataReplication = (typeof DataReplication)[keyof typeof DataReplication]; + /** * @public *

Describes a standby WorkSpace.

@@ -1458,6 +1472,12 @@ export interface StandbyWorkspace { *

The tags associated with the standby WorkSpace.

*/ Tags?: Tag[]; + + /** + * @public + *

Indicates whether data replication is enabled, and if enabled, the type of data replication.

+ */ + DataReplication?: DataReplication; } /** @@ -2076,6 +2096,25 @@ export interface FailedCreateWorkspaceRequest { ErrorMessage?: string; } +/** + * @public + *

Describes the data replication settings.

+ */ +export interface DataReplicationSettings { + /** + * @public + *

Indicates whether data replication is enabled, and if enabled, the type of data replication.

+ */ + DataReplication?: DataReplication; + + /** + * @public + *

The date and time at which the last successful snapshot was taken of the + * primary WorkSpace used for replicating data.

+ */ + RecoverySnapshotTime?: Date; +} + /** * @public * @enum @@ -2169,6 +2208,31 @@ export interface RelatedWorkspaceProperties { Type?: StandbyWorkspaceRelationshipType; } +/** + * @public + *

Describes the properties of the related standby WorkSpaces.

+ */ +export interface StandbyWorkspacesProperties { + /** + * @public + *

The identifier of the standby WorkSpace

+ */ + StandbyWorkspaceId?: string; + + /** + * @public + *

Indicates whether data replication is enabled, and if enabled, the type of data replication.

+ */ + DataReplication?: DataReplication; + + /** + * @public + *

The date and time at which the last successful snapshot was taken of the + * primary WorkSpace used for replicating data.

+ */ + RecoverySnapshotTime?: Date; +} + /** * @public *

Describes a WorkSpace.

@@ -2281,6 +2345,18 @@ export interface Workspace { *

The standby WorkSpace or primary WorkSpace related to the specified WorkSpace.

*/ RelatedWorkspaces?: RelatedWorkspaceProperties[]; + + /** + * @public + *

Indicates the settings of the data replication.

+ */ + DataReplicationSettings?: DataReplicationSettings; + + /** + * @public + *

The properties of the standby WorkSpace

+ */ + StandbyWorkspacesProperties?: StandbyWorkspacesProperties[]; } /** @@ -5169,7 +5245,13 @@ export interface ModifyWorkspacePropertiesRequest { * @public *

The properties of the WorkSpace.

*/ - WorkspaceProperties: WorkspaceProperties | undefined; + WorkspaceProperties?: WorkspaceProperties; + + /** + * @public + *

Indicates the data replication status.

+ */ + DataReplication?: DataReplication; } /** diff --git a/clients/client-workspaces/src/protocols/Aws_json1_1.ts b/clients/client-workspaces/src/protocols/Aws_json1_1.ts index d58cf9e3f2b2d..11ec4b1eb5dfd 100644 --- a/clients/client-workspaces/src/protocols/Aws_json1_1.ts +++ b/clients/client-workspaces/src/protocols/Aws_json1_1.ts @@ -4,6 +4,7 @@ import { _json, collectBody, decorateServiceException as __decorateServiceException, + expectBoolean as __expectBoolean, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, @@ -283,6 +284,8 @@ import { CreateWorkspaceImageRequest, CreateWorkspaceImageResult, CreateWorkspacesRequest, + CreateWorkspacesResult, + DataReplicationSettings, DefaultImportClientBrandingAttributes, DeletableCertificateBasedAuthProperty, DeletableSamlProperty, @@ -327,6 +330,7 @@ import { DescribeWorkspaceSnapshotsRequest, DescribeWorkspaceSnapshotsResult, DescribeWorkspacesRequest, + DescribeWorkspacesResult, DisassociateConnectionAliasRequest, DisassociateIpGroupsRequest, DisassociateWorkspaceApplicationRequest, @@ -375,6 +379,7 @@ import { SelfservicePermissions, Snapshot, StandbyWorkspace, + StandbyWorkspacesProperties, StartRequest, StartWorkspacesRequest, StopRequest, @@ -390,6 +395,7 @@ import { UpdateWorkspaceBundleRequest, UpdateWorkspaceImagePermissionRequest, UserStorage, + Workspace, WorkspaceAccessProperties, WorkSpaceApplication, WorkSpaceApplicationDeployment, @@ -2159,7 +2165,7 @@ export const de_CreateWorkspacesCommand = async ( } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); + contents = de_CreateWorkspacesResult(data, context); const response: CreateWorkspacesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, @@ -3618,7 +3624,7 @@ export const de_DescribeWorkspacesCommand = async ( } const data: any = await parseBody(output.body, context); let contents: any = {}; - contents = _json(data); + contents = de_DescribeWorkspacesResult(data, context); const response: DescribeWorkspacesCommandOutput = { $metadata: deserializeMetadata(output), ...contents, @@ -6113,7 +6119,25 @@ const de_CreateWorkspaceImageResult = (output: any, context: __SerdeContext): Cr }) as any; }; -// de_CreateWorkspacesResult omitted. +/** + * deserializeAws_json1_1CreateWorkspacesResult + */ +const de_CreateWorkspacesResult = (output: any, context: __SerdeContext): CreateWorkspacesResult => { + return take(output, { + FailedRequests: _json, + PendingRequests: (_: any) => de_WorkspaceList(_, context), + }) as any; +}; + +/** + * deserializeAws_json1_1DataReplicationSettings + */ +const de_DataReplicationSettings = (output: any, context: __SerdeContext): DataReplicationSettings => { + return take(output, { + DataReplication: __expectString, + RecoverySnapshotTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; // de_DedicatedTenancyCidrRangeList omitted. @@ -6284,7 +6308,15 @@ const de_DescribeWorkspaceSnapshotsResult = ( }) as any; }; -// de_DescribeWorkspacesResult omitted. +/** + * deserializeAws_json1_1DescribeWorkspacesResult + */ +const de_DescribeWorkspacesResult = (output: any, context: __SerdeContext): DescribeWorkspacesResult => { + return take(output, { + NextToken: __expectString, + Workspaces: (_: any) => de_WorkspaceList(_, context), + }) as any; +}; // de_DirectoryList omitted. @@ -6480,6 +6512,29 @@ const de_SnapshotList = (output: any, context: __SerdeContext): Snapshot[] => { // de_StandbyWorkspace omitted. +/** + * deserializeAws_json1_1StandbyWorkspacesProperties + */ +const de_StandbyWorkspacesProperties = (output: any, context: __SerdeContext): StandbyWorkspacesProperties => { + return take(output, { + DataReplication: __expectString, + RecoverySnapshotTime: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + StandbyWorkspaceId: __expectString, + }) as any; +}; + +/** + * deserializeAws_json1_1StandbyWorkspacesPropertiesList + */ +const de_StandbyWorkspacesPropertiesList = (output: any, context: __SerdeContext): StandbyWorkspacesProperties[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_StandbyWorkspacesProperties(entry, context); + }); + return retVal; +}; + // de_StartWorkspacesResult omitted. // de_StopWorkspacesResult omitted. @@ -6510,7 +6565,31 @@ const de_SnapshotList = (output: any, context: __SerdeContext): Snapshot[] => { // de_UserStorage omitted. -// de_Workspace omitted. +/** + * deserializeAws_json1_1Workspace + */ +const de_Workspace = (output: any, context: __SerdeContext): Workspace => { + return take(output, { + BundleId: __expectString, + ComputerName: __expectString, + DataReplicationSettings: (_: any) => de_DataReplicationSettings(_, context), + DirectoryId: __expectString, + ErrorCode: __expectString, + ErrorMessage: __expectString, + IpAddress: __expectString, + ModificationStates: _json, + RelatedWorkspaces: _json, + RootVolumeEncryptionEnabled: __expectBoolean, + StandbyWorkspacesProperties: (_: any) => de_StandbyWorkspacesPropertiesList(_, context), + State: __expectString, + SubnetId: __expectString, + UserName: __expectString, + UserVolumeEncryptionEnabled: __expectBoolean, + VolumeEncryptionKey: __expectString, + WorkspaceId: __expectString, + WorkspaceProperties: _json, + }) as any; +}; // de_WorkspaceAccessProperties omitted. @@ -6630,7 +6709,17 @@ const de_WorkspaceImageList = (output: any, context: __SerdeContext): WorkspaceI return retVal; }; -// de_WorkspaceList omitted. +/** + * deserializeAws_json1_1WorkspaceList + */ +const de_WorkspaceList = (output: any, context: __SerdeContext): Workspace[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + return de_Workspace(entry, context); + }); + return retVal; +}; // de_WorkspaceProperties omitted. diff --git a/codegen/sdk-codegen/aws-models/workspaces.json b/codegen/sdk-codegen/aws-models/workspaces.json index 2c4cd2e43e866..1807fd0712183 100644 --- a/codegen/sdk-codegen/aws-models/workspaces.json +++ b/codegen/sdk-codegen/aws-models/workspaces.json @@ -2127,6 +2127,43 @@ "smithy.api#output": {} } }, + "com.amazonaws.workspaces#DataReplication": { + "type": "enum", + "members": { + "NO_REPLICATION": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "NO_REPLICATION" + } + }, + "PRIMARY_AS_SOURCE": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "PRIMARY_AS_SOURCE" + } + } + } + }, + "com.amazonaws.workspaces#DataReplicationSettings": { + "type": "structure", + "members": { + "DataReplication": { + "target": "com.amazonaws.workspaces#DataReplication", + "traits": { + "smithy.api#documentation": "

Indicates whether data replication is enabled, and if enabled, the type of data replication.

" + } + }, + "RecoverySnapshotTime": { + "target": "com.amazonaws.workspaces#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time at which the last successful snapshot was taken of the \n primary WorkSpace used for replicating data.

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

Describes the data replication settings.

" + } + }, "com.amazonaws.workspaces#DedicatedTenancyCidrRangeList": { "type": "list", "member": { @@ -5857,8 +5894,13 @@ "WorkspaceProperties": { "target": "com.amazonaws.workspaces#WorkspaceProperties", "traits": { - "smithy.api#documentation": "

The properties of the WorkSpace.

", - "smithy.api#required": {} + "smithy.api#documentation": "

The properties of the WorkSpace.

" + } + }, + "DataReplication": { + "target": "com.amazonaws.workspaces#DataReplication", + "traits": { + "smithy.api#documentation": "

Indicates the data replication status.

" } } }, @@ -6890,6 +6932,12 @@ "traits": { "smithy.api#documentation": "

The tags associated with the standby WorkSpace.

" } + }, + "DataReplication": { + "target": "com.amazonaws.workspaces#DataReplication", + "traits": { + "smithy.api#documentation": "

Indicates whether data replication is enabled, and if enabled, the type of data replication.

" + } } }, "traits": { @@ -6919,6 +6967,38 @@ "target": "com.amazonaws.workspaces#StandbyWorkspace" } }, + "com.amazonaws.workspaces#StandbyWorkspacesProperties": { + "type": "structure", + "members": { + "StandbyWorkspaceId": { + "target": "com.amazonaws.workspaces#WorkspaceId", + "traits": { + "smithy.api#documentation": "

The identifier of the standby WorkSpace

" + } + }, + "DataReplication": { + "target": "com.amazonaws.workspaces#DataReplication", + "traits": { + "smithy.api#documentation": "

Indicates whether data replication is enabled, and if enabled, the type of data replication.

" + } + }, + "RecoverySnapshotTime": { + "target": "com.amazonaws.workspaces#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time at which the last successful snapshot was taken of the \n primary WorkSpace used for replicating data.

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

Describes the properties of the related standby WorkSpaces.

" + } + }, + "com.amazonaws.workspaces#StandbyWorkspacesPropertiesList": { + "type": "list", + "member": { + "target": "com.amazonaws.workspaces#StandbyWorkspacesProperties" + } + }, "com.amazonaws.workspaces#StartRequest": { "type": "structure", "members": { @@ -7897,6 +7977,18 @@ "traits": { "smithy.api#documentation": "

The standby WorkSpace or primary WorkSpace related to the specified WorkSpace.

" } + }, + "DataReplicationSettings": { + "target": "com.amazonaws.workspaces#DataReplicationSettings", + "traits": { + "smithy.api#documentation": "

Indicates the settings of the data replication.

" + } + }, + "StandbyWorkspacesProperties": { + "target": "com.amazonaws.workspaces#StandbyWorkspacesPropertiesList", + "traits": { + "smithy.api#documentation": "

The properties of the standby WorkSpace

" + } } }, "traits": {