AWS IoT

2019/03/14 - AWS IoT - 2 updated api methods

Changes  Update iot client to latest version

CreateOTAUpdate (updated) Link ¶
Changes (request)
{'tags': [{'Key': 'string', 'Value': 'string'}]}

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

See also: AWS API Documentation

Request Syntax

client.create_ota_update(
    otaUpdateId='string',
    description='string',
    targets=[
        'string',
    ],
    targetSelection='CONTINUOUS'|'SNAPSHOT',
    awsJobExecutionsRolloutConfig={
        'maximumPerMinute': 123
    },
    files=[
        {
            'fileName': 'string',
            'fileVersion': 'string',
            'fileLocation': {
                'stream': {
                    'streamId': 'string',
                    'fileId': 123
                },
                's3Location': {
                    'bucket': 'string',
                    'key': 'string',
                    'version': 'string'
                }
            },
            'codeSigning': {
                'awsSignerJobId': 'string',
                'startSigningJobParameter': {
                    'signingProfileParameter': {
                        'certificateArn': 'string',
                        'platform': 'string',
                        'certificatePathOnDevice': 'string'
                    },
                    'signingProfileName': 'string',
                    'destination': {
                        's3Destination': {
                            'bucket': 'string',
                            'prefix': 'string'
                        }
                    }
                },
                'customCodeSigning': {
                    'signature': {
                        'inlineDocument': b'bytes'
                    },
                    'certificateChain': {
                        'certificateName': 'string',
                        'inlineDocument': 'string'
                    },
                    'hashAlgorithm': 'string',
                    'signatureAlgorithm': 'string'
                }
            },
            'attributes': {
                'string': 'string'
            }
        },
    ],
    roleArn='string',
    additionalParameters={
        'string': 'string'
    },
    tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type otaUpdateId:

string

param otaUpdateId:

[REQUIRED]

The ID of the OTA update to be created.

type description:

string

param description:

The description of the OTA update.

type targets:

list

param targets:

[REQUIRED]

The targeted devices to receive OTA updates.

  • (string) --

type targetSelection:

string

param 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 awsJobExecutionsRolloutConfig:

dict

param awsJobExecutionsRolloutConfig:

Configuration for the rollout of OTA updates.

  • maximumPerMinute (integer) --

    The maximum number of OTA update job executions started per minute.

type files:

list

param files:

[REQUIRED]

The files to be streamed by the OTA update.

  • (dict) --

    Describes a file to be associated with an OTA update.

    • fileName (string) --

      The name of the file.

    • fileVersion (string) --

      The file version.

    • fileLocation (dict) --

      The location of the updated firmware.

      • stream (dict) --

        The stream that contains the OTA update.

        • streamId (string) --

          The stream ID.

        • fileId (integer) --

          The ID of a file associated with a stream.

      • s3Location (dict) --

        The location of the updated firmware in S3.

        • bucket (string) --

          The S3 bucket.

        • key (string) --

          The S3 key.

        • version (string) --

          The S3 bucket version.

    • codeSigning (dict) --

      The code signing method of the file.

      • awsSignerJobId (string) --

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

      • startSigningJobParameter (dict) --

        Describes the code-signing job.

        • signingProfileParameter (dict) --

          Describes the code-signing profile.

          • certificateArn (string) --

            Certificate ARN.

          • platform (string) --

            The hardware platform of your device.

          • certificatePathOnDevice (string) --

            The location of the code-signing certificate on your device.

        • signingProfileName (string) --

          The code-signing profile name.

        • destination (dict) --

          The location to write the code-signed file.

          • s3Destination (dict) --

            Describes the location in S3 of the updated firmware.

            • bucket (string) --

              The S3 bucket that contains the updated firmware.

            • prefix (string) --

              The S3 prefix.

      • customCodeSigning (dict) --

        A custom method for code signing a file.

        • signature (dict) --

          The signature for the file.

          • inlineDocument (bytes) --

            A base64 encoded binary representation of the code signing signature.

        • certificateChain (dict) --

          The certificate chain.

          • 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 (dict) --

      A list of name/attribute pairs.

      • (string) --

        • (string) --

type roleArn:

string

param roleArn:

[REQUIRED]

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

type additionalParameters:

dict

param additionalParameters:

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

  • (string) --

    • (string) --

type tags:

list

param tags:

Metadata which can be used to manage updates.

  • (dict) --

    A set of key/value pairs that are used to manage the resource.

    • Key (string) --

      The tag's key.

    • Value (string) --

      The tag's value.

rtype:

dict

returns:

Response Syntax

{
    'otaUpdateId': 'string',
    'awsIotJobId': 'string',
    'otaUpdateArn': 'string',
    'awsIotJobArn': 'string',
    'otaUpdateStatus': 'CREATE_PENDING'|'CREATE_IN_PROGRESS'|'CREATE_COMPLETE'|'CREATE_FAILED'
}

Response Structure

  • (dict) --

    • otaUpdateId (string) --

      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.

CreateStream (updated) Link ¶
Changes (request)
{'tags': [{'Key': 'string', 'Value': 'string'}]}

Creates a stream for delivering one or more large files in chunks over MQTT. A stream transports data bytes in chunks or blocks packaged as MQTT messages from a source like S3. You can have one or more files associated with a stream. The total size of a file associated with the stream cannot exceed more than 2 MB. The stream will be created with version 0. If a stream is created with the same streamID as a stream that existed and was deleted within last 90 days, we will resurrect that old stream by incrementing the version by 1.

See also: AWS API Documentation

Request Syntax

client.create_stream(
    streamId='string',
    description='string',
    files=[
        {
            'fileId': 123,
            's3Location': {
                'bucket': 'string',
                'key': 'string',
                'version': 'string'
            }
        },
    ],
    roleArn='string',
    tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type streamId:

string

param streamId:

[REQUIRED]

The stream ID.

type description:

string

param description:

A description of the stream.

type files:

list

param files:

[REQUIRED]

The files to stream.

  • (dict) --

    Represents a file to stream.

    • fileId (integer) --

      The file ID.

    • s3Location (dict) --

      The location of the file in S3.

      • bucket (string) --

        The S3 bucket.

      • key (string) --

        The S3 key.

      • version (string) --

        The S3 bucket version.

type roleArn:

string

param roleArn:

[REQUIRED]

An IAM role that allows the IoT service principal assumes to access your S3 files.

type tags:

list

param tags:

Metadata which can be used to manage streams.

  • (dict) --

    A set of key/value pairs that are used to manage the resource.

    • Key (string) --

      The tag's key.

    • Value (string) --

      The tag's value.

rtype:

dict

returns:

Response Syntax

{
    'streamId': 'string',
    'streamArn': 'string',
    'description': 'string',
    'streamVersion': 123
}

Response Structure

  • (dict) --

    • streamId (string) --

      The stream ID.

    • streamArn (string) --

      The stream ARN.

    • description (string) --

      A description of the stream.

    • streamVersion (integer) --

      The version of the stream.