Skip to content

Commit 7af6954

Browse files
author
awstools
committed
feat(client-mgn): New and modified APIs for the Post-Migration Framework
1 parent d2cbd47 commit 7af6954

12 files changed

+2430
-26
lines changed

clients/client-mgn/src/Mgn.ts

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,22 @@ import {
66
ChangeServerLifeCycleStateCommandInput,
77
ChangeServerLifeCycleStateCommandOutput,
88
} from "./commands/ChangeServerLifeCycleStateCommand";
9+
import {
10+
CreateLaunchConfigurationTemplateCommand,
11+
CreateLaunchConfigurationTemplateCommandInput,
12+
CreateLaunchConfigurationTemplateCommandOutput,
13+
} from "./commands/CreateLaunchConfigurationTemplateCommand";
914
import {
1015
CreateReplicationConfigurationTemplateCommand,
1116
CreateReplicationConfigurationTemplateCommandInput,
1217
CreateReplicationConfigurationTemplateCommandOutput,
1318
} from "./commands/CreateReplicationConfigurationTemplateCommand";
1419
import { DeleteJobCommand, DeleteJobCommandInput, DeleteJobCommandOutput } from "./commands/DeleteJobCommand";
20+
import {
21+
DeleteLaunchConfigurationTemplateCommand,
22+
DeleteLaunchConfigurationTemplateCommandInput,
23+
DeleteLaunchConfigurationTemplateCommandOutput,
24+
} from "./commands/DeleteLaunchConfigurationTemplateCommand";
1525
import {
1626
DeleteReplicationConfigurationTemplateCommand,
1727
DeleteReplicationConfigurationTemplateCommandInput,
@@ -37,6 +47,11 @@ import {
3747
DescribeJobsCommandInput,
3848
DescribeJobsCommandOutput,
3949
} from "./commands/DescribeJobsCommand";
50+
import {
51+
DescribeLaunchConfigurationTemplatesCommand,
52+
DescribeLaunchConfigurationTemplatesCommandInput,
53+
DescribeLaunchConfigurationTemplatesCommandOutput,
54+
} from "./commands/DescribeLaunchConfigurationTemplatesCommand";
4055
import {
4156
DescribeReplicationConfigurationTemplatesCommand,
4257
DescribeReplicationConfigurationTemplatesCommandInput,
@@ -119,6 +134,11 @@ import {
119134
UpdateLaunchConfigurationCommandInput,
120135
UpdateLaunchConfigurationCommandOutput,
121136
} from "./commands/UpdateLaunchConfigurationCommand";
137+
import {
138+
UpdateLaunchConfigurationTemplateCommand,
139+
UpdateLaunchConfigurationTemplateCommandInput,
140+
UpdateLaunchConfigurationTemplateCommandOutput,
141+
} from "./commands/UpdateLaunchConfigurationTemplateCommand";
122142
import {
123143
UpdateReplicationConfigurationCommand,
124144
UpdateReplicationConfigurationCommandInput,
@@ -172,6 +192,38 @@ export class Mgn extends MgnClient {
172192
}
173193
}
174194

195+
/**
196+
* <p>Creates a new ReplicationConfigurationTemplate.</p>
197+
*/
198+
public createLaunchConfigurationTemplate(
199+
args: CreateLaunchConfigurationTemplateCommandInput,
200+
options?: __HttpHandlerOptions
201+
): Promise<CreateLaunchConfigurationTemplateCommandOutput>;
202+
public createLaunchConfigurationTemplate(
203+
args: CreateLaunchConfigurationTemplateCommandInput,
204+
cb: (err: any, data?: CreateLaunchConfigurationTemplateCommandOutput) => void
205+
): void;
206+
public createLaunchConfigurationTemplate(
207+
args: CreateLaunchConfigurationTemplateCommandInput,
208+
options: __HttpHandlerOptions,
209+
cb: (err: any, data?: CreateLaunchConfigurationTemplateCommandOutput) => void
210+
): void;
211+
public createLaunchConfigurationTemplate(
212+
args: CreateLaunchConfigurationTemplateCommandInput,
213+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateLaunchConfigurationTemplateCommandOutput) => void),
214+
cb?: (err: any, data?: CreateLaunchConfigurationTemplateCommandOutput) => void
215+
): Promise<CreateLaunchConfigurationTemplateCommandOutput> | void {
216+
const command = new CreateLaunchConfigurationTemplateCommand(args);
217+
if (typeof optionsOrCb === "function") {
218+
this.send(command, optionsOrCb);
219+
} else if (typeof cb === "function") {
220+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
221+
this.send(command, optionsOrCb || {}, cb);
222+
} else {
223+
return this.send(command, optionsOrCb);
224+
}
225+
}
226+
175227
/**
176228
* <p>Creates a new ReplicationConfigurationTemplate.</p>
177229
*/
@@ -232,6 +284,38 @@ export class Mgn extends MgnClient {
232284
}
233285
}
234286

287+
/**
288+
* <p>Creates a new ReplicationConfigurationTemplate.</p>
289+
*/
290+
public deleteLaunchConfigurationTemplate(
291+
args: DeleteLaunchConfigurationTemplateCommandInput,
292+
options?: __HttpHandlerOptions
293+
): Promise<DeleteLaunchConfigurationTemplateCommandOutput>;
294+
public deleteLaunchConfigurationTemplate(
295+
args: DeleteLaunchConfigurationTemplateCommandInput,
296+
cb: (err: any, data?: DeleteLaunchConfigurationTemplateCommandOutput) => void
297+
): void;
298+
public deleteLaunchConfigurationTemplate(
299+
args: DeleteLaunchConfigurationTemplateCommandInput,
300+
options: __HttpHandlerOptions,
301+
cb: (err: any, data?: DeleteLaunchConfigurationTemplateCommandOutput) => void
302+
): void;
303+
public deleteLaunchConfigurationTemplate(
304+
args: DeleteLaunchConfigurationTemplateCommandInput,
305+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteLaunchConfigurationTemplateCommandOutput) => void),
306+
cb?: (err: any, data?: DeleteLaunchConfigurationTemplateCommandOutput) => void
307+
): Promise<DeleteLaunchConfigurationTemplateCommandOutput> | void {
308+
const command = new DeleteLaunchConfigurationTemplateCommand(args);
309+
if (typeof optionsOrCb === "function") {
310+
this.send(command, optionsOrCb);
311+
} else if (typeof cb === "function") {
312+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
313+
this.send(command, optionsOrCb || {}, cb);
314+
} else {
315+
return this.send(command, optionsOrCb);
316+
}
317+
}
318+
235319
/**
236320
* <p>Deletes a single Replication Configuration Template by ID</p>
237321
*/
@@ -391,6 +475,38 @@ export class Mgn extends MgnClient {
391475
}
392476
}
393477

478+
/**
479+
* <p>Creates a new ReplicationConfigurationTemplate.</p>
480+
*/
481+
public describeLaunchConfigurationTemplates(
482+
args: DescribeLaunchConfigurationTemplatesCommandInput,
483+
options?: __HttpHandlerOptions
484+
): Promise<DescribeLaunchConfigurationTemplatesCommandOutput>;
485+
public describeLaunchConfigurationTemplates(
486+
args: DescribeLaunchConfigurationTemplatesCommandInput,
487+
cb: (err: any, data?: DescribeLaunchConfigurationTemplatesCommandOutput) => void
488+
): void;
489+
public describeLaunchConfigurationTemplates(
490+
args: DescribeLaunchConfigurationTemplatesCommandInput,
491+
options: __HttpHandlerOptions,
492+
cb: (err: any, data?: DescribeLaunchConfigurationTemplatesCommandOutput) => void
493+
): void;
494+
public describeLaunchConfigurationTemplates(
495+
args: DescribeLaunchConfigurationTemplatesCommandInput,
496+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DescribeLaunchConfigurationTemplatesCommandOutput) => void),
497+
cb?: (err: any, data?: DescribeLaunchConfigurationTemplatesCommandOutput) => void
498+
): Promise<DescribeLaunchConfigurationTemplatesCommandOutput> | void {
499+
const command = new DescribeLaunchConfigurationTemplatesCommand(args);
500+
if (typeof optionsOrCb === "function") {
501+
this.send(command, optionsOrCb);
502+
} else if (typeof cb === "function") {
503+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
504+
this.send(command, optionsOrCb || {}, cb);
505+
} else {
506+
return this.send(command, optionsOrCb);
507+
}
508+
}
509+
394510
/**
395511
* <p>Lists all ReplicationConfigurationTemplates, filtered by Source Server IDs.</p>
396512
*/
@@ -954,6 +1070,38 @@ export class Mgn extends MgnClient {
9541070
}
9551071
}
9561072

1073+
/**
1074+
* <p>Creates a new ReplicationConfigurationTemplate.</p>
1075+
*/
1076+
public updateLaunchConfigurationTemplate(
1077+
args: UpdateLaunchConfigurationTemplateCommandInput,
1078+
options?: __HttpHandlerOptions
1079+
): Promise<UpdateLaunchConfigurationTemplateCommandOutput>;
1080+
public updateLaunchConfigurationTemplate(
1081+
args: UpdateLaunchConfigurationTemplateCommandInput,
1082+
cb: (err: any, data?: UpdateLaunchConfigurationTemplateCommandOutput) => void
1083+
): void;
1084+
public updateLaunchConfigurationTemplate(
1085+
args: UpdateLaunchConfigurationTemplateCommandInput,
1086+
options: __HttpHandlerOptions,
1087+
cb: (err: any, data?: UpdateLaunchConfigurationTemplateCommandOutput) => void
1088+
): void;
1089+
public updateLaunchConfigurationTemplate(
1090+
args: UpdateLaunchConfigurationTemplateCommandInput,
1091+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateLaunchConfigurationTemplateCommandOutput) => void),
1092+
cb?: (err: any, data?: UpdateLaunchConfigurationTemplateCommandOutput) => void
1093+
): Promise<UpdateLaunchConfigurationTemplateCommandOutput> | void {
1094+
const command = new UpdateLaunchConfigurationTemplateCommand(args);
1095+
if (typeof optionsOrCb === "function") {
1096+
this.send(command, optionsOrCb);
1097+
} else if (typeof cb === "function") {
1098+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1099+
this.send(command, optionsOrCb || {}, cb);
1100+
} else {
1101+
return this.send(command, optionsOrCb);
1102+
}
1103+
}
1104+
9571105
/**
9581106
* <p>Allows you to update multiple ReplicationConfigurations by Source Server ID.</p>
9591107
*/

clients/client-mgn/src/MgnClient.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,19 @@ import {
5757
ChangeServerLifeCycleStateCommandInput,
5858
ChangeServerLifeCycleStateCommandOutput,
5959
} from "./commands/ChangeServerLifeCycleStateCommand";
60+
import {
61+
CreateLaunchConfigurationTemplateCommandInput,
62+
CreateLaunchConfigurationTemplateCommandOutput,
63+
} from "./commands/CreateLaunchConfigurationTemplateCommand";
6064
import {
6165
CreateReplicationConfigurationTemplateCommandInput,
6266
CreateReplicationConfigurationTemplateCommandOutput,
6367
} from "./commands/CreateReplicationConfigurationTemplateCommand";
6468
import { DeleteJobCommandInput, DeleteJobCommandOutput } from "./commands/DeleteJobCommand";
69+
import {
70+
DeleteLaunchConfigurationTemplateCommandInput,
71+
DeleteLaunchConfigurationTemplateCommandOutput,
72+
} from "./commands/DeleteLaunchConfigurationTemplateCommand";
6573
import {
6674
DeleteReplicationConfigurationTemplateCommandInput,
6775
DeleteReplicationConfigurationTemplateCommandOutput,
@@ -76,6 +84,10 @@ import {
7684
DescribeJobLogItemsCommandOutput,
7785
} from "./commands/DescribeJobLogItemsCommand";
7886
import { DescribeJobsCommandInput, DescribeJobsCommandOutput } from "./commands/DescribeJobsCommand";
87+
import {
88+
DescribeLaunchConfigurationTemplatesCommandInput,
89+
DescribeLaunchConfigurationTemplatesCommandOutput,
90+
} from "./commands/DescribeLaunchConfigurationTemplatesCommand";
7991
import {
8092
DescribeReplicationConfigurationTemplatesCommandInput,
8193
DescribeReplicationConfigurationTemplatesCommandOutput,
@@ -124,6 +136,10 @@ import {
124136
UpdateLaunchConfigurationCommandInput,
125137
UpdateLaunchConfigurationCommandOutput,
126138
} from "./commands/UpdateLaunchConfigurationCommand";
139+
import {
140+
UpdateLaunchConfigurationTemplateCommandInput,
141+
UpdateLaunchConfigurationTemplateCommandOutput,
142+
} from "./commands/UpdateLaunchConfigurationTemplateCommand";
127143
import {
128144
UpdateReplicationConfigurationCommandInput,
129145
UpdateReplicationConfigurationCommandOutput,
@@ -140,13 +156,16 @@ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
140156

141157
export type ServiceInputTypes =
142158
| ChangeServerLifeCycleStateCommandInput
159+
| CreateLaunchConfigurationTemplateCommandInput
143160
| CreateReplicationConfigurationTemplateCommandInput
144161
| DeleteJobCommandInput
162+
| DeleteLaunchConfigurationTemplateCommandInput
145163
| DeleteReplicationConfigurationTemplateCommandInput
146164
| DeleteSourceServerCommandInput
147165
| DeleteVcenterClientCommandInput
148166
| DescribeJobLogItemsCommandInput
149167
| DescribeJobsCommandInput
168+
| DescribeLaunchConfigurationTemplatesCommandInput
150169
| DescribeReplicationConfigurationTemplatesCommandInput
151170
| DescribeSourceServersCommandInput
152171
| DescribeVcenterClientsCommandInput
@@ -165,19 +184,23 @@ export type ServiceInputTypes =
165184
| TerminateTargetInstancesCommandInput
166185
| UntagResourceCommandInput
167186
| UpdateLaunchConfigurationCommandInput
187+
| UpdateLaunchConfigurationTemplateCommandInput
168188
| UpdateReplicationConfigurationCommandInput
169189
| UpdateReplicationConfigurationTemplateCommandInput
170190
| UpdateSourceServerReplicationTypeCommandInput;
171191

172192
export type ServiceOutputTypes =
173193
| ChangeServerLifeCycleStateCommandOutput
194+
| CreateLaunchConfigurationTemplateCommandOutput
174195
| CreateReplicationConfigurationTemplateCommandOutput
175196
| DeleteJobCommandOutput
197+
| DeleteLaunchConfigurationTemplateCommandOutput
176198
| DeleteReplicationConfigurationTemplateCommandOutput
177199
| DeleteSourceServerCommandOutput
178200
| DeleteVcenterClientCommandOutput
179201
| DescribeJobLogItemsCommandOutput
180202
| DescribeJobsCommandOutput
203+
| DescribeLaunchConfigurationTemplatesCommandOutput
181204
| DescribeReplicationConfigurationTemplatesCommandOutput
182205
| DescribeSourceServersCommandOutput
183206
| DescribeVcenterClientsCommandOutput
@@ -196,6 +219,7 @@ export type ServiceOutputTypes =
196219
| TerminateTargetInstancesCommandOutput
197220
| UntagResourceCommandOutput
198221
| UpdateLaunchConfigurationCommandOutput
222+
| UpdateLaunchConfigurationTemplateCommandOutput
199223
| UpdateReplicationConfigurationCommandOutput
200224
| UpdateReplicationConfigurationTemplateCommandOutput
201225
| UpdateSourceServerReplicationTypeCommandOutput;
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// smithy-typescript generated code
2+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
3+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
4+
import { Command as $Command } from "@aws-sdk/smithy-client";
5+
import {
6+
FinalizeHandlerArguments,
7+
Handler,
8+
HandlerExecutionContext,
9+
HttpHandlerOptions as __HttpHandlerOptions,
10+
MetadataBearer as __MetadataBearer,
11+
MiddlewareStack,
12+
SerdeContext as __SerdeContext,
13+
} from "@aws-sdk/types";
14+
15+
import { MgnClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MgnClient";
16+
import { CreateLaunchConfigurationTemplateRequest, LaunchConfigurationTemplate } from "../models/models_0";
17+
import {
18+
deserializeAws_restJson1CreateLaunchConfigurationTemplateCommand,
19+
serializeAws_restJson1CreateLaunchConfigurationTemplateCommand,
20+
} from "../protocols/Aws_restJson1";
21+
22+
export interface CreateLaunchConfigurationTemplateCommandInput extends CreateLaunchConfigurationTemplateRequest {}
23+
export interface CreateLaunchConfigurationTemplateCommandOutput extends LaunchConfigurationTemplate, __MetadataBearer {}
24+
25+
/**
26+
* <p>Creates a new ReplicationConfigurationTemplate.</p>
27+
* @example
28+
* Use a bare-bones client and the command you need to make an API call.
29+
* ```javascript
30+
* import { MgnClient, CreateLaunchConfigurationTemplateCommand } from "@aws-sdk/client-mgn"; // ES Modules import
31+
* // const { MgnClient, CreateLaunchConfigurationTemplateCommand } = require("@aws-sdk/client-mgn"); // CommonJS import
32+
* const client = new MgnClient(config);
33+
* const command = new CreateLaunchConfigurationTemplateCommand(input);
34+
* const response = await client.send(command);
35+
* ```
36+
*
37+
* @see {@link CreateLaunchConfigurationTemplateCommandInput} for command's `input` shape.
38+
* @see {@link CreateLaunchConfigurationTemplateCommandOutput} for command's `response` shape.
39+
* @see {@link MgnClientResolvedConfig | config} for MgnClient's `config` shape.
40+
*
41+
*/
42+
export class CreateLaunchConfigurationTemplateCommand extends $Command<
43+
CreateLaunchConfigurationTemplateCommandInput,
44+
CreateLaunchConfigurationTemplateCommandOutput,
45+
MgnClientResolvedConfig
46+
> {
47+
// Start section: command_properties
48+
// End section: command_properties
49+
50+
constructor(readonly input: CreateLaunchConfigurationTemplateCommandInput) {
51+
// Start section: command_constructor
52+
super();
53+
// End section: command_constructor
54+
}
55+
56+
/**
57+
* @internal
58+
*/
59+
resolveMiddleware(
60+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
61+
configuration: MgnClientResolvedConfig,
62+
options?: __HttpHandlerOptions
63+
): Handler<CreateLaunchConfigurationTemplateCommandInput, CreateLaunchConfigurationTemplateCommandOutput> {
64+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
65+
66+
const stack = clientStack.concat(this.middlewareStack);
67+
68+
const { logger } = configuration;
69+
const clientName = "MgnClient";
70+
const commandName = "CreateLaunchConfigurationTemplateCommand";
71+
const handlerExecutionContext: HandlerExecutionContext = {
72+
logger,
73+
clientName,
74+
commandName,
75+
inputFilterSensitiveLog: CreateLaunchConfigurationTemplateRequest.filterSensitiveLog,
76+
outputFilterSensitiveLog: LaunchConfigurationTemplate.filterSensitiveLog,
77+
};
78+
const { requestHandler } = configuration;
79+
return stack.resolve(
80+
(request: FinalizeHandlerArguments<any>) =>
81+
requestHandler.handle(request.request as __HttpRequest, options || {}),
82+
handlerExecutionContext
83+
);
84+
}
85+
86+
private serialize(
87+
input: CreateLaunchConfigurationTemplateCommandInput,
88+
context: __SerdeContext
89+
): Promise<__HttpRequest> {
90+
return serializeAws_restJson1CreateLaunchConfigurationTemplateCommand(input, context);
91+
}
92+
93+
private deserialize(
94+
output: __HttpResponse,
95+
context: __SerdeContext
96+
): Promise<CreateLaunchConfigurationTemplateCommandOutput> {
97+
return deserializeAws_restJson1CreateLaunchConfigurationTemplateCommand(output, context);
98+
}
99+
100+
// Start section: command_body_extra
101+
// End section: command_body_extra
102+
}

0 commit comments

Comments
 (0)