Table of Contents
A low-level client representing AWS IoT Events Data
AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, and triggers actions when such events occur. You can use AWS IoT Events Data API commands to send inputs to detectors, list detectors, and view or update a detector's status.
For more information, see What is AWS IoT Events? in the AWS IoT Events Developer Guide .
import boto3
client = boto3.client('iotevents-data')
These are the available methods:
Acknowledges one or more alarms. The alarms change to the ACKNOWLEDGED state after you acknowledge them.
See also: AWS API Documentation
Request Syntax
response = client.batch_acknowledge_alarm(
acknowledgeActionRequests=[
{
'requestId': 'string',
'alarmModelName': 'string',
'keyValue': 'string',
'note': 'string'
},
]
)
[REQUIRED]
The list of acknowledge action requests. You can specify up to 10 requests per operation.
Information needed to acknowledge the alarm.
The request ID. Each ID must be unique within each batch.
The name of the alarm model.
The value of the key used as a filter to select only the alarms associated with the key .
The note that you can leave when you acknowledge the alarm.
{
'errorEntries': [
{
'requestId': 'string',
'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
'errorMessage': 'string'
},
]
}
Response Structure
A list of errors associated with the request, or null if there are no errors. Each error entry contains an entry ID that helps you identify the entry that failed.
Contains error messages associated with one of the following requests:
The request ID. Each ID must be unique within each batch.
The error code.
A message that describes the error.
Exceptions
Disables one or more alarms. The alarms change to the DISABLED state after you disable them.
See also: AWS API Documentation
Request Syntax
response = client.batch_disable_alarm(
disableActionRequests=[
{
'requestId': 'string',
'alarmModelName': 'string',
'keyValue': 'string',
'note': 'string'
},
]
)
[REQUIRED]
The list of disable action requests. You can specify up to 10 requests per operation.
Information used to disable the alarm.
The request ID. Each ID must be unique within each batch.
The name of the alarm model.
The value of the key used as a filter to select only the alarms associated with the key .
The note that you can leave when you disable the alarm.
{
'errorEntries': [
{
'requestId': 'string',
'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
'errorMessage': 'string'
},
]
}
Response Structure
A list of errors associated with the request, or null if there are no errors. Each error entry contains an entry ID that helps you identify the entry that failed.
Contains error messages associated with one of the following requests:
The request ID. Each ID must be unique within each batch.
The error code.
A message that describes the error.
Exceptions
Enables one or more alarms. The alarms change to the NORMAL state after you enable them.
See also: AWS API Documentation
Request Syntax
response = client.batch_enable_alarm(
enableActionRequests=[
{
'requestId': 'string',
'alarmModelName': 'string',
'keyValue': 'string',
'note': 'string'
},
]
)
[REQUIRED]
The list of enable action requests. You can specify up to 10 requests per operation.
Information needed to enable the alarm.
The request ID. Each ID must be unique within each batch.
The name of the alarm model.
The value of the key used as a filter to select only the alarms associated with the key .
The note that you can leave when you enable the alarm.
{
'errorEntries': [
{
'requestId': 'string',
'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
'errorMessage': 'string'
},
]
}
Response Structure
A list of errors associated with the request, or null if there are no errors. Each error entry contains an entry ID that helps you identify the entry that failed.
Contains error messages associated with one of the following requests:
The request ID. Each ID must be unique within each batch.
The error code.
A message that describes the error.
Exceptions
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',
'timestamp': {
'timeInMillis': 123
}
},
]
)
[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).
The timestamp associated with the message.
The value of the timestamp, in the Unix epoch format.
{
'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 error code.
A message that describes the error.
Exceptions
Resets one or more alarms. The alarms return to the NORMAL state after you reset them.
See also: AWS API Documentation
Request Syntax
response = client.batch_reset_alarm(
resetActionRequests=[
{
'requestId': 'string',
'alarmModelName': 'string',
'keyValue': 'string',
'note': 'string'
},
]
)
[REQUIRED]
The list of reset action requests. You can specify up to 10 requests per operation.
Information needed to reset the alarm.
The request ID. Each ID must be unique within each batch.
The name of the alarm model.
The value of the key used as a filter to select only the alarms associated with the key .
The note that you can leave when you reset the alarm.
{
'errorEntries': [
{
'requestId': 'string',
'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
'errorMessage': 'string'
},
]
}
Response Structure
A list of errors associated with the request, or null if there are no errors. Each error entry contains an entry ID that helps you identify the entry that failed.
Contains error messages associated with one of the following requests:
The request ID. Each ID must be unique within each batch.
The error code.
A message that describes the error.
Exceptions
Changes one or more alarms to the snooze mode. The alarms change to the SNOOZE_DISABLED state after you set them to the snooze mode.
See also: AWS API Documentation
Request Syntax
response = client.batch_snooze_alarm(
snoozeActionRequests=[
{
'requestId': 'string',
'alarmModelName': 'string',
'keyValue': 'string',
'note': 'string',
'snoozeDuration': 123
},
]
)
[REQUIRED]
The list of snooze action requests. You can specify up to 10 requests per operation.
Information needed to snooze the alarm.
The request ID. Each ID must be unique within each batch.
The name of the alarm model.
The value of the key used as a filter to select only the alarms associated with the key .
The note that you can leave when you snooze the alarm.
The snooze time in seconds. The alarm automatically changes to the NORMAL state after this duration.
{
'errorEntries': [
{
'requestId': 'string',
'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
'errorMessage': 'string'
},
]
}
Response Structure
A list of errors associated with the request, or null if there are no errors. Each error entry contains an entry ID that helps you identify the entry that failed.
Contains error messages associated with one of the following requests:
The request ID. Each ID must be unique within each batch.
The error code.
A message that describes the error.
Exceptions
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 occurred 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 error code.
A message that describes the error.
Exceptions
Check if an operation can be paginated.
Retrieves information about an alarm.
See also: AWS API Documentation
Request Syntax
response = client.describe_alarm(
alarmModelName='string',
keyValue='string'
)
[REQUIRED]
The name of the alarm model.
dict
Response Syntax
{
'alarm': {
'alarmModelName': 'string',
'alarmModelVersion': 'string',
'keyValue': 'string',
'alarmState': {
'stateName': 'DISABLED'|'NORMAL'|'ACTIVE'|'ACKNOWLEDGED'|'SNOOZE_DISABLED'|'LATCHED',
'ruleEvaluation': {
'simpleRuleEvaluation': {
'inputPropertyValue': 'string',
'operator': 'GREATER'|'GREATER_OR_EQUAL'|'LESS'|'LESS_OR_EQUAL'|'EQUAL'|'NOT_EQUAL',
'thresholdValue': 'string'
}
},
'customerAction': {
'actionName': 'SNOOZE'|'ENABLE'|'DISABLE'|'ACKNOWLEDGE'|'RESET',
'snoozeActionConfiguration': {
'snoozeDuration': 123,
'note': 'string'
},
'enableActionConfiguration': {
'note': 'string'
},
'disableActionConfiguration': {
'note': 'string'
},
'acknowledgeActionConfiguration': {
'note': 'string'
},
'resetActionConfiguration': {
'note': 'string'
}
},
'systemEvent': {
'eventType': 'STATE_CHANGE',
'stateChangeConfiguration': {
'triggerType': 'SNOOZE_TIMEOUT'
}
}
},
'severity': 123,
'creationTime': datetime(2015, 1, 1),
'lastUpdateTime': datetime(2015, 1, 1)
}
}
Response Structure
(dict) --
alarm (dict) --
Contains information about an alarm.
alarmModelName (string) --
The name of the alarm model.
alarmModelVersion (string) --
The version of the alarm model.
keyValue (string) --
The value of the key used as a filter to select only the alarms associated with the key .
alarmState (dict) --
Contains information about the current state of the alarm.
stateName (string) --
The name of the alarm state. The state name can be one of the following values:
ruleEvaluation (dict) --
Information needed to evaluate data.
simpleRuleEvaluation (dict) --
Information needed to compare two values with a comparison operator.
inputPropertyValue (string) --
The value of the input property, on the left side of the comparison operator.
operator (string) --
The comparison operator.
thresholdValue (string) --
The threshold value, on the right side of the comparison operator.
customerAction (dict) --
Contains information about the action that you can take to respond to the alarm.
actionName (string) --
The name of the action. The action name can be one of the following values:
For more information, see the AlarmState API.
snoozeActionConfiguration (dict) --
Contains the configuration information of a snooze action.
snoozeDuration (integer) --
The snooze time in seconds. The alarm automatically changes to the NORMAL state after this duration.
note (string) --
The note that you can leave when you snooze the alarm.
enableActionConfiguration (dict) --
Contains the configuration information of an enable action.
note (string) --
The note that you can leave when you enable the alarm.
disableActionConfiguration (dict) --
Contains the configuration information of a disable action.
note (string) --
The note that you can leave when you disable the alarm.
acknowledgeActionConfiguration (dict) --
Contains the configuration information of an acknowledge action.
note (string) --
The note that you can leave when you acknowledge the alarm.
resetActionConfiguration (dict) --
Contains the configuration information of a reset action.
note (string) --
The note that you can leave when you reset the alarm.
systemEvent (dict) --
Contains information about alarm state changes.
eventType (string) --
The event type. If the value is STATE_CHANGE , the event contains information about alarm state changes.
stateChangeConfiguration (dict) --
Contains the configuration information of alarm state changes.
triggerType (string) --
The trigger type. If the value is SNOOZE_TIMEOUT , the snooze duration ends and the alarm automatically changes to the NORMAL state.
severity (integer) --
A non-negative integer that reflects the severity level of the alarm.
creationTime (datetime) --
The time the alarm was created, in the Unix epoch format.
lastUpdateTime (datetime) --
The time the alarm was last updated, in the Unix epoch format.
Exceptions
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.
Exceptions
Create a paginator for an operation.
Returns an object that can wait for some condition.
Lists one or more alarms. The operation returns only the metadata associated with each alarm.
See also: AWS API Documentation
Request Syntax
response = client.list_alarms(
alarmModelName='string',
nextToken='string',
maxResults=123
)
[REQUIRED]
The name of the alarm model.
dict
Response Syntax
{
'alarmSummaries': [
{
'alarmModelName': 'string',
'alarmModelVersion': 'string',
'keyValue': 'string',
'stateName': 'DISABLED'|'NORMAL'|'ACTIVE'|'ACKNOWLEDGED'|'SNOOZE_DISABLED'|'LATCHED',
'creationTime': datetime(2015, 1, 1),
'lastUpdateTime': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
alarmSummaries (list) --
A list that summarizes each alarm.
(dict) --
Contains a summary of an alarm.
alarmModelName (string) --
The name of the alarm model.
alarmModelVersion (string) --
The version of the alarm model.
keyValue (string) --
The value of the key used as a filter to select only the alarms associated with the key .
stateName (string) --
The name of the alarm state. The state name can be one of the following values:
creationTime (datetime) --
The time the alarm was created, in the Unix epoch format.
lastUpdateTime (datetime) --
The time the alarm was last updated, in the Unix epoch format.
nextToken (string) --
The token that you can use to return the next set of results, or null if there are no more results.
Exceptions
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) --
The token that you can use to return the next set of results, or null if there are no more results.
Exceptions
The available paginators are: