AWS IoT Events Data

2019/05/30 - AWS IoT Events Data - 4 new api methods

Changes  The AWS IoT Events service allows customers to monitor their IoT devices and sensors to detect failures or changes in operation and to trigger actions when these events occur

BatchUpdateDetector (new) Link ¶

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

client.batch_update_detector(
    detectors=[
        {
            'messageId': 'string',
            'detectorModelName': 'string',
            'keyValue': 'string',
            'state': {
                'stateName': 'string',
                'variables': [
                    {
                        'name': 'string',
                        'value': 'string'
                    },
                ],
                'timers': [
                    {
                        'name': 'string',
                        'seconds': 123
                    },
                ]
            }
        },
    ]
)
type detectors

list

param detectors

[REQUIRED]

The list of detectors (instances) to be updated, along with the values to be updated.

  • (dict) --

    Information used to update the detector (instance).

    • messageId (string) -- [REQUIRED]

      The ID you wish to assign to the detector update "message". Each "messageId" must be unique within each batch sent.

    • detectorModelName (string) -- [REQUIRED]

      The name of the detector model that created the detectors (instances).

    • keyValue (string) --

      The value of the input key attribute (identifying the device or system) that caused the creation of this detector (instance).

    • state (dict) -- [REQUIRED]

      The new state, variable values, and timer settings of the detector (instance).

      • stateName (string) -- [REQUIRED]

        The name of the new state of the detector (instance).

      • variables (list) -- [REQUIRED]

        The new values of the detector's variables. Any variable whose value is not specified will be cleared.

        • (dict) --

          The new value of the variable.

          • name (string) -- [REQUIRED]

            The name of the variable.

          • value (string) -- [REQUIRED]

            The new value of the variable.

      • timers (list) -- [REQUIRED]

        The new values of the detector's timers. Any timer whose value is not specified will be cleared and its timeout event will not occur.

        • (dict) --

          The new setting of a timer.

          • name (string) -- [REQUIRED]

            The name of the timer.

          • seconds (integer) -- [REQUIRED]

            The new setting of the timer (the number of seconds before the timer elapses).

rtype

dict

returns

Response Syntax

{
    'batchUpdateDetectorErrorEntries': [
        {
            'messageId': 'string',
            'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
            'errorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • batchUpdateDetectorErrorEntries (list) --

      A list of those detector updates which resulted in errors. (The specific update did not occur if an error is listed here.)

      • (dict) --

        Information about the error which occured when attempting to update a detector.

        • messageId (string) --

          The "messageId" of the update request that caused the error. (The value of the messageId in the update request Detector object.)

        • errorCode (string) --

          The code of the error.

        • errorMessage (string) --

          A message describing the error.

DescribeDetector (new) Link ¶

Returns information about the specified detector (instance).

See also: AWS API Documentation

Request Syntax

client.describe_detector(
    detectorModelName='string',
    keyValue='string'
)
type detectorModelName

string

param detectorModelName

[REQUIRED]

The name of the detector model whose detectors (instances) you want information about.

type keyValue

string

param keyValue

A filter used to limit results to detectors (instances) created because of the given key ID.

rtype

dict

returns

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

ListDetectors (new) Link ¶

Lists detectors (the instances of a detector model).

See also: AWS API Documentation

Request Syntax

client.list_detectors(
    detectorModelName='string',
    stateName='string',
    nextToken='string',
    maxResults=123
)
type detectorModelName

string

param detectorModelName

[REQUIRED]

The name of the detector model whose instances you want to list.

type stateName

string

param stateName

A filter that limits results to those detectors (instances) in the given state.

type nextToken

string

param nextToken

The token for the next set of results.

type maxResults

integer

param maxResults

The maximum number of results to return at one time.

rtype

dict

returns

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.

BatchPutMessage (new) Link ¶

Sends a set of messages to the AWS IoT Events system. Each message payload will be 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 is not guaranteed--you must send messages one at a time and wait for a successful response to guarantee ordering.

See also: AWS API Documentation

Request Syntax

client.batch_put_message(
    messages=[
        {
            'messageId': 'string',
            'inputName': 'string',
            'payload': b'bytes'
        },
    ]
)
type messages

list

param messages

[REQUIRED]

The list of messages to send. Each message has format: '{ "messageId": "string", "inputName": "string", "payload": "string"}' .

  • (dict) --

    Information about a message.

    • messageId (string) -- [REQUIRED]

      The ID you wish to assign to the message. Each "messageId" must be unique within each batch sent.

    • inputName (string) -- [REQUIRED]

      The name of the input into which the message payload will be transformed.

    • payload (bytes) -- [REQUIRED]

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

rtype

dict

returns

Response Syntax

{
    'BatchPutMessageErrorEntries': [
        {
            'messageId': 'string',
            'errorCode': 'ResourceNotFoundException'|'InvalidRequestException'|'InternalFailureException'|'ServiceUnavailableException'|'ThrottlingException',
            'errorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • BatchPutMessageErrorEntries (list) --

      A list of any errors encountered when sending the messages.

      • (dict) --

        Contains informations about the errors encountered.

        • messageId (string) --

          The ID of the message that caused the error. (See the value corresponding to the messageId key in the message object.)

        • errorCode (string) --

          The code associated with the error.

        • errorMessage (string) --

          More information about the error.