IoTEventsData

Table of Contents

Client

class IoTEventsData.Client

A low-level client representing AWS IoT Events Data:

import boto3

client = boto3.client('iotevents-data')

These are the available methods:

batch_put_message(**kwargs)

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'
        },
    ]
)
Parameters
messages (list) --

[REQUIRED]

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

  • (dict) --

    Information about a message.

    • messageId (string) -- [REQUIRED]

      The ID to assign to the message. Within each batch sent, each "messageId" must be unique.

    • inputName (string) -- [REQUIRED]

      The name of the input into which the message payload is 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).

Return type
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 information 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.

batch_update_detector(**kwargs)

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
                    },
                ]
            }
        },
    ]
)
Parameters
detectors (list) --

[REQUIRED]

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

  • (dict) --

    Information used to update the detector (instance).

    • messageId (string) -- [REQUIRED]

      The ID 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 isn't specified is 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 isn't specified is cleared, and its timeout event won't 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).

Return type
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 that resulted in errors. (If an error is listed here, the specific update did not occur.)

      • (dict) --

        Information about the error that 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.

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns
True if the operation can be paginated, False otherwise.
describe_detector(**kwargs)

Returns information about the specified detector (instance).

See also: AWS API Documentation

Request Syntax

response = client.describe_detector(
    detectorModelName='string',
    keyValue='string'
)
Parameters
  • detectorModelName (string) --

    [REQUIRED]

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

  • keyValue (string) -- A filter used to limit results to detectors (instances) created because of the given key ID.
Return type

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 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_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns

The presigned url

get_paginator(operation_name)

Create a paginator for an operation.

Parameters
operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError
Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type
L{botocore.paginate.Paginator}
Returns
A paginator object.
get_waiter(waiter_name)

Returns an object that can wait for some condition.

Parameters
waiter_name (str) -- The name of the waiter to get. See the waiters section of the service docs for a list of available waiters.
Returns
The specified waiter object.
Return type
botocore.waiter.Waiter
list_detectors(**kwargs)

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
)
Parameters
  • detectorModelName (string) --

    [REQUIRED]

    The name of the detector model whose detectors (instances) are listed.

  • stateName (string) -- A filter that limits results to those detectors (instances) in the given state.
  • nextToken (string) -- The token for the next set of results.
  • maxResults (integer) -- The maximum number of results to return at one time.
Return type

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.

Paginators

The available paginators are: