@aws-sdk/client-iot-jobs-data-plane 3.693.0 → 3.698.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -11
- package/dist-cjs/index.js +214 -1
- package/dist-es/IoTJobsDataPlane.js +2 -0
- package/dist-es/commands/StartCommandExecutionCommand.js +22 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/models/models_0.js +49 -0
- package/dist-es/protocols/Aws_restJson1.js +119 -2
- package/dist-types/IoTJobsDataPlane.d.ts +28 -11
- package/dist-types/IoTJobsDataPlaneClient.d.ts +24 -13
- package/dist-types/commands/DescribeJobExecutionCommand.d.ts +2 -1
- package/dist-types/commands/GetPendingJobExecutionsCommand.d.ts +2 -1
- package/dist-types/commands/StartCommandExecutionCommand.d.ts +104 -0
- package/dist-types/commands/StartNextPendingJobExecutionCommand.d.ts +4 -2
- package/dist-types/commands/UpdateJobExecutionCommand.d.ts +6 -4
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/index.d.ts +21 -11
- package/dist-types/models/models_0.d.ts +226 -55
- package/dist-types/protocols/Aws_restJson1.d.ts +9 -0
- package/dist-types/ts3.4/IoTJobsDataPlane.d.ts +17 -0
- package/dist-types/ts3.4/IoTJobsDataPlaneClient.d.ts +6 -0
- package/dist-types/ts3.4/commands/StartCommandExecutionCommand.d.ts +51 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +46 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +12 -0
- package/package.json +38 -36
package/README.md
CHANGED
|
@@ -6,17 +6,27 @@
|
|
|
6
6
|
|
|
7
7
|
AWS SDK for JavaScript IoTJobsDataPlane Client for Node.js, Browser and React Native.
|
|
8
8
|
|
|
9
|
-
<p>
|
|
10
|
-
and executed on one or more devices connected to
|
|
11
|
-
set of devices to download and install application or
|
|
12
|
-
remote troubleshooting
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<p>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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>
|
|
20
30
|
|
|
21
31
|
## Installing
|
|
22
32
|
|
|
@@ -228,6 +238,14 @@ GetPendingJobExecutions
|
|
|
228
238
|
|
|
229
239
|
[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/)
|
|
230
240
|
|
|
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
|
+
|
|
231
249
|
</details>
|
|
232
250
|
<details>
|
|
233
251
|
<summary>
|
package/dist-cjs/index.js
CHANGED
|
@@ -22,8 +22,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var src_exports = {};
|
|
23
23
|
__export(src_exports, {
|
|
24
24
|
CertificateValidationException: () => CertificateValidationException,
|
|
25
|
+
ConflictException: () => ConflictException,
|
|
25
26
|
DescribeJobExecutionCommand: () => DescribeJobExecutionCommand,
|
|
26
27
|
GetPendingJobExecutionsCommand: () => GetPendingJobExecutionsCommand,
|
|
28
|
+
InternalServerException: () => InternalServerException,
|
|
27
29
|
InvalidRequestException: () => InvalidRequestException,
|
|
28
30
|
InvalidStateTransitionException: () => InvalidStateTransitionException,
|
|
29
31
|
IoTJobsDataPlane: () => IoTJobsDataPlane,
|
|
@@ -31,11 +33,14 @@ __export(src_exports, {
|
|
|
31
33
|
IoTJobsDataPlaneServiceException: () => IoTJobsDataPlaneServiceException,
|
|
32
34
|
JobExecutionStatus: () => JobExecutionStatus,
|
|
33
35
|
ResourceNotFoundException: () => ResourceNotFoundException,
|
|
36
|
+
ServiceQuotaExceededException: () => ServiceQuotaExceededException,
|
|
34
37
|
ServiceUnavailableException: () => ServiceUnavailableException,
|
|
38
|
+
StartCommandExecutionCommand: () => StartCommandExecutionCommand,
|
|
35
39
|
StartNextPendingJobExecutionCommand: () => StartNextPendingJobExecutionCommand,
|
|
36
40
|
TerminalStateException: () => TerminalStateException,
|
|
37
41
|
ThrottlingException: () => ThrottlingException,
|
|
38
42
|
UpdateJobExecutionCommand: () => UpdateJobExecutionCommand,
|
|
43
|
+
ValidationException: () => ValidationException,
|
|
39
44
|
__Client: () => import_smithy_client.Client
|
|
40
45
|
});
|
|
41
46
|
module.exports = __toCommonJS(src_exports);
|
|
@@ -189,6 +194,7 @@ var import_middleware_serde = require("@smithy/middleware-serde");
|
|
|
189
194
|
var import_core2 = require("@aws-sdk/core");
|
|
190
195
|
|
|
191
196
|
|
|
197
|
+
var import_uuid = require("uuid");
|
|
192
198
|
|
|
193
199
|
// src/models/IoTJobsDataPlaneServiceException.ts
|
|
194
200
|
|
|
@@ -222,6 +228,24 @@ var _CertificateValidationException = class _CertificateValidationException exte
|
|
|
222
228
|
};
|
|
223
229
|
__name(_CertificateValidationException, "CertificateValidationException");
|
|
224
230
|
var CertificateValidationException = _CertificateValidationException;
|
|
231
|
+
var _ConflictException = class _ConflictException extends IoTJobsDataPlaneServiceException {
|
|
232
|
+
/**
|
|
233
|
+
* @internal
|
|
234
|
+
*/
|
|
235
|
+
constructor(opts) {
|
|
236
|
+
super({
|
|
237
|
+
name: "ConflictException",
|
|
238
|
+
$fault: "client",
|
|
239
|
+
...opts
|
|
240
|
+
});
|
|
241
|
+
this.name = "ConflictException";
|
|
242
|
+
this.$fault = "client";
|
|
243
|
+
Object.setPrototypeOf(this, _ConflictException.prototype);
|
|
244
|
+
this.resourceId = opts.resourceId;
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
__name(_ConflictException, "ConflictException");
|
|
248
|
+
var ConflictException = _ConflictException;
|
|
225
249
|
var JobExecutionStatus = {
|
|
226
250
|
CANCELED: "CANCELED",
|
|
227
251
|
FAILED: "FAILED",
|
|
@@ -318,6 +342,23 @@ var _ThrottlingException = class _ThrottlingException extends IoTJobsDataPlaneSe
|
|
|
318
342
|
};
|
|
319
343
|
__name(_ThrottlingException, "ThrottlingException");
|
|
320
344
|
var ThrottlingException = _ThrottlingException;
|
|
345
|
+
var _InternalServerException = class _InternalServerException extends IoTJobsDataPlaneServiceException {
|
|
346
|
+
/**
|
|
347
|
+
* @internal
|
|
348
|
+
*/
|
|
349
|
+
constructor(opts) {
|
|
350
|
+
super({
|
|
351
|
+
name: "InternalServerException",
|
|
352
|
+
$fault: "server",
|
|
353
|
+
...opts
|
|
354
|
+
});
|
|
355
|
+
this.name = "InternalServerException";
|
|
356
|
+
this.$fault = "server";
|
|
357
|
+
Object.setPrototypeOf(this, _InternalServerException.prototype);
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
__name(_InternalServerException, "InternalServerException");
|
|
361
|
+
var InternalServerException = _InternalServerException;
|
|
321
362
|
var _InvalidStateTransitionException = class _InvalidStateTransitionException extends IoTJobsDataPlaneServiceException {
|
|
322
363
|
/**
|
|
323
364
|
* @internal
|
|
@@ -335,6 +376,40 @@ var _InvalidStateTransitionException = class _InvalidStateTransitionException ex
|
|
|
335
376
|
};
|
|
336
377
|
__name(_InvalidStateTransitionException, "InvalidStateTransitionException");
|
|
337
378
|
var InvalidStateTransitionException = _InvalidStateTransitionException;
|
|
379
|
+
var _ServiceQuotaExceededException = class _ServiceQuotaExceededException extends IoTJobsDataPlaneServiceException {
|
|
380
|
+
/**
|
|
381
|
+
* @internal
|
|
382
|
+
*/
|
|
383
|
+
constructor(opts) {
|
|
384
|
+
super({
|
|
385
|
+
name: "ServiceQuotaExceededException",
|
|
386
|
+
$fault: "client",
|
|
387
|
+
...opts
|
|
388
|
+
});
|
|
389
|
+
this.name = "ServiceQuotaExceededException";
|
|
390
|
+
this.$fault = "client";
|
|
391
|
+
Object.setPrototypeOf(this, _ServiceQuotaExceededException.prototype);
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
__name(_ServiceQuotaExceededException, "ServiceQuotaExceededException");
|
|
395
|
+
var ServiceQuotaExceededException = _ServiceQuotaExceededException;
|
|
396
|
+
var _ValidationException = class _ValidationException extends IoTJobsDataPlaneServiceException {
|
|
397
|
+
/**
|
|
398
|
+
* @internal
|
|
399
|
+
*/
|
|
400
|
+
constructor(opts) {
|
|
401
|
+
super({
|
|
402
|
+
name: "ValidationException",
|
|
403
|
+
$fault: "client",
|
|
404
|
+
...opts
|
|
405
|
+
});
|
|
406
|
+
this.name = "ValidationException";
|
|
407
|
+
this.$fault = "client";
|
|
408
|
+
Object.setPrototypeOf(this, _ValidationException.prototype);
|
|
409
|
+
}
|
|
410
|
+
};
|
|
411
|
+
__name(_ValidationException, "ValidationException");
|
|
412
|
+
var ValidationException = _ValidationException;
|
|
338
413
|
|
|
339
414
|
// src/protocols/Aws_restJson1.ts
|
|
340
415
|
var se_DescribeJobExecutionCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
@@ -360,6 +435,25 @@ var se_GetPendingJobExecutionsCommand = /* @__PURE__ */ __name(async (input, con
|
|
|
360
435
|
b.m("GET").h(headers).b(body);
|
|
361
436
|
return b.build();
|
|
362
437
|
}, "se_GetPendingJobExecutionsCommand");
|
|
438
|
+
var se_StartCommandExecutionCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
439
|
+
const b = (0, import_core.requestBuilder)(input, context);
|
|
440
|
+
const headers = {
|
|
441
|
+
"content-type": "application/json"
|
|
442
|
+
};
|
|
443
|
+
b.bp("/command-executions");
|
|
444
|
+
let body;
|
|
445
|
+
body = JSON.stringify(
|
|
446
|
+
(0, import_smithy_client.take)(input, {
|
|
447
|
+
clientToken: [true, (_) => _ ?? (0, import_uuid.v4)()],
|
|
448
|
+
commandArn: [],
|
|
449
|
+
executionTimeoutSeconds: [],
|
|
450
|
+
parameters: (_) => se_CommandExecutionParameterMap(_, context),
|
|
451
|
+
targetArn: []
|
|
452
|
+
})
|
|
453
|
+
);
|
|
454
|
+
b.m("POST").h(headers).b(body);
|
|
455
|
+
return b.build();
|
|
456
|
+
}, "se_StartCommandExecutionCommand");
|
|
363
457
|
var se_StartNextPendingJobExecutionCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
364
458
|
const b = (0, import_core.requestBuilder)(input, context);
|
|
365
459
|
const headers = {
|
|
@@ -429,6 +523,20 @@ var de_GetPendingJobExecutionsCommand = /* @__PURE__ */ __name(async (output, co
|
|
|
429
523
|
Object.assign(contents, doc);
|
|
430
524
|
return contents;
|
|
431
525
|
}, "de_GetPendingJobExecutionsCommand");
|
|
526
|
+
var de_StartCommandExecutionCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
527
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
528
|
+
return de_CommandError(output, context);
|
|
529
|
+
}
|
|
530
|
+
const contents = (0, import_smithy_client.map)({
|
|
531
|
+
$metadata: deserializeMetadata(output)
|
|
532
|
+
});
|
|
533
|
+
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
534
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
535
|
+
executionId: import_smithy_client.expectString
|
|
536
|
+
});
|
|
537
|
+
Object.assign(contents, doc);
|
|
538
|
+
return contents;
|
|
539
|
+
}, "de_StartCommandExecutionCommand");
|
|
432
540
|
var de_StartNextPendingJobExecutionCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
433
541
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
434
542
|
return de_CommandError(output, context);
|
|
@@ -483,6 +591,18 @@ var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
|
483
591
|
case "ThrottlingException":
|
|
484
592
|
case "com.amazonaws.iotjobsdataplane#ThrottlingException":
|
|
485
593
|
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
594
|
+
case "ConflictException":
|
|
595
|
+
case "com.amazonaws.iotjobsdataplane#ConflictException":
|
|
596
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
597
|
+
case "InternalServerException":
|
|
598
|
+
case "com.amazonaws.iotjobsdataplane#InternalServerException":
|
|
599
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
600
|
+
case "ServiceQuotaExceededException":
|
|
601
|
+
case "com.amazonaws.iotjobsdataplane#ServiceQuotaExceededException":
|
|
602
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
603
|
+
case "ValidationException":
|
|
604
|
+
case "com.amazonaws.iotjobsdataplane#ValidationException":
|
|
605
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
486
606
|
case "InvalidStateTransitionException":
|
|
487
607
|
case "com.amazonaws.iotjobsdataplane#InvalidStateTransitionException":
|
|
488
608
|
throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context);
|
|
@@ -509,6 +629,33 @@ var de_CertificateValidationExceptionRes = /* @__PURE__ */ __name(async (parsedO
|
|
|
509
629
|
});
|
|
510
630
|
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
511
631
|
}, "de_CertificateValidationExceptionRes");
|
|
632
|
+
var de_ConflictExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
633
|
+
const contents = (0, import_smithy_client.map)({});
|
|
634
|
+
const data = parsedOutput.body;
|
|
635
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
636
|
+
message: import_smithy_client.expectString,
|
|
637
|
+
resourceId: import_smithy_client.expectString
|
|
638
|
+
});
|
|
639
|
+
Object.assign(contents, doc);
|
|
640
|
+
const exception = new ConflictException({
|
|
641
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
642
|
+
...contents
|
|
643
|
+
});
|
|
644
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
645
|
+
}, "de_ConflictExceptionRes");
|
|
646
|
+
var de_InternalServerExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
647
|
+
const contents = (0, import_smithy_client.map)({});
|
|
648
|
+
const data = parsedOutput.body;
|
|
649
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
650
|
+
message: import_smithy_client.expectString
|
|
651
|
+
});
|
|
652
|
+
Object.assign(contents, doc);
|
|
653
|
+
const exception = new InternalServerException({
|
|
654
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
655
|
+
...contents
|
|
656
|
+
});
|
|
657
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
658
|
+
}, "de_InternalServerExceptionRes");
|
|
512
659
|
var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
513
660
|
const contents = (0, import_smithy_client.map)({});
|
|
514
661
|
const data = parsedOutput.body;
|
|
@@ -548,6 +695,19 @@ var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput
|
|
|
548
695
|
});
|
|
549
696
|
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
550
697
|
}, "de_ResourceNotFoundExceptionRes");
|
|
698
|
+
var de_ServiceQuotaExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
699
|
+
const contents = (0, import_smithy_client.map)({});
|
|
700
|
+
const data = parsedOutput.body;
|
|
701
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
702
|
+
message: import_smithy_client.expectString
|
|
703
|
+
});
|
|
704
|
+
Object.assign(contents, doc);
|
|
705
|
+
const exception = new ServiceQuotaExceededException({
|
|
706
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
707
|
+
...contents
|
|
708
|
+
});
|
|
709
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
710
|
+
}, "de_ServiceQuotaExceededExceptionRes");
|
|
551
711
|
var de_ServiceUnavailableExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
552
712
|
const contents = (0, import_smithy_client.map)({});
|
|
553
713
|
const data = parsedOutput.body;
|
|
@@ -588,6 +748,39 @@ var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, cont
|
|
|
588
748
|
});
|
|
589
749
|
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
590
750
|
}, "de_ThrottlingExceptionRes");
|
|
751
|
+
var de_ValidationExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
752
|
+
const contents = (0, import_smithy_client.map)({});
|
|
753
|
+
const data = parsedOutput.body;
|
|
754
|
+
const doc = (0, import_smithy_client.take)(data, {
|
|
755
|
+
message: import_smithy_client.expectString
|
|
756
|
+
});
|
|
757
|
+
Object.assign(contents, doc);
|
|
758
|
+
const exception = new ValidationException({
|
|
759
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
760
|
+
...contents
|
|
761
|
+
});
|
|
762
|
+
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
763
|
+
}, "de_ValidationExceptionRes");
|
|
764
|
+
var se_CommandExecutionParameterMap = /* @__PURE__ */ __name((input, context) => {
|
|
765
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
766
|
+
if (value === null) {
|
|
767
|
+
return acc;
|
|
768
|
+
}
|
|
769
|
+
acc[key] = se_CommandParameterValue(value, context);
|
|
770
|
+
return acc;
|
|
771
|
+
}, {});
|
|
772
|
+
}, "se_CommandExecutionParameterMap");
|
|
773
|
+
var se_CommandParameterValue = /* @__PURE__ */ __name((input, context) => {
|
|
774
|
+
return (0, import_smithy_client.take)(input, {
|
|
775
|
+
B: [],
|
|
776
|
+
BIN: context.base64Encoder,
|
|
777
|
+
D: import_smithy_client.serializeFloat,
|
|
778
|
+
I: [],
|
|
779
|
+
L: [],
|
|
780
|
+
S: [],
|
|
781
|
+
UL: []
|
|
782
|
+
});
|
|
783
|
+
}, "se_CommandParameterValue");
|
|
591
784
|
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
592
785
|
httpStatusCode: output.statusCode,
|
|
593
786
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
@@ -622,6 +815,20 @@ var _GetPendingJobExecutionsCommand = class _GetPendingJobExecutionsCommand exte
|
|
|
622
815
|
__name(_GetPendingJobExecutionsCommand, "GetPendingJobExecutionsCommand");
|
|
623
816
|
var GetPendingJobExecutionsCommand = _GetPendingJobExecutionsCommand;
|
|
624
817
|
|
|
818
|
+
// src/commands/StartCommandExecutionCommand.ts
|
|
819
|
+
|
|
820
|
+
|
|
821
|
+
|
|
822
|
+
var _StartCommandExecutionCommand = class _StartCommandExecutionCommand extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
|
|
823
|
+
return [
|
|
824
|
+
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
825
|
+
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
826
|
+
];
|
|
827
|
+
}).s("IotLaserThingJobManagerExternalService", "StartCommandExecution", {}).n("IoTJobsDataPlaneClient", "StartCommandExecutionCommand").f(void 0, void 0).ser(se_StartCommandExecutionCommand).de(de_StartCommandExecutionCommand).build() {
|
|
828
|
+
};
|
|
829
|
+
__name(_StartCommandExecutionCommand, "StartCommandExecutionCommand");
|
|
830
|
+
var StartCommandExecutionCommand = _StartCommandExecutionCommand;
|
|
831
|
+
|
|
625
832
|
// src/commands/StartNextPendingJobExecutionCommand.ts
|
|
626
833
|
|
|
627
834
|
|
|
@@ -654,6 +861,7 @@ var UpdateJobExecutionCommand = _UpdateJobExecutionCommand;
|
|
|
654
861
|
var commands = {
|
|
655
862
|
DescribeJobExecutionCommand,
|
|
656
863
|
GetPendingJobExecutionsCommand,
|
|
864
|
+
StartCommandExecutionCommand,
|
|
657
865
|
StartNextPendingJobExecutionCommand,
|
|
658
866
|
UpdateJobExecutionCommand
|
|
659
867
|
};
|
|
@@ -672,15 +880,20 @@ var IoTJobsDataPlane = _IoTJobsDataPlane;
|
|
|
672
880
|
$Command,
|
|
673
881
|
DescribeJobExecutionCommand,
|
|
674
882
|
GetPendingJobExecutionsCommand,
|
|
883
|
+
StartCommandExecutionCommand,
|
|
675
884
|
StartNextPendingJobExecutionCommand,
|
|
676
885
|
UpdateJobExecutionCommand,
|
|
677
886
|
CertificateValidationException,
|
|
887
|
+
ConflictException,
|
|
678
888
|
JobExecutionStatus,
|
|
679
889
|
InvalidRequestException,
|
|
680
890
|
ResourceNotFoundException,
|
|
681
891
|
ServiceUnavailableException,
|
|
682
892
|
TerminalStateException,
|
|
683
893
|
ThrottlingException,
|
|
684
|
-
|
|
894
|
+
InternalServerException,
|
|
895
|
+
InvalidStateTransitionException,
|
|
896
|
+
ServiceQuotaExceededException,
|
|
897
|
+
ValidationException
|
|
685
898
|
});
|
|
686
899
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
2
2
|
import { DescribeJobExecutionCommand, } from "./commands/DescribeJobExecutionCommand";
|
|
3
3
|
import { GetPendingJobExecutionsCommand, } from "./commands/GetPendingJobExecutionsCommand";
|
|
4
|
+
import { StartCommandExecutionCommand, } from "./commands/StartCommandExecutionCommand";
|
|
4
5
|
import { StartNextPendingJobExecutionCommand, } from "./commands/StartNextPendingJobExecutionCommand";
|
|
5
6
|
import { UpdateJobExecutionCommand, } from "./commands/UpdateJobExecutionCommand";
|
|
6
7
|
import { IoTJobsDataPlaneClient } from "./IoTJobsDataPlaneClient";
|
|
7
8
|
const commands = {
|
|
8
9
|
DescribeJobExecutionCommand,
|
|
9
10
|
GetPendingJobExecutionsCommand,
|
|
11
|
+
StartCommandExecutionCommand,
|
|
10
12
|
StartNextPendingJobExecutionCommand,
|
|
11
13
|
UpdateJobExecutionCommand,
|
|
12
14
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { commonParams } from "../endpoint/EndpointParameters";
|
|
5
|
+
import { de_StartCommandExecutionCommand, se_StartCommandExecutionCommand } from "../protocols/Aws_restJson1";
|
|
6
|
+
export { $Command };
|
|
7
|
+
export class StartCommandExecutionCommand extends $Command
|
|
8
|
+
.classBuilder()
|
|
9
|
+
.ep(commonParams)
|
|
10
|
+
.m(function (Command, cs, config, o) {
|
|
11
|
+
return [
|
|
12
|
+
getSerdePlugin(config, this.serialize, this.deserialize),
|
|
13
|
+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
14
|
+
];
|
|
15
|
+
})
|
|
16
|
+
.s("IotLaserThingJobManagerExternalService", "StartCommandExecution", {})
|
|
17
|
+
.n("IoTJobsDataPlaneClient", "StartCommandExecutionCommand")
|
|
18
|
+
.f(void 0, void 0)
|
|
19
|
+
.ser(se_StartCommandExecutionCommand)
|
|
20
|
+
.de(de_StartCommandExecutionCommand)
|
|
21
|
+
.build() {
|
|
22
|
+
}
|
|
@@ -11,6 +11,19 @@ export class CertificateValidationException extends __BaseException {
|
|
|
11
11
|
Object.setPrototypeOf(this, CertificateValidationException.prototype);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
export class ConflictException extends __BaseException {
|
|
15
|
+
constructor(opts) {
|
|
16
|
+
super({
|
|
17
|
+
name: "ConflictException",
|
|
18
|
+
$fault: "client",
|
|
19
|
+
...opts,
|
|
20
|
+
});
|
|
21
|
+
this.name = "ConflictException";
|
|
22
|
+
this.$fault = "client";
|
|
23
|
+
Object.setPrototypeOf(this, ConflictException.prototype);
|
|
24
|
+
this.resourceId = opts.resourceId;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
14
27
|
export const JobExecutionStatus = {
|
|
15
28
|
CANCELED: "CANCELED",
|
|
16
29
|
FAILED: "FAILED",
|
|
@@ -82,6 +95,18 @@ export class ThrottlingException extends __BaseException {
|
|
|
82
95
|
this.payload = opts.payload;
|
|
83
96
|
}
|
|
84
97
|
}
|
|
98
|
+
export class InternalServerException extends __BaseException {
|
|
99
|
+
constructor(opts) {
|
|
100
|
+
super({
|
|
101
|
+
name: "InternalServerException",
|
|
102
|
+
$fault: "server",
|
|
103
|
+
...opts,
|
|
104
|
+
});
|
|
105
|
+
this.name = "InternalServerException";
|
|
106
|
+
this.$fault = "server";
|
|
107
|
+
Object.setPrototypeOf(this, InternalServerException.prototype);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
85
110
|
export class InvalidStateTransitionException extends __BaseException {
|
|
86
111
|
constructor(opts) {
|
|
87
112
|
super({
|
|
@@ -94,3 +119,27 @@ export class InvalidStateTransitionException extends __BaseException {
|
|
|
94
119
|
Object.setPrototypeOf(this, InvalidStateTransitionException.prototype);
|
|
95
120
|
}
|
|
96
121
|
}
|
|
122
|
+
export class ServiceQuotaExceededException extends __BaseException {
|
|
123
|
+
constructor(opts) {
|
|
124
|
+
super({
|
|
125
|
+
name: "ServiceQuotaExceededException",
|
|
126
|
+
$fault: "client",
|
|
127
|
+
...opts,
|
|
128
|
+
});
|
|
129
|
+
this.name = "ServiceQuotaExceededException";
|
|
130
|
+
this.$fault = "client";
|
|
131
|
+
Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
export class ValidationException extends __BaseException {
|
|
135
|
+
constructor(opts) {
|
|
136
|
+
super({
|
|
137
|
+
name: "ValidationException",
|
|
138
|
+
$fault: "client",
|
|
139
|
+
...opts,
|
|
140
|
+
});
|
|
141
|
+
this.name = "ValidationException";
|
|
142
|
+
this.$fault = "client";
|
|
143
|
+
Object.setPrototypeOf(this, ValidationException.prototype);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
|
|
2
2
|
import { requestBuilder as rb } from "@smithy/core";
|
|
3
|
-
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
|
|
4
|
+
import { v4 as generateIdempotencyToken } from "uuid";
|
|
4
5
|
import { IoTJobsDataPlaneServiceException as __BaseException } from "../models/IoTJobsDataPlaneServiceException";
|
|
5
|
-
import { CertificateValidationException, InvalidRequestException, InvalidStateTransitionException, ResourceNotFoundException, ServiceUnavailableException, TerminalStateException, ThrottlingException, } from "../models/models_0";
|
|
6
|
+
import { CertificateValidationException, ConflictException, InternalServerException, InvalidRequestException, InvalidStateTransitionException, ResourceNotFoundException, ServiceQuotaExceededException, ServiceUnavailableException, TerminalStateException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
6
7
|
export const se_DescribeJobExecutionCommand = async (input, context) => {
|
|
7
8
|
const b = rb(input, context);
|
|
8
9
|
const headers = {};
|
|
@@ -26,6 +27,23 @@ export const se_GetPendingJobExecutionsCommand = async (input, context) => {
|
|
|
26
27
|
b.m("GET").h(headers).b(body);
|
|
27
28
|
return b.build();
|
|
28
29
|
};
|
|
30
|
+
export const se_StartCommandExecutionCommand = async (input, context) => {
|
|
31
|
+
const b = rb(input, context);
|
|
32
|
+
const headers = {
|
|
33
|
+
"content-type": "application/json",
|
|
34
|
+
};
|
|
35
|
+
b.bp("/command-executions");
|
|
36
|
+
let body;
|
|
37
|
+
body = JSON.stringify(take(input, {
|
|
38
|
+
clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
39
|
+
commandArn: [],
|
|
40
|
+
executionTimeoutSeconds: [],
|
|
41
|
+
parameters: (_) => se_CommandExecutionParameterMap(_, context),
|
|
42
|
+
targetArn: [],
|
|
43
|
+
}));
|
|
44
|
+
b.m("POST").h(headers).b(body);
|
|
45
|
+
return b.build();
|
|
46
|
+
};
|
|
29
47
|
export const se_StartNextPendingJobExecutionCommand = async (input, context) => {
|
|
30
48
|
const b = rb(input, context);
|
|
31
49
|
const headers = {
|
|
@@ -91,6 +109,20 @@ export const de_GetPendingJobExecutionsCommand = async (output, context) => {
|
|
|
91
109
|
Object.assign(contents, doc);
|
|
92
110
|
return contents;
|
|
93
111
|
};
|
|
112
|
+
export const de_StartCommandExecutionCommand = async (output, context) => {
|
|
113
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
114
|
+
return de_CommandError(output, context);
|
|
115
|
+
}
|
|
116
|
+
const contents = map({
|
|
117
|
+
$metadata: deserializeMetadata(output),
|
|
118
|
+
});
|
|
119
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
120
|
+
const doc = take(data, {
|
|
121
|
+
executionId: __expectString,
|
|
122
|
+
});
|
|
123
|
+
Object.assign(contents, doc);
|
|
124
|
+
return contents;
|
|
125
|
+
};
|
|
94
126
|
export const de_StartNextPendingJobExecutionCommand = async (output, context) => {
|
|
95
127
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
96
128
|
return de_CommandError(output, context);
|
|
@@ -145,6 +177,18 @@ const de_CommandError = async (output, context) => {
|
|
|
145
177
|
case "ThrottlingException":
|
|
146
178
|
case "com.amazonaws.iotjobsdataplane#ThrottlingException":
|
|
147
179
|
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
180
|
+
case "ConflictException":
|
|
181
|
+
case "com.amazonaws.iotjobsdataplane#ConflictException":
|
|
182
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
183
|
+
case "InternalServerException":
|
|
184
|
+
case "com.amazonaws.iotjobsdataplane#InternalServerException":
|
|
185
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
186
|
+
case "ServiceQuotaExceededException":
|
|
187
|
+
case "com.amazonaws.iotjobsdataplane#ServiceQuotaExceededException":
|
|
188
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
189
|
+
case "ValidationException":
|
|
190
|
+
case "com.amazonaws.iotjobsdataplane#ValidationException":
|
|
191
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
148
192
|
case "InvalidStateTransitionException":
|
|
149
193
|
case "com.amazonaws.iotjobsdataplane#InvalidStateTransitionException":
|
|
150
194
|
throw await de_InvalidStateTransitionExceptionRes(parsedOutput, context);
|
|
@@ -171,6 +215,33 @@ const de_CertificateValidationExceptionRes = async (parsedOutput, context) => {
|
|
|
171
215
|
});
|
|
172
216
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
173
217
|
};
|
|
218
|
+
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
219
|
+
const contents = map({});
|
|
220
|
+
const data = parsedOutput.body;
|
|
221
|
+
const doc = take(data, {
|
|
222
|
+
message: __expectString,
|
|
223
|
+
resourceId: __expectString,
|
|
224
|
+
});
|
|
225
|
+
Object.assign(contents, doc);
|
|
226
|
+
const exception = new ConflictException({
|
|
227
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
228
|
+
...contents,
|
|
229
|
+
});
|
|
230
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
231
|
+
};
|
|
232
|
+
const de_InternalServerExceptionRes = async (parsedOutput, context) => {
|
|
233
|
+
const contents = map({});
|
|
234
|
+
const data = parsedOutput.body;
|
|
235
|
+
const doc = take(data, {
|
|
236
|
+
message: __expectString,
|
|
237
|
+
});
|
|
238
|
+
Object.assign(contents, doc);
|
|
239
|
+
const exception = new InternalServerException({
|
|
240
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
241
|
+
...contents,
|
|
242
|
+
});
|
|
243
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
244
|
+
};
|
|
174
245
|
const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
|
|
175
246
|
const contents = map({});
|
|
176
247
|
const data = parsedOutput.body;
|
|
@@ -210,6 +281,19 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
|
|
|
210
281
|
});
|
|
211
282
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
212
283
|
};
|
|
284
|
+
const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
|
|
285
|
+
const contents = map({});
|
|
286
|
+
const data = parsedOutput.body;
|
|
287
|
+
const doc = take(data, {
|
|
288
|
+
message: __expectString,
|
|
289
|
+
});
|
|
290
|
+
Object.assign(contents, doc);
|
|
291
|
+
const exception = new ServiceQuotaExceededException({
|
|
292
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
293
|
+
...contents,
|
|
294
|
+
});
|
|
295
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
296
|
+
};
|
|
213
297
|
const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
|
|
214
298
|
const contents = map({});
|
|
215
299
|
const data = parsedOutput.body;
|
|
@@ -250,6 +334,39 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
|
|
|
250
334
|
});
|
|
251
335
|
return __decorateServiceException(exception, parsedOutput.body);
|
|
252
336
|
};
|
|
337
|
+
const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
338
|
+
const contents = map({});
|
|
339
|
+
const data = parsedOutput.body;
|
|
340
|
+
const doc = take(data, {
|
|
341
|
+
message: __expectString,
|
|
342
|
+
});
|
|
343
|
+
Object.assign(contents, doc);
|
|
344
|
+
const exception = new ValidationException({
|
|
345
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
346
|
+
...contents,
|
|
347
|
+
});
|
|
348
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
349
|
+
};
|
|
350
|
+
const se_CommandExecutionParameterMap = (input, context) => {
|
|
351
|
+
return Object.entries(input).reduce((acc, [key, value]) => {
|
|
352
|
+
if (value === null) {
|
|
353
|
+
return acc;
|
|
354
|
+
}
|
|
355
|
+
acc[key] = se_CommandParameterValue(value, context);
|
|
356
|
+
return acc;
|
|
357
|
+
}, {});
|
|
358
|
+
};
|
|
359
|
+
const se_CommandParameterValue = (input, context) => {
|
|
360
|
+
return take(input, {
|
|
361
|
+
B: [],
|
|
362
|
+
BIN: context.base64Encoder,
|
|
363
|
+
D: __serializeFloat,
|
|
364
|
+
I: [],
|
|
365
|
+
L: [],
|
|
366
|
+
S: [],
|
|
367
|
+
UL: [],
|
|
368
|
+
});
|
|
369
|
+
};
|
|
253
370
|
const deserializeMetadata = (output) => ({
|
|
254
371
|
httpStatusCode: output.statusCode,
|
|
255
372
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|