Table of Contents
A low-level client representing AWS IoT Events Data:
import boto3
client = boto3.client('iotevents-data')
These are the available methods:
Sends a set of messages to the AWS IoT Events system. Each message payload is transformed into the input you specify ("inputName" ) and ingested into any detectors that monitor that input. If multiple messages are sent, the order in which the messages are processed isn't guaranteed. To guarantee ordering, you must send messages one at a time and wait for a successful response.
See also: AWS API Documentation
Request Syntax
response = client.batch_put_message(
messages=[
{
'messageId': 'string',
'inputName': 'string',
'payload': b'bytes'
},
]
)
[REQUIRED]
The list of messages to send. Each message has the following format: '{ "messageId": "string", "inputName": "string", "payload": "string"}'
Information about a message.
The ID to assign to the message. Within each batch sent, each "messageId" must be unique.
The name of the input into which the message payload is transformed.
The payload of the message. This can be a JSON string or a Base-64-encoded string representing binary data (in which case you must decode it).
{
'BatchPutMessageErrorEntries': [
{
'messageId': 'string',
'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
'errorMessage': 'string'
},
]
}
Response Structure
A list of any errors encountered when sending the messages.
Contains information about the errors encountered.
The ID of the message that caused the error. (See the value corresponding to the "messageId" key in the "message" object.)
The code associated with the error.
More information about the error.
Updates the state, variable values, and timer settings of one or more detectors (instances) of a specified detector model.
See also: AWS API Documentation
Request Syntax
response = client.batch_update_detector(
detectors=[
{
'messageId': 'string',
'detectorModelName': 'string',
'keyValue': 'string',
'state': {
'stateName': 'string',
'variables': [
{
'name': 'string',
'value': 'string'
},
],
'timers': [
{
'name': 'string',
'seconds': 123
},
]
}
},
]
)
[REQUIRED]
The list of detectors (instances) to update, along with the values to update.
Information used to update the detector (instance).
The ID to assign to the detector update "message" . Each "messageId" must be unique within each batch sent.
The name of the detector model that created the detectors (instances).
The value of the input key attribute (identifying the device or system) that caused the creation of this detector (instance).
The new state, variable values, and timer settings of the detector (instance).
The name of the new state of the detector (instance).
The new values of the detector's variables. Any variable whose value isn't specified is cleared.
The new value of the variable.
The name of the variable.
The new value of the variable.
The new values of the detector's timers. Any timer whose value isn't specified is cleared, and its timeout event won't occur.
The new setting of a timer.
The name of the timer.
The new setting of the timer (the number of seconds before the timer elapses).
{
'batchUpdateDetectorErrorEntries': [
{
'messageId': 'string',
'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
'errorMessage': 'string'
},
]
}
Response Structure
A list of those detector updates that resulted in errors. (If an error is listed here, the specific update did not occur.)
Information about the error that occured when attempting to update a detector.
The "messageId" of the update request that caused the error. (The value of the "messageId" in the update request "Detector" object.)
The code of the error.
A message describing the error.
Check if an operation can be paginated.
Returns information about the specified detector (instance).
See also: AWS API Documentation
Request Syntax
response = client.describe_detector(
detectorModelName='string',
keyValue='string'
)
[REQUIRED]
The name of the detector model whose detectors (instances) you want information about.
dict
Response Syntax
{
'detector': {
'detectorModelName': 'string',
'keyValue': 'string',
'detectorModelVersion': 'string',
'state': {
'stateName': 'string',
'variables': [
{
'name': 'string',
'value': 'string'
},
],
'timers': [
{
'name': 'string',
'timestamp': datetime(2015, 1, 1)
},
]
},
'creationTime': datetime(2015, 1, 1),
'lastUpdateTime': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
detector (dict) --
Information about the detector (instance).
detectorModelName (string) --
The name of the detector model that created this detector (instance).
keyValue (string) --
The value of the key (identifying the device or system) that caused the creation of this detector (instance).
detectorModelVersion (string) --
The version of the detector model that created this detector (instance).
state (dict) --
The current state of the detector (instance).
stateName (string) --
The name of the state.
variables (list) --
The current values of the detector's variables.
(dict) --
The current state of the variable.
name (string) --
The name of the variable.
value (string) --
The current value of the variable.
timers (list) --
The current state of the detector's timers.
(dict) --
The current state of a timer.
name (string) --
The name of the timer.
timestamp (datetime) --
The number of seconds which have elapsed on the timer.
creationTime (datetime) --
The time the detector (instance) was created.
lastUpdateTime (datetime) --
The time the detector (instance) was last updated.
Generate a presigned url given a client, its method, and arguments
The presigned url
Create a paginator for an operation.
Returns an object that can wait for some condition.
Lists detectors (the instances of a detector model).
See also: AWS API Documentation
Request Syntax
response = client.list_detectors(
detectorModelName='string',
stateName='string',
nextToken='string',
maxResults=123
)
[REQUIRED]
The name of the detector model whose detectors (instances) are listed.
dict
Response Syntax
{
'detectorSummaries': [
{
'detectorModelName': 'string',
'keyValue': 'string',
'detectorModelVersion': 'string',
'state': {
'stateName': 'string'
},
'creationTime': datetime(2015, 1, 1),
'lastUpdateTime': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
detectorSummaries (list) --
A list of summary information about the detectors (instances).
(dict) --
Information about the detector (instance).
detectorModelName (string) --
The name of the detector model that created this detector (instance).
keyValue (string) --
The value of the key (identifying the device or system) that caused the creation of this detector (instance).
detectorModelVersion (string) --
The version of the detector model that created this detector (instance).
state (dict) --
The current state of the detector (instance).
stateName (string) --
The name of the state.
creationTime (datetime) --
The time the detector (instance) was created.
lastUpdateTime (datetime) --
The time the detector (instance) was last updated.
nextToken (string) --
A token to retrieve the next set of results, or null if there are no additional results.
The available paginators are: