Class: AWS.IoTEvents

Inherits:
AWS.Service show all
Identifier:
iotevents
API Version:
2018-07-27
Defined in:
(unknown)

Overview

Constructs a service interface object. Each API operation is exposed as a function on service.

Service Description

AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, and triggers actions when such events occur. AWS IoT Events API commands enable you to create, read, update and delete inputs and detector models, and to list their versions.

Sending a Request Using IoTEvents

var iotevents = new AWS.IoTEvents();
iotevents.createDetectorModel(params, function (err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Locking the API Version

In order to ensure that the IoTEvents object uses this specific API, you can construct the object by passing the apiVersion option to the constructor:

var iotevents = new AWS.IoTEvents({apiVersion: '2018-07-27'});

You can also set the API version globally in AWS.config.apiVersions using the iotevents service identifier:

AWS.config.apiVersions = {
  iotevents: '2018-07-27',
  // other service API versions
};

var iotevents = new AWS.IoTEvents();

Version:

  • 2018-07-27

Constructor Summary collapse

Property Summary collapse

Properties inherited from AWS.Service

apiVersions

Method Summary collapse

Methods inherited from AWS.Service

makeRequest, makeUnauthenticatedRequest, waitFor, setupRequestListeners, defineService

Constructor Details

new AWS.IoTEvents(options = {}) ⇒ Object

Constructs a service object. This object has one method for each API operation.

Examples:

Constructing a IoTEvents object

var iotevents = new AWS.IoTEvents({apiVersion: '2018-07-27'});

Options Hash (options):

  • params (map)

    An optional map of parameters to bind to every request sent by this service object. For more information on bound parameters, see "Working with Services" in the Getting Started Guide.

  • endpoint (String)

    The endpoint URI to send requests to. The default endpoint is built from the configured region. The endpoint should be a string like 'https://{service}.{region}.amazonaws.com'.

  • accessKeyId (String)

    your AWS access key ID.

  • secretAccessKey (String)

    your AWS secret access key.

  • sessionToken (AWS.Credentials)

    the optional AWS session token to sign requests with.

  • credentials (AWS.Credentials)

    the AWS credentials to sign requests with. You can either specify this object, or specify the accessKeyId and secretAccessKey options directly.

  • credentialProvider (AWS.CredentialProviderChain)

    the provider chain used to resolve credentials if no static credentials property is set.

  • region (String)

    the region to send service requests to. See AWS.IoTEvents.region for more information.

  • maxRetries (Integer)

    the maximum amount of retries to attempt with a request. See AWS.IoTEvents.maxRetries for more information.

  • maxRedirects (Integer)

    the maximum amount of redirects to follow with a request. See AWS.IoTEvents.maxRedirects for more information.

  • sslEnabled (Boolean)

    whether to enable SSL for requests.

  • paramValidation (Boolean|map)

    whether input parameters should be validated against the operation description before sending the request. Defaults to true. Pass a map to enable any of the following specific validation features:

    • min [Boolean] — Validates that a value meets the min constraint. This is enabled by default when paramValidation is set to true.
    • max [Boolean] — Validates that a value meets the max constraint.
    • pattern [Boolean] — Validates that a string value matches a regular expression.
    • enum [Boolean] — Validates that a string value matches one of the allowable enum values.
  • computeChecksums (Boolean)

    whether to compute checksums for payload bodies when the service accepts it (currently supported in S3 only)

  • convertResponseTypes (Boolean)

    whether types are converted when parsing response data. Currently only supported for JSON based services. Turning this off may improve performance on large response payloads. Defaults to true.

  • correctClockSkew (Boolean)

    whether to apply a clock skew correction and retry requests that fail because of an skewed client clock. Defaults to false.

  • s3ForcePathStyle (Boolean)

    whether to force path style URLs for S3 objects.

  • s3BucketEndpoint (Boolean)

    whether the provided endpoint addresses an individual bucket (false if it addresses the root API endpoint). Note that setting this configuration option requires an endpoint to be provided explicitly to the service constructor.

  • s3DisableBodySigning (Boolean)

    whether S3 body signing should be disabled when using signature version v4. Body signing can only be disabled when using https. Defaults to true.

  • s3UsEast1RegionalEndpoint ('legacy'|'regional')

    when region is set to 'us-east-1', whether to send s3 request to global endpoints or 'us-east-1' regional endpoints. This config is only applicable to S3 client. Defaults to legacy

  • s3UseArnRegion (Boolean)

    whether to override the request region with the region inferred from requested resource's ARN. Only available for S3 buckets Defaults to true

  • retryDelayOptions (map)

    A set of options to configure the retry delay on retryable errors. Currently supported options are:

    • base [Integer] — The base number of milliseconds to use in the exponential backoff for operation retries. Defaults to 100 ms for all services except DynamoDB, where it defaults to 50ms.
    • customBackoff [function] — A custom function that accepts a retry count and error and returns the amount of time to delay in milliseconds. If the result is a non-zero negative value, no further retry attempts will be made. The base option will be ignored if this option is supplied.
  • httpOptions (map)

    A set of options to pass to the low-level HTTP request. Currently supported options are:

    • proxy [String] — the URL to proxy requests through
    • agent [http.Agent, https.Agent] — the Agent object to perform HTTP requests with. Used for connection pooling. Defaults to the global agent (http.globalAgent) for non-SSL connections. Note that for SSL connections, a special Agent object is used in order to enable peer certificate verification. This feature is only available in the Node.js environment.
    • connectTimeout [Integer] — Sets the socket to timeout after failing to establish a connection with the server after connectTimeout milliseconds. This timeout has no effect once a socket connection has been established.
    • timeout [Integer] — Sets the socket to timeout after timeout milliseconds of inactivity on the socket. Defaults to two minutes (120000).
    • xhrAsync [Boolean] — Whether the SDK will send asynchronous HTTP requests. Used in the browser environment only. Set to false to send requests synchronously. Defaults to true (async on).
    • xhrWithCredentials [Boolean] — Sets the "withCredentials" property of an XMLHttpRequest object. Used in the browser environment only. Defaults to false.
  • apiVersion (String, Date)

    a String in YYYY-MM-DD format (or a date) that represents the latest possible API version that can be used in all services (unless overridden by apiVersions). Specify 'latest' to use the latest possible version.

  • apiVersions (map<String, String|Date>)

    a map of service identifiers (the lowercase service class name) with the API version to use when instantiating a service. Specify 'latest' for each individual that can use the latest available version.

  • logger (#write, #log)

    an object that responds to .write() (like a stream) or .log() (like the console object) in order to log information about requests

  • systemClockOffset (Number)

    an offset value in milliseconds to apply to all signing times. Use this to compensate for clock skew when your system may be out of sync with the service time. Note that this configuration option can only be applied to the global AWS.config object and cannot be overridden in service-specific configuration. Defaults to 0 milliseconds.

  • signatureVersion (String)

    the signature version to sign requests with (overriding the API configuration). Possible values are: 'v2', 'v3', 'v4'.

  • signatureCache (Boolean)

    whether the signature to sign requests with (overriding the API configuration) is cached. Only applies to the signature version 'v4'. Defaults to true.

  • dynamoDbCrc32 (Boolean)

    whether to validate the CRC32 checksum of HTTP response bodies returned by DynamoDB. Default: true.

  • useAccelerateEndpoint (Boolean)

    Whether to use the S3 Transfer Acceleration endpoint with the S3 service. Default: false.

  • clientSideMonitoring (Boolean)

    whether to collect and publish this client's performance metrics of all its API requests.

  • endpointDiscoveryEnabled (Boolean)

    whether to enable endpoint discovery for operations that allow optionally using an endpoint returned by the service. Defaults to 'false'

  • endpointCacheSize (Number)

    the size of the global cache storing endpoints from endpoint discovery operations. Once endpoint cache is created, updating this setting cannot change existing cache size. Defaults to 1000

  • hostPrefixEnabled (Boolean)

    whether to marshal request parameters to the prefix of hostname. Defaults to true.

  • stsRegionalEndpoints ('legacy'|'regional')

    whether to send sts request to global endpoints or regional endpoints. Defaults to 'legacy'.

Property Details

endpointAWS.Endpoint (readwrite)

Returns an Endpoint object representing the endpoint URL for service requests.

Returns:

  • (AWS.Endpoint)

    an Endpoint object representing the endpoint URL for service requests.

Method Details

createDetectorModel(params = {}, callback) ⇒ AWS.Request

Creates a detector model.

Service Reference:

Examples:

Calling the createDetectorModel operation

var params = {
  detectorModelDefinition: { /* required */
    initialStateName: 'STRING_VALUE', /* required */
    states: [ /* required */
      {
        stateName: 'STRING_VALUE', /* required */
        onEnter: {
          events: [
            {
              eventName: 'STRING_VALUE', /* required */
              actions: [
                {
                  clearTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  firehose: {
                    deliveryStreamName: 'STRING_VALUE', /* required */
                    separator: 'STRING_VALUE'
                  },
                  iotEvents: {
                    inputName: 'STRING_VALUE' /* required */
                  },
                  iotTopicPublish: {
                    mqttTopic: 'STRING_VALUE' /* required */
                  },
                  lambda: {
                    functionArn: 'STRING_VALUE' /* required */
                  },
                  resetTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setTimer: {
                    seconds: 'NUMBER_VALUE', /* required */
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setVariable: {
                    value: 'STRING_VALUE', /* required */
                    variableName: 'STRING_VALUE' /* required */
                  },
                  sns: {
                    targetArn: 'STRING_VALUE' /* required */
                  },
                  sqs: {
                    queueUrl: 'STRING_VALUE', /* required */
                    useBase64: true || false
                  }
                },
                /* more items */
              ],
              condition: 'STRING_VALUE'
            },
            /* more items */
          ]
        },
        onExit: {
          events: [
            {
              eventName: 'STRING_VALUE', /* required */
              actions: [
                {
                  clearTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  firehose: {
                    deliveryStreamName: 'STRING_VALUE', /* required */
                    separator: 'STRING_VALUE'
                  },
                  iotEvents: {
                    inputName: 'STRING_VALUE' /* required */
                  },
                  iotTopicPublish: {
                    mqttTopic: 'STRING_VALUE' /* required */
                  },
                  lambda: {
                    functionArn: 'STRING_VALUE' /* required */
                  },
                  resetTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setTimer: {
                    seconds: 'NUMBER_VALUE', /* required */
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setVariable: {
                    value: 'STRING_VALUE', /* required */
                    variableName: 'STRING_VALUE' /* required */
                  },
                  sns: {
                    targetArn: 'STRING_VALUE' /* required */
                  },
                  sqs: {
                    queueUrl: 'STRING_VALUE', /* required */
                    useBase64: true || false
                  }
                },
                /* more items */
              ],
              condition: 'STRING_VALUE'
            },
            /* more items */
          ]
        },
        onInput: {
          events: [
            {
              eventName: 'STRING_VALUE', /* required */
              actions: [
                {
                  clearTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  firehose: {
                    deliveryStreamName: 'STRING_VALUE', /* required */
                    separator: 'STRING_VALUE'
                  },
                  iotEvents: {
                    inputName: 'STRING_VALUE' /* required */
                  },
                  iotTopicPublish: {
                    mqttTopic: 'STRING_VALUE' /* required */
                  },
                  lambda: {
                    functionArn: 'STRING_VALUE' /* required */
                  },
                  resetTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setTimer: {
                    seconds: 'NUMBER_VALUE', /* required */
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setVariable: {
                    value: 'STRING_VALUE', /* required */
                    variableName: 'STRING_VALUE' /* required */
                  },
                  sns: {
                    targetArn: 'STRING_VALUE' /* required */
                  },
                  sqs: {
                    queueUrl: 'STRING_VALUE', /* required */
                    useBase64: true || false
                  }
                },
                /* more items */
              ],
              condition: 'STRING_VALUE'
            },
            /* more items */
          ],
          transitionEvents: [
            {
              condition: 'STRING_VALUE', /* required */
              eventName: 'STRING_VALUE', /* required */
              nextState: 'STRING_VALUE', /* required */
              actions: [
                {
                  clearTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  firehose: {
                    deliveryStreamName: 'STRING_VALUE', /* required */
                    separator: 'STRING_VALUE'
                  },
                  iotEvents: {
                    inputName: 'STRING_VALUE' /* required */
                  },
                  iotTopicPublish: {
                    mqttTopic: 'STRING_VALUE' /* required */
                  },
                  lambda: {
                    functionArn: 'STRING_VALUE' /* required */
                  },
                  resetTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setTimer: {
                    seconds: 'NUMBER_VALUE', /* required */
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setVariable: {
                    value: 'STRING_VALUE', /* required */
                    variableName: 'STRING_VALUE' /* required */
                  },
                  sns: {
                    targetArn: 'STRING_VALUE' /* required */
                  },
                  sqs: {
                    queueUrl: 'STRING_VALUE', /* required */
                    useBase64: true || false
                  }
                },
                /* more items */
              ]
            },
            /* more items */
          ]
        }
      },
      /* more items */
    ]
  },
  detectorModelName: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE', /* required */
  detectorModelDescription: 'STRING_VALUE',
  evaluationMethod: BATCH | SERIAL,
  key: 'STRING_VALUE',
  tags: [
    {
      key: 'STRING_VALUE', /* required */
      value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
iotevents.createDetectorModel(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • detectorModelName — (String)

      The name of the detector model.

    • detectorModelDefinition — (map)

      Information that defines how the detectors operate.

      • statesrequired — (Array<map>)

        Information about the states of the detector.

        • stateNamerequired — (String)

          The name of the state.

        • onInput — (map)

          When an input is received and the "condition" is TRUE, perform the specified "actions".

          • events — (Array<map>)

            Specifies the actions performed when the "condition" evaluates to TRUE.

            • eventNamerequired — (String)

              The name of the event.

            • condition — (String)

              [Optional] The Boolean expression that when TRUE causes the "actions" to be performed. If not present, the actions are performed (=TRUE); if the expression result is not a Boolean value, the actions are NOT performed (=FALSE).

            • actions — (Array<map>)

              The actions to be performed.

              • setVariable — (map)

                Sets a variable to a specified value.

                • variableNamerequired — (String)

                  The name of the variable.

                • valuerequired — (String)

                  The new value of the variable.

              • sns — (map)

                Sends an Amazon SNS message.

                • targetArnrequired — (String)

                  The ARN of the Amazon SNS target where the message is sent.

              • iotTopicPublish — (map)

                Publishes an MQTT message with the given topic to the AWS IoT message broker.

                • mqttTopicrequired — (String)

                  The MQTT topic of the message.

              • setTimer — (map)

                Information needed to set the timer.

                • timerNamerequired — (String)

                  The name of the timer.

                • secondsrequired — (Integer)

                  The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

              • clearTimer — (map)

                Information needed to clear the timer.

                • timerNamerequired — (String)

                  The name of the timer to clear.

              • resetTimer — (map)

                Information needed to reset the timer.

                • timerNamerequired — (String)

                  The name of the timer to reset.

              • lambda — (map)

                Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                • functionArnrequired — (String)

                  The ARN of the AWS Lambda function which is executed.

              • iotEvents — (map)

                Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                • inputNamerequired — (String)

                  The name of the AWS IoT Events input where the data is sent.

              • sqs — (map)

                Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                • queueUrlrequired — (String)

                  The URL of the Amazon SQS queue where the data is written.

                • useBase64 — (Boolean)

                  Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

              • firehose — (map)

                Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                • deliveryStreamNamerequired — (String)

                  The name of the Kinesis Data Firehose delivery stream where the data is written.

                • separator — (String)

                  A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

          • transitionEvents — (Array<map>)

            Specifies the actions performed, and the next state entered, when a "condition" evaluates to TRUE.

            • eventNamerequired — (String)

              The name of the transition event.

            • conditionrequired — (String)

              [Required] A Boolean expression that when TRUE causes the actions to be performed and the "nextState" to be entered.

            • actions — (Array<map>)

              The actions to be performed.

              • setVariable — (map)

                Sets a variable to a specified value.

                • variableNamerequired — (String)

                  The name of the variable.

                • valuerequired — (String)

                  The new value of the variable.

              • sns — (map)

                Sends an Amazon SNS message.

                • targetArnrequired — (String)

                  The ARN of the Amazon SNS target where the message is sent.

              • iotTopicPublish — (map)

                Publishes an MQTT message with the given topic to the AWS IoT message broker.

                • mqttTopicrequired — (String)

                  The MQTT topic of the message.

              • setTimer — (map)

                Information needed to set the timer.

                • timerNamerequired — (String)

                  The name of the timer.

                • secondsrequired — (Integer)

                  The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

              • clearTimer — (map)

                Information needed to clear the timer.

                • timerNamerequired — (String)

                  The name of the timer to clear.

              • resetTimer — (map)

                Information needed to reset the timer.

                • timerNamerequired — (String)

                  The name of the timer to reset.

              • lambda — (map)

                Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                • functionArnrequired — (String)

                  The ARN of the AWS Lambda function which is executed.

              • iotEvents — (map)

                Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                • inputNamerequired — (String)

                  The name of the AWS IoT Events input where the data is sent.

              • sqs — (map)

                Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                • queueUrlrequired — (String)

                  The URL of the Amazon SQS queue where the data is written.

                • useBase64 — (Boolean)

                  Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

              • firehose — (map)

                Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                • deliveryStreamNamerequired — (String)

                  The name of the Kinesis Data Firehose delivery stream where the data is written.

                • separator — (String)

                  A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

            • nextStaterequired — (String)

              The next state to enter.

        • onEnter — (map)

          When entering this state, perform these "actions" if the "condition" is TRUE.

          • events — (Array<map>)

            Specifies the actions that are performed when the state is entered and the "condition" is TRUE.

            • eventNamerequired — (String)

              The name of the event.

            • condition — (String)

              [Optional] The Boolean expression that when TRUE causes the "actions" to be performed. If not present, the actions are performed (=TRUE); if the expression result is not a Boolean value, the actions are NOT performed (=FALSE).

            • actions — (Array<map>)

              The actions to be performed.

              • setVariable — (map)

                Sets a variable to a specified value.

                • variableNamerequired — (String)

                  The name of the variable.

                • valuerequired — (String)

                  The new value of the variable.

              • sns — (map)

                Sends an Amazon SNS message.

                • targetArnrequired — (String)

                  The ARN of the Amazon SNS target where the message is sent.

              • iotTopicPublish — (map)

                Publishes an MQTT message with the given topic to the AWS IoT message broker.

                • mqttTopicrequired — (String)

                  The MQTT topic of the message.

              • setTimer — (map)

                Information needed to set the timer.

                • timerNamerequired — (String)

                  The name of the timer.

                • secondsrequired — (Integer)

                  The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

              • clearTimer — (map)

                Information needed to clear the timer.

                • timerNamerequired — (String)

                  The name of the timer to clear.

              • resetTimer — (map)

                Information needed to reset the timer.

                • timerNamerequired — (String)

                  The name of the timer to reset.

              • lambda — (map)

                Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                • functionArnrequired — (String)

                  The ARN of the AWS Lambda function which is executed.

              • iotEvents — (map)

                Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                • inputNamerequired — (String)

                  The name of the AWS IoT Events input where the data is sent.

              • sqs — (map)

                Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                • queueUrlrequired — (String)

                  The URL of the Amazon SQS queue where the data is written.

                • useBase64 — (Boolean)

                  Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

              • firehose — (map)

                Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                • deliveryStreamNamerequired — (String)

                  The name of the Kinesis Data Firehose delivery stream where the data is written.

                • separator — (String)

                  A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

        • onExit — (map)

          When exiting this state, perform these "actions" if the specified "condition" is TRUE.

          • events — (Array<map>)

            Specifies the "actions" that are performed when the state is exited and the "condition" is TRUE.

            • eventNamerequired — (String)

              The name of the event.

            • condition — (String)

              [Optional] The Boolean expression that when TRUE causes the "actions" to be performed. If not present, the actions are performed (=TRUE); if the expression result is not a Boolean value, the actions are NOT performed (=FALSE).

            • actions — (Array<map>)

              The actions to be performed.

              • setVariable — (map)

                Sets a variable to a specified value.

                • variableNamerequired — (String)

                  The name of the variable.

                • valuerequired — (String)

                  The new value of the variable.

              • sns — (map)

                Sends an Amazon SNS message.

                • targetArnrequired — (String)

                  The ARN of the Amazon SNS target where the message is sent.

              • iotTopicPublish — (map)

                Publishes an MQTT message with the given topic to the AWS IoT message broker.

                • mqttTopicrequired — (String)

                  The MQTT topic of the message.

              • setTimer — (map)

                Information needed to set the timer.

                • timerNamerequired — (String)

                  The name of the timer.

                • secondsrequired — (Integer)

                  The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

              • clearTimer — (map)

                Information needed to clear the timer.

                • timerNamerequired — (String)

                  The name of the timer to clear.

              • resetTimer — (map)

                Information needed to reset the timer.

                • timerNamerequired — (String)

                  The name of the timer to reset.

              • lambda — (map)

                Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                • functionArnrequired — (String)

                  The ARN of the AWS Lambda function which is executed.

              • iotEvents — (map)

                Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                • inputNamerequired — (String)

                  The name of the AWS IoT Events input where the data is sent.

              • sqs — (map)

                Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                • queueUrlrequired — (String)

                  The URL of the Amazon SQS queue where the data is written.

                • useBase64 — (Boolean)

                  Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

              • firehose — (map)

                Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                • deliveryStreamNamerequired — (String)

                  The name of the Kinesis Data Firehose delivery stream where the data is written.

                • separator — (String)

                  A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

      • initialStateNamerequired — (String)

        The state that is entered at the creation of each detector (instance).

    • detectorModelDescription — (String)

      A brief description of the detector model.

    • key — (String)

      The input attribute key used to identify a device or system to create a detector (an instance of the detector model) and then to route each input received to the appropriate detector (instance). This parameter uses a JSON-path expression to specify the attribute-value pair in the message payload of each input that is used to identify the device associated with the input.

    • roleArn — (String)

      The ARN of the role that grants permission to AWS IoT Events to perform its operations.

    • tags — (Array<map>)

      Metadata that can be used to manage the detector model.

      • keyrequired — (String)

        The tag's key.

      • valuerequired — (String)

        The tag's value.

    • evaluationMethod — (String)

      When set to SERIAL, variables are updated and event conditions evaluated in the order that the events are defined. When set to BATCH, variables are updated and events performed only after all event conditions are evaluated.

      Possible values include:
      • "BATCH"
      • "SERIAL"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • detectorModelConfiguration — (map)

        Information about how the detector model is configured.

        • detectorModelName — (String)

          The name of the detector model.

        • detectorModelVersion — (String)

          The version of the detector model.

        • detectorModelDescription — (String)

          A brief description of the detector model.

        • detectorModelArn — (String)

          The ARN of the detector model.

        • roleArn — (String)

          The ARN of the role that grants permission to AWS IoT Events to perform its operations.

        • creationTime — (Date)

          The time the detector model was created.

        • lastUpdateTime — (Date)

          The time the detector model was last updated.

        • status — (String)

          The status of the detector model.

          Possible values include:
          • "ACTIVE"
          • "ACTIVATING"
          • "INACTIVE"
          • "DEPRECATED"
          • "DRAFT"
          • "PAUSED"
          • "FAILED"
        • key — (String)

          The input attribute key used to identify a device or system to create a detector (an instance of the detector model) and then to route each input received to the appropriate detector (instance). This parameter uses a JSON-path expression to specify the attribute-value pair in the message payload of each input that is used to identify the device associated with the input.

        • evaluationMethod — (String)

          When set to SERIAL, variables are updated and event conditions evaluated in the order that the events are defined. When set to BATCH, variables are updated and events performed only after all event conditions are evaluated.

          Possible values include:
          • "BATCH"
          • "SERIAL"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

createInput(params = {}, callback) ⇒ AWS.Request

Creates an input.

Service Reference:

Examples:

Calling the createInput operation

var params = {
  inputDefinition: { /* required */
    attributes: [ /* required */
      {
        jsonPath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ]
  },
  inputName: 'STRING_VALUE', /* required */
  inputDescription: 'STRING_VALUE',
  tags: [
    {
      key: 'STRING_VALUE', /* required */
      value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
iotevents.createInput(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • inputName — (String)

      The name you want to give to the input.

    • inputDescription — (String)

      A brief description of the input.

    • inputDefinition — (map)

      The definition of the input.

      • attributesrequired — (Array<map>)

        The attributes from the JSON payload that are made available by the input. Inputs are derived from messages sent to the AWS IoT Events system using BatchPutMessage. Each such message contains a JSON payload, and those attributes (and their paired values) specified here are available for use in the "condition" expressions used by detectors that monitor this input.

        • jsonPathrequired — (String)

          An expression that specifies an attribute-value pair in a JSON structure. Use this to specify an attribute from the JSON payload that is made available by the input. Inputs are derived from messages sent to the AWS IoT Events system (BatchPutMessage). Each such message contains a JSON payload, and the attribute (and its paired value) specified here are available for use in the "condition" expressions used by detectors.

          Syntax: <field-name>.<field-name>...

    • tags — (Array<map>)

      Metadata that can be used to manage the input.

      • keyrequired — (String)

        The tag's key.

      • valuerequired — (String)

        The tag's value.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • inputConfiguration — (map)

        Information about the configuration of the input.

        • inputNamerequired — (String)

          The name of the input.

        • inputDescription — (String)

          A brief description of the input.

        • inputArnrequired — (String)

          The ARN of the input.

        • creationTimerequired — (Date)

          The time the input was created.

        • lastUpdateTimerequired — (Date)

          The last time the input was updated.

        • statusrequired — (String)

          The status of the input.

          Possible values include:
          • "CREATING"
          • "UPDATING"
          • "ACTIVE"
          • "DELETING"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteDetectorModel(params = {}, callback) ⇒ AWS.Request

Deletes a detector model. Any active instances of the detector model are also deleted.

Service Reference:

Examples:

Calling the deleteDetectorModel operation

var params = {
  detectorModelName: 'STRING_VALUE' /* required */
};
iotevents.deleteDetectorModel(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • detectorModelName — (String)

      The name of the detector model to be deleted.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

deleteInput(params = {}, callback) ⇒ AWS.Request

Deletes an input.

Service Reference:

Examples:

Calling the deleteInput operation

var params = {
  inputName: 'STRING_VALUE' /* required */
};
iotevents.deleteInput(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • inputName — (String)

      The name of the input to delete.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeDetectorModel(params = {}, callback) ⇒ AWS.Request

Describes a detector model. If the "version" parameter is not specified, information about the latest version is returned.

Service Reference:

Examples:

Calling the describeDetectorModel operation

var params = {
  detectorModelName: 'STRING_VALUE', /* required */
  detectorModelVersion: 'STRING_VALUE'
};
iotevents.describeDetectorModel(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • detectorModelName — (String)

      The name of the detector model.

    • detectorModelVersion — (String)

      The version of the detector model.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • detectorModel — (map)

        Information about the detector model.

        • detectorModelDefinition — (map)

          Information that defines how a detector operates.

          • statesrequired — (Array<map>)

            Information about the states of the detector.

            • stateNamerequired — (String)

              The name of the state.

            • onInput — (map)

              When an input is received and the "condition" is TRUE, perform the specified "actions".

              • events — (Array<map>)

                Specifies the actions performed when the "condition" evaluates to TRUE.

                • eventNamerequired — (String)

                  The name of the event.

                • condition — (String)

                  [Optional] The Boolean expression that when TRUE causes the "actions" to be performed. If not present, the actions are performed (=TRUE); if the expression result is not a Boolean value, the actions are NOT performed (=FALSE).

                • actions — (Array<map>)

                  The actions to be performed.

                  • setVariable — (map)

                    Sets a variable to a specified value.

                    • variableNamerequired — (String)

                      The name of the variable.

                    • valuerequired — (String)

                      The new value of the variable.

                  • sns — (map)

                    Sends an Amazon SNS message.

                    • targetArnrequired — (String)

                      The ARN of the Amazon SNS target where the message is sent.

                  • iotTopicPublish — (map)

                    Publishes an MQTT message with the given topic to the AWS IoT message broker.

                    • mqttTopicrequired — (String)

                      The MQTT topic of the message.

                  • setTimer — (map)

                    Information needed to set the timer.

                    • timerNamerequired — (String)

                      The name of the timer.

                    • secondsrequired — (Integer)

                      The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

                  • clearTimer — (map)

                    Information needed to clear the timer.

                    • timerNamerequired — (String)

                      The name of the timer to clear.

                  • resetTimer — (map)

                    Information needed to reset the timer.

                    • timerNamerequired — (String)

                      The name of the timer to reset.

                  • lambda — (map)

                    Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                    • functionArnrequired — (String)

                      The ARN of the AWS Lambda function which is executed.

                  • iotEvents — (map)

                    Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                    • inputNamerequired — (String)

                      The name of the AWS IoT Events input where the data is sent.

                  • sqs — (map)

                    Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                    • queueUrlrequired — (String)

                      The URL of the Amazon SQS queue where the data is written.

                    • useBase64 — (Boolean)

                      Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

                  • firehose — (map)

                    Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                    • deliveryStreamNamerequired — (String)

                      The name of the Kinesis Data Firehose delivery stream where the data is written.

                    • separator — (String)

                      A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

              • transitionEvents — (Array<map>)

                Specifies the actions performed, and the next state entered, when a "condition" evaluates to TRUE.

                • eventNamerequired — (String)

                  The name of the transition event.

                • conditionrequired — (String)

                  [Required] A Boolean expression that when TRUE causes the actions to be performed and the "nextState" to be entered.

                • actions — (Array<map>)

                  The actions to be performed.

                  • setVariable — (map)

                    Sets a variable to a specified value.

                    • variableNamerequired — (String)

                      The name of the variable.

                    • valuerequired — (String)

                      The new value of the variable.

                  • sns — (map)

                    Sends an Amazon SNS message.

                    • targetArnrequired — (String)

                      The ARN of the Amazon SNS target where the message is sent.

                  • iotTopicPublish — (map)

                    Publishes an MQTT message with the given topic to the AWS IoT message broker.

                    • mqttTopicrequired — (String)

                      The MQTT topic of the message.

                  • setTimer — (map)

                    Information needed to set the timer.

                    • timerNamerequired — (String)

                      The name of the timer.

                    • secondsrequired — (Integer)

                      The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

                  • clearTimer — (map)

                    Information needed to clear the timer.

                    • timerNamerequired — (String)

                      The name of the timer to clear.

                  • resetTimer — (map)

                    Information needed to reset the timer.

                    • timerNamerequired — (String)

                      The name of the timer to reset.

                  • lambda — (map)

                    Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                    • functionArnrequired — (String)

                      The ARN of the AWS Lambda function which is executed.

                  • iotEvents — (map)

                    Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                    • inputNamerequired — (String)

                      The name of the AWS IoT Events input where the data is sent.

                  • sqs — (map)

                    Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                    • queueUrlrequired — (String)

                      The URL of the Amazon SQS queue where the data is written.

                    • useBase64 — (Boolean)

                      Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

                  • firehose — (map)

                    Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                    • deliveryStreamNamerequired — (String)

                      The name of the Kinesis Data Firehose delivery stream where the data is written.

                    • separator — (String)

                      A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

                • nextStaterequired — (String)

                  The next state to enter.

            • onEnter — (map)

              When entering this state, perform these "actions" if the "condition" is TRUE.

              • events — (Array<map>)

                Specifies the actions that are performed when the state is entered and the "condition" is TRUE.

                • eventNamerequired — (String)

                  The name of the event.

                • condition — (String)

                  [Optional] The Boolean expression that when TRUE causes the "actions" to be performed. If not present, the actions are performed (=TRUE); if the expression result is not a Boolean value, the actions are NOT performed (=FALSE).

                • actions — (Array<map>)

                  The actions to be performed.

                  • setVariable — (map)

                    Sets a variable to a specified value.

                    • variableNamerequired — (String)

                      The name of the variable.

                    • valuerequired — (String)

                      The new value of the variable.

                  • sns — (map)

                    Sends an Amazon SNS message.

                    • targetArnrequired — (String)

                      The ARN of the Amazon SNS target where the message is sent.

                  • iotTopicPublish — (map)

                    Publishes an MQTT message with the given topic to the AWS IoT message broker.

                    • mqttTopicrequired — (String)

                      The MQTT topic of the message.

                  • setTimer — (map)

                    Information needed to set the timer.

                    • timerNamerequired — (String)

                      The name of the timer.

                    • secondsrequired — (Integer)

                      The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

                  • clearTimer — (map)

                    Information needed to clear the timer.

                    • timerNamerequired — (String)

                      The name of the timer to clear.

                  • resetTimer — (map)

                    Information needed to reset the timer.

                    • timerNamerequired — (String)

                      The name of the timer to reset.

                  • lambda — (map)

                    Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                    • functionArnrequired — (String)

                      The ARN of the AWS Lambda function which is executed.

                  • iotEvents — (map)

                    Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                    • inputNamerequired — (String)

                      The name of the AWS IoT Events input where the data is sent.

                  • sqs — (map)

                    Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                    • queueUrlrequired — (String)

                      The URL of the Amazon SQS queue where the data is written.

                    • useBase64 — (Boolean)

                      Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

                  • firehose — (map)

                    Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                    • deliveryStreamNamerequired — (String)

                      The name of the Kinesis Data Firehose delivery stream where the data is written.

                    • separator — (String)

                      A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

            • onExit — (map)

              When exiting this state, perform these "actions" if the specified "condition" is TRUE.

              • events — (Array<map>)

                Specifies the "actions" that are performed when the state is exited and the "condition" is TRUE.

                • eventNamerequired — (String)

                  The name of the event.

                • condition — (String)

                  [Optional] The Boolean expression that when TRUE causes the "actions" to be performed. If not present, the actions are performed (=TRUE); if the expression result is not a Boolean value, the actions are NOT performed (=FALSE).

                • actions — (Array<map>)

                  The actions to be performed.

                  • setVariable — (map)

                    Sets a variable to a specified value.

                    • variableNamerequired — (String)

                      The name of the variable.

                    • valuerequired — (String)

                      The new value of the variable.

                  • sns — (map)

                    Sends an Amazon SNS message.

                    • targetArnrequired — (String)

                      The ARN of the Amazon SNS target where the message is sent.

                  • iotTopicPublish — (map)

                    Publishes an MQTT message with the given topic to the AWS IoT message broker.

                    • mqttTopicrequired — (String)

                      The MQTT topic of the message.

                  • setTimer — (map)

                    Information needed to set the timer.

                    • timerNamerequired — (String)

                      The name of the timer.

                    • secondsrequired — (Integer)

                      The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

                  • clearTimer — (map)

                    Information needed to clear the timer.

                    • timerNamerequired — (String)

                      The name of the timer to clear.

                  • resetTimer — (map)

                    Information needed to reset the timer.

                    • timerNamerequired — (String)

                      The name of the timer to reset.

                  • lambda — (map)

                    Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                    • functionArnrequired — (String)

                      The ARN of the AWS Lambda function which is executed.

                  • iotEvents — (map)

                    Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                    • inputNamerequired — (String)

                      The name of the AWS IoT Events input where the data is sent.

                  • sqs — (map)

                    Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                    • queueUrlrequired — (String)

                      The URL of the Amazon SQS queue where the data is written.

                    • useBase64 — (Boolean)

                      Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

                  • firehose — (map)

                    Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                    • deliveryStreamNamerequired — (String)

                      The name of the Kinesis Data Firehose delivery stream where the data is written.

                    • separator — (String)

                      A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

          • initialStateNamerequired — (String)

            The state that is entered at the creation of each detector (instance).

        • detectorModelConfiguration — (map)

          Information about how the detector is configured.

          • detectorModelName — (String)

            The name of the detector model.

          • detectorModelVersion — (String)

            The version of the detector model.

          • detectorModelDescription — (String)

            A brief description of the detector model.

          • detectorModelArn — (String)

            The ARN of the detector model.

          • roleArn — (String)

            The ARN of the role that grants permission to AWS IoT Events to perform its operations.

          • creationTime — (Date)

            The time the detector model was created.

          • lastUpdateTime — (Date)

            The time the detector model was last updated.

          • status — (String)

            The status of the detector model.

            Possible values include:
            • "ACTIVE"
            • "ACTIVATING"
            • "INACTIVE"
            • "DEPRECATED"
            • "DRAFT"
            • "PAUSED"
            • "FAILED"
          • key — (String)

            The input attribute key used to identify a device or system to create a detector (an instance of the detector model) and then to route each input received to the appropriate detector (instance). This parameter uses a JSON-path expression to specify the attribute-value pair in the message payload of each input that is used to identify the device associated with the input.

          • evaluationMethod — (String)

            When set to SERIAL, variables are updated and event conditions evaluated in the order that the events are defined. When set to BATCH, variables are updated and events performed only after all event conditions are evaluated.

            Possible values include:
            • "BATCH"
            • "SERIAL"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeInput(params = {}, callback) ⇒ AWS.Request

Describes an input.

Service Reference:

Examples:

Calling the describeInput operation

var params = {
  inputName: 'STRING_VALUE' /* required */
};
iotevents.describeInput(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • inputName — (String)

      The name of the input.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • input — (map)

        Information about the input.

        • inputConfiguration — (map)

          Information about the configuration of an input.

          • inputNamerequired — (String)

            The name of the input.

          • inputDescription — (String)

            A brief description of the input.

          • inputArnrequired — (String)

            The ARN of the input.

          • creationTimerequired — (Date)

            The time the input was created.

          • lastUpdateTimerequired — (Date)

            The last time the input was updated.

          • statusrequired — (String)

            The status of the input.

            Possible values include:
            • "CREATING"
            • "UPDATING"
            • "ACTIVE"
            • "DELETING"
        • inputDefinition — (map)

          The definition of the input.

          • attributesrequired — (Array<map>)

            The attributes from the JSON payload that are made available by the input. Inputs are derived from messages sent to the AWS IoT Events system using BatchPutMessage. Each such message contains a JSON payload, and those attributes (and their paired values) specified here are available for use in the "condition" expressions used by detectors that monitor this input.

            • jsonPathrequired — (String)

              An expression that specifies an attribute-value pair in a JSON structure. Use this to specify an attribute from the JSON payload that is made available by the input. Inputs are derived from messages sent to the AWS IoT Events system (BatchPutMessage). Each such message contains a JSON payload, and the attribute (and its paired value) specified here are available for use in the "condition" expressions used by detectors.

              Syntax: <field-name>.<field-name>...

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

describeLoggingOptions(params = {}, callback) ⇒ AWS.Request

Retrieves the current settings of the AWS IoT Events logging options.

Service Reference:

Examples:

Calling the describeLoggingOptions operation

var params = {
};
iotevents.describeLoggingOptions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • loggingOptions — (map)

        The current settings of the AWS IoT Events logging options.

        • roleArnrequired — (String)

          The ARN of the role that grants permission to AWS IoT Events to perform logging.

        • levelrequired — (String)

          The logging level.

          Possible values include:
          • "ERROR"
          • "INFO"
          • "DEBUG"
        • enabledrequired — (Boolean)

          If TRUE, logging is enabled for AWS IoT Events.

        • detectorDebugOptions — (Array<map>)

          Information that identifies those detector models and their detectors (instances) for which the logging level is given.

          • detectorModelNamerequired — (String)

            The name of the detector model.

          • keyValue — (String)

            The value of the input attribute key used to create the detector (the instance of the detector model).

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listDetectorModels(params = {}, callback) ⇒ AWS.Request

Lists the detector models you have created. Only the metadata associated with each detector model is returned.

Service Reference:

Examples:

Calling the listDetectorModels operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
iotevents.listDetectorModels(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      The token for the next set of results.

    • maxResults — (Integer)

      The maximum number of results to return at one time.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • detectorModelSummaries — (Array<map>)

        Summary information about the detector models.

        • detectorModelName — (String)

          The name of the detector model.

        • detectorModelDescription — (String)

          A brief description of the detector model.

        • creationTime — (Date)

          The time the detector model was created.

      • nextToken — (String)

        A token to retrieve the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listDetectorModelVersions(params = {}, callback) ⇒ AWS.Request

Lists all the versions of a detector model. Only the metadata associated with each detector model version is returned.

Service Reference:

Examples:

Calling the listDetectorModelVersions operation

var params = {
  detectorModelName: 'STRING_VALUE', /* required */
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
iotevents.listDetectorModelVersions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • detectorModelName — (String)

      The name of the detector model whose versions are returned.

    • nextToken — (String)

      The token for the next set of results.

    • maxResults — (Integer)

      The maximum number of results to return at one time.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • detectorModelVersionSummaries — (Array<map>)

        Summary information about the detector model versions.

        • detectorModelName — (String)

          The name of the detector model.

        • detectorModelVersion — (String)

          The ID of the detector model version.

        • detectorModelArn — (String)

          The ARN of the detector model version.

        • roleArn — (String)

          The ARN of the role that grants the detector model permission to perform its tasks.

        • creationTime — (Date)

          The time the detector model version was created.

        • lastUpdateTime — (Date)

          The last time the detector model version was updated.

        • status — (String)

          The status of the detector model version.

          Possible values include:
          • "ACTIVE"
          • "ACTIVATING"
          • "INACTIVE"
          • "DEPRECATED"
          • "DRAFT"
          • "PAUSED"
          • "FAILED"
        • evaluationMethod — (String)

          When set to SERIAL, variables are updated and event conditions evaluated in the order that the events are defined. When set to BATCH, variables are updated and events performed only after all event conditions are evaluated.

          Possible values include:
          • "BATCH"
          • "SERIAL"
      • nextToken — (String)

        A token to retrieve the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listInputs(params = {}, callback) ⇒ AWS.Request

Lists the inputs you have created.

Service Reference:

Examples:

Calling the listInputs operation

var params = {
  maxResults: 'NUMBER_VALUE',
  nextToken: 'STRING_VALUE'
};
iotevents.listInputs(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • nextToken — (String)

      The token for the next set of results.

    • maxResults — (Integer)

      The maximum number of results to return at one time.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • inputSummaries — (Array<map>)

        Summary information about the inputs.

        • inputName — (String)

          The name of the input.

        • inputDescription — (String)

          A brief description of the input.

        • inputArn — (String)

          The ARN of the input.

        • creationTime — (Date)

          The time the input was created.

        • lastUpdateTime — (Date)

          The last time the input was updated.

        • status — (String)

          The status of the input.

          Possible values include:
          • "CREATING"
          • "UPDATING"
          • "ACTIVE"
          • "DELETING"
      • nextToken — (String)

        A token to retrieve the next set of results, or null if there are no additional results.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

listTagsForResource(params = {}, callback) ⇒ AWS.Request

Lists the tags (metadata) you have assigned to the resource.

Service Reference:

Examples:

Calling the listTagsForResource operation

var params = {
  resourceArn: 'STRING_VALUE' /* required */
};
iotevents.listTagsForResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • resourceArn — (String)

      The ARN of the resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • tags — (Array<map>)

        The list of tags assigned to the resource.

        • keyrequired — (String)

          The tag's key.

        • valuerequired — (String)

          The tag's value.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

putLoggingOptions(params = {}, callback) ⇒ AWS.Request

Sets or updates the AWS IoT Events logging options.

If you update the value of any "loggingOptions" field, it takes up to one minute for the change to take effect. Also, if you change the policy attached to the role you specified in the "roleArn" field (for example, to correct an invalid policy) it takes up to five minutes for that change to take effect.

Service Reference:

Examples:

Calling the putLoggingOptions operation

var params = {
  loggingOptions: { /* required */
    enabled: true || false, /* required */
    level: ERROR | INFO | DEBUG, /* required */
    roleArn: 'STRING_VALUE', /* required */
    detectorDebugOptions: [
      {
        detectorModelName: 'STRING_VALUE', /* required */
        keyValue: 'STRING_VALUE'
      },
      /* more items */
    ]
  }
};
iotevents.putLoggingOptions(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • loggingOptions — (map)

      The new values of the AWS IoT Events logging options.

      • roleArnrequired — (String)

        The ARN of the role that grants permission to AWS IoT Events to perform logging.

      • levelrequired — (String)

        The logging level.

        Possible values include:
        • "ERROR"
        • "INFO"
        • "DEBUG"
      • enabledrequired — (Boolean)

        If TRUE, logging is enabled for AWS IoT Events.

      • detectorDebugOptions — (Array<map>)

        Information that identifies those detector models and their detectors (instances) for which the logging level is given.

        • detectorModelNamerequired — (String)

          The name of the detector model.

        • keyValue — (String)

          The value of the input attribute key used to create the detector (the instance of the detector model).

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

tagResource(params = {}, callback) ⇒ AWS.Request

Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.

Service Reference:

Examples:

Calling the tagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tags: [ /* required */
    {
      key: 'STRING_VALUE', /* required */
      value: 'STRING_VALUE' /* required */
    },
    /* more items */
  ]
};
iotevents.tagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • resourceArn — (String)

      The ARN of the resource.

    • tags — (Array<map>)

      The new or modified tags for the resource.

      • keyrequired — (String)

        The tag's key.

      • valuerequired — (String)

        The tag's value.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

untagResource(params = {}, callback) ⇒ AWS.Request

Removes the given tags (metadata) from the resource.

Service Reference:

Examples:

Calling the untagResource operation

var params = {
  resourceArn: 'STRING_VALUE', /* required */
  tagKeys: [ /* required */
    'STRING_VALUE',
    /* more items */
  ]
};
iotevents.untagResource(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • resourceArn — (String)

      The ARN of the resource.

    • tagKeys — (Array<String>)

      A list of the keys of the tags to be removed from the resource.

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs.

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateDetectorModel(params = {}, callback) ⇒ AWS.Request

Updates a detector model. Detectors (instances) spawned by the previous version are deleted and then re-created as new inputs arrive.

Service Reference:

Examples:

Calling the updateDetectorModel operation

var params = {
  detectorModelDefinition: { /* required */
    initialStateName: 'STRING_VALUE', /* required */
    states: [ /* required */
      {
        stateName: 'STRING_VALUE', /* required */
        onEnter: {
          events: [
            {
              eventName: 'STRING_VALUE', /* required */
              actions: [
                {
                  clearTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  firehose: {
                    deliveryStreamName: 'STRING_VALUE', /* required */
                    separator: 'STRING_VALUE'
                  },
                  iotEvents: {
                    inputName: 'STRING_VALUE' /* required */
                  },
                  iotTopicPublish: {
                    mqttTopic: 'STRING_VALUE' /* required */
                  },
                  lambda: {
                    functionArn: 'STRING_VALUE' /* required */
                  },
                  resetTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setTimer: {
                    seconds: 'NUMBER_VALUE', /* required */
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setVariable: {
                    value: 'STRING_VALUE', /* required */
                    variableName: 'STRING_VALUE' /* required */
                  },
                  sns: {
                    targetArn: 'STRING_VALUE' /* required */
                  },
                  sqs: {
                    queueUrl: 'STRING_VALUE', /* required */
                    useBase64: true || false
                  }
                },
                /* more items */
              ],
              condition: 'STRING_VALUE'
            },
            /* more items */
          ]
        },
        onExit: {
          events: [
            {
              eventName: 'STRING_VALUE', /* required */
              actions: [
                {
                  clearTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  firehose: {
                    deliveryStreamName: 'STRING_VALUE', /* required */
                    separator: 'STRING_VALUE'
                  },
                  iotEvents: {
                    inputName: 'STRING_VALUE' /* required */
                  },
                  iotTopicPublish: {
                    mqttTopic: 'STRING_VALUE' /* required */
                  },
                  lambda: {
                    functionArn: 'STRING_VALUE' /* required */
                  },
                  resetTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setTimer: {
                    seconds: 'NUMBER_VALUE', /* required */
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setVariable: {
                    value: 'STRING_VALUE', /* required */
                    variableName: 'STRING_VALUE' /* required */
                  },
                  sns: {
                    targetArn: 'STRING_VALUE' /* required */
                  },
                  sqs: {
                    queueUrl: 'STRING_VALUE', /* required */
                    useBase64: true || false
                  }
                },
                /* more items */
              ],
              condition: 'STRING_VALUE'
            },
            /* more items */
          ]
        },
        onInput: {
          events: [
            {
              eventName: 'STRING_VALUE', /* required */
              actions: [
                {
                  clearTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  firehose: {
                    deliveryStreamName: 'STRING_VALUE', /* required */
                    separator: 'STRING_VALUE'
                  },
                  iotEvents: {
                    inputName: 'STRING_VALUE' /* required */
                  },
                  iotTopicPublish: {
                    mqttTopic: 'STRING_VALUE' /* required */
                  },
                  lambda: {
                    functionArn: 'STRING_VALUE' /* required */
                  },
                  resetTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setTimer: {
                    seconds: 'NUMBER_VALUE', /* required */
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setVariable: {
                    value: 'STRING_VALUE', /* required */
                    variableName: 'STRING_VALUE' /* required */
                  },
                  sns: {
                    targetArn: 'STRING_VALUE' /* required */
                  },
                  sqs: {
                    queueUrl: 'STRING_VALUE', /* required */
                    useBase64: true || false
                  }
                },
                /* more items */
              ],
              condition: 'STRING_VALUE'
            },
            /* more items */
          ],
          transitionEvents: [
            {
              condition: 'STRING_VALUE', /* required */
              eventName: 'STRING_VALUE', /* required */
              nextState: 'STRING_VALUE', /* required */
              actions: [
                {
                  clearTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  firehose: {
                    deliveryStreamName: 'STRING_VALUE', /* required */
                    separator: 'STRING_VALUE'
                  },
                  iotEvents: {
                    inputName: 'STRING_VALUE' /* required */
                  },
                  iotTopicPublish: {
                    mqttTopic: 'STRING_VALUE' /* required */
                  },
                  lambda: {
                    functionArn: 'STRING_VALUE' /* required */
                  },
                  resetTimer: {
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setTimer: {
                    seconds: 'NUMBER_VALUE', /* required */
                    timerName: 'STRING_VALUE' /* required */
                  },
                  setVariable: {
                    value: 'STRING_VALUE', /* required */
                    variableName: 'STRING_VALUE' /* required */
                  },
                  sns: {
                    targetArn: 'STRING_VALUE' /* required */
                  },
                  sqs: {
                    queueUrl: 'STRING_VALUE', /* required */
                    useBase64: true || false
                  }
                },
                /* more items */
              ]
            },
            /* more items */
          ]
        }
      },
      /* more items */
    ]
  },
  detectorModelName: 'STRING_VALUE', /* required */
  roleArn: 'STRING_VALUE', /* required */
  detectorModelDescription: 'STRING_VALUE',
  evaluationMethod: BATCH | SERIAL
};
iotevents.updateDetectorModel(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • detectorModelName — (String)

      The name of the detector model that is updated.

    • detectorModelDefinition — (map)

      Information that defines how a detector operates.

      • statesrequired — (Array<map>)

        Information about the states of the detector.

        • stateNamerequired — (String)

          The name of the state.

        • onInput — (map)

          When an input is received and the "condition" is TRUE, perform the specified "actions".

          • events — (Array<map>)

            Specifies the actions performed when the "condition" evaluates to TRUE.

            • eventNamerequired — (String)

              The name of the event.

            • condition — (String)

              [Optional] The Boolean expression that when TRUE causes the "actions" to be performed. If not present, the actions are performed (=TRUE); if the expression result is not a Boolean value, the actions are NOT performed (=FALSE).

            • actions — (Array<map>)

              The actions to be performed.

              • setVariable — (map)

                Sets a variable to a specified value.

                • variableNamerequired — (String)

                  The name of the variable.

                • valuerequired — (String)

                  The new value of the variable.

              • sns — (map)

                Sends an Amazon SNS message.

                • targetArnrequired — (String)

                  The ARN of the Amazon SNS target where the message is sent.

              • iotTopicPublish — (map)

                Publishes an MQTT message with the given topic to the AWS IoT message broker.

                • mqttTopicrequired — (String)

                  The MQTT topic of the message.

              • setTimer — (map)

                Information needed to set the timer.

                • timerNamerequired — (String)

                  The name of the timer.

                • secondsrequired — (Integer)

                  The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

              • clearTimer — (map)

                Information needed to clear the timer.

                • timerNamerequired — (String)

                  The name of the timer to clear.

              • resetTimer — (map)

                Information needed to reset the timer.

                • timerNamerequired — (String)

                  The name of the timer to reset.

              • lambda — (map)

                Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                • functionArnrequired — (String)

                  The ARN of the AWS Lambda function which is executed.

              • iotEvents — (map)

                Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                • inputNamerequired — (String)

                  The name of the AWS IoT Events input where the data is sent.

              • sqs — (map)

                Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                • queueUrlrequired — (String)

                  The URL of the Amazon SQS queue where the data is written.

                • useBase64 — (Boolean)

                  Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

              • firehose — (map)

                Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                • deliveryStreamNamerequired — (String)

                  The name of the Kinesis Data Firehose delivery stream where the data is written.

                • separator — (String)

                  A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

          • transitionEvents — (Array<map>)

            Specifies the actions performed, and the next state entered, when a "condition" evaluates to TRUE.

            • eventNamerequired — (String)

              The name of the transition event.

            • conditionrequired — (String)

              [Required] A Boolean expression that when TRUE causes the actions to be performed and the "nextState" to be entered.

            • actions — (Array<map>)

              The actions to be performed.

              • setVariable — (map)

                Sets a variable to a specified value.

                • variableNamerequired — (String)

                  The name of the variable.

                • valuerequired — (String)

                  The new value of the variable.

              • sns — (map)

                Sends an Amazon SNS message.

                • targetArnrequired — (String)

                  The ARN of the Amazon SNS target where the message is sent.

              • iotTopicPublish — (map)

                Publishes an MQTT message with the given topic to the AWS IoT message broker.

                • mqttTopicrequired — (String)

                  The MQTT topic of the message.

              • setTimer — (map)

                Information needed to set the timer.

                • timerNamerequired — (String)

                  The name of the timer.

                • secondsrequired — (Integer)

                  The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

              • clearTimer — (map)

                Information needed to clear the timer.

                • timerNamerequired — (String)

                  The name of the timer to clear.

              • resetTimer — (map)

                Information needed to reset the timer.

                • timerNamerequired — (String)

                  The name of the timer to reset.

              • lambda — (map)

                Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                • functionArnrequired — (String)

                  The ARN of the AWS Lambda function which is executed.

              • iotEvents — (map)

                Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                • inputNamerequired — (String)

                  The name of the AWS IoT Events input where the data is sent.

              • sqs — (map)

                Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                • queueUrlrequired — (String)

                  The URL of the Amazon SQS queue where the data is written.

                • useBase64 — (Boolean)

                  Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

              • firehose — (map)

                Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                • deliveryStreamNamerequired — (String)

                  The name of the Kinesis Data Firehose delivery stream where the data is written.

                • separator — (String)

                  A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

            • nextStaterequired — (String)

              The next state to enter.

        • onEnter — (map)

          When entering this state, perform these "actions" if the "condition" is TRUE.

          • events — (Array<map>)

            Specifies the actions that are performed when the state is entered and the "condition" is TRUE.

            • eventNamerequired — (String)

              The name of the event.

            • condition — (String)

              [Optional] The Boolean expression that when TRUE causes the "actions" to be performed. If not present, the actions are performed (=TRUE); if the expression result is not a Boolean value, the actions are NOT performed (=FALSE).

            • actions — (Array<map>)

              The actions to be performed.

              • setVariable — (map)

                Sets a variable to a specified value.

                • variableNamerequired — (String)

                  The name of the variable.

                • valuerequired — (String)

                  The new value of the variable.

              • sns — (map)

                Sends an Amazon SNS message.

                • targetArnrequired — (String)

                  The ARN of the Amazon SNS target where the message is sent.

              • iotTopicPublish — (map)

                Publishes an MQTT message with the given topic to the AWS IoT message broker.

                • mqttTopicrequired — (String)

                  The MQTT topic of the message.

              • setTimer — (map)

                Information needed to set the timer.

                • timerNamerequired — (String)

                  The name of the timer.

                • secondsrequired — (Integer)

                  The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

              • clearTimer — (map)

                Information needed to clear the timer.

                • timerNamerequired — (String)

                  The name of the timer to clear.

              • resetTimer — (map)

                Information needed to reset the timer.

                • timerNamerequired — (String)

                  The name of the timer to reset.

              • lambda — (map)

                Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                • functionArnrequired — (String)

                  The ARN of the AWS Lambda function which is executed.

              • iotEvents — (map)

                Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                • inputNamerequired — (String)

                  The name of the AWS IoT Events input where the data is sent.

              • sqs — (map)

                Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                • queueUrlrequired — (String)

                  The URL of the Amazon SQS queue where the data is written.

                • useBase64 — (Boolean)

                  Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

              • firehose — (map)

                Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                • deliveryStreamNamerequired — (String)

                  The name of the Kinesis Data Firehose delivery stream where the data is written.

                • separator — (String)

                  A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

        • onExit — (map)

          When exiting this state, perform these "actions" if the specified "condition" is TRUE.

          • events — (Array<map>)

            Specifies the "actions" that are performed when the state is exited and the "condition" is TRUE.

            • eventNamerequired — (String)

              The name of the event.

            • condition — (String)

              [Optional] The Boolean expression that when TRUE causes the "actions" to be performed. If not present, the actions are performed (=TRUE); if the expression result is not a Boolean value, the actions are NOT performed (=FALSE).

            • actions — (Array<map>)

              The actions to be performed.

              • setVariable — (map)

                Sets a variable to a specified value.

                • variableNamerequired — (String)

                  The name of the variable.

                • valuerequired — (String)

                  The new value of the variable.

              • sns — (map)

                Sends an Amazon SNS message.

                • targetArnrequired — (String)

                  The ARN of the Amazon SNS target where the message is sent.

              • iotTopicPublish — (map)

                Publishes an MQTT message with the given topic to the AWS IoT message broker.

                • mqttTopicrequired — (String)

                  The MQTT topic of the message.

              • setTimer — (map)

                Information needed to set the timer.

                • timerNamerequired — (String)

                  The name of the timer.

                • secondsrequired — (Integer)

                  The number of seconds until the timer expires. The minimum value is 60 seconds to ensure accuracy.

              • clearTimer — (map)

                Information needed to clear the timer.

                • timerNamerequired — (String)

                  The name of the timer to clear.

              • resetTimer — (map)

                Information needed to reset the timer.

                • timerNamerequired — (String)

                  The name of the timer to reset.

              • lambda — (map)

                Calls an AWS Lambda function, passing in information about the detector model instance and the event which triggered the action.

                • functionArnrequired — (String)

                  The ARN of the AWS Lambda function which is executed.

              • iotEvents — (map)

                Sends an IoT Events input, passing in information about the detector model instance and the event which triggered the action.

                • inputNamerequired — (String)

                  The name of the AWS IoT Events input where the data is sent.

              • sqs — (map)

                Sends information about the detector model instance and the event which triggered the action to an Amazon SQS queue.

                • queueUrlrequired — (String)

                  The URL of the Amazon SQS queue where the data is written.

                • useBase64 — (Boolean)

                  Set this to TRUE if you want the data to be Base-64 encoded before it is written to the queue. Otherwise, set this to FALSE.

              • firehose — (map)

                Sends information about the detector model instance and the event which triggered the action to a Kinesis Data Firehose delivery stream.

                • deliveryStreamNamerequired — (String)

                  The name of the Kinesis Data Firehose delivery stream where the data is written.

                • separator — (String)

                  A character separator that is used to separate records written to the Kinesis Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' (Windows newline), ',' (comma).

      • initialStateNamerequired — (String)

        The state that is entered at the creation of each detector (instance).

    • detectorModelDescription — (String)

      A brief description of the detector model.

    • roleArn — (String)

      The ARN of the role that grants permission to AWS IoT Events to perform its operations.

    • evaluationMethod — (String)

      When set to SERIAL, variables are updated and event conditions evaluated in the order that the events are defined. When set to BATCH, variables are updated and events performed only after all event conditions are evaluated.

      Possible values include:
      • "BATCH"
      • "SERIAL"

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • detectorModelConfiguration — (map)

        Information about how the detector model is configured.

        • detectorModelName — (String)

          The name of the detector model.

        • detectorModelVersion — (String)

          The version of the detector model.

        • detectorModelDescription — (String)

          A brief description of the detector model.

        • detectorModelArn — (String)

          The ARN of the detector model.

        • roleArn — (String)

          The ARN of the role that grants permission to AWS IoT Events to perform its operations.

        • creationTime — (Date)

          The time the detector model was created.

        • lastUpdateTime — (Date)

          The time the detector model was last updated.

        • status — (String)

          The status of the detector model.

          Possible values include:
          • "ACTIVE"
          • "ACTIVATING"
          • "INACTIVE"
          • "DEPRECATED"
          • "DRAFT"
          • "PAUSED"
          • "FAILED"
        • key — (String)

          The input attribute key used to identify a device or system to create a detector (an instance of the detector model) and then to route each input received to the appropriate detector (instance). This parameter uses a JSON-path expression to specify the attribute-value pair in the message payload of each input that is used to identify the device associated with the input.

        • evaluationMethod — (String)

          When set to SERIAL, variables are updated and event conditions evaluated in the order that the events are defined. When set to BATCH, variables are updated and events performed only after all event conditions are evaluated.

          Possible values include:
          • "BATCH"
          • "SERIAL"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.

updateInput(params = {}, callback) ⇒ AWS.Request

Updates an input.

Service Reference:

Examples:

Calling the updateInput operation

var params = {
  inputDefinition: { /* required */
    attributes: [ /* required */
      {
        jsonPath: 'STRING_VALUE' /* required */
      },
      /* more items */
    ]
  },
  inputName: 'STRING_VALUE', /* required */
  inputDescription: 'STRING_VALUE'
};
iotevents.updateInput(params, function(err, data) {
  if (err) console.log(err, err.stack); // an error occurred
  else     console.log(data);           // successful response
});

Parameters:

  • params (Object) (defaults to: {})
    • inputName — (String)

      The name of the input you want to update.

    • inputDescription — (String)

      A brief description of the input.

    • inputDefinition — (map)

      The definition of the input.

      • attributesrequired — (Array<map>)

        The attributes from the JSON payload that are made available by the input. Inputs are derived from messages sent to the AWS IoT Events system using BatchPutMessage. Each such message contains a JSON payload, and those attributes (and their paired values) specified here are available for use in the "condition" expressions used by detectors that monitor this input.

        • jsonPathrequired — (String)

          An expression that specifies an attribute-value pair in a JSON structure. Use this to specify an attribute from the JSON payload that is made available by the input. Inputs are derived from messages sent to the AWS IoT Events system (BatchPutMessage). Each such message contains a JSON payload, and the attribute (and its paired value) specified here are available for use in the "condition" expressions used by detectors.

          Syntax: <field-name>.<field-name>...

Callback (callback):

  • function(err, data) { ... }

    Called when a response from the service is returned. If a callback is not supplied, you must call AWS.Request.send() on the returned request object to initiate the request.

    Context (this):

    • (AWS.Response)

      the response object containing error, data properties, and the original request object.

    Parameters:

    • err (Error)

      the error object returned from the request. Set to null if the request is successful.

    • data (Object)

      the de-serialized data returned from the request. Set to null if a request error occurs. The data object has the following properties:

      • inputConfiguration — (map)

        Information about the configuration of the input.

        • inputNamerequired — (String)

          The name of the input.

        • inputDescription — (String)

          A brief description of the input.

        • inputArnrequired — (String)

          The ARN of the input.

        • creationTimerequired — (Date)

          The time the input was created.

        • lastUpdateTimerequired — (Date)

          The last time the input was updated.

        • statusrequired — (String)

          The status of the input.

          Possible values include:
          • "CREATING"
          • "UPDATING"
          • "ACTIVE"
          • "DELETING"

Returns:

  • (AWS.Request)

    a handle to the operation request for subsequent event callback registration.