AWS IoT

2016/07/26 - AWS IoT - 5 new 8 updated api methods

DeprecateThingType (new) Link ¶

Deprecates a thing type. You can not associate new things with deprecated thing type.

Request Syntax

client.deprecate_thing_type(
    thingTypeName='string',
    undoDeprecate=True|False
)
type thingTypeName

string

param thingTypeName

[REQUIRED]

The name of the thing type to deprecate.

type undoDeprecate

boolean

param undoDeprecate

Whether to undeprecate a deprecated thing type. If true , the thing type will not be deprecated anymore and you can associate it with things.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the DeprecateThingType operation.

DescribeThingType (new) Link ¶

Gets information about the specified thing type.

Request Syntax

client.describe_thing_type(
    thingTypeName='string'
)
type thingTypeName

string

param thingTypeName

[REQUIRED]

The name of the thing type.

rtype

dict

returns

Response Syntax

{
    'thingTypeName': 'string',
    'thingTypeProperties': {
        'thingTypeDescription': 'string',
        'searchableAttributes': [
            'string',
        ]
    },
    'thingTypeMetadata': {
        'deprecated': True|False,
        'deprecationDate': datetime(2015, 1, 1),
        'creationDate': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    The output for the DescribeThingType operation.

    • thingTypeName (string) --

      The name of the thing type.

    • thingTypeProperties (dict) --

      The ThingTypeProperties contains information about the thing type including description, and a list of searchable thing attribute names.

      • thingTypeDescription (string) --

        The description of the thing type.

      • searchableAttributes (list) --

        A list of searchable thing attribute names.

        • (string) --

    • thingTypeMetadata (dict) --

      The ThingTypeMetadata contains additional information about the thing type including: creation date and time, a value indicating whether the thing type is deprecated, and a date and time when time was deprecated.

      • deprecated (boolean) --

        Whether the thing type is deprecated. If true , no new things could be associated with this type.

      • deprecationDate (datetime) --

        The date and time when the thing type was deprecated.

      • creationDate (datetime) --

        The date and time when the thing type was created.

CreateThingType (new) Link ¶

Creates a new thing type.

Request Syntax

client.create_thing_type(
    thingTypeName='string',
    thingTypeProperties={
        'thingTypeDescription': 'string',
        'searchableAttributes': [
            'string',
        ]
    }
)
type thingTypeName

string

param thingTypeName

[REQUIRED]

The name of the thing type.

type thingTypeProperties

dict

param thingTypeProperties

The ThingTypeProperties for the thing type to create. It contains information about the new thing type including a description, and a list of searchable thing attribute names.

  • thingTypeDescription (string) --

    The description of the thing type.

  • searchableAttributes (list) --

    A list of searchable thing attribute names.

    • (string) --

rtype

dict

returns

Response Syntax

{
    'thingTypeName': 'string',
    'thingTypeArn': 'string'
}

Response Structure

  • (dict) --

    The output of the CreateThingType operation.

    • thingTypeName (string) --

      The name of the thing type.

    • thingTypeArn (string) --

      The Amazon Resource Name (ARN) of the thing type.

ListThingTypes (new) Link ¶

Lists the existing thing types.

Request Syntax

client.list_thing_types(
    nextToken='string',
    maxResults=123,
    thingTypeName='string'
)
type nextToken

string

param nextToken

The token for the next set of results, or null if there are no additional results.

type maxResults

integer

param maxResults

The maximum number of results to return in this operation.

type thingTypeName

string

param thingTypeName

The name of the thing type.

rtype

dict

returns

Response Syntax

{
    'thingTypes': [
        {
            'thingTypeName': 'string',
            'thingTypeProperties': {
                'thingTypeDescription': 'string',
                'searchableAttributes': [
                    'string',
                ]
            },
            'thingTypeMetadata': {
                'deprecated': True|False,
                'deprecationDate': datetime(2015, 1, 1),
                'creationDate': datetime(2015, 1, 1)
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    The output for the ListThingTypes operation.

    • thingTypes (list) --

      The thing types.

      • (dict) --

        The definition of the thing type, including thing type name and description.

        • thingTypeName (string) --

          The name of the thing type.

        • thingTypeProperties (dict) --

          The ThingTypeProperties for the thing type.

          • thingTypeDescription (string) --

            The description of the thing type.

          • searchableAttributes (list) --

            A list of searchable thing attribute names.

            • (string) --

        • thingTypeMetadata (dict) --

          The ThingTypeMetadata contains additional information about the thing type including: creation date and time, a value indicating whether the thing type is deprecated, and a date and time when time was deprecated.

          • deprecated (boolean) --

            Whether the thing type is deprecated. If true , no new things could be associated with this type.

          • deprecationDate (datetime) --

            The date and time when the thing type was deprecated.

          • creationDate (datetime) --

            The date and time when the thing type was created.

    • nextToken (string) --

      The token for the next set of results, or null if there are no additional results.

DeleteThingType (new) Link ¶

Deletes the specified thing type . You cannot delete a thing type if it has things associated with it. To delete a thing type, first mark it as deprecated by calling DeprecateThingType, then remove any associated things by calling UpdateThing to change the thing type on any associated thing, and finally use DeleteThingType to delete the thing type.

Request Syntax

client.delete_thing_type(
    thingTypeName='string'
)
type thingTypeName

string

param thingTypeName

[REQUIRED]

The name of the thing type.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output for the DeleteThingType operation.

CreateThing (updated) Link ¶
Changes (request)
{'attributePayload': {'merge': 'boolean'}, 'thingTypeName': 'string'}

Creates a thing record in the thing registry.

Request Syntax

client.create_thing(
    thingName='string',
    thingTypeName='string',
    attributePayload={
        'attributes': {
            'string': 'string'
        },
        'merge': True|False
    }
)
type thingName

string

param thingName

[REQUIRED]

The name of the thing to create.

type thingTypeName

string

param thingTypeName

The name of the thing type associated with the new thing.

type attributePayload

dict

param attributePayload

The attribute payload, which consists of up to three name/value pairs in a JSON document. For example:

{\"attributes\":{\"string1\":\"string2\"}})

  • attributes (dict) --

    A JSON string containing up to three key-value pair in JSON format. For example:

    {\"attributes\":{\"string1\":\"string2\"}})

    • (string) --

      • (string) -- An attribute value for an Thing. An empty or null value in Update means that existing value for that attribute should be deleted. Empty and null values in create are ignored.

  • merge (boolean) --

    Specifies whether the list of attributes provided in the AttributePayload is merged with the attributes stored in the registry, instead of overwriting them.

    To remove an attribute, call UpdateThing with an empty attribute value.

    Note

    The merge attribute is only valid when calling UpdateThing .

rtype

dict

returns

Response Syntax

{
    'thingName': 'string',
    'thingArn': 'string'
}

Response Structure

  • (dict) --

    The output of the CreateThing operation.

    • thingName (string) --

      The name of the new thing.

    • thingArn (string) --

      The ARN of the new thing.

CreateTopicRule (updated) Link ¶
Changes (request)
{'topicRulePayload': {'actions': {'firehose': {'separator': 'string'}}}}

Creates a rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.

Request Syntax

client.create_topic_rule(
    ruleName='string',
    topicRulePayload={
        'sql': 'string',
        'description': 'string',
        'actions': [
            {
                'dynamoDB': {
                    'tableName': 'string',
                    'roleArn': 'string',
                    'operation': 'string',
                    'hashKeyField': 'string',
                    'hashKeyValue': 'string',
                    'hashKeyType': 'STRING'|'NUMBER',
                    'rangeKeyField': 'string',
                    'rangeKeyValue': 'string',
                    'rangeKeyType': 'STRING'|'NUMBER',
                    'payloadField': 'string'
                },
                'lambda': {
                    'functionArn': 'string'
                },
                'sns': {
                    'targetArn': 'string',
                    'roleArn': 'string',
                    'messageFormat': 'RAW'|'JSON'
                },
                'sqs': {
                    'roleArn': 'string',
                    'queueUrl': 'string',
                    'useBase64': True|False
                },
                'kinesis': {
                    'roleArn': 'string',
                    'streamName': 'string',
                    'partitionKey': 'string'
                },
                'republish': {
                    'roleArn': 'string',
                    'topic': 'string'
                },
                's3': {
                    'roleArn': 'string',
                    'bucketName': 'string',
                    'key': 'string'
                },
                'firehose': {
                    'roleArn': 'string',
                    'deliveryStreamName': 'string',
                    'separator': 'string'
                },
                'cloudwatchMetric': {
                    'roleArn': 'string',
                    'metricNamespace': 'string',
                    'metricName': 'string',
                    'metricValue': 'string',
                    'metricUnit': 'string',
                    'metricTimestamp': 'string'
                },
                'cloudwatchAlarm': {
                    'roleArn': 'string',
                    'alarmName': 'string',
                    'stateReason': 'string',
                    'stateValue': 'string'
                },
                'elasticsearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                }
            },
        ],
        'ruleDisabled': True|False,
        'awsIotSqlVersion': 'string'
    }
)
type ruleName

string

param ruleName

[REQUIRED]

The name of the rule.

type topicRulePayload

dict

param topicRulePayload

[REQUIRED]

The rule payload.

  • sql (string) -- [REQUIRED]

    The SQL statement used to query the topic. For more information, see AWS IoT SQL Reference in the AWS IoT Developer Guide .

  • description (string) --

    The description of the rule.

  • actions (list) -- [REQUIRED]

    The actions associated with the rule.

    • (dict) --

      Describes the actions associated with a rule.

      • dynamoDB (dict) --

        Write to a DynamoDB table.

        • tableName (string) -- [REQUIRED]

          The name of the DynamoDB table.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the DynamoDB table.

        • operation (string) --

          The type of operation to be performed. This follows the substitution template, so it can be ${operation} , but the substitution must result in one of the following: INSERT , UPDATE , or DELETE .

        • hashKeyField (string) -- [REQUIRED]

          The hash key name.

        • hashKeyValue (string) -- [REQUIRED]

          The hash key value.

        • hashKeyType (string) --

          The hash key type. Valid values are "STRING" or "NUMBER"

        • rangeKeyField (string) --

          The range key name.

        • rangeKeyValue (string) --

          The range key value.

        • rangeKeyType (string) --

          The range key type. Valid values are "STRING" or "NUMBER"

        • payloadField (string) --

          The action payload. This name can be customized.

      • lambda (dict) --

        Invoke a Lambda function.

        • functionArn (string) -- [REQUIRED]

          The ARN of the Lambda function.

      • sns (dict) --

        Publish to an Amazon SNS topic.

        • targetArn (string) -- [REQUIRED]

          The ARN of the SNS topic.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • messageFormat (string) --

          The message format of the message to publish. Optional. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see http://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

      • sqs (dict) --

        Publish to an Amazon SQS queue.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • queueUrl (string) -- [REQUIRED]

          The URL of the Amazon SQS queue.

        • useBase64 (boolean) --

          Specifies whether to use Base64 encoding.

      • kinesis (dict) --

        Write data to an Amazon Kinesis stream.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the Amazon Kinesis stream.

        • streamName (string) -- [REQUIRED]

          The name of the Amazon Kinesis stream.

        • partitionKey (string) --

          The partition key.

      • republish (dict) --

        Publish to another MQTT topic.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • topic (string) -- [REQUIRED]

          The name of the MQTT topic.

      • s3 (dict) --

        Write to an Amazon S3 bucket.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • bucketName (string) -- [REQUIRED]

          The Amazon S3 bucket.

        • key (string) -- [REQUIRED]

          The object key.

      • firehose (dict) --

        Write to an Amazon Kinesis Firehose stream.

        • roleArn (string) -- [REQUIRED]

          The IAM role that grants access to the Amazon Kinesis Firehost stream.

        • deliveryStreamName (string) -- [REQUIRED]

          The delivery stream name.

        • separator (string) --

          A character separator that will be used to separate records written to the firehose stream. Valid values are: 'n' (newline), 't' (tab), 'rn' (Windows newline), ',' (comma).

      • cloudwatchMetric (dict) --

        Capture a CloudWatch metric.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch metric.

        • metricNamespace (string) -- [REQUIRED]

          The CloudWatch metric namespace name.

        • metricName (string) -- [REQUIRED]

          The CloudWatch metric name.

        • metricValue (string) -- [REQUIRED]

          The CloudWatch metric value.

        • metricUnit (string) -- [REQUIRED]

          The metric unit supported by CloudWatch.

        • metricTimestamp (string) --

          An optional Unix timestamp.

      • cloudwatchAlarm (dict) --

        Change the state of a CloudWatch alarm.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch alarm.

        • alarmName (string) -- [REQUIRED]

          The CloudWatch alarm name.

        • stateReason (string) -- [REQUIRED]

          The reason for the alarm change.

        • stateValue (string) -- [REQUIRED]

          The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

      • elasticsearch (dict) --

        Write data to an Amazon Elasticsearch Service; domain.

        • roleArn (string) -- [REQUIRED]

          The IAM role ARN that has access to Elasticsearch.

        • endpoint (string) -- [REQUIRED]

          The endpoint of your Elasticsearch domain.

        • index (string) -- [REQUIRED]

          The Elasticsearch index where you want to store your data.

        • type (string) -- [REQUIRED]

          The type of document you are storing.

        • id (string) -- [REQUIRED]

          The unique identifier for the document you are storing.

  • ruleDisabled (boolean) --

    Specifies whether the rule is disabled.

  • awsIotSqlVersion (string) --

    The version of the SQL rules engine to use when evaluating the rule.

returns

None

DeleteThing (updated) Link ¶
Changes (request)
{'expectedVersion': 'long'}

Deletes the specified thing.

Request Syntax

client.delete_thing(
    thingName='string',
    expectedVersion=123
)
type thingName

string

param thingName

[REQUIRED]

The name of the thing to delete.

type expectedVersion

integer

param expectedVersion

The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the DeleteThing request is rejected with a VersionConflictException .

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output of the DeleteThing operation.

DescribeThing (updated) Link ¶
Changes (response)
{'thingTypeName': 'string', 'version': 'long'}

Gets information about the specified thing.

Request Syntax

client.describe_thing(
    thingName='string'
)
type thingName

string

param thingName

[REQUIRED]

The name of the thing.

rtype

dict

returns

Response Syntax

{
    'defaultClientId': 'string',
    'thingName': 'string',
    'thingTypeName': 'string',
    'attributes': {
        'string': 'string'
    },
    'version': 123
}

Response Structure

  • (dict) --

    The output from the DescribeThing operation.

    • defaultClientId (string) --

      The default client ID.

    • thingName (string) --

      The name of the thing.

    • thingTypeName (string) --

      The thing type name.

    • attributes (dict) --

      The thing attributes.

      • (string) --

        • (string) -- An attribute value for an Thing. An empty or null value in Update means that existing value for that attribute should be deleted. Empty and null values in create are ignored.

    • version (integer) --

      The current version of the thing record in the registry.

      Note

      To avoid unintentional changes to the information in the registry, you can pass the version information in the expectedVersion parameter of the UpdateThing and DeleteThing calls.

GetTopicRule (updated) Link ¶
Changes (response)
{'rule': {'actions': {'firehose': {'separator': 'string'}}}}

Gets information about the specified rule.

Request Syntax

client.get_topic_rule(
    ruleName='string'
)
type ruleName

string

param ruleName

[REQUIRED]

The name of the rule.

rtype

dict

returns

Response Syntax

{
    'ruleArn': 'string',
    'rule': {
        'ruleName': 'string',
        'sql': 'string',
        'description': 'string',
        'createdAt': datetime(2015, 1, 1),
        'actions': [
            {
                'dynamoDB': {
                    'tableName': 'string',
                    'roleArn': 'string',
                    'operation': 'string',
                    'hashKeyField': 'string',
                    'hashKeyValue': 'string',
                    'hashKeyType': 'STRING'|'NUMBER',
                    'rangeKeyField': 'string',
                    'rangeKeyValue': 'string',
                    'rangeKeyType': 'STRING'|'NUMBER',
                    'payloadField': 'string'
                },
                'lambda': {
                    'functionArn': 'string'
                },
                'sns': {
                    'targetArn': 'string',
                    'roleArn': 'string',
                    'messageFormat': 'RAW'|'JSON'
                },
                'sqs': {
                    'roleArn': 'string',
                    'queueUrl': 'string',
                    'useBase64': True|False
                },
                'kinesis': {
                    'roleArn': 'string',
                    'streamName': 'string',
                    'partitionKey': 'string'
                },
                'republish': {
                    'roleArn': 'string',
                    'topic': 'string'
                },
                's3': {
                    'roleArn': 'string',
                    'bucketName': 'string',
                    'key': 'string'
                },
                'firehose': {
                    'roleArn': 'string',
                    'deliveryStreamName': 'string',
                    'separator': 'string'
                },
                'cloudwatchMetric': {
                    'roleArn': 'string',
                    'metricNamespace': 'string',
                    'metricName': 'string',
                    'metricValue': 'string',
                    'metricUnit': 'string',
                    'metricTimestamp': 'string'
                },
                'cloudwatchAlarm': {
                    'roleArn': 'string',
                    'alarmName': 'string',
                    'stateReason': 'string',
                    'stateValue': 'string'
                },
                'elasticsearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                }
            },
        ],
        'ruleDisabled': True|False,
        'awsIotSqlVersion': 'string'
    }
}

Response Structure

  • (dict) --

    The output from the GetTopicRule operation.

    • ruleArn (string) --

      The rule ARN.

    • rule (dict) --

      The rule.

      • ruleName (string) --

        The name of the rule.

      • sql (string) --

        The SQL statement used to query the topic. When using a SQL query with multiple lines, be sure to escape the newline characters.

      • description (string) --

        The description of the rule.

      • createdAt (datetime) --

        The date and time the rule was created.

      • actions (list) --

        The actions associated with the rule.

        • (dict) --

          Describes the actions associated with a rule.

          • dynamoDB (dict) --

            Write to a DynamoDB table.

            • tableName (string) --

              The name of the DynamoDB table.

            • roleArn (string) --

              The ARN of the IAM role that grants access to the DynamoDB table.

            • operation (string) --

              The type of operation to be performed. This follows the substitution template, so it can be ${operation} , but the substitution must result in one of the following: INSERT , UPDATE , or DELETE .

            • hashKeyField (string) --

              The hash key name.

            • hashKeyValue (string) --

              The hash key value.

            • hashKeyType (string) --

              The hash key type. Valid values are "STRING" or "NUMBER"

            • rangeKeyField (string) --

              The range key name.

            • rangeKeyValue (string) --

              The range key value.

            • rangeKeyType (string) --

              The range key type. Valid values are "STRING" or "NUMBER"

            • payloadField (string) --

              The action payload. This name can be customized.

          • lambda (dict) --

            Invoke a Lambda function.

            • functionArn (string) --

              The ARN of the Lambda function.

          • sns (dict) --

            Publish to an Amazon SNS topic.

            • targetArn (string) --

              The ARN of the SNS topic.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

            • messageFormat (string) --

              The message format of the message to publish. Optional. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see http://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

          • sqs (dict) --

            Publish to an Amazon SQS queue.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

            • queueUrl (string) --

              The URL of the Amazon SQS queue.

            • useBase64 (boolean) --

              Specifies whether to use Base64 encoding.

          • kinesis (dict) --

            Write data to an Amazon Kinesis stream.

            • roleArn (string) --

              The ARN of the IAM role that grants access to the Amazon Kinesis stream.

            • streamName (string) --

              The name of the Amazon Kinesis stream.

            • partitionKey (string) --

              The partition key.

          • republish (dict) --

            Publish to another MQTT topic.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

            • topic (string) --

              The name of the MQTT topic.

          • s3 (dict) --

            Write to an Amazon S3 bucket.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

            • bucketName (string) --

              The Amazon S3 bucket.

            • key (string) --

              The object key.

          • firehose (dict) --

            Write to an Amazon Kinesis Firehose stream.

            • roleArn (string) --

              The IAM role that grants access to the Amazon Kinesis Firehost stream.

            • deliveryStreamName (string) --

              The delivery stream name.

            • separator (string) --

              A character separator that will be used to separate records written to the firehose stream. Valid values are: 'n' (newline), 't' (tab), 'rn' (Windows newline), ',' (comma).

          • cloudwatchMetric (dict) --

            Capture a CloudWatch metric.

            • roleArn (string) --

              The IAM role that allows access to the CloudWatch metric.

            • metricNamespace (string) --

              The CloudWatch metric namespace name.

            • metricName (string) --

              The CloudWatch metric name.

            • metricValue (string) --

              The CloudWatch metric value.

            • metricUnit (string) --

              The metric unit supported by CloudWatch.

            • metricTimestamp (string) --

              An optional Unix timestamp.

          • cloudwatchAlarm (dict) --

            Change the state of a CloudWatch alarm.

            • roleArn (string) --

              The IAM role that allows access to the CloudWatch alarm.

            • alarmName (string) --

              The CloudWatch alarm name.

            • stateReason (string) --

              The reason for the alarm change.

            • stateValue (string) --

              The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

          • elasticsearch (dict) --

            Write data to an Amazon Elasticsearch Service; domain.

            • roleArn (string) --

              The IAM role ARN that has access to Elasticsearch.

            • endpoint (string) --

              The endpoint of your Elasticsearch domain.

            • index (string) --

              The Elasticsearch index where you want to store your data.

            • type (string) --

              The type of document you are storing.

            • id (string) --

              The unique identifier for the document you are storing.

      • ruleDisabled (boolean) --

        Specifies whether the rule is disabled.

      • awsIotSqlVersion (string) --

        The version of the SQL rules engine to use when evaluating the rule.

ListThings (updated) Link ¶
Changes (request, response)
Request
{'thingTypeName': 'string'}
Response
{'things': {'thingTypeName': 'string', 'version': 'long'}}

Lists your things. Use the attributeName and attributeValue parameters to filter your things. For example, calling ListThings with attributeName=Color and attributeValue=Red retrieves all things in the registry that contain an attribute Color with the value Red .

Request Syntax

client.list_things(
    nextToken='string',
    maxResults=123,
    attributeName='string',
    attributeValue='string',
    thingTypeName='string'
)
type nextToken

string

param nextToken

The token for the next set of results, or null if there are no additional results.

type maxResults

integer

param maxResults

The maximum number of results to return in this operation.

type attributeName

string

param attributeName

The attribute name used to search for things.

type attributeValue

string

param attributeValue

The attribute value used to search for things.

type thingTypeName

string

param thingTypeName

The name of the thing type used to search for things.

rtype

dict

returns

Response Syntax

{
    'things': [
        {
            'thingName': 'string',
            'thingTypeName': 'string',
            'attributes': {
                'string': 'string'
            },
            'version': 123
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    The output from the ListThings operation.

    • things (list) --

      The things.

      • (dict) --

        The properties of the thing, including thing name, thing type name, and a list of thing attributes.

        • thingName (string) --

          The name of the thing.

        • thingTypeName (string) --

          The name of the thing type, if the thing has been associated with a type.

        • attributes (dict) --

          A list of thing attributes which are name-value pairs.

          • (string) --

            • (string) -- An attribute value for an Thing. An empty or null value in Update means that existing value for that attribute should be deleted. Empty and null values in create are ignored.

        • version (integer) --

          The version of the thing record in the registry.

    • nextToken (string) --

      The token for the next set of results, or null if there are no additional results.

ReplaceTopicRule (updated) Link ¶
Changes (request)
{'topicRulePayload': {'actions': {'firehose': {'separator': 'string'}}}}

Replaces the specified rule. You must specify all parameters for the new rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.

Request Syntax

client.replace_topic_rule(
    ruleName='string',
    topicRulePayload={
        'sql': 'string',
        'description': 'string',
        'actions': [
            {
                'dynamoDB': {
                    'tableName': 'string',
                    'roleArn': 'string',
                    'operation': 'string',
                    'hashKeyField': 'string',
                    'hashKeyValue': 'string',
                    'hashKeyType': 'STRING'|'NUMBER',
                    'rangeKeyField': 'string',
                    'rangeKeyValue': 'string',
                    'rangeKeyType': 'STRING'|'NUMBER',
                    'payloadField': 'string'
                },
                'lambda': {
                    'functionArn': 'string'
                },
                'sns': {
                    'targetArn': 'string',
                    'roleArn': 'string',
                    'messageFormat': 'RAW'|'JSON'
                },
                'sqs': {
                    'roleArn': 'string',
                    'queueUrl': 'string',
                    'useBase64': True|False
                },
                'kinesis': {
                    'roleArn': 'string',
                    'streamName': 'string',
                    'partitionKey': 'string'
                },
                'republish': {
                    'roleArn': 'string',
                    'topic': 'string'
                },
                's3': {
                    'roleArn': 'string',
                    'bucketName': 'string',
                    'key': 'string'
                },
                'firehose': {
                    'roleArn': 'string',
                    'deliveryStreamName': 'string',
                    'separator': 'string'
                },
                'cloudwatchMetric': {
                    'roleArn': 'string',
                    'metricNamespace': 'string',
                    'metricName': 'string',
                    'metricValue': 'string',
                    'metricUnit': 'string',
                    'metricTimestamp': 'string'
                },
                'cloudwatchAlarm': {
                    'roleArn': 'string',
                    'alarmName': 'string',
                    'stateReason': 'string',
                    'stateValue': 'string'
                },
                'elasticsearch': {
                    'roleArn': 'string',
                    'endpoint': 'string',
                    'index': 'string',
                    'type': 'string',
                    'id': 'string'
                }
            },
        ],
        'ruleDisabled': True|False,
        'awsIotSqlVersion': 'string'
    }
)
type ruleName

string

param ruleName

[REQUIRED]

The name of the rule.

type topicRulePayload

dict

param topicRulePayload

[REQUIRED]

The rule payload.

  • sql (string) -- [REQUIRED]

    The SQL statement used to query the topic. For more information, see AWS IoT SQL Reference in the AWS IoT Developer Guide .

  • description (string) --

    The description of the rule.

  • actions (list) -- [REQUIRED]

    The actions associated with the rule.

    • (dict) --

      Describes the actions associated with a rule.

      • dynamoDB (dict) --

        Write to a DynamoDB table.

        • tableName (string) -- [REQUIRED]

          The name of the DynamoDB table.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the DynamoDB table.

        • operation (string) --

          The type of operation to be performed. This follows the substitution template, so it can be ${operation} , but the substitution must result in one of the following: INSERT , UPDATE , or DELETE .

        • hashKeyField (string) -- [REQUIRED]

          The hash key name.

        • hashKeyValue (string) -- [REQUIRED]

          The hash key value.

        • hashKeyType (string) --

          The hash key type. Valid values are "STRING" or "NUMBER"

        • rangeKeyField (string) --

          The range key name.

        • rangeKeyValue (string) --

          The range key value.

        • rangeKeyType (string) --

          The range key type. Valid values are "STRING" or "NUMBER"

        • payloadField (string) --

          The action payload. This name can be customized.

      • lambda (dict) --

        Invoke a Lambda function.

        • functionArn (string) -- [REQUIRED]

          The ARN of the Lambda function.

      • sns (dict) --

        Publish to an Amazon SNS topic.

        • targetArn (string) -- [REQUIRED]

          The ARN of the SNS topic.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • messageFormat (string) --

          The message format of the message to publish. Optional. Accepted values are "JSON" and "RAW". The default value of the attribute is "RAW". SNS uses this setting to determine if the payload should be parsed and relevant platform-specific bits of the payload should be extracted. To read more about SNS message formats, see http://docs.aws.amazon.com/sns/latest/dg/json-formats.html refer to their official documentation.

      • sqs (dict) --

        Publish to an Amazon SQS queue.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • queueUrl (string) -- [REQUIRED]

          The URL of the Amazon SQS queue.

        • useBase64 (boolean) --

          Specifies whether to use Base64 encoding.

      • kinesis (dict) --

        Write data to an Amazon Kinesis stream.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access to the Amazon Kinesis stream.

        • streamName (string) -- [REQUIRED]

          The name of the Amazon Kinesis stream.

        • partitionKey (string) --

          The partition key.

      • republish (dict) --

        Publish to another MQTT topic.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • topic (string) -- [REQUIRED]

          The name of the MQTT topic.

      • s3 (dict) --

        Write to an Amazon S3 bucket.

        • roleArn (string) -- [REQUIRED]

          The ARN of the IAM role that grants access.

        • bucketName (string) -- [REQUIRED]

          The Amazon S3 bucket.

        • key (string) -- [REQUIRED]

          The object key.

      • firehose (dict) --

        Write to an Amazon Kinesis Firehose stream.

        • roleArn (string) -- [REQUIRED]

          The IAM role that grants access to the Amazon Kinesis Firehost stream.

        • deliveryStreamName (string) -- [REQUIRED]

          The delivery stream name.

        • separator (string) --

          A character separator that will be used to separate records written to the firehose stream. Valid values are: 'n' (newline), 't' (tab), 'rn' (Windows newline), ',' (comma).

      • cloudwatchMetric (dict) --

        Capture a CloudWatch metric.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch metric.

        • metricNamespace (string) -- [REQUIRED]

          The CloudWatch metric namespace name.

        • metricName (string) -- [REQUIRED]

          The CloudWatch metric name.

        • metricValue (string) -- [REQUIRED]

          The CloudWatch metric value.

        • metricUnit (string) -- [REQUIRED]

          The metric unit supported by CloudWatch.

        • metricTimestamp (string) --

          An optional Unix timestamp.

      • cloudwatchAlarm (dict) --

        Change the state of a CloudWatch alarm.

        • roleArn (string) -- [REQUIRED]

          The IAM role that allows access to the CloudWatch alarm.

        • alarmName (string) -- [REQUIRED]

          The CloudWatch alarm name.

        • stateReason (string) -- [REQUIRED]

          The reason for the alarm change.

        • stateValue (string) -- [REQUIRED]

          The value of the alarm state. Acceptable values are: OK, ALARM, INSUFFICIENT_DATA.

      • elasticsearch (dict) --

        Write data to an Amazon Elasticsearch Service; domain.

        • roleArn (string) -- [REQUIRED]

          The IAM role ARN that has access to Elasticsearch.

        • endpoint (string) -- [REQUIRED]

          The endpoint of your Elasticsearch domain.

        • index (string) -- [REQUIRED]

          The Elasticsearch index where you want to store your data.

        • type (string) -- [REQUIRED]

          The type of document you are storing.

        • id (string) -- [REQUIRED]

          The unique identifier for the document you are storing.

  • ruleDisabled (boolean) --

    Specifies whether the rule is disabled.

  • awsIotSqlVersion (string) --

    The version of the SQL rules engine to use when evaluating the rule.

returns

None

UpdateThing (updated) Link ¶
Changes (request)
{'attributePayload': {'merge': 'boolean'},
 'expectedVersion': 'long',
 'removeThingType': 'boolean',
 'thingTypeName': 'string'}

Updates the data for a thing.

Request Syntax

client.update_thing(
    thingName='string',
    thingTypeName='string',
    attributePayload={
        'attributes': {
            'string': 'string'
        },
        'merge': True|False
    },
    expectedVersion=123,
    removeThingType=True|False
)
type thingName

string

param thingName

[REQUIRED]

The name of the thing to update.

type thingTypeName

string

param thingTypeName

The name of the thing type.

type attributePayload

dict

param attributePayload

A list of thing attributes, a JSON string containing name-value pairs. For example:

{\"attributes\":{\"name1\":\"value2\"}})

This data is used to add new attributes or update existing attributes.

  • attributes (dict) --

    A JSON string containing up to three key-value pair in JSON format. For example:

    {\"attributes\":{\"string1\":\"string2\"}})

    • (string) --

      • (string) -- An attribute value for an Thing. An empty or null value in Update means that existing value for that attribute should be deleted. Empty and null values in create are ignored.

  • merge (boolean) --

    Specifies whether the list of attributes provided in the AttributePayload is merged with the attributes stored in the registry, instead of overwriting them.

    To remove an attribute, call UpdateThing with an empty attribute value.

    Note

    The merge attribute is only valid when calling UpdateThing .

type expectedVersion

integer

param expectedVersion

The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the UpdateThing request is rejected with a VersionConflictException .

type removeThingType

boolean

param removeThingType

Remove a thing type association. If true , the assocation is removed.

rtype

dict

returns

Response Syntax

{}

Response Structure

  • (dict) --

    The output from the UpdateThing operation.