AWS IoT

2016/01/21 - AWS IoT - 2 new 2 updated api methods

EnableTopicRule (new) Link ¶

Enables the specified rule.

Request Syntax

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

string

param ruleName

[REQUIRED]

The name of the topic rule to enable.

returns

None

DisableTopicRule (new) Link ¶

Disables the specified rule

Request Syntax

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

string

param ruleName

[REQUIRED]

The name of the rule to disable.

returns

None

GetTopicRule (updated) Link ¶
Changes (response)
{'ruleArn': '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',
                    'hashKeyField': 'string',
                    'hashKeyValue': 'string',
                    'rangeKeyField': 'string',
                    'rangeKeyValue': 'string',
                    'payloadField': 'string'
                },
                'lambda': {
                    'functionArn': 'string'
                },
                'sns': {
                    'targetArn': 'string',
                    'roleArn': 'string'
                },
                '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'
                }
            },
        ],
        'ruleDisabled': True|False
    }
}

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 properly.

      • 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.

            • hashKeyField (string) --

              The hash key name.

            • hashKeyValue (string) --

              The hash key value.

            • rangeKeyField (string) --

              The range key name.

            • rangeKeyValue (string) --

              The range key value.

            • 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 SNS topic.

            • targetArn (string) --

              The ARN of the SNS topic.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

          • sqs (dict) --

            Publish to an 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 a Kinesis stream.

            • roleArn (string) --

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

            • streamName (string) --

              The name of the 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 S3 bucket.

            • roleArn (string) --

              The ARN of the IAM role that grants access.

            • bucketName (string) --

              The S3 bucket.

            • key (string) --

              The object key.

          • firehose (dict) --

            Write to a Kinesis Firehose stream.

            • roleArn (string) --

              The IAM role that grants access to the firehose stream.

            • deliveryStreamName (string) --

              The delivery stream name.

      • ruleDisabled (boolean) --

        Specifies whether the rule is disabled.

ListTopicRules (updated) Link ¶
Changes (response)
{'rules': {'ruleArn': 'string'}}

Lists the rules for the specific topic.

Request Syntax

client.list_topic_rules(
    topic='string',
    maxResults=123,
    nextToken='string',
    ruleDisabled=True|False
)
type topic

string

param topic

The topic.

type maxResults

integer

param maxResults

The maximum number of results to return.

type nextToken

string

param nextToken

A token used to retrieve the next value.

type ruleDisabled

boolean

param ruleDisabled

Specifies whether the rule is disabled.

rtype

dict

returns

Response Syntax

{
    'rules': [
        {
            'ruleArn': 'string',
            'ruleName': 'string',
            'topicPattern': 'string',
            'createdAt': datetime(2015, 1, 1),
            'ruleDisabled': True|False
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    The output from the ListTopicRules operation.

    • rules (list) --

      The rules.

      • (dict) --

        Describes a rule.

        • ruleArn (string) --

          The rule ARN.

        • ruleName (string) --

          The name of the rule.

        • topicPattern (string) --

          The pattern for the topic names that apply.

        • createdAt (datetime) --

          The date and time the rule was created.

        • ruleDisabled (boolean) --

          Specifies whether the rule is disabled.

    • nextToken (string) --

      A token used to retrieve the next value.