Skip to content

Commit b203a9c

Browse files
author
awstools
committed
feat(client-iot-jobs-data-plane): General Availability (GA) release of AWS IoT Device Management - Commands, to trigger light-weight remote actions on targeted devices
1 parent 0f45892 commit b203a9c

14 files changed

+1056
-144
lines changed

Diff for: clients/client-iot-jobs-data-plane/README.md

+29-11
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,27 @@
66

77
AWS SDK for JavaScript IoTJobsDataPlane Client for Node.js, Browser and React Native.
88

9-
<p>AWS IoT Jobs is a service that allows you to define a set of jobs — remote operations that are sent to
10-
and executed on one or more devices connected to AWS IoT. For example, you can define a job that instructs a
11-
set of devices to download and install application or firmware updates, reboot, rotate certificates, or perform
12-
remote troubleshooting operations.</p>
13-
<p> To create a job, you make a job document which is a description of the remote operations to be
14-
performed, and you specify a list of targets that should perform the operations. The targets can be individual
15-
things, thing groups or both.</p>
16-
<p> AWS IoT Jobs sends a message to inform the targets that a job is available. The target starts the
17-
execution of the job by downloading the job document, performing the operations it specifies, and reporting its
18-
progress to AWS IoT. The Jobs service provides commands to track the progress of a job on a specific target and
19-
for all the targets of the job</p>
9+
<p>IoT Jobs is a service that allows you to define a set of jobs — remote operations
10+
that are sent to and executed on one or more devices connected to Amazon Web Services IoT Core. For example,
11+
you can define a job that instructs a set of devices to download and install application or
12+
firmware updates, reboot, rotate certificates, or perform remote troubleshooting
13+
operations.</p>
14+
<p>Find the endpoint address for actions in the IoT jobs data plane by running this
15+
CLI command:</p>
16+
<p>
17+
<code>aws iot describe-endpoint --endpoint-type iot:Jobs</code>
18+
</p>
19+
<p>The service name used by <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">Amazon Web Services
20+
Signature Version 4</a> to sign requests is:
21+
<i>iot-jobs-data</i>.</p>
22+
<p> To create a job, you make a job document which is a description of the remote
23+
operations to be performed, and you specify a list of targets that should perform the
24+
operations. The targets can be individual things, thing groups or both.</p>
25+
<p> IoT Jobs sends a message to inform the targets that a job is available. The target
26+
starts the execution of the job by downloading the job document, performing the operations
27+
it specifies, and reporting its progress to Amazon Web Services IoT Core. The Jobs service provides commands
28+
to track the progress of a job on a specific target and for all the targets of the
29+
job</p>
2030

2131
## Installing
2232

@@ -228,6 +238,14 @@ GetPendingJobExecutions
228238

229239
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/iot-jobs-data-plane/command/GetPendingJobExecutionsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot-jobs-data-plane/Interface/GetPendingJobExecutionsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot-jobs-data-plane/Interface/GetPendingJobExecutionsCommandOutput/)
230240

241+
</details>
242+
<details>
243+
<summary>
244+
StartCommandExecution
245+
</summary>
246+
247+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/iot-jobs-data-plane/command/StartCommandExecutionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot-jobs-data-plane/Interface/StartCommandExecutionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-iot-jobs-data-plane/Interface/StartCommandExecutionCommandOutput/)
248+
231249
</details>
232250
<details>
233251
<summary>

Diff for: clients/client-iot-jobs-data-plane/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@
5858
"@smithy/util-middleware": "^3.0.10",
5959
"@smithy/util-retry": "^3.0.10",
6060
"@smithy/util-utf8": "^3.0.0",
61-
"tslib": "^2.6.2"
61+
"@types/uuid": "^9.0.1",
62+
"tslib": "^2.6.2",
63+
"uuid": "^9.0.1"
6264
},
6365
"devDependencies": {
6466
"@tsconfig/node16": "16.1.3",

Diff for: clients/client-iot-jobs-data-plane/src/IoTJobsDataPlane.ts

+44-11
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ import {
1212
GetPendingJobExecutionsCommandInput,
1313
GetPendingJobExecutionsCommandOutput,
1414
} from "./commands/GetPendingJobExecutionsCommand";
15+
import {
16+
StartCommandExecutionCommand,
17+
StartCommandExecutionCommandInput,
18+
StartCommandExecutionCommandOutput,
19+
} from "./commands/StartCommandExecutionCommand";
1520
import {
1621
StartNextPendingJobExecutionCommand,
1722
StartNextPendingJobExecutionCommandInput,
@@ -27,6 +32,7 @@ import { IoTJobsDataPlaneClient, IoTJobsDataPlaneClientConfig } from "./IoTJobsD
2732
const commands = {
2833
DescribeJobExecutionCommand,
2934
GetPendingJobExecutionsCommand,
35+
StartCommandExecutionCommand,
3036
StartNextPendingJobExecutionCommand,
3137
UpdateJobExecutionCommand,
3238
};
@@ -66,6 +72,23 @@ export interface IoTJobsDataPlane {
6672
cb: (err: any, data?: GetPendingJobExecutionsCommandOutput) => void
6773
): void;
6874

75+
/**
76+
* @see {@link StartCommandExecutionCommand}
77+
*/
78+
startCommandExecution(
79+
args: StartCommandExecutionCommandInput,
80+
options?: __HttpHandlerOptions
81+
): Promise<StartCommandExecutionCommandOutput>;
82+
startCommandExecution(
83+
args: StartCommandExecutionCommandInput,
84+
cb: (err: any, data?: StartCommandExecutionCommandOutput) => void
85+
): void;
86+
startCommandExecution(
87+
args: StartCommandExecutionCommandInput,
88+
options: __HttpHandlerOptions,
89+
cb: (err: any, data?: StartCommandExecutionCommandOutput) => void
90+
): void;
91+
6992
/**
7093
* @see {@link StartNextPendingJobExecutionCommand}
7194
*/
@@ -102,17 +125,27 @@ export interface IoTJobsDataPlane {
102125
}
103126

104127
/**
105-
* <p>AWS IoT Jobs is a service that allows you to define a set of jobs — remote operations that are sent to
106-
* and executed on one or more devices connected to AWS IoT. For example, you can define a job that instructs a
107-
* set of devices to download and install application or firmware updates, reboot, rotate certificates, or perform
108-
* remote troubleshooting operations.</p>
109-
* <p> To create a job, you make a job document which is a description of the remote operations to be
110-
* performed, and you specify a list of targets that should perform the operations. The targets can be individual
111-
* things, thing groups or both.</p>
112-
* <p> AWS IoT Jobs sends a message to inform the targets that a job is available. The target starts the
113-
* execution of the job by downloading the job document, performing the operations it specifies, and reporting its
114-
* progress to AWS IoT. The Jobs service provides commands to track the progress of a job on a specific target and
115-
* for all the targets of the job</p>
128+
* <p>IoT Jobs is a service that allows you to define a set of jobs — remote operations
129+
* that are sent to and executed on one or more devices connected to Amazon Web Services IoT Core. For example,
130+
* you can define a job that instructs a set of devices to download and install application or
131+
* firmware updates, reboot, rotate certificates, or perform remote troubleshooting
132+
* operations.</p>
133+
* <p>Find the endpoint address for actions in the IoT jobs data plane by running this
134+
* CLI command:</p>
135+
* <p>
136+
* <code>aws iot describe-endpoint --endpoint-type iot:Jobs</code>
137+
* </p>
138+
* <p>The service name used by <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">Amazon Web Services
139+
* Signature Version 4</a> to sign requests is:
140+
* <i>iot-jobs-data</i>.</p>
141+
* <p> To create a job, you make a job document which is a description of the remote
142+
* operations to be performed, and you specify a list of targets that should perform the
143+
* operations. The targets can be individual things, thing groups or both.</p>
144+
* <p> IoT Jobs sends a message to inform the targets that a job is available. The target
145+
* starts the execution of the job by downloading the job document, performing the operations
146+
* it specifies, and reporting its progress to Amazon Web Services IoT Core. The Jobs service provides commands
147+
* to track the progress of a job on a specific target and for all the targets of the
148+
* job</p>
116149
* @public
117150
*/
118151
export class IoTJobsDataPlane extends IoTJobsDataPlaneClient implements IoTJobsDataPlane {}

Diff for: clients/client-iot-jobs-data-plane/src/IoTJobsDataPlaneClient.ts

+27-11
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ import {
6161
GetPendingJobExecutionsCommandInput,
6262
GetPendingJobExecutionsCommandOutput,
6363
} from "./commands/GetPendingJobExecutionsCommand";
64+
import {
65+
StartCommandExecutionCommandInput,
66+
StartCommandExecutionCommandOutput,
67+
} from "./commands/StartCommandExecutionCommand";
6468
import {
6569
StartNextPendingJobExecutionCommandInput,
6670
StartNextPendingJobExecutionCommandOutput,
@@ -83,6 +87,7 @@ export { __Client };
8387
export type ServiceInputTypes =
8488
| DescribeJobExecutionCommandInput
8589
| GetPendingJobExecutionsCommandInput
90+
| StartCommandExecutionCommandInput
8691
| StartNextPendingJobExecutionCommandInput
8792
| UpdateJobExecutionCommandInput;
8893

@@ -92,6 +97,7 @@ export type ServiceInputTypes =
9297
export type ServiceOutputTypes =
9398
| DescribeJobExecutionCommandOutput
9499
| GetPendingJobExecutionsCommandOutput
100+
| StartCommandExecutionCommandOutput
95101
| StartNextPendingJobExecutionCommandOutput
96102
| UpdateJobExecutionCommandOutput;
97103

@@ -267,17 +273,27 @@ export type IoTJobsDataPlaneClientResolvedConfigType = __SmithyResolvedConfigura
267273
export interface IoTJobsDataPlaneClientResolvedConfig extends IoTJobsDataPlaneClientResolvedConfigType {}
268274

269275
/**
270-
* <p>AWS IoT Jobs is a service that allows you to define a set of jobs — remote operations that are sent to
271-
* and executed on one or more devices connected to AWS IoT. For example, you can define a job that instructs a
272-
* set of devices to download and install application or firmware updates, reboot, rotate certificates, or perform
273-
* remote troubleshooting operations.</p>
274-
* <p> To create a job, you make a job document which is a description of the remote operations to be
275-
* performed, and you specify a list of targets that should perform the operations. The targets can be individual
276-
* things, thing groups or both.</p>
277-
* <p> AWS IoT Jobs sends a message to inform the targets that a job is available. The target starts the
278-
* execution of the job by downloading the job document, performing the operations it specifies, and reporting its
279-
* progress to AWS IoT. The Jobs service provides commands to track the progress of a job on a specific target and
280-
* for all the targets of the job</p>
276+
* <p>IoT Jobs is a service that allows you to define a set of jobs — remote operations
277+
* that are sent to and executed on one or more devices connected to Amazon Web Services IoT Core. For example,
278+
* you can define a job that instructs a set of devices to download and install application or
279+
* firmware updates, reboot, rotate certificates, or perform remote troubleshooting
280+
* operations.</p>
281+
* <p>Find the endpoint address for actions in the IoT jobs data plane by running this
282+
* CLI command:</p>
283+
* <p>
284+
* <code>aws iot describe-endpoint --endpoint-type iot:Jobs</code>
285+
* </p>
286+
* <p>The service name used by <a href="https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html">Amazon Web Services
287+
* Signature Version 4</a> to sign requests is:
288+
* <i>iot-jobs-data</i>.</p>
289+
* <p> To create a job, you make a job document which is a description of the remote
290+
* operations to be performed, and you specify a list of targets that should perform the
291+
* operations. The targets can be individual things, thing groups or both.</p>
292+
* <p> IoT Jobs sends a message to inform the targets that a job is available. The target
293+
* starts the execution of the job by downloading the job document, performing the operations
294+
* it specifies, and reporting its progress to Amazon Web Services IoT Core. The Jobs service provides commands
295+
* to track the progress of a job on a specific target and for all the targets of the
296+
* job</p>
281297
* @public
282298
*/
283299
export class IoTJobsDataPlaneClient extends __Client<

Diff for: clients/client-iot-jobs-data-plane/src/commands/DescribeJobExecutionCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface DescribeJobExecutionCommandOutput extends DescribeJobExecutionR
2929

3030
/**
3131
* <p>Gets details of a job execution.</p>
32+
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">DescribeJobExecution</a> action.</p>
3233
* @example
3334
* Use a bare-bones client and the command you need to make an API call.
3435
* ```javascript
@@ -73,7 +74,7 @@ export interface DescribeJobExecutionCommandOutput extends DescribeJobExecutionR
7374
* <p>The certificate is invalid.</p>
7475
*
7576
* @throws {@link InvalidRequestException} (client fault)
76-
* <p>The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.</p>
77+
* <p>The contents of the request were invalid.</p>
7778
*
7879
* @throws {@link ResourceNotFoundException} (client fault)
7980
* <p>The specified resource does not exist.</p>

Diff for: clients/client-iot-jobs-data-plane/src/commands/GetPendingJobExecutionsCommand.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface GetPendingJobExecutionsCommandOutput extends GetPendingJobExecu
2929

3030
/**
3131
* <p>Gets the list of all jobs for a thing that are not in a terminal status.</p>
32+
* <p>Requires permission to access the <a href="https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions">GetPendingJobExecutions</a> action.</p>
3233
* @example
3334
* Use a bare-bones client and the command you need to make an API call.
3435
* ```javascript
@@ -75,7 +76,7 @@ export interface GetPendingJobExecutionsCommandOutput extends GetPendingJobExecu
7576
* <p>The certificate is invalid.</p>
7677
*
7778
* @throws {@link InvalidRequestException} (client fault)
78-
* <p>The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.</p>
79+
* <p>The contents of the request were invalid.</p>
7980
*
8081
* @throws {@link ResourceNotFoundException} (client fault)
8182
* <p>The specified resource does not exist.</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { IoTJobsDataPlaneClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IoTJobsDataPlaneClient";
9+
import { StartCommandExecutionRequest, StartCommandExecutionResponse } from "../models/models_0";
10+
import { de_StartCommandExecutionCommand, se_StartCommandExecutionCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export type { __MetadataBearer };
16+
export { $Command };
17+
/**
18+
* @public
19+
*
20+
* The input for {@link StartCommandExecutionCommand}.
21+
*/
22+
export interface StartCommandExecutionCommandInput extends StartCommandExecutionRequest {}
23+
/**
24+
* @public
25+
*
26+
* The output of {@link StartCommandExecutionCommand}.
27+
*/
28+
export interface StartCommandExecutionCommandOutput extends StartCommandExecutionResponse, __MetadataBearer {}
29+
30+
/**
31+
* <p>Using the command created with the <code>CreateCommand</code> API, start a command
32+
* execution on a specific device.</p>
33+
* @example
34+
* Use a bare-bones client and the command you need to make an API call.
35+
* ```javascript
36+
* import { IoTJobsDataPlaneClient, StartCommandExecutionCommand } from "@aws-sdk/client-iot-jobs-data-plane"; // ES Modules import
37+
* // const { IoTJobsDataPlaneClient, StartCommandExecutionCommand } = require("@aws-sdk/client-iot-jobs-data-plane"); // CommonJS import
38+
* const client = new IoTJobsDataPlaneClient(config);
39+
* const input = { // StartCommandExecutionRequest
40+
* targetArn: "STRING_VALUE", // required
41+
* commandArn: "STRING_VALUE", // required
42+
* parameters: { // CommandExecutionParameterMap
43+
* "<keys>": { // CommandParameterValue
44+
* S: "STRING_VALUE",
45+
* B: true || false,
46+
* I: Number("int"),
47+
* L: Number("long"),
48+
* D: Number("double"),
49+
* BIN: new Uint8Array(), // e.g. Buffer.from("") or new TextEncoder().encode("")
50+
* UL: "STRING_VALUE",
51+
* },
52+
* },
53+
* executionTimeoutSeconds: Number("long"),
54+
* clientToken: "STRING_VALUE",
55+
* };
56+
* const command = new StartCommandExecutionCommand(input);
57+
* const response = await client.send(command);
58+
* // { // StartCommandExecutionResponse
59+
* // executionId: "STRING_VALUE",
60+
* // };
61+
*
62+
* ```
63+
*
64+
* @param StartCommandExecutionCommandInput - {@link StartCommandExecutionCommandInput}
65+
* @returns {@link StartCommandExecutionCommandOutput}
66+
* @see {@link StartCommandExecutionCommandInput} for command's `input` shape.
67+
* @see {@link StartCommandExecutionCommandOutput} for command's `response` shape.
68+
* @see {@link IoTJobsDataPlaneClientResolvedConfig | config} for IoTJobsDataPlaneClient's `config` shape.
69+
*
70+
* @throws {@link ConflictException} (client fault)
71+
* <p>A conflict has occurred when performing the API request.</p>
72+
*
73+
* @throws {@link InternalServerException} (server fault)
74+
* <p>An internal server error occurred when performing the API request.</p>
75+
*
76+
* @throws {@link ResourceNotFoundException} (client fault)
77+
* <p>The specified resource does not exist.</p>
78+
*
79+
* @throws {@link ServiceQuotaExceededException} (client fault)
80+
* <p>The service quota has been exceeded for this request.</p>
81+
*
82+
* @throws {@link ThrottlingException} (client fault)
83+
* <p>The rate exceeds the limit.</p>
84+
*
85+
* @throws {@link ValidationException} (client fault)
86+
* <p>A validation error occurred when performing the API request.</p>
87+
*
88+
* @throws {@link IoTJobsDataPlaneServiceException}
89+
* <p>Base exception class for all service exceptions from IoTJobsDataPlane service.</p>
90+
*
91+
* @public
92+
*/
93+
export class StartCommandExecutionCommand extends $Command
94+
.classBuilder<
95+
StartCommandExecutionCommandInput,
96+
StartCommandExecutionCommandOutput,
97+
IoTJobsDataPlaneClientResolvedConfig,
98+
ServiceInputTypes,
99+
ServiceOutputTypes
100+
>()
101+
.ep(commonParams)
102+
.m(function (this: any, Command: any, cs: any, config: IoTJobsDataPlaneClientResolvedConfig, o: any) {
103+
return [
104+
getSerdePlugin(config, this.serialize, this.deserialize),
105+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
106+
];
107+
})
108+
.s("IotLaserThingJobManagerExternalService", "StartCommandExecution", {})
109+
.n("IoTJobsDataPlaneClient", "StartCommandExecutionCommand")
110+
.f(void 0, void 0)
111+
.ser(se_StartCommandExecutionCommand)
112+
.de(de_StartCommandExecutionCommand)
113+
.build() {
114+
/** @internal type navigation helper, not in runtime. */
115+
protected declare static __types: {
116+
api: {
117+
input: StartCommandExecutionRequest;
118+
output: StartCommandExecutionResponse;
119+
};
120+
sdk: {
121+
input: StartCommandExecutionCommandInput;
122+
output: StartCommandExecutionCommandOutput;
123+
};
124+
};
125+
}

0 commit comments

Comments
 (0)