Menu
AWS IoT
Developer Guide

CreateOTAUpdate

CreateOTAUpdate

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

https

Request syntax:

POST /otaUpdates/otaUpdateId Content-type: application/json { "description": "string", "targets": [ "string" ], "targetSelection": "string", "files": [ { "fileName": "string", "fileVersion": "string", "fileSource": { "streamId": "string", "fileId": "integer" }, "codeSigning": { "awsSignerJobId": "string", "customCodeSigning": { "signature": { "stream": { "streamId": "string", "fileId": "integer" }, "inlineDocument": "blob" }, "certificateChain": { "stream": { "streamId": "string", "fileId": "integer" }, "certificateName": "string", "inlineDocument": "string" }, "hashAlgorithm": "string", "signatureAlgorithm": "string" } }, "attributes": { "string": "string" } } ], "roleArn": "string", "additionalParameters": { "string": "string" } }

URI Request Parameters:

Name

Type

Req?

Description

otaUpdateId

OTAUpdateId

yes

The ID of the OTA update to be created.

Request Body Parameters:

Name

Type

Req?

Description

description

OTAUpdateDescription

no

The description of the OTA update.

targets

Targets

yes

The targeted devices to receive OTA updates.

targetSelection

TargetSelection

no

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.

files

OTAUpdateFiles

yes

The files to be streamed by the OTA update.

roleArn

RoleArn

yes

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

additionalParameters

AdditionalParameterMap

no

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

Response syntax:

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

Response Body Parameters:

Name

Type

Req?

Description

otaUpdateId

OTAUpdateId

no

The OTA update ID.

awsIotJobId

AwsIotJobId

no

The AWS IoT job ID associated with the OTA update.

otaUpdateArn

OTAUpdateArn

no

The OTA update ARN.

awsIotJobArn

AwsIotJobArn

no

The AWS IoT job ARN associated with the OTA update.

otaUpdateStatus

OTAUpdateStatus

no

The OTA update status.

Errors:

InvalidRequestException

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.

HTTP response code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

ResourceAlreadyExistsException

The resource already exists.

HTTP response code: 409

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

UnauthorizedException

You are not authorized to perform this operation.

HTTP response code: 401

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

cli

Synopsis:

aws iot create-ota-update \ --ota-update-id <value> \ [--description <value>] \ --targets <value> \ [--target-selection <value>] \ --files <value> \ --role-arn <value> \ [--additional-parameters <value>] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "otaUpdateId": "string", "description": "string", "targets": [ "string" ], "targetSelection": "string", "files": [ { "fileName": "string", "fileVersion": "string", "fileSource": { "streamId": "string", "fileId": "integer" }, "codeSigning": { "awsSignerJobId": "string", "customCodeSigning": { "signature": { "stream": { "streamId": "string", "fileId": "integer" }, "inlineDocument": "blob" }, "certificateChain": { "stream": { "streamId": "string", "fileId": "integer" }, "certificateName": "string", "inlineDocument": "string" }, "hashAlgorithm": "string", "signatureAlgorithm": "string" } }, "attributes": { "string": "string" } } ], "roleArn": "string", "additionalParameters": { "string": "string" } }

cli-input-json fields:

Name

Type

Description

otaUpdateId

string

length- max:128 min:1

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

The ID of the OTA update to be created.

description

string

length- max:2028

pattern: [^\\p{C}]+

The description of the OTA update.

targets

list

member: Target

The targeted devices to receive OTA updates.

targetSelection

string

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.

enum: CONTINUOUS | SNAPSHOT

files

list

member: OTAUpdateFile

The files to be streamed by the OTA update.

fileName

string

The name of the file.

fileVersion

string

The file version.

fileSource

Stream

The source of the file.

streamId

string

length- max:128 min:1

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

The stream ID.

fileId

integer

range- max:255 min:0

The ID of a file associated with a stream.

codeSigning

CodeSigning

The code signing method of the file.

awsSignerJobId

string

The ID of the AWSSignerJob which was created to sign the file.

customCodeSigning

CustomCodeSigning

A custom method for code signing a file.

signature

CodeSigningSignature

The signature for the file.

stream

Stream

A stream of the code signing signature.

streamId

string

length- max:128 min:1

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

The stream ID.

fileId

integer

range- max:255 min:0

The ID of a file associated with a stream.

inlineDocument

blob

A base64 encoded binary representation of the code signing signature.

certificateChain

CodeSigningCertificateChain

The certificate chain.

stream

Stream

A stream of the certificate chain files.

streamId

string

length- max:128 min:1

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

The stream ID.

fileId

integer

range- max:255 min:0

The ID of a file associated with a stream.

certificateName

string

The name of the certificate.

inlineDocument

string

A base64 encoded binary representation of the code signing certificate chain.

hashAlgorithm

string

The hash algorithm used to code sign the file.

signatureAlgorithm

string

The signature algorithm used to code sign the file.

attributes

map

A list of name/attribute pairs.

roleArn

string

length- max:2048 min:20

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

additionalParameters

map

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

Output:

{ "otaUpdateId": "string", "awsIotJobId": "string", "otaUpdateArn": "string", "awsIotJobArn": "string", "otaUpdateStatus": "string" }

cli output fields:

Name

Type

Description

otaUpdateId

string

length- max:128 min:1

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

The OTA update ID.

awsIotJobId

string

The AWS IoT job ID associated with the OTA update.

otaUpdateArn

string

The OTA update ARN.

awsIotJobArn

string

The AWS IoT job ARN associated with the OTA update.

otaUpdateStatus

string

The OTA update status.

enum: CREATE_PENDING | CREATE_IN_PROGRESS | CREATE_COMPLETE | CREATE_FAILED

Errors:

InvalidRequestException

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.

ResourceNotFoundException

The specified resource does not exist.

ResourceAlreadyExistsException

The resource already exists.

ThrottlingException

The rate exceeds the limit.

UnauthorizedException

You are not authorized to perform this operation.

InternalFailureException

An unexpected error has occurred.

ServiceUnavailableException

The service is temporarily unavailable.