Skip to content

Commit 4910403

Browse files
author
awstools
committed
feat(client-backup-gateway): Adds GetGateway and UpdateGatewaySoftwareNow API and adds hypervisor name to UpdateHypervisor API
1 parent a938290 commit 4910403

File tree

8 files changed

+763
-4
lines changed

8 files changed

+763
-4
lines changed

clients/client-backup-gateway/src/BackupGateway.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import {
2727
DisassociateGatewayFromServerCommandInput,
2828
DisassociateGatewayFromServerCommandOutput,
2929
} from "./commands/DisassociateGatewayFromServerCommand";
30+
import { GetGatewayCommand, GetGatewayCommandInput, GetGatewayCommandOutput } from "./commands/GetGatewayCommand";
3031
import {
3132
ImportHypervisorConfigurationCommand,
3233
ImportHypervisorConfigurationCommandInput,
@@ -73,6 +74,11 @@ import {
7374
UpdateGatewayInformationCommandInput,
7475
UpdateGatewayInformationCommandOutput,
7576
} from "./commands/UpdateGatewayInformationCommand";
77+
import {
78+
UpdateGatewaySoftwareNowCommand,
79+
UpdateGatewaySoftwareNowCommandInput,
80+
UpdateGatewaySoftwareNowCommandOutput,
81+
} from "./commands/UpdateGatewaySoftwareNowCommand";
7682
import {
7783
UpdateHypervisorCommand,
7884
UpdateHypervisorCommandInput,
@@ -254,6 +260,33 @@ export class BackupGateway extends BackupGatewayClient {
254260
}
255261
}
256262

263+
/**
264+
* <p>By providing the ARN (Amazon Resource Name), this
265+
* API returns the gateway.</p>
266+
*/
267+
public getGateway(args: GetGatewayCommandInput, options?: __HttpHandlerOptions): Promise<GetGatewayCommandOutput>;
268+
public getGateway(args: GetGatewayCommandInput, cb: (err: any, data?: GetGatewayCommandOutput) => void): void;
269+
public getGateway(
270+
args: GetGatewayCommandInput,
271+
options: __HttpHandlerOptions,
272+
cb: (err: any, data?: GetGatewayCommandOutput) => void
273+
): void;
274+
public getGateway(
275+
args: GetGatewayCommandInput,
276+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetGatewayCommandOutput) => void),
277+
cb?: (err: any, data?: GetGatewayCommandOutput) => void
278+
): Promise<GetGatewayCommandOutput> | void {
279+
const command = new GetGatewayCommand(args);
280+
if (typeof optionsOrCb === "function") {
281+
this.send(command, optionsOrCb);
282+
} else if (typeof cb === "function") {
283+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
284+
this.send(command, optionsOrCb || {}, cb);
285+
} else {
286+
return this.send(command, optionsOrCb);
287+
}
288+
}
289+
257290
/**
258291
* <p>Connect to a hypervisor by importing its configuration.</p>
259292
*/
@@ -568,6 +601,44 @@ export class BackupGateway extends BackupGatewayClient {
568601
}
569602
}
570603

604+
/**
605+
* <p>Updates the gateway virtual machine (VM) software.
606+
* The request immediately triggers the software update.</p>
607+
* <note>
608+
* <p>When you make this request, you get a <code>200 OK</code>
609+
* success response immediately. However, it might take some
610+
* time for the update to complete.</p>
611+
* </note>
612+
*/
613+
public updateGatewaySoftwareNow(
614+
args: UpdateGatewaySoftwareNowCommandInput,
615+
options?: __HttpHandlerOptions
616+
): Promise<UpdateGatewaySoftwareNowCommandOutput>;
617+
public updateGatewaySoftwareNow(
618+
args: UpdateGatewaySoftwareNowCommandInput,
619+
cb: (err: any, data?: UpdateGatewaySoftwareNowCommandOutput) => void
620+
): void;
621+
public updateGatewaySoftwareNow(
622+
args: UpdateGatewaySoftwareNowCommandInput,
623+
options: __HttpHandlerOptions,
624+
cb: (err: any, data?: UpdateGatewaySoftwareNowCommandOutput) => void
625+
): void;
626+
public updateGatewaySoftwareNow(
627+
args: UpdateGatewaySoftwareNowCommandInput,
628+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateGatewaySoftwareNowCommandOutput) => void),
629+
cb?: (err: any, data?: UpdateGatewaySoftwareNowCommandOutput) => void
630+
): Promise<UpdateGatewaySoftwareNowCommandOutput> | void {
631+
const command = new UpdateGatewaySoftwareNowCommand(args);
632+
if (typeof optionsOrCb === "function") {
633+
this.send(command, optionsOrCb);
634+
} else if (typeof cb === "function") {
635+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
636+
this.send(command, optionsOrCb || {}, cb);
637+
} else {
638+
return this.send(command, optionsOrCb);
639+
}
640+
}
641+
571642
/**
572643
* <p>Updates a hypervisor metadata, including its host, username, and password. Specify which
573644
* hypervisor to update using the Amazon Resource Name (ARN) of the hypervisor in your

clients/client-backup-gateway/src/BackupGatewayClient.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import {
6363
DisassociateGatewayFromServerCommandInput,
6464
DisassociateGatewayFromServerCommandOutput,
6565
} from "./commands/DisassociateGatewayFromServerCommand";
66+
import { GetGatewayCommandInput, GetGatewayCommandOutput } from "./commands/GetGatewayCommand";
6667
import {
6768
ImportHypervisorConfigurationCommandInput,
6869
ImportHypervisorConfigurationCommandOutput,
@@ -91,6 +92,10 @@ import {
9192
UpdateGatewayInformationCommandInput,
9293
UpdateGatewayInformationCommandOutput,
9394
} from "./commands/UpdateGatewayInformationCommand";
95+
import {
96+
UpdateGatewaySoftwareNowCommandInput,
97+
UpdateGatewaySoftwareNowCommandOutput,
98+
} from "./commands/UpdateGatewaySoftwareNowCommand";
9499
import { UpdateHypervisorCommandInput, UpdateHypervisorCommandOutput } from "./commands/UpdateHypervisorCommand";
95100
import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
96101

@@ -100,6 +105,7 @@ export type ServiceInputTypes =
100105
| DeleteGatewayCommandInput
101106
| DeleteHypervisorCommandInput
102107
| DisassociateGatewayFromServerCommandInput
108+
| GetGatewayCommandInput
103109
| ImportHypervisorConfigurationCommandInput
104110
| ListGatewaysCommandInput
105111
| ListHypervisorsCommandInput
@@ -110,6 +116,7 @@ export type ServiceInputTypes =
110116
| TestHypervisorConfigurationCommandInput
111117
| UntagResourceCommandInput
112118
| UpdateGatewayInformationCommandInput
119+
| UpdateGatewaySoftwareNowCommandInput
113120
| UpdateHypervisorCommandInput;
114121

115122
export type ServiceOutputTypes =
@@ -118,6 +125,7 @@ export type ServiceOutputTypes =
118125
| DeleteGatewayCommandOutput
119126
| DeleteHypervisorCommandOutput
120127
| DisassociateGatewayFromServerCommandOutput
128+
| GetGatewayCommandOutput
121129
| ImportHypervisorConfigurationCommandOutput
122130
| ListGatewaysCommandOutput
123131
| ListHypervisorsCommandOutput
@@ -128,6 +136,7 @@ export type ServiceOutputTypes =
128136
| TestHypervisorConfigurationCommandOutput
129137
| UntagResourceCommandOutput
130138
| UpdateGatewayInformationCommandOutput
139+
| UpdateGatewaySoftwareNowCommandOutput
131140
| UpdateHypervisorCommandOutput;
132141

133142
export interface ClientDefaults extends Partial<__SmithyResolvedConfiguration<__HttpHandlerOptions>> {
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
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 { BackupGatewayClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BackupGatewayClient";
16+
import { GetGatewayInput, GetGatewayOutput } from "../models/models_0";
17+
import {
18+
deserializeAws_json1_0GetGatewayCommand,
19+
serializeAws_json1_0GetGatewayCommand,
20+
} from "../protocols/Aws_json1_0";
21+
22+
export interface GetGatewayCommandInput extends GetGatewayInput {}
23+
export interface GetGatewayCommandOutput extends GetGatewayOutput, __MetadataBearer {}
24+
25+
/**
26+
* <p>By providing the ARN (Amazon Resource Name), this
27+
* API returns the gateway.</p>
28+
* @example
29+
* Use a bare-bones client and the command you need to make an API call.
30+
* ```javascript
31+
* import { BackupGatewayClient, GetGatewayCommand } from "@aws-sdk/client-backup-gateway"; // ES Modules import
32+
* // const { BackupGatewayClient, GetGatewayCommand } = require("@aws-sdk/client-backup-gateway"); // CommonJS import
33+
* const client = new BackupGatewayClient(config);
34+
* const command = new GetGatewayCommand(input);
35+
* const response = await client.send(command);
36+
* ```
37+
*
38+
* @see {@link GetGatewayCommandInput} for command's `input` shape.
39+
* @see {@link GetGatewayCommandOutput} for command's `response` shape.
40+
* @see {@link BackupGatewayClientResolvedConfig | config} for BackupGatewayClient's `config` shape.
41+
*
42+
*/
43+
export class GetGatewayCommand extends $Command<
44+
GetGatewayCommandInput,
45+
GetGatewayCommandOutput,
46+
BackupGatewayClientResolvedConfig
47+
> {
48+
// Start section: command_properties
49+
// End section: command_properties
50+
51+
constructor(readonly input: GetGatewayCommandInput) {
52+
// Start section: command_constructor
53+
super();
54+
// End section: command_constructor
55+
}
56+
57+
/**
58+
* @internal
59+
*/
60+
resolveMiddleware(
61+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
62+
configuration: BackupGatewayClientResolvedConfig,
63+
options?: __HttpHandlerOptions
64+
): Handler<GetGatewayCommandInput, GetGatewayCommandOutput> {
65+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
66+
67+
const stack = clientStack.concat(this.middlewareStack);
68+
69+
const { logger } = configuration;
70+
const clientName = "BackupGatewayClient";
71+
const commandName = "GetGatewayCommand";
72+
const handlerExecutionContext: HandlerExecutionContext = {
73+
logger,
74+
clientName,
75+
commandName,
76+
inputFilterSensitiveLog: GetGatewayInput.filterSensitiveLog,
77+
outputFilterSensitiveLog: GetGatewayOutput.filterSensitiveLog,
78+
};
79+
const { requestHandler } = configuration;
80+
return stack.resolve(
81+
(request: FinalizeHandlerArguments<any>) =>
82+
requestHandler.handle(request.request as __HttpRequest, options || {}),
83+
handlerExecutionContext
84+
);
85+
}
86+
87+
private serialize(input: GetGatewayCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
88+
return serializeAws_json1_0GetGatewayCommand(input, context);
89+
}
90+
91+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<GetGatewayCommandOutput> {
92+
return deserializeAws_json1_0GetGatewayCommand(output, context);
93+
}
94+
95+
// Start section: command_body_extra
96+
// End section: command_body_extra
97+
}
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 { BackupGatewayClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BackupGatewayClient";
16+
import { UpdateGatewaySoftwareNowInput, UpdateGatewaySoftwareNowOutput } from "../models/models_0";
17+
import {
18+
deserializeAws_json1_0UpdateGatewaySoftwareNowCommand,
19+
serializeAws_json1_0UpdateGatewaySoftwareNowCommand,
20+
} from "../protocols/Aws_json1_0";
21+
22+
export interface UpdateGatewaySoftwareNowCommandInput extends UpdateGatewaySoftwareNowInput {}
23+
export interface UpdateGatewaySoftwareNowCommandOutput extends UpdateGatewaySoftwareNowOutput, __MetadataBearer {}
24+
25+
/**
26+
* <p>Updates the gateway virtual machine (VM) software.
27+
* The request immediately triggers the software update.</p>
28+
* <note>
29+
* <p>When you make this request, you get a <code>200 OK</code>
30+
* success response immediately. However, it might take some
31+
* time for the update to complete.</p>
32+
* </note>
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { BackupGatewayClient, UpdateGatewaySoftwareNowCommand } from "@aws-sdk/client-backup-gateway"; // ES Modules import
37+
* // const { BackupGatewayClient, UpdateGatewaySoftwareNowCommand } = require("@aws-sdk/client-backup-gateway"); // CommonJS import
38+
* const client = new BackupGatewayClient(config);
39+
* const command = new UpdateGatewaySoftwareNowCommand(input);
40+
* const response = await client.send(command);
41+
* ```
42+
*
43+
* @see {@link UpdateGatewaySoftwareNowCommandInput} for command's `input` shape.
44+
* @see {@link UpdateGatewaySoftwareNowCommandOutput} for command's `response` shape.
45+
* @see {@link BackupGatewayClientResolvedConfig | config} for BackupGatewayClient's `config` shape.
46+
*
47+
*/
48+
export class UpdateGatewaySoftwareNowCommand extends $Command<
49+
UpdateGatewaySoftwareNowCommandInput,
50+
UpdateGatewaySoftwareNowCommandOutput,
51+
BackupGatewayClientResolvedConfig
52+
> {
53+
// Start section: command_properties
54+
// End section: command_properties
55+
56+
constructor(readonly input: UpdateGatewaySoftwareNowCommandInput) {
57+
// Start section: command_constructor
58+
super();
59+
// End section: command_constructor
60+
}
61+
62+
/**
63+
* @internal
64+
*/
65+
resolveMiddleware(
66+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
67+
configuration: BackupGatewayClientResolvedConfig,
68+
options?: __HttpHandlerOptions
69+
): Handler<UpdateGatewaySoftwareNowCommandInput, UpdateGatewaySoftwareNowCommandOutput> {
70+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
71+
72+
const stack = clientStack.concat(this.middlewareStack);
73+
74+
const { logger } = configuration;
75+
const clientName = "BackupGatewayClient";
76+
const commandName = "UpdateGatewaySoftwareNowCommand";
77+
const handlerExecutionContext: HandlerExecutionContext = {
78+
logger,
79+
clientName,
80+
commandName,
81+
inputFilterSensitiveLog: UpdateGatewaySoftwareNowInput.filterSensitiveLog,
82+
outputFilterSensitiveLog: UpdateGatewaySoftwareNowOutput.filterSensitiveLog,
83+
};
84+
const { requestHandler } = configuration;
85+
return stack.resolve(
86+
(request: FinalizeHandlerArguments<any>) =>
87+
requestHandler.handle(request.request as __HttpRequest, options || {}),
88+
handlerExecutionContext
89+
);
90+
}
91+
92+
private serialize(input: UpdateGatewaySoftwareNowCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
93+
return serializeAws_json1_0UpdateGatewaySoftwareNowCommand(input, context);
94+
}
95+
96+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<UpdateGatewaySoftwareNowCommandOutput> {
97+
return deserializeAws_json1_0UpdateGatewaySoftwareNowCommand(output, context);
98+
}
99+
100+
// Start section: command_body_extra
101+
// End section: command_body_extra
102+
}

clients/client-backup-gateway/src/commands/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export * from "./CreateGatewayCommand";
44
export * from "./DeleteGatewayCommand";
55
export * from "./DeleteHypervisorCommand";
66
export * from "./DisassociateGatewayFromServerCommand";
7+
export * from "./GetGatewayCommand";
78
export * from "./ImportHypervisorConfigurationCommand";
89
export * from "./ListGatewaysCommand";
910
export * from "./ListHypervisorsCommand";
@@ -14,4 +15,5 @@ export * from "./TagResourceCommand";
1415
export * from "./TestHypervisorConfigurationCommand";
1516
export * from "./UntagResourceCommand";
1617
export * from "./UpdateGatewayInformationCommand";
18+
export * from "./UpdateGatewaySoftwareNowCommand";
1719
export * from "./UpdateHypervisorCommand";

0 commit comments

Comments
 (0)