AWS IoT 1-Click Devices Service

2019/03/25 - AWS IoT 1-Click Devices Service - 3 new 3 updated api methods

Changes  This release adds tagging support for AWS IoT 1-Click Device resources. Use these APIs to add, remove, or list tags on Devices, and leverage the tags for various authorization and billing scenarios. This release also adds the ARN property for DescribeDevice response object.

ListTagsForResource (new) Link ¶

List all tags on an AWS IoT 1-Click resource.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    ResourceArn='string'
)
type ResourceArn

string

param ResourceArn

[REQUIRED]

The AWS IoT 1-Click resource with tags to be listed. This value is an Amazon Resource Name (ARN).

rtype

dict

returns

Response Syntax

{
    'Tags': {
        'string': 'string'
    }
}

Response Structure

  • (dict) --

    • Tags (dict) --

      The tags currently associated with the AWS IoT 1-Click resource.

      • (string) --

        • (string) --

TagResource (new) Link ¶

Associate a set of tags with an AWS IoT 1-Click resource. You can then activate these user-defined tags so that they appear on the Billing and Cost Management console for cost allocation tracking.

See also: AWS API Documentation

Request Syntax

client.tag_resource(
    ResourceArn='string',
    Tags={
        'string': 'string'
    }
)
type ResourceArn

string

param ResourceArn

[REQUIRED]

Identifies the AWS IoT 1-Click resource to which tags should be added. This value is an Amazon Resource Name (ARN).

type Tags

dict

param Tags

[REQUIRED]

The tags to be assigned to the AWS IoT 1-Click resource.

  • (string) --

    • (string) --

returns

None

UntagResource (new) Link ¶

Removes the association of tags from an AWS IoT 1-Click resource.

See also: AWS API Documentation

Request Syntax

client.untag_resource(
    ResourceArn='string',
    TagKeys=[
        'string',
    ]
)
type ResourceArn

string

param ResourceArn

[REQUIRED]

The AWS IoT 1-Click resource the tags will be removed from. This value is an Amazon Resource Name (ARN).

type TagKeys

list

param TagKeys

[REQUIRED]

A list of tag keys. Existing tags of the resource whose keys are members of this list will be removed from the AWS IoT 1-Click resource.

  • (string) --

returns

None

DescribeDevice (updated) Link ¶
Changes (response)
{'DeviceDescription': {'Arn': 'string', 'Tags': {'string': 'string'}}}

Given a device ID, returns a DescribeDeviceResponse object describing the details of the device.

See also: AWS API Documentation

Request Syntax

client.describe_device(
    DeviceId='string'
)
type DeviceId

string

param DeviceId

[REQUIRED]

The unique identifier of the device.

rtype

dict

returns

Response Syntax

{
    'DeviceDescription': {
        'Arn': 'string',
        'Attributes': {
            'string': 'string'
        },
        'DeviceId': 'string',
        'Enabled': True|False,
        'RemainingLife': 123.0,
        'Type': 'string',
        'Tags': {
            'string': 'string'
        }
    }
}

Response Structure

  • (dict) --

    200 response

    • DeviceDescription (dict) --

      Device details.

      • Arn (string) --

        The ARN of the device.

      • Attributes (dict) --

        An array of zero or more elements of DeviceAttribute objects providing user specified device attributes.

        • (string) --

          • (string) --

      • DeviceId (string) --

        The unique identifier of the device.

      • Enabled (boolean) --

        A Boolean value indicating whether or not the device is enabled.

      • RemainingLife (float) --

        A value between 0 and 1 inclusive, representing the fraction of life remaining for the device.

      • Type (string) --

        The type of the device, such as "button".

      • Tags (dict) --

        The tags currently associated with the AWS IoT 1-Click device.

        • (string) --

          • (string) --

FinalizeDeviceClaim (updated) Link ¶
Changes (request)
{'Tags': {'string': 'string'}}

Given a device ID, finalizes the claim request for the associated device.

Note

Claiming a device consists of initiating a claim, then publishing a device event, and finalizing the claim. For a device of type button, a device event can be published by simply clicking the device.

See also: AWS API Documentation

Request Syntax

client.finalize_device_claim(
    DeviceId='string',
    Tags={
        'string': 'string'
    }
)
type DeviceId

string

param DeviceId

[REQUIRED]

The unique identifier of the device.

type Tags

dict

param Tags

The tags to be assigned to the AWS IoT 1-Click device.

  • (string) --

    • (string) --

rtype

dict

returns

Response Syntax

{
    'State': 'string'
}

Response Structure

  • (dict) --

    200 response

    • State (string) --

      The device's final claim state.

ListDevices (updated) Link ¶
Changes (response)
{'Devices': {'Arn': 'string', 'Tags': {'string': 'string'}}}

Lists the 1-Click compatible devices associated with your AWS account.

See also: AWS API Documentation

Request Syntax

client.list_devices(
    DeviceType='string',
    MaxResults=123,
    NextToken='string'
)
type DeviceType

string

param DeviceType

The type of the device, such as "button".

type MaxResults

integer

param MaxResults

The maximum number of results to return per request. If not set, a default value of 100 is used.

type NextToken

string

param NextToken

The token to retrieve the next set of results.

rtype

dict

returns

Response Syntax

{
    'Devices': [
        {
            'Arn': 'string',
            'Attributes': {
                'string': 'string'
            },
            'DeviceId': 'string',
            'Enabled': True|False,
            'RemainingLife': 123.0,
            'Type': 'string',
            'Tags': {
                'string': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    200 response

    • Devices (list) --

      A list of devices.

      • (dict) --

        • Arn (string) --

          The ARN of the device.

        • Attributes (dict) --

          An array of zero or more elements of DeviceAttribute objects providing user specified device attributes.

          • (string) --

            • (string) --

        • DeviceId (string) --

          The unique identifier of the device.

        • Enabled (boolean) --

          A Boolean value indicating whether or not the device is enabled.

        • RemainingLife (float) --

          A value between 0 and 1 inclusive, representing the fraction of life remaining for the device.

        • Type (string) --

          The type of the device, such as "button".

        • Tags (dict) --

          The tags currently associated with the AWS IoT 1-Click device.

          • (string) --

            • (string) --

    • NextToken (string) --

      The token to retrieve the next set of results.