Skip to content

Commit 3cef41f

Browse files
author
awstools
committed
feat(client-medialive): Link devices now support remote rebooting. Link devices now support maintenance windows. Maintenance windows allow a Link device to install software updates without stopping the MediaLive channel. The channel will experience a brief loss of input from the device while updates are installed.
1 parent 23fdb65 commit 3cef41f

File tree

12 files changed

+910
-178
lines changed

12 files changed

+910
-178
lines changed

clients/client-medialive/src/MediaLive.ts

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ import {
180180
PurchaseOfferingCommandInput,
181181
PurchaseOfferingCommandOutput,
182182
} from "./commands/PurchaseOfferingCommand";
183+
import {
184+
RebootInputDeviceCommand,
185+
RebootInputDeviceCommandInput,
186+
RebootInputDeviceCommandOutput,
187+
} from "./commands/RebootInputDeviceCommand";
183188
import {
184189
RejectInputDeviceTransferCommand,
185190
RejectInputDeviceTransferCommandInput,
@@ -190,6 +195,11 @@ import {
190195
StartChannelCommandInput,
191196
StartChannelCommandOutput,
192197
} from "./commands/StartChannelCommand";
198+
import {
199+
StartInputDeviceMaintenanceWindowCommand,
200+
StartInputDeviceMaintenanceWindowCommandInput,
201+
StartInputDeviceMaintenanceWindowCommandOutput,
202+
} from "./commands/StartInputDeviceMaintenanceWindowCommand";
193203
import {
194204
StartMultiplexCommand,
195205
StartMultiplexCommandInput,
@@ -1567,6 +1577,38 @@ export class MediaLive extends MediaLiveClient {
15671577
}
15681578
}
15691579

1580+
/**
1581+
* Send a reboot command to the specified input device. The device will begin rebooting within a few seconds of sending the command. When the reboot is complete, the device’s connection status will change to connected.
1582+
*/
1583+
public rebootInputDevice(
1584+
args: RebootInputDeviceCommandInput,
1585+
options?: __HttpHandlerOptions
1586+
): Promise<RebootInputDeviceCommandOutput>;
1587+
public rebootInputDevice(
1588+
args: RebootInputDeviceCommandInput,
1589+
cb: (err: any, data?: RebootInputDeviceCommandOutput) => void
1590+
): void;
1591+
public rebootInputDevice(
1592+
args: RebootInputDeviceCommandInput,
1593+
options: __HttpHandlerOptions,
1594+
cb: (err: any, data?: RebootInputDeviceCommandOutput) => void
1595+
): void;
1596+
public rebootInputDevice(
1597+
args: RebootInputDeviceCommandInput,
1598+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: RebootInputDeviceCommandOutput) => void),
1599+
cb?: (err: any, data?: RebootInputDeviceCommandOutput) => void
1600+
): Promise<RebootInputDeviceCommandOutput> | void {
1601+
const command = new RebootInputDeviceCommand(args);
1602+
if (typeof optionsOrCb === "function") {
1603+
this.send(command, optionsOrCb);
1604+
} else if (typeof cb === "function") {
1605+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1606+
this.send(command, optionsOrCb || {}, cb);
1607+
} else {
1608+
return this.send(command, optionsOrCb);
1609+
}
1610+
}
1611+
15701612
/**
15711613
* Reject the transfer of the specified input device to your AWS account.
15721614
*/
@@ -1628,6 +1670,38 @@ export class MediaLive extends MediaLiveClient {
16281670
}
16291671
}
16301672

1673+
/**
1674+
* Start a maintenance window for the specified input device. Starting a maintenance window will give the device up to two hours to install software. If the device was streaming prior to the maintenance, it will resume streaming when the software is fully installed. Devices automatically install updates while they are powered on and their MediaLive channels are stopped. A maintenance window allows you to update a device without having to stop MediaLive channels that use the device. The device must remain powered on and connected to the internet for the duration of the maintenance.
1675+
*/
1676+
public startInputDeviceMaintenanceWindow(
1677+
args: StartInputDeviceMaintenanceWindowCommandInput,
1678+
options?: __HttpHandlerOptions
1679+
): Promise<StartInputDeviceMaintenanceWindowCommandOutput>;
1680+
public startInputDeviceMaintenanceWindow(
1681+
args: StartInputDeviceMaintenanceWindowCommandInput,
1682+
cb: (err: any, data?: StartInputDeviceMaintenanceWindowCommandOutput) => void
1683+
): void;
1684+
public startInputDeviceMaintenanceWindow(
1685+
args: StartInputDeviceMaintenanceWindowCommandInput,
1686+
options: __HttpHandlerOptions,
1687+
cb: (err: any, data?: StartInputDeviceMaintenanceWindowCommandOutput) => void
1688+
): void;
1689+
public startInputDeviceMaintenanceWindow(
1690+
args: StartInputDeviceMaintenanceWindowCommandInput,
1691+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: StartInputDeviceMaintenanceWindowCommandOutput) => void),
1692+
cb?: (err: any, data?: StartInputDeviceMaintenanceWindowCommandOutput) => void
1693+
): Promise<StartInputDeviceMaintenanceWindowCommandOutput> | void {
1694+
const command = new StartInputDeviceMaintenanceWindowCommand(args);
1695+
if (typeof optionsOrCb === "function") {
1696+
this.send(command, optionsOrCb);
1697+
} else if (typeof cb === "function") {
1698+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1699+
this.send(command, optionsOrCb || {}, cb);
1700+
} else {
1701+
return this.send(command, optionsOrCb);
1702+
}
1703+
}
1704+
16311705
/**
16321706
* Start (run) the multiplex. Starting the multiplex does not start the channels. You must explicitly start each channel.
16331707
*/

clients/client-medialive/src/MediaLiveClient.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,16 @@ import {
144144
ListTagsForResourceCommandOutput,
145145
} from "./commands/ListTagsForResourceCommand";
146146
import { PurchaseOfferingCommandInput, PurchaseOfferingCommandOutput } from "./commands/PurchaseOfferingCommand";
147+
import { RebootInputDeviceCommandInput, RebootInputDeviceCommandOutput } from "./commands/RebootInputDeviceCommand";
147148
import {
148149
RejectInputDeviceTransferCommandInput,
149150
RejectInputDeviceTransferCommandOutput,
150151
} from "./commands/RejectInputDeviceTransferCommand";
151152
import { StartChannelCommandInput, StartChannelCommandOutput } from "./commands/StartChannelCommand";
153+
import {
154+
StartInputDeviceMaintenanceWindowCommandInput,
155+
StartInputDeviceMaintenanceWindowCommandOutput,
156+
} from "./commands/StartInputDeviceMaintenanceWindowCommand";
152157
import { StartMultiplexCommandInput, StartMultiplexCommandOutput } from "./commands/StartMultiplexCommand";
153158
import { StopChannelCommandInput, StopChannelCommandOutput } from "./commands/StopChannelCommand";
154159
import { StopMultiplexCommandInput, StopMultiplexCommandOutput } from "./commands/StopMultiplexCommand";
@@ -216,8 +221,10 @@ export type ServiceInputTypes =
216221
| ListReservationsCommandInput
217222
| ListTagsForResourceCommandInput
218223
| PurchaseOfferingCommandInput
224+
| RebootInputDeviceCommandInput
219225
| RejectInputDeviceTransferCommandInput
220226
| StartChannelCommandInput
227+
| StartInputDeviceMaintenanceWindowCommandInput
221228
| StartMultiplexCommandInput
222229
| StopChannelCommandInput
223230
| StopMultiplexCommandInput
@@ -275,8 +282,10 @@ export type ServiceOutputTypes =
275282
| ListReservationsCommandOutput
276283
| ListTagsForResourceCommandOutput
277284
| PurchaseOfferingCommandOutput
285+
| RebootInputDeviceCommandOutput
278286
| RejectInputDeviceTransferCommandOutput
279287
| StartChannelCommandOutput
288+
| StartInputDeviceMaintenanceWindowCommandOutput
280289
| StartMultiplexCommandOutput
281290
| StopChannelCommandOutput
282291
| StopMultiplexCommandOutput
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
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 { MediaLiveClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaLiveClient";
16+
import { RebootInputDeviceRequest, RebootInputDeviceResponse } from "../models/models_1";
17+
import {
18+
deserializeAws_restJson1RebootInputDeviceCommand,
19+
serializeAws_restJson1RebootInputDeviceCommand,
20+
} from "../protocols/Aws_restJson1";
21+
22+
export interface RebootInputDeviceCommandInput extends RebootInputDeviceRequest {}
23+
export interface RebootInputDeviceCommandOutput extends RebootInputDeviceResponse, __MetadataBearer {}
24+
25+
/**
26+
* Send a reboot command to the specified input device. The device will begin rebooting within a few seconds of sending the command. When the reboot is complete, the device’s connection status will change to connected.
27+
* @example
28+
* Use a bare-bones client and the command you need to make an API call.
29+
* ```javascript
30+
* import { MediaLiveClient, RebootInputDeviceCommand } from "@aws-sdk/client-medialive"; // ES Modules import
31+
* // const { MediaLiveClient, RebootInputDeviceCommand } = require("@aws-sdk/client-medialive"); // CommonJS import
32+
* const client = new MediaLiveClient(config);
33+
* const command = new RebootInputDeviceCommand(input);
34+
* const response = await client.send(command);
35+
* ```
36+
*
37+
* @see {@link RebootInputDeviceCommandInput} for command's `input` shape.
38+
* @see {@link RebootInputDeviceCommandOutput} for command's `response` shape.
39+
* @see {@link MediaLiveClientResolvedConfig | config} for MediaLiveClient's `config` shape.
40+
*
41+
*/
42+
export class RebootInputDeviceCommand extends $Command<
43+
RebootInputDeviceCommandInput,
44+
RebootInputDeviceCommandOutput,
45+
MediaLiveClientResolvedConfig
46+
> {
47+
// Start section: command_properties
48+
// End section: command_properties
49+
50+
constructor(readonly input: RebootInputDeviceCommandInput) {
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: MediaLiveClientResolvedConfig,
62+
options?: __HttpHandlerOptions
63+
): Handler<RebootInputDeviceCommandInput, RebootInputDeviceCommandOutput> {
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 = "MediaLiveClient";
70+
const commandName = "RebootInputDeviceCommand";
71+
const handlerExecutionContext: HandlerExecutionContext = {
72+
logger,
73+
clientName,
74+
commandName,
75+
inputFilterSensitiveLog: RebootInputDeviceRequest.filterSensitiveLog,
76+
outputFilterSensitiveLog: RebootInputDeviceResponse.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(input: RebootInputDeviceCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
87+
return serializeAws_restJson1RebootInputDeviceCommand(input, context);
88+
}
89+
90+
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<RebootInputDeviceCommandOutput> {
91+
return deserializeAws_restJson1RebootInputDeviceCommand(output, context);
92+
}
93+
94+
// Start section: command_body_extra
95+
// End section: command_body_extra
96+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
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 { MediaLiveClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaLiveClient";
16+
import {
17+
StartInputDeviceMaintenanceWindowRequest,
18+
StartInputDeviceMaintenanceWindowResponse,
19+
} from "../models/models_1";
20+
import {
21+
deserializeAws_restJson1StartInputDeviceMaintenanceWindowCommand,
22+
serializeAws_restJson1StartInputDeviceMaintenanceWindowCommand,
23+
} from "../protocols/Aws_restJson1";
24+
25+
export interface StartInputDeviceMaintenanceWindowCommandInput extends StartInputDeviceMaintenanceWindowRequest {}
26+
export interface StartInputDeviceMaintenanceWindowCommandOutput
27+
extends StartInputDeviceMaintenanceWindowResponse,
28+
__MetadataBearer {}
29+
30+
/**
31+
* Start a maintenance window for the specified input device. Starting a maintenance window will give the device up to two hours to install software. If the device was streaming prior to the maintenance, it will resume streaming when the software is fully installed. Devices automatically install updates while they are powered on and their MediaLive channels are stopped. A maintenance window allows you to update a device without having to stop MediaLive channels that use the device. The device must remain powered on and connected to the internet for the duration of the maintenance.
32+
* @example
33+
* Use a bare-bones client and the command you need to make an API call.
34+
* ```javascript
35+
* import { MediaLiveClient, StartInputDeviceMaintenanceWindowCommand } from "@aws-sdk/client-medialive"; // ES Modules import
36+
* // const { MediaLiveClient, StartInputDeviceMaintenanceWindowCommand } = require("@aws-sdk/client-medialive"); // CommonJS import
37+
* const client = new MediaLiveClient(config);
38+
* const command = new StartInputDeviceMaintenanceWindowCommand(input);
39+
* const response = await client.send(command);
40+
* ```
41+
*
42+
* @see {@link StartInputDeviceMaintenanceWindowCommandInput} for command's `input` shape.
43+
* @see {@link StartInputDeviceMaintenanceWindowCommandOutput} for command's `response` shape.
44+
* @see {@link MediaLiveClientResolvedConfig | config} for MediaLiveClient's `config` shape.
45+
*
46+
*/
47+
export class StartInputDeviceMaintenanceWindowCommand extends $Command<
48+
StartInputDeviceMaintenanceWindowCommandInput,
49+
StartInputDeviceMaintenanceWindowCommandOutput,
50+
MediaLiveClientResolvedConfig
51+
> {
52+
// Start section: command_properties
53+
// End section: command_properties
54+
55+
constructor(readonly input: StartInputDeviceMaintenanceWindowCommandInput) {
56+
// Start section: command_constructor
57+
super();
58+
// End section: command_constructor
59+
}
60+
61+
/**
62+
* @internal
63+
*/
64+
resolveMiddleware(
65+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
66+
configuration: MediaLiveClientResolvedConfig,
67+
options?: __HttpHandlerOptions
68+
): Handler<StartInputDeviceMaintenanceWindowCommandInput, StartInputDeviceMaintenanceWindowCommandOutput> {
69+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
70+
71+
const stack = clientStack.concat(this.middlewareStack);
72+
73+
const { logger } = configuration;
74+
const clientName = "MediaLiveClient";
75+
const commandName = "StartInputDeviceMaintenanceWindowCommand";
76+
const handlerExecutionContext: HandlerExecutionContext = {
77+
logger,
78+
clientName,
79+
commandName,
80+
inputFilterSensitiveLog: StartInputDeviceMaintenanceWindowRequest.filterSensitiveLog,
81+
outputFilterSensitiveLog: StartInputDeviceMaintenanceWindowResponse.filterSensitiveLog,
82+
};
83+
const { requestHandler } = configuration;
84+
return stack.resolve(
85+
(request: FinalizeHandlerArguments<any>) =>
86+
requestHandler.handle(request.request as __HttpRequest, options || {}),
87+
handlerExecutionContext
88+
);
89+
}
90+
91+
private serialize(
92+
input: StartInputDeviceMaintenanceWindowCommandInput,
93+
context: __SerdeContext
94+
): Promise<__HttpRequest> {
95+
return serializeAws_restJson1StartInputDeviceMaintenanceWindowCommand(input, context);
96+
}
97+
98+
private deserialize(
99+
output: __HttpResponse,
100+
context: __SerdeContext
101+
): Promise<StartInputDeviceMaintenanceWindowCommandOutput> {
102+
return deserializeAws_restJson1StartInputDeviceMaintenanceWindowCommand(output, context);
103+
}
104+
105+
// Start section: command_body_extra
106+
// End section: command_body_extra
107+
}

clients/client-medialive/src/commands/UpdateInputCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
} from "@aws-sdk/types";
1414

1515
import { MediaLiveClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaLiveClient";
16-
import { UpdateInputRequest, UpdateInputResponse } from "../models/models_1";
16+
import { UpdateInputRequest } from "../models/models_1";
17+
import { UpdateInputResponse } from "../models/models_2";
1718
import {
1819
deserializeAws_restJson1UpdateInputCommand,
1920
serializeAws_restJson1UpdateInputCommand,

clients/client-medialive/src/commands/UpdateInputDeviceCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "@aws-sdk/types";
1414

1515
import { MediaLiveClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaLiveClient";
16-
import { UpdateInputDeviceRequest, UpdateInputDeviceResponse } from "../models/models_1";
16+
import { UpdateInputDeviceRequest, UpdateInputDeviceResponse } from "../models/models_2";
1717
import {
1818
deserializeAws_restJson1UpdateInputDeviceCommand,
1919
serializeAws_restJson1UpdateInputDeviceCommand,

clients/client-medialive/src/commands/UpdateInputSecurityGroupCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "@aws-sdk/types";
1414

1515
import { MediaLiveClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../MediaLiveClient";
16-
import { UpdateInputSecurityGroupRequest, UpdateInputSecurityGroupResponse } from "../models/models_1";
16+
import { UpdateInputSecurityGroupRequest, UpdateInputSecurityGroupResponse } from "../models/models_2";
1717
import {
1818
deserializeAws_restJson1UpdateInputSecurityGroupCommand,
1919
serializeAws_restJson1UpdateInputSecurityGroupCommand,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ export * from "./ListOfferingsCommand";
4242
export * from "./ListReservationsCommand";
4343
export * from "./ListTagsForResourceCommand";
4444
export * from "./PurchaseOfferingCommand";
45+
export * from "./RebootInputDeviceCommand";
4546
export * from "./RejectInputDeviceTransferCommand";
4647
export * from "./StartChannelCommand";
48+
export * from "./StartInputDeviceMaintenanceWindowCommand";
4749
export * from "./StartMultiplexCommand";
4850
export * from "./StopChannelCommand";
4951
export * from "./StopMultiplexCommand";

0 commit comments

Comments
 (0)