2016/09/15 - AWS IoT - 4 updated api methods
Changes Updates registerCertificate operation, and allows users to specify cannedAcl for S3 action.
{'topicRulePayload': {'actions': {'s3': {'cannedAcl': 'private | public-read | ' 'public-read-write | ' 'aws-exec-read | ' 'authenticated-read | ' 'bucket-owner-read | ' 'bucket-owner-full-control ' '| log-delivery-write'}}}}
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', 'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write' }, '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' } )
string
[REQUIRED]
The name of the rule.
dict
[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.
cannedAcl (string) --
The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs .
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.
None
{'rule': {'actions': {'s3': {'cannedAcl': 'private | public-read | ' 'public-read-write | aws-exec-read | ' 'authenticated-read | ' 'bucket-owner-read | ' 'bucket-owner-full-control | ' 'log-delivery-write'}}}}
Gets information about the specified rule.
Request Syntax
client.get_topic_rule( ruleName='string' )
string
[REQUIRED]
The name of the rule.
dict
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', 'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write' }, '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.
cannedAcl (string) --
The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs .
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.
{'status': 'ACTIVE | INACTIVE | REVOKED | PENDING_TRANSFER | REGISTER_INACTIVE ' '| PENDING_ACTIVATION'}
Registers a device certificate with AWS IoT. If you have more than one CA certificate that has the same subject field, you must specify the CA certificate that was used to sign the device certificate being registered.
Request Syntax
client.register_certificate( certificatePem='string', caCertificatePem='string', setAsActive=True|False, status='ACTIVE'|'INACTIVE'|'REVOKED'|'PENDING_TRANSFER'|'REGISTER_INACTIVE'|'PENDING_ACTIVATION' )
string
[REQUIRED]
The certificate data, in PEM format.
string
The CA certificate used to sign the device certificate being registered.
boolean
A boolean value that specifies if the CA certificate is set to active.
string
dict
Response Syntax
{ 'certificateArn': 'string', 'certificateId': 'string' }
Response Structure
(dict) --
The output from the RegisterCertificate operation.
certificateArn (string) --
The certificate ARN.
certificateId (string) --
The certificate identifier.
{'topicRulePayload': {'actions': {'s3': {'cannedAcl': 'private | public-read | ' 'public-read-write | ' 'aws-exec-read | ' 'authenticated-read | ' 'bucket-owner-read | ' 'bucket-owner-full-control ' '| log-delivery-write'}}}}
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', 'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write' }, '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' } )
string
[REQUIRED]
The name of the rule.
dict
[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.
cannedAcl (string) --
The Amazon S3 canned ACL that controls access to the object identified by the object key. For more information, see S3 canned ACLs .
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.
None