Skip to content

Commit e477f4a

Browse files
author
awstools
committed
feat(client-workspaces): The release introduces CreateStandbyWorkspaces, an API that allows you to create standby WorkSpaces associated with a primary WorkSpace in another Region. DescribeWorkspaces now includes related WorkSpaces properties. DescribeWorkspaceBundles and CreateWorkspaceBundle now return more bundle details.
1 parent 5dd3fca commit e477f4a

File tree

7 files changed

+9282
-8372
lines changed

7 files changed

+9282
-8372
lines changed

clients/client-workspaces/src/WorkSpaces.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ import {
3636
CreateIpGroupCommandInput,
3737
CreateIpGroupCommandOutput,
3838
} from "./commands/CreateIpGroupCommand";
39+
import {
40+
CreateStandbyWorkspacesCommand,
41+
CreateStandbyWorkspacesCommandInput,
42+
CreateStandbyWorkspacesCommandOutput,
43+
} from "./commands/CreateStandbyWorkspacesCommand";
3944
import { CreateTagsCommand, CreateTagsCommandInput, CreateTagsCommandOutput } from "./commands/CreateTagsCommand";
4045
import {
4146
CreateUpdatedWorkspaceImageCommand,
@@ -589,6 +594,38 @@ export class WorkSpaces extends WorkSpacesClient {
589594
}
590595
}
591596

597+
/**
598+
* <p>Creates a Standby WorkSpace in a secondary region.</p>
599+
*/
600+
public createStandbyWorkspaces(
601+
args: CreateStandbyWorkspacesCommandInput,
602+
options?: __HttpHandlerOptions
603+
): Promise<CreateStandbyWorkspacesCommandOutput>;
604+
public createStandbyWorkspaces(
605+
args: CreateStandbyWorkspacesCommandInput,
606+
cb: (err: any, data?: CreateStandbyWorkspacesCommandOutput) => void
607+
): void;
608+
public createStandbyWorkspaces(
609+
args: CreateStandbyWorkspacesCommandInput,
610+
options: __HttpHandlerOptions,
611+
cb: (err: any, data?: CreateStandbyWorkspacesCommandOutput) => void
612+
): void;
613+
public createStandbyWorkspaces(
614+
args: CreateStandbyWorkspacesCommandInput,
615+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateStandbyWorkspacesCommandOutput) => void),
616+
cb?: (err: any, data?: CreateStandbyWorkspacesCommandOutput) => void
617+
): Promise<CreateStandbyWorkspacesCommandOutput> | void {
618+
const command = new CreateStandbyWorkspacesCommand(args);
619+
if (typeof optionsOrCb === "function") {
620+
this.send(command, optionsOrCb);
621+
} else if (typeof cb === "function") {
622+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
623+
this.send(command, optionsOrCb || {}, cb);
624+
} else {
625+
return this.send(command, optionsOrCb);
626+
}
627+
}
628+
592629
/**
593630
* <p>Creates the specified tags for the specified WorkSpaces resource.</p>
594631
*/

clients/client-workspaces/src/WorkSpacesClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ import {
6363
CreateConnectionAliasCommandOutput,
6464
} from "./commands/CreateConnectionAliasCommand";
6565
import { CreateIpGroupCommandInput, CreateIpGroupCommandOutput } from "./commands/CreateIpGroupCommand";
66+
import {
67+
CreateStandbyWorkspacesCommandInput,
68+
CreateStandbyWorkspacesCommandOutput,
69+
} from "./commands/CreateStandbyWorkspacesCommand";
6670
import { CreateTagsCommandInput, CreateTagsCommandOutput } from "./commands/CreateTagsCommand";
6771
import {
6872
CreateUpdatedWorkspaceImageCommandInput,
@@ -259,6 +263,7 @@ export type ServiceInputTypes =
259263
| CreateConnectClientAddInCommandInput
260264
| CreateConnectionAliasCommandInput
261265
| CreateIpGroupCommandInput
266+
| CreateStandbyWorkspacesCommandInput
262267
| CreateTagsCommandInput
263268
| CreateUpdatedWorkspaceImageCommandInput
264269
| CreateWorkspaceBundleCommandInput
@@ -325,6 +330,7 @@ export type ServiceOutputTypes =
325330
| CreateConnectClientAddInCommandOutput
326331
| CreateConnectionAliasCommandOutput
327332
| CreateIpGroupCommandOutput
333+
| CreateStandbyWorkspacesCommandOutput
328334
| CreateTagsCommandOutput
329335
| CreateUpdatedWorkspaceImageCommandOutput
330336
| CreateWorkspaceBundleCommandOutput
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
3+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
5+
import { Command as $Command } from "@aws-sdk/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@aws-sdk/types";
15+
16+
import {
17+
CreateStandbyWorkspacesRequest,
18+
CreateStandbyWorkspacesRequestFilterSensitiveLog,
19+
CreateStandbyWorkspacesResult,
20+
CreateStandbyWorkspacesResultFilterSensitiveLog,
21+
} from "../models/models_0";
22+
import {
23+
deserializeAws_json1_1CreateStandbyWorkspacesCommand,
24+
serializeAws_json1_1CreateStandbyWorkspacesCommand,
25+
} from "../protocols/Aws_json1_1";
26+
import { ServiceInputTypes, ServiceOutputTypes, WorkSpacesClientResolvedConfig } from "../WorkSpacesClient";
27+
28+
export interface CreateStandbyWorkspacesCommandInput extends CreateStandbyWorkspacesRequest {}
29+
export interface CreateStandbyWorkspacesCommandOutput extends CreateStandbyWorkspacesResult, __MetadataBearer {}
30+
31+
/**
32+
* <p>Creates a Standby WorkSpace in a secondary region.</p>
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { WorkSpacesClient, CreateStandbyWorkspacesCommand } from "@aws-sdk/client-workspaces"; // ES Modules import
37+
* // const { WorkSpacesClient, CreateStandbyWorkspacesCommand } = require("@aws-sdk/client-workspaces"); // CommonJS import
38+
* const client = new WorkSpacesClient(config);
39+
* const command = new CreateStandbyWorkspacesCommand(input);
40+
* const response = await client.send(command);
41+
* ```
42+
*
43+
* @see {@link CreateStandbyWorkspacesCommandInput} for command's `input` shape.
44+
* @see {@link CreateStandbyWorkspacesCommandOutput} for command's `response` shape.
45+
* @see {@link WorkSpacesClientResolvedConfig | config} for WorkSpacesClient's `config` shape.
46+
*
47+
*/
48+
export class CreateStandbyWorkspacesCommand extends $Command<
49+
CreateStandbyWorkspacesCommandInput,
50+
CreateStandbyWorkspacesCommandOutput,
51+
WorkSpacesClientResolvedConfig
52+
> {
53+
// Start section: command_properties
54+
// End section: command_properties
55+
56+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
57+
return {
58+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
59+
Endpoint: { type: "builtInParams", name: "endpoint" },
60+
Region: { type: "builtInParams", name: "region" },
61+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
62+
};
63+
}
64+
65+
constructor(readonly input: CreateStandbyWorkspacesCommandInput) {
66+
// Start section: command_constructor
67+
super();
68+
// End section: command_constructor
69+
}
70+
71+
/**
72+
* @internal
73+
*/
74+
resolveMiddleware(
75+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
76+
configuration: WorkSpacesClientResolvedConfig,
77+
options?: __HttpHandlerOptions
78+
): Handler<CreateStandbyWorkspacesCommandInput, CreateStandbyWorkspacesCommandOutput> {
79+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
80+
this.middlewareStack.use(
81+
getEndpointPlugin(configuration, CreateStandbyWorkspacesCommand.getEndpointParameterInstructions())
82+
);
83+
84+
const stack = clientStack.concat(this.middlewareStack);
85+
86+
const { logger } = configuration;
87+
const clientName = "WorkSpacesClient";
88+
const commandName = "CreateStandbyWorkspacesCommand";
89+
const handlerExecutionContext: HandlerExecutionContext = {
90+
logger,
91+
clientName,
92+
commandName,
93+
inputFilterSensitiveLog: CreateStandbyWorkspacesRequestFilterSensitiveLog,
94+
outputFilterSensitiveLog: CreateStandbyWorkspacesResultFilterSensitiveLog,
95+
};
96+
const { requestHandler } = configuration;
97+
return stack.resolve(
98+
(request: FinalizeHandlerArguments<any>) =>
99+
requestHandler.handle(request.request as __HttpRequest, options || {}),
100+
handlerExecutionContext
101+
);
102+
}
103+
104+
private serialize(input: CreateStandbyWorkspacesCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
105+
return serializeAws_json1_1CreateStandbyWorkspacesCommand(input, context);
106+
}
107+
108+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<CreateStandbyWorkspacesCommandOutput> {
109+
return deserializeAws_json1_1CreateStandbyWorkspacesCommand(output, context);
110+
}
111+
112+
// Start section: command_body_extra
113+
// End section: command_body_extra
114+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export * from "./CopyWorkspaceImageCommand";
66
export * from "./CreateConnectClientAddInCommand";
77
export * from "./CreateConnectionAliasCommand";
88
export * from "./CreateIpGroupCommand";
9+
export * from "./CreateStandbyWorkspacesCommand";
910
export * from "./CreateTagsCommand";
1011
export * from "./CreateUpdatedWorkspaceImageCommand";
1112
export * from "./CreateWorkspaceBundleCommand";

0 commit comments

Comments
 (0)