ota_updates
Creates, updates, deletes, gets or lists an ota_updates resource.
Overview
| Name | ota_updates |
| Type | Resource |
| Id | aws.iot.ota_updates |
Fields
The following fields are returned by SELECT queries:
- get_ota_update
- list_ota_updates
| Name | Datatype | Description |
|---|---|---|
additional_parameters | object | A collection of name/value pairs |
aws_iot_job_arn | string | The IoT job ARN associated with the OTA update. |
aws_iot_job_id | string | The IoT job ID associated with the OTA update. |
aws_job_executions_rollout_config | object | Configuration for the rollout of OTA updates. |
aws_job_presigned_url_config | object | Configuration information for pre-signed URLs. Valid when protocols contains HTTP. |
creation_date | string (date-time) | The date when the OTA update was created. |
description | string | A description of the OTA update. (pattern: <code>[^\p{C}]+</code>) |
error_info | object | Error information associated with the OTA update. |
last_modified_date | string (date-time) | The date when the OTA update was last updated. |
ota_update_arn | string | The OTA update ARN. |
ota_update_files | array | A list of files associated with the OTA update. |
ota_update_id | string | The OTA update ID. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
ota_update_status | string | The status of the OTA update. (CREATE_PENDING, CREATE_IN_PROGRESS, CREATE_COMPLETE, CREATE_FAILED, DELETE_IN_PROGRESS, DELETE_FAILED) |
protocols | array | The protocol used to transfer the OTA update image. Valid values are [HTTP], [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the target device can choose the protocol. |
target_selection | string | Specifies whether the OTA update will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the OTA update (SNAPSHOT). If continuous, the OTA update may also be run on a thing when a change is detected in a target. For example, an OTA update will run on a thing when the thing is added to a target group, even after the OTA update was completed by all things originally in the group. (CONTINUOUS, SNAPSHOT) |
targets | array | The targets of the OTA update. |
| Name | Datatype | Description |
|---|---|---|
creation_date | string (date-time) | The date when the OTA update was created. |
ota_update_arn | string | The OTA update ARN. |
ota_update_id | string | The OTA update ID. (pattern: <code>[a-zA-Z0-9_-]+</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_ota_update | select | ota_update_id, region | Gets an OTA update. Requires permission to access the GetOTAUpdate action. | |
list_ota_updates | select | region | maxResults, nextToken, otaUpdateStatus | Lists OTA updates. Requires permission to access the ListOTAUpdates action. |
create_ota_update | insert | ota_update_id, region, targets, files, roleArn | Creates an IoT OTA update on a target group of things or groups. Requires permission to access the CreateOTAUpdate action. | |
delete_ota_update | delete | ota_update_id, region | deleteStream, forceDeleteAWSJob | Delete an OTA update. Requires permission to access the DeleteOTAUpdate action. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
ota_update_id | string | The ID of the OTA update to delete. |
region | string | AWS region (default: us-east-1) |
deleteStream | boolean | When true, the stream created by the OTAUpdate process is deleted when the OTA update is deleted. Ignored if the stream specified in the OTAUpdate is supplied by the user. |
forceDeleteAWSJob | boolean | When true, deletes the IoT job created by the OTAUpdate process even if it is "IN_PROGRESS". Otherwise, if the job is not in a terminal state ("COMPLETED" or "CANCELED") an exception will occur. The default is false. |
maxResults | integer | The maximum number of results to return at one time. |
nextToken | string | A token used to retrieve the next set of results. |
otaUpdateStatus | string | The OTA update job status. |
SELECT examples
- get_ota_update
- list_ota_updates
Gets an OTA update. Requires permission to access the GetOTAUpdate action.
SELECT
additional_parameters,
aws_iot_job_arn,
aws_iot_job_id,
aws_job_executions_rollout_config,
aws_job_presigned_url_config,
creation_date,
description,
error_info,
last_modified_date,
ota_update_arn,
ota_update_files,
ota_update_id,
ota_update_status,
protocols,
target_selection,
targets
FROM aws.iot.ota_updates
WHERE ota_update_id = '{{ ota_update_id }}' -- required
AND region = '{{ region }}' -- required
;
Lists OTA updates. Requires permission to access the ListOTAUpdates action.
SELECT
creation_date,
ota_update_arn,
ota_update_id
FROM aws.iot.ota_updates
WHERE region = '{{ region }}' -- required
AND maxResults = '{{ maxResults }}'
AND nextToken = '{{ nextToken }}'
AND otaUpdateStatus = '{{ otaUpdateStatus }}'
;
INSERT examples
- create_ota_update
- Manifest
Creates an IoT OTA update on a target group of things or groups. Requires permission to access the CreateOTAUpdate action.
INSERT INTO aws.iot.ota_updates (
description,
targets,
protocols,
targetSelection,
awsJobExecutionsRolloutConfig,
awsJobPresignedUrlConfig,
awsJobAbortConfig,
awsJobTimeoutConfig,
files,
roleArn,
additionalParameters,
tags,
ota_update_id,
region
)
SELECT
'{{ description }}',
'{{ targets }}' /* required */,
'{{ protocols }}',
'{{ targetSelection }}',
'{{ awsJobExecutionsRolloutConfig }}',
'{{ awsJobPresignedUrlConfig }}',
'{{ awsJobAbortConfig }}',
'{{ awsJobTimeoutConfig }}',
'{{ files }}' /* required */,
'{{ roleArn }}' /* required */,
'{{ additionalParameters }}',
'{{ tags }}',
'{{ ota_update_id }}',
'{{ region }}'
RETURNING
aws_iot_job_arn,
aws_iot_job_id,
ota_update_arn,
ota_update_id,
ota_update_status
;
# Description fields are for documentation purposes
- name: ota_updates
props:
- name: ota_update_id
value: "{{ ota_update_id }}"
description: Required parameter for the ota_updates resource.
- name: region
value: "{{ region }}"
description: Required parameter for the ota_updates resource.
- name: description
value: "{{ description }}"
- name: targets
value:
- "{{ targets }}"
- name: protocols
value:
- "{{ protocols }}"
- name: targetSelection
value: "{{ targetSelection }}"
valid_values: ['CONTINUOUS', 'SNAPSHOT']
- name: awsJobExecutionsRolloutConfig
description: |
Configuration for the rollout of OTA updates.
value:
maximumPerMinute: {{ maximumPerMinute }}
exponentialRate:
baseRatePerMinute: {{ baseRatePerMinute }}
incrementFactor: {{ incrementFactor }}
rateIncreaseCriteria:
numberOfNotifiedThings: {{ numberOfNotifiedThings }}
numberOfSucceededThings: {{ numberOfSucceededThings }}
- name: awsJobPresignedUrlConfig
description: |
Configuration information for pre-signed URLs. Valid when protocols contains HTTP.
value:
expiresInSec: {{ expiresInSec }}
- name: awsJobAbortConfig
description: |
The criteria that determine when and how a job abort takes place.
value:
abortCriteriaList:
- failureType: "{{ failureType }}"
action: "{{ action }}"
thresholdPercentage: {{ thresholdPercentage }}
minNumberOfExecutedThings: {{ minNumberOfExecutedThings }}
- name: awsJobTimeoutConfig
description: |
Specifies the amount of time each device has to finish its execution of the job. A timer is started when the job execution status is set to IN_PROGRESS. If the job execution status is not set to another terminal state before the timer expires, it will be automatically set to TIMED_OUT.
value:
inProgressTimeoutInMinutes: {{ inProgressTimeoutInMinutes }}
- name: files
value:
- fileName: "{{ fileName }}"
fileType: {{ fileType }}
fileVersion: "{{ fileVersion }}"
fileLocation:
stream:
streamId: "{{ streamId }}"
fileId: {{ fileId }}
s3Location:
bucket: "{{ bucket }}"
key: "{{ key }}"
version: "{{ version }}"
codeSigning:
awsSignerJobId: "{{ awsSignerJobId }}"
startSigningJobParameter:
signingProfileParameter:
certificateArn: "{{ certificateArn }}"
platform: "{{ platform }}"
certificatePathOnDevice: "{{ certificatePathOnDevice }}"
signingProfileName: "{{ signingProfileName }}"
destination:
s3Destination:
bucket: "{{ bucket }}"
prefix: "{{ prefix }}"
customCodeSigning:
signature:
inlineDocument: "{{ inlineDocument }}"
certificateChain:
certificateName: "{{ certificateName }}"
inlineDocument: "{{ inlineDocument }}"
hashAlgorithm: "{{ hashAlgorithm }}"
signatureAlgorithm: "{{ signatureAlgorithm }}"
attributes: "{{ attributes }}"
- name: roleArn
value: "{{ roleArn }}"
- name: additionalParameters
value: "{{ additionalParameters }}"
- name: tags
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
DELETE examples
- delete_ota_update
Delete an OTA update. Requires permission to access the DeleteOTAUpdate action.
DELETE FROM aws.iot.ota_updates
WHERE ota_update_id = '{{ ota_update_id }}' --required
AND region = '{{ region }}' --required
AND deleteStream = '{{ deleteStream }}'
AND forceDeleteAWSJob = '{{ forceDeleteAWSJob }}'
;