AWS IoT
API Reference

CreateOTAUpdate

Creates an AWS IoT OTAUpdate on a target group of things or groups.

Request Syntax

POST /otaUpdates/otaUpdateId HTTP/1.1 Content-type: application/json { "additionalParameters": { "string" : "string" }, "awsJobExecutionsRolloutConfig": { "maximumPerMinute": number }, "description": "string", "files": [ { "attributes": { "string" : "string" }, "codeSigning": { "awsSignerJobId": "string", "customCodeSigning": { "certificateChain": { "certificateName": "string", "inlineDocument": "string" }, "hashAlgorithm": "string", "signature": { "inlineDocument": blob }, "signatureAlgorithm": "string" }, "startSigningJobParameter": { "destination": { "s3Destination": { "bucket": "string", "prefix": "string" } }, "signingProfileName": "string", "signingProfileParameter": { "certificateArn": "string", "certificatePathOnDevice": "string", "platform": "string" } } }, "fileLocation": { "s3Location": { "bucket": "string", "key": "string", "version": "string" }, "stream": { "fileId": number, "streamId": "string" } }, "fileName": "string", "fileVersion": "string" } ], "roleArn": "string", "targets": [ "string" ], "targetSelection": "string" }

URI Request Parameters

The request requires the following URI parameters.

otaUpdateId

The ID of the OTA update to be created.

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9_-]+

Request Body

The request accepts the following data in JSON format.

additionalParameters

A list of additional OTA update parameters which are name-value pairs.

Type: String to string map

Required: No

awsJobExecutionsRolloutConfig

Configuration for the rollout of OTA updates.

Type: AwsJobExecutionsRolloutConfig object

Required: No

description

The description of the OTA update.

Type: String

Length Constraints: Maximum length of 2028.

Pattern: [^\p{C}]+

Required: No

files

The files to be streamed by the OTA update.

Type: Array of OTAUpdateFile objects

Array Members: Minimum number of 1 item. Maximum number of 50 items.

Required: Yes

roleArn

The IAM role that allows access to the AWS IoT Jobs service.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Required: Yes

targets

The targeted devices to receive OTA updates.

Type: Array of strings

Array Members: Minimum number of 1 item.

Required: Yes

targetSelection

Specifies whether the update will continue to run (CONTINUOUS), or will be complete after all the things specified as targets have completed the update (SNAPSHOT). If continuous, the update may also be run on a thing when a change is detected in a target. For example, an update will run on a thing when the thing is added to a target group, even after the update was completed by all things originally in the group. Valid values: CONTINUOUS | SNAPSHOT.

Type: String

Valid Values: CONTINUOUS | SNAPSHOT

Required: No

Response Syntax

HTTP/1.1 200 Content-type: application/json { "awsIotJobArn": "string", "awsIotJobId": "string", "otaUpdateArn": "string", "otaUpdateId": "string", "otaUpdateStatus": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

awsIotJobArn

The AWS IoT job ARN associated with the OTA update.

Type: String

awsIotJobId

The AWS IoT job ID associated with the OTA update.

Type: String

otaUpdateArn

The OTA update ARN.

Type: String

otaUpdateId

The OTA update ID.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [a-zA-Z0-9_-]+

otaUpdateStatus

The OTA update status.

Type: String

Valid Values: CREATE_PENDING | CREATE_IN_PROGRESS | CREATE_COMPLETE | CREATE_FAILED

Errors

InternalFailureException

An unexpected error has occurred.

HTTP Status Code: 500

InvalidRequestException

The request is not valid.

HTTP Status Code: 400

LimitExceededException

A limit has been exceeded.

HTTP Status Code: 410

ResourceAlreadyExistsException

The resource already exists.

HTTP Status Code: 409

ResourceNotFoundException

The specified resource does not exist.

HTTP Status Code: 404

ServiceUnavailableException

The service is temporarily unavailable.

HTTP Status Code: 503

ThrottlingException

The rate exceeds the limit.

HTTP Status Code: 429

UnauthorizedException

You are not authorized to perform this operation.

HTTP Status Code: 401

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: