Skip to content

Commit

Permalink
Documentation updates
Browse files Browse the repository at this point in the history
  • Loading branch information
gregbreen committed Oct 11, 2023
1 parent 0906e72 commit e40bedd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ usage: create_ota_update.py [-h] binary bucket signingProfile otaRole thingGroup
Create and execute AWS IoT OTA update directly using jobs
positional arguments:
binary Name of the binary file (oject key) in the S3 bucket
binary Name of the binary file (object key) in the S3 bucket
bucket Name of the bucket
signingProfile Name of the signing profile
otaRole Name of the IAM role that grants IoT access to S3, IoT jobs and code signing
thingGroup Name of the target Thing group
jobId ID of the job to be created
jobId ID of the job to be created ('AFR_OTA-' will be prepended)
optional arguments:
-h, --help show this help message and exit
Expand Down Expand Up @@ -96,7 +96,7 @@ The following scenario is demonstrated:
5. Number of [retries](https://docs.aws.amazon.com/iot/latest/apireference/API_CreateJob.html#iot-CreateJob-request-jobExecutionsRetryConfig) set to 3.
6. A [scheduled job](https://docs.aws.amazon.com/iot/latest/apireference/API_CreateJob.html#iot-CreateJob-request-schedulingConfig) that starts one hour in the future and ends an hour later.

The example can of course be adjusted to cater for different options and to use additional advanced job configuration such as [recurring maintenace windows](https://docs.aws.amazon.com/iot/latest/apireference/API_SchedulingConfig.html#iot-Type-SchedulingConfig-maintenanceWindows), [software catalog package versions](https://docs.aws.amazon.com/iot/latest/apireference/API_CreateJob.html#iot-CreateJob-request-destinationPackageVersions) and [namespaces](https://docs.aws.amazon.com/iot/latest/apireference/API_CreateJob.html#iot-CreateJob-request-namespaceId).
The example can of course be adjusted to cater for different options and to use additional advanced job configuration such as [recurring maintenance windows](https://docs.aws.amazon.com/iot/latest/apireference/API_SchedulingConfig.html#iot-Type-SchedulingConfig-maintenanceWindows) and [software catalog package versions](https://docs.aws.amazon.com/iot/latest/apireference/API_CreateJob.html#iot-CreateJob-request-destinationPackageVersions).

# Deviations

Expand Down
12 changes: 7 additions & 5 deletions create_ota_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
makes numerous other API calls, finishing with CreateJob. This example makes
those APIs calls to construct a job and job document that is equivalent to
an OTA Update. This approach allows you to perform an OTA Update that uses
advanced job configuration options such as retries, scheduling and destination
package versions. These options are not supported by CreateOTAUpdate, but are
advanced job configuration options such as retries, scheduling and Software
Package Catalog. These options are not supported by CreateOTAUpdate, but are
supported by CreateJob.
This example creates the OTA Update job with the following paraemters and scenario:
Expand Down Expand Up @@ -192,7 +192,7 @@ def create_job():
# ],
'startTime': (now + timedelta(hours=1)).strftime('%Y-%m-%dT%H:%M')
}
# You may optionally define package version ARNs here
# You may optionally define Software Package Catalog package version ARNs here
# destinationPackageVersions=[
# 'string',
# ]
Expand All @@ -201,13 +201,15 @@ def create_job():


parser = argparse.ArgumentParser(description='Create and execute AWS IoT OTA update using jobs')
parser.add_argument('binary', help='Name of the binary file (oject key) in the S3 bucket')
parser.add_argument('binary', help='Name of the binary file (object key)\
in the S3 bucket')
parser.add_argument('bucket', help='Name of the bucket')
parser.add_argument('signingProfile', help='Name of the signing profile')
parser.add_argument('otaRole', help='Name of the IAM role that grants IoT access\
to S3, IoT jobs and code signing')
parser.add_argument('thingGroup', help='Name of the target Thing group')
parser.add_argument('jobId', help='ID of the job to be created')
parser.add_argument('jobId', help='ID of the job to be created (\'AFR_OTA-\' will\
be prepended)')
args = parser.parse_args()

iot = boto3.client('iot')
Expand Down

0 comments on commit e40bedd

Please sign in to comment.