You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::IoT::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for AWS IoT. To construct a client, you need to configure a :region and :credentials.

iot = Aws::IoT::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::IoT::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::IoT::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#accept_certificate_transfer(options = {}) ⇒ Struct

Accepts a pending certificate transfer. The default state of the certificate is INACTIVE.

To check for pending certificate transfers, call ListCertificates to enumerate your certificates.

Examples:

Request syntax with placeholder values


resp = client.accept_certificate_transfer({
  certificate_id: "CertificateId", # required
  set_as_active: false,
})

Options Hash (options):

  • :certificate_id (required, String)

    The ID of the certificate.

  • :set_as_active (Boolean)

    Specifies whether the certificate is active.

Returns:

  • (Struct)

    Returns an empty response.

#add_thing_to_thing_group(options = {}) ⇒ Struct

Adds a thing to a thing group.

Examples:

Request syntax with placeholder values


resp = client.add_thing_to_thing_group({
  thing_group_name: "ThingGroupName",
  thing_group_arn: "ThingGroupArn",
  thing_name: "ThingName",
  thing_arn: "ThingArn",
})

Options Hash (options):

  • :thing_group_name (String)

    The name of the group to which you are adding a thing.

  • :thing_group_arn (String)

    The ARN of the group to which you are adding a thing.

  • :thing_name (String)

    The name of the thing to add to a group.

  • :thing_arn (String)

    The ARN of the thing to add to a group.

Returns:

  • (Struct)

    Returns an empty response.

#associate_targets_with_job(options = {}) ⇒ Types::AssociateTargetsWithJobResponse

Associates a group with a continuous job. The following criteria must be met:

  • The job must have been created with the targetSelection field set to "CONTINUOUS".

  • The job status must currently be "IN_PROGRESS".

  • The total number of targets associated with a job must not exceed 100.

Examples:

Request syntax with placeholder values


resp = client.associate_targets_with_job({
  targets: ["TargetArn"], # required
  job_id: "JobId", # required
  comment: "Comment",
})

Response structure


resp.job_arn #=> String
resp.job_id #=> String
resp.description #=> String

Options Hash (options):

  • :targets (required, Array<String>)

    A list of thing group ARNs that define the targets of the job.

  • :job_id (required, String)

    The unique identifier you assigned to this job when it was created.

  • :comment (String)

    An optional comment string describing why the job was associated with the targets.

Returns:

#attach_policy(options = {}) ⇒ Struct

Attaches a policy to the specified target.

Examples:

Request syntax with placeholder values


resp = client.attach_policy({
  policy_name: "PolicyName", # required
  target: "PolicyTarget", # required
})

Options Hash (options):

  • :policy_name (required, String)

    The name of the policy to attach.

  • :target (required, String)

    The identity to which the policy is attached.

Returns:

  • (Struct)

    Returns an empty response.

#attach_principal_policy(options = {}) ⇒ Struct

Attaches the specified policy to the specified principal (certificate or other credential).

Note: This API is deprecated. Please use AttachPolicy instead.

Examples:

Request syntax with placeholder values


resp = client.attach_principal_policy({
  policy_name: "PolicyName", # required
  principal: "Principal", # required
})

Options Hash (options):

  • :policy_name (required, String)

    The policy name.

  • :principal (required, String)

    The principal, which can be a certificate ARN (as returned from the CreateCertificate operation) or an Amazon Cognito ID.

Returns:

  • (Struct)

    Returns an empty response.

#attach_thing_principal(options = {}) ⇒ Struct

Attaches the specified principal to the specified thing.

Examples:

Request syntax with placeholder values


resp = client.attach_thing_principal({
  thing_name: "ThingName", # required
  principal: "Principal", # required
})

Options Hash (options):

  • :thing_name (required, String)

    The name of the thing.

  • :principal (required, String)

    The principal, such as a certificate or other credential.

Returns:

  • (Struct)

    Returns an empty response.

#cancel_certificate_transfer(options = {}) ⇒ Struct

Cancels a pending transfer for the specified certificate.

Note Only the transfer source account can use this operation to cancel a transfer. (Transfer destinations can use RejectCertificateTransfer instead.) After transfer, AWS IoT returns the certificate to the source account in the INACTIVE state. After the destination account has accepted the transfer, the transfer cannot be cancelled.

After a certificate transfer is cancelled, the status of the certificate changes from PENDING_TRANSFER to INACTIVE.

Examples:

Request syntax with placeholder values


resp = client.cancel_certificate_transfer({
  certificate_id: "CertificateId", # required
})

Options Hash (options):

  • :certificate_id (required, String)

    The ID of the certificate.

Returns:

  • (Struct)

    Returns an empty response.

#cancel_job(options = {}) ⇒ Types::CancelJobResponse

Cancels a job.

Examples:

Request syntax with placeholder values


resp = client.cancel_job({
  job_id: "JobId", # required
  comment: "Comment",
})

Response structure


resp.job_arn #=> String
resp.job_id #=> String
resp.description #=> String

Options Hash (options):

  • :job_id (required, String)

    The unique identifier you assigned to this job when it was created.

  • :comment (String)

    An optional comment string describing why the job was canceled.

Returns:

#clear_default_authorizer(options = {}) ⇒ Struct

Clears the default authorizer.

Examples:

Request syntax with placeholder values


resp = client.clear_default_authorizer()

Returns:

  • (Struct)

    Returns an empty response.

#create_authorizer(options = {}) ⇒ Types::CreateAuthorizerResponse

Creates an authorizer.

Examples:

Request syntax with placeholder values


resp = client.create_authorizer({
  authorizer_name: "AuthorizerName", # required
  authorizer_function_arn: "AuthorizerFunctionArn", # required
  token_key_name: "TokenKeyName", # required
  token_signing_public_keys: { # required
    "KeyName" => "KeyValue",
  },
  status: "ACTIVE", # accepts ACTIVE, INACTIVE
})

Response structure


resp.authorizer_name #=> String
resp.authorizer_arn #=> String

Options Hash (options):

  • :authorizer_name (required, String)

    The authorizer name.

  • :authorizer_function_arn (required, String)

    The ARN of the authorizer\'s Lambda function.

  • :token_key_name (required, String)

    The name of the token key used to extract the token from the HTTP headers.

  • :token_signing_public_keys (required, Hash<String,String>)

    The public keys used to verify the digital signature returned by your custom authentication service.

  • :status (String)

    The status of the create authorizer request.

Returns:

#create_certificate_from_csr(options = {}) ⇒ Types::CreateCertificateFromCsrResponse

Creates an X.509 certificate using the specified certificate signing request.

Note: The CSR must include a public key that is either an RSA key with a length of at least 2048 bits or an ECC key from NIST P-256 or NIST P-384 curves.

Note: Reusing the same certificate signing request (CSR) results in a distinct certificate.

You can create multiple certificates in a batch by creating a directory, copying multiple .csr files into that directory, and then specifying that directory on the command line. The following commands show how to create a batch of certificates given a batch of CSRs.

Assuming a set of CSRs are located inside of the directory my-csr-directory:

On Linux and OS X, the command is:

$ ls my-csr-directory/ | xargs -I {} aws iot create-certificate-from-csr --certificate-signing-request file://my-csr-directory/{}

This command lists all of the CSRs in my-csr-directory and pipes each CSR file name to the aws iot create-certificate-from-csr AWS CLI command to create a certificate for the corresponding CSR.

The aws iot create-certificate-from-csr part of the command can also be run in parallel to speed up the certificate creation process:

$ ls my-csr-directory/ | xargs -P 10 -I {} aws iot create-certificate-from-csr --certificate-signing-request file://my-csr-directory/{}

On Windows PowerShell, the command to create certificates for all CSRs in my-csr-directory is:

> ls -Name my-csr-directory | %iot create-certificate-from-csr --certificate-signing-request file://my-csr-directory/$_

On a Windows command prompt, the command to create certificates for all CSRs in my-csr-directory is:

> forfiles /p my-csr-directory /c "cmd /c aws iot create-certificate-from-csr --certificate-signing-request file://@path"

Examples:

Request syntax with placeholder values


resp = client.create_certificate_from_csr({
  certificate_signing_request: "CertificateSigningRequest", # required
  set_as_active: false,
})

Response structure


resp.certificate_arn #=> String
resp.certificate_id #=> String
resp.certificate_pem #=> String

Options Hash (options):

  • :certificate_signing_request (required, String)

    The certificate signing request (CSR).

  • :set_as_active (Boolean)

    Specifies whether the certificate is active.

Returns:

#create_job(options = {}) ⇒ Types::CreateJobResponse

Creates a job.

Examples:

Request syntax with placeholder values


resp = client.create_job({
  job_id: "JobId", # required
  targets: ["TargetArn"], # required
  document_source: "JobDocumentSource",
  document: "JobDocument",
  description: "JobDescription",
  presigned_url_config: {
    role_arn: "RoleArn",
    expires_in_sec: 1,
  },
  target_selection: "CONTINUOUS", # accepts CONTINUOUS, SNAPSHOT
  job_executions_rollout_config: {
    maximum_per_minute: 1,
  },
  document_parameters: {
    "ParameterKey" => "ParameterValue",
  },
})

Response structure


resp.job_arn #=> String
resp.job_id #=> String
resp.description #=> String

Options Hash (options):

  • :job_id (required, String)

    A job identifier which must be unique for your AWS account. We recommend using a UUID. Alpha-numeric characters, \"-\" and \"_\" are valid for use here.

  • :targets (required, Array<String>)

    A list of things and thing groups to which the job should be sent.

  • :document_source (String)

    An S3 link to the job document.

  • :document (String)

    The job document.

  • :description (String)

    A short text description of the job.

  • :presigned_url_config (Types::PresignedUrlConfig)

    Configuration information for pre-signed S3 URLs.

  • :target_selection (String)

    Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a thing when the thing is added to a target group, even after the job was completed by all things originally in the group.

  • :job_executions_rollout_config (Types::JobExecutionsRolloutConfig)

    Allows you to create a staged rollout of the job.

  • :document_parameters (Hash<String,String>)

    Parameters for the job document.

Returns:

#create_keys_and_certificate(options = {}) ⇒ Types::CreateKeysAndCertificateResponse

Creates a 2048-bit RSA key pair and issues an X.509 certificate using the issued public key.

Note This is the only time AWS IoT issues the private key for this certificate, so it is important to keep it in a secure location.

Examples:

Request syntax with placeholder values


resp = client.create_keys_and_certificate({
  set_as_active: false,
})

Response structure


resp.certificate_arn #=> String
resp.certificate_id #=> String
resp.certificate_pem #=> String
resp.key_pair.public_key #=> String
resp.key_pair.private_key #=> String

Options Hash (options):

  • :set_as_active (Boolean)

    Specifies whether the certificate is active.

Returns:

#create_policy(options = {}) ⇒ Types::CreatePolicyResponse

Creates an AWS IoT policy.

The created policy is the default version for the policy. This operation creates a policy version with a version identifier of 1 and sets 1 as the policy's default version.

Examples:

Request syntax with placeholder values


resp = client.create_policy({
  policy_name: "PolicyName", # required
  policy_document: "PolicyDocument", # required
})

Response structure


resp.policy_name #=> String
resp.policy_arn #=> String
resp.policy_document #=> String
resp.policy_version_id #=> String

Options Hash (options):

  • :policy_name (required, String)

    The policy name.

  • :policy_document (required, String)

    The JSON document that describes the policy. policyDocument must have a minimum length of 1, with a maximum length of 2048, excluding whitespace.

Returns:

#create_policy_version(options = {}) ⇒ Types::CreatePolicyVersionResponse

Creates a new version of the specified AWS IoT policy. To update a policy, create a new policy version. A managed policy can have up to five versions. If the policy has five versions, you must use DeletePolicyVersion to delete an existing version before you create a new one.

Optionally, you can set the new version as the policy's default version. The default version is the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

Examples:

Request syntax with placeholder values


resp = client.create_policy_version({
  policy_name: "PolicyName", # required
  policy_document: "PolicyDocument", # required
  set_as_default: false,
})

Response structure


resp.policy_arn #=> String
resp.policy_document #=> String
resp.policy_version_id #=> String
resp.is_default_version #=> true/false

Options Hash (options):

  • :policy_name (required, String)

    The policy name.

  • :policy_document (required, String)

    The JSON document that describes the policy. Minimum length of 1. Maximum length of 2048, excluding whitespace.

  • :set_as_default (Boolean)

    Specifies whether the policy version is set as the default. When this parameter is true, the new policy version becomes the operative version (that is, the version that is in effect for the certificates to which the policy is attached).

Returns:

#create_role_alias(options = {}) ⇒ Types::CreateRoleAliasResponse

Creates a role alias.

Examples:

Request syntax with placeholder values


resp = client.create_role_alias({
  role_alias: "RoleAlias", # required
  role_arn: "RoleArn", # required
  credential_duration_seconds: 1,
})

Response structure


resp.role_alias #=> String
resp.role_alias_arn #=> String

Options Hash (options):

  • :role_alias (required, String)

    The role alias that points to a role ARN. This allows you to change the role without having to update the device.

  • :role_arn (required, String)

    The role ARN.

  • :credential_duration_seconds (Integer)

    How long (in seconds) the credentials will be valid.

Returns:

#create_thing(options = {}) ⇒ Types::CreateThingResponse

Creates a thing record in the thing registry.

Examples:

Request syntax with placeholder values


resp = client.create_thing({
  thing_name: "ThingName", # required
  thing_type_name: "ThingTypeName",
  attribute_payload: {
    attributes: {
      "AttributeName" => "AttributeValue",
    },
    merge: false,
  },
})

Response structure


resp.thing_name #=> String
resp.thing_arn #=> String
resp.thing_id #=> String

Options Hash (options):

  • :thing_name (required, String)

    The name of the thing to create.

  • :thing_type_name (String)

    The name of the thing type associated with the new thing.

  • :attribute_payload (Types::AttributePayload)

    The attribute payload, which consists of up to three name/value pairs in a JSON document. For example:

    `{\"attributes\":{\"string1\":\"string2\"}}`

Returns:

#create_thing_group(options = {}) ⇒ Types::CreateThingGroupResponse

Create a thing group.

Examples:

Request syntax with placeholder values


resp = client.create_thing_group({
  thing_group_name: "ThingGroupName", # required
  parent_group_name: "ThingGroupName",
  thing_group_properties: {
    thing_group_description: "ThingGroupDescription",
    attribute_payload: {
      attributes: {
        "AttributeName" => "AttributeValue",
      },
      merge: false,
    },
  },
})

Response structure


resp.thing_group_name #=> String
resp.thing_group_arn #=> String
resp.thing_group_id #=> String

Options Hash (options):

  • :thing_group_name (required, String)

    The thing group name to create.

  • :parent_group_name (String)

    The name of the parent thing group.

  • :thing_group_properties (Types::ThingGroupProperties)

    The thing group properties.

Returns:

#create_thing_type(options = {}) ⇒ Types::CreateThingTypeResponse

Creates a new thing type.

Examples:

Request syntax with placeholder values


resp = client.create_thing_type({
  thing_type_name: "ThingTypeName", # required
  thing_type_properties: {
    thing_type_description: "ThingTypeDescription",
    searchable_attributes: ["AttributeName"],
  },
})

Response structure


resp.thing_type_name #=> String
resp.thing_type_arn #=> String
resp.thing_type_id #=> String

Options Hash (options):

  • :thing_type_name (required, String)

    The name of the thing type.

  • :thing_type_properties (Types::ThingTypeProperties)

    The ThingTypeProperties for the thing type to create. It contains information about the new thing type including a description, and a list of searchable thing attribute names.

Returns:

#create_topic_rule(options = {}) ⇒ Struct

Creates a rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.

Examples:

Request syntax with placeholder values


resp = client.create_topic_rule({
  rule_name: "RuleName", # required
  topic_rule_payload: { # required
    sql: "SQL", # required
    description: "Description",
    actions: [ # required
      {
        dynamo_db: {
          table_name: "TableName", # required
          role_arn: "AwsArn", # required
          operation: "DynamoOperation",
          hash_key_field: "HashKeyField", # required
          hash_key_value: "HashKeyValue", # required
          hash_key_type: "STRING", # accepts STRING, NUMBER
          range_key_field: "RangeKeyField",
          range_key_value: "RangeKeyValue",
          range_key_type: "STRING", # accepts STRING, NUMBER
          payload_field: "PayloadField",
        },
        dynamo_d_bv_2: {
          role_arn: "AwsArn",
          put_item: {
            table_name: "TableName", # required
          },
        },
        lambda: {
          function_arn: "FunctionArn", # required
        },
        sns: {
          target_arn: "AwsArn", # required
          role_arn: "AwsArn", # required
          message_format: "RAW", # accepts RAW, JSON
        },
        sqs: {
          role_arn: "AwsArn", # required
          queue_url: "QueueUrl", # required
          use_base_64: false,
        },
        kinesis: {
          role_arn: "AwsArn", # required
          stream_name: "StreamName", # required
          partition_key: "PartitionKey",
        },
        republish: {
          role_arn: "AwsArn", # required
          topic: "TopicPattern", # required
        },
        s3: {
          role_arn: "AwsArn", # required
          bucket_name: "BucketName", # required
          key: "Key", # required
          canned_acl: "private", # accepts private, public-read, public-read-write, aws-exec-read, authenticated-read, bucket-owner-read, bucket-owner-full-control, log-delivery-write
        },
        firehose: {
          role_arn: "AwsArn", # required
          delivery_stream_name: "DeliveryStreamName", # required
          separator: "FirehoseSeparator",
        },
        cloudwatch_metric: {
          role_arn: "AwsArn", # required
          metric_namespace: "MetricNamespace", # required
          metric_name: "MetricName", # required
          metric_value: "MetricValue", # required
          metric_unit: "MetricUnit", # required
          metric_timestamp: "MetricTimestamp",
        },
        cloudwatch_alarm: {
          role_arn: "AwsArn", # required
          alarm_name: "AlarmName", # required
          state_reason: "StateReason", # required
          state_value: "StateValue", # required
        },
        elasticsearch: {
          role_arn: "AwsArn", # required
          endpoint: "ElasticsearchEndpoint", # required
          index: "ElasticsearchIndex", # required
          type: "ElasticsearchType", # required
          id: "ElasticsearchId", # required
        },
        salesforce: {
          token: "SalesforceToken", # required
          url: "SalesforceEndpoint", # required
        },
      },
    ],
    rule_disabled: false,
    aws_iot_sql_version: "AwsIotSqlVersion",
    error_action: {
      dynamo_db: {
        table_name: "TableName", # required
        role_arn: "AwsArn", # required
        operation: "DynamoOperation",
        hash_key_field: "HashKeyField", # required
        hash_key_value: "HashKeyValue", # required
        hash_key_type: "STRING", # accepts STRING, NUMBER
        range_key_field: "RangeKeyField",
        range_key_value: "RangeKeyValue",
        range_key_type: "STRING", # accepts STRING, NUMBER
        payload_field: "PayloadField",
      },
      dynamo_d_bv_2: {
        role_arn: "AwsArn",
        put_item: {
          table_name: "TableName", # required
        },
      },
      lambda: {
        function_arn: "FunctionArn", # required
      },
      sns: {
        target_arn: "AwsArn", # required
        role_arn: "AwsArn", # required
        message_format: "RAW", # accepts RAW, JSON
      },
      sqs: {
        role_arn: "AwsArn", # required
        queue_url: "QueueUrl", # required
        use_base_64: false,
      },
      kinesis: {
        role_arn: "AwsArn", # required
        stream_name: "StreamName", # required
        partition_key: "PartitionKey",
      },
      republish: {
        role_arn: "AwsArn", # required
        topic: "TopicPattern", # required
      },
      s3: {
        role_arn: "AwsArn", # required
        bucket_name: "BucketName", # required
        key: "Key", # required
        canned_acl: "private", # accepts private, public-read, public-read-write, aws-exec-read, authenticated-read, bucket-owner-read, bucket-owner-full-control, log-delivery-write
      },
      firehose: {
        role_arn: "AwsArn", # required
        delivery_stream_name: "DeliveryStreamName", # required
        separator: "FirehoseSeparator",
      },
      cloudwatch_metric: {
        role_arn: "AwsArn", # required
        metric_namespace: "MetricNamespace", # required
        metric_name: "MetricName", # required
        metric_value: "MetricValue", # required
        metric_unit: "MetricUnit", # required
        metric_timestamp: "MetricTimestamp",
      },
      cloudwatch_alarm: {
        role_arn: "AwsArn", # required
        alarm_name: "AlarmName", # required
        state_reason: "StateReason", # required
        state_value: "StateValue", # required
      },
      elasticsearch: {
        role_arn: "AwsArn", # required
        endpoint: "ElasticsearchEndpoint", # required
        index: "ElasticsearchIndex", # required
        type: "ElasticsearchType", # required
        id: "ElasticsearchId", # required
      },
      salesforce: {
        token: "SalesforceToken", # required
        url: "SalesforceEndpoint", # required
      },
    },
  },
})

Options Hash (options):

  • :rule_name (required, String)

    The name of the rule.

  • :topic_rule_payload (required, Types::TopicRulePayload)

    The rule payload.

Returns:

  • (Struct)

    Returns an empty response.

#delete_authorizer(options = {}) ⇒ Struct

Deletes an authorizer.

Examples:

Request syntax with placeholder values


resp = client.delete_authorizer({
  authorizer_name: "AuthorizerName", # required
})

Options Hash (options):

  • :authorizer_name (required, String)

    The name of the authorizer to delete.

Returns:

  • (Struct)

    Returns an empty response.

#delete_ca_certificate(options = {}) ⇒ Struct

Deletes a registered CA certificate.

Examples:

Request syntax with placeholder values


resp = client.delete_ca_certificate({
  certificate_id: "CertificateId", # required
})

Options Hash (options):

  • :certificate_id (required, String)

    The ID of the certificate to delete.

Returns:

  • (Struct)

    Returns an empty response.

#delete_certificate(options = {}) ⇒ Struct

Deletes the specified certificate.

A certificate cannot be deleted if it has a policy attached to it or if its status is set to ACTIVE. To delete a certificate, first use the DetachPrincipalPolicy API to detach all policies. Next, use the UpdateCertificate API to set the certificate to the INACTIVE status.

Examples:

Request syntax with placeholder values


resp = client.delete_certificate({
  certificate_id: "CertificateId", # required
  force_delete: false,
})

Options Hash (options):

  • :certificate_id (required, String)

    The ID of the certificate.

  • :force_delete (Boolean)

    Forces a certificate request to be deleted.

Returns:

  • (Struct)

    Returns an empty response.

#delete_policy(options = {}) ⇒ Struct

Deletes the specified policy.

A policy cannot be deleted if it has non-default versions or it is attached to any certificate.

To delete a policy, use the DeletePolicyVersion API to delete all non-default versions of the policy; use the DetachPrincipalPolicy API to detach the policy from any certificate; and then use the DeletePolicy API to delete the policy.

When a policy is deleted using DeletePolicy, its default version is deleted with it.

Examples:

Request syntax with placeholder values


resp = client.delete_policy({
  policy_name: "PolicyName", # required
})

Options Hash (options):

  • :policy_name (required, String)

    The name of the policy to delete.

Returns:

  • (Struct)

    Returns an empty response.

#delete_policy_version(options = {}) ⇒ Struct

Deletes the specified version of the specified policy. You cannot delete the default version of a policy using this API. To delete the default version of a policy, use DeletePolicy. To find out which version of a policy is marked as the default version, use ListPolicyVersions.

Examples:

Request syntax with placeholder values


resp = client.delete_policy_version({
  policy_name: "PolicyName", # required
  policy_version_id: "PolicyVersionId", # required
})

Options Hash (options):

  • :policy_name (required, String)

    The name of the policy.

  • :policy_version_id (required, String)

    The policy version ID.

Returns:

  • (Struct)

    Returns an empty response.

#delete_registration_code(options = {}) ⇒ Struct

Deletes a CA certificate registration code.

Examples:

Request syntax with placeholder values


resp = client.delete_registration_code()

Returns:

  • (Struct)

    Returns an empty response.

#delete_role_alias(options = {}) ⇒ Struct

Deletes a role alias

Examples:

Request syntax with placeholder values


resp = client.delete_role_alias({
  role_alias: "RoleAlias", # required
})

Options Hash (options):

  • :role_alias (required, String)

    The role alias to delete.

Returns:

  • (Struct)

    Returns an empty response.

#delete_thing(options = {}) ⇒ Struct

Deletes the specified thing.

Examples:

Request syntax with placeholder values


resp = client.delete_thing({
  thing_name: "ThingName", # required
  expected_version: 1,
})

Options Hash (options):

  • :thing_name (required, String)

    The name of the thing to delete.

  • :expected_version (Integer)

    The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the DeleteThing request is rejected with a VersionConflictException.

Returns:

  • (Struct)

    Returns an empty response.

#delete_thing_group(options = {}) ⇒ Struct

Deletes a thing group.

Examples:

Request syntax with placeholder values


resp = client.delete_thing_group({
  thing_group_name: "ThingGroupName", # required
  expected_version: 1,
})

Options Hash (options):

  • :thing_group_name (required, String)

    The name of the thing group to delete.

  • :expected_version (Integer)

    The expected version of the thing group to delete.

Returns:

  • (Struct)

    Returns an empty response.

#delete_thing_type(options = {}) ⇒ Struct

Deletes the specified thing type . You cannot delete a thing type if it has things associated with it. To delete a thing type, first mark it as deprecated by calling DeprecateThingType, then remove any associated things by calling UpdateThing to change the thing type on any associated thing, and finally use DeleteThingType to delete the thing type.

Examples:

Request syntax with placeholder values


resp = client.delete_thing_type({
  thing_type_name: "ThingTypeName", # required
})

Options Hash (options):

  • :thing_type_name (required, String)

    The name of the thing type.

Returns:

  • (Struct)

    Returns an empty response.

#delete_topic_rule(options = {}) ⇒ Struct

Deletes the rule.

Examples:

Request syntax with placeholder values


resp = client.delete_topic_rule({
  rule_name: "RuleName", # required
})

Options Hash (options):

  • :rule_name (required, String)

    The name of the rule.

Returns:

  • (Struct)

    Returns an empty response.

#delete_v2_logging_level(options = {}) ⇒ Struct

Deletes a logging level.

Examples:

Request syntax with placeholder values


resp = client.delete_v2_logging_level({
  target_type: "DEFAULT", # required, accepts DEFAULT, THING_GROUP
  target_name: "LogTargetName", # required
})

Options Hash (options):

  • :target_type (required, String)

    The type of resource for which you are configuring logging. Must be THING_Group.

  • :target_name (required, String)

    The name of the resource for which you are configuring logging.

Returns:

  • (Struct)

    Returns an empty response.

#deprecate_thing_type(options = {}) ⇒ Struct

Deprecates a thing type. You can not associate new things with deprecated thing type.

Examples:

Request syntax with placeholder values


resp = client.deprecate_thing_type({
  thing_type_name: "ThingTypeName", # required
  undo_deprecate: false,
})

Options Hash (options):

  • :thing_type_name (required, String)

    The name of the thing type to deprecate.

  • :undo_deprecate (Boolean)

    Whether to undeprecate a deprecated thing type. If true, the thing type will not be deprecated anymore and you can associate it with things.

Returns:

  • (Struct)

    Returns an empty response.

#describe_authorizer(options = {}) ⇒ Types::DescribeAuthorizerResponse

Describes an authorizer.

Examples:

Request syntax with placeholder values


resp = client.describe_authorizer({
  authorizer_name: "AuthorizerName", # required
})

Response structure


resp.authorizer_description.authorizer_name #=> String
resp.authorizer_description.authorizer_arn #=> String
resp.authorizer_description.authorizer_function_arn #=> String
resp.authorizer_description.token_key_name #=> String
resp.authorizer_description.token_signing_public_keys #=> Hash
resp.authorizer_description.token_signing_public_keys["KeyName"] #=> String
resp.authorizer_description.status #=> String, one of "ACTIVE", "INACTIVE"
resp.authorizer_description.creation_date #=> Time
resp.authorizer_description.last_modified_date #=> Time

Options Hash (options):

  • :authorizer_name (required, String)

    The name of the authorizer to describe.

Returns:

#describe_ca_certificate(options = {}) ⇒ Types::DescribeCACertificateResponse

Describes a registered CA certificate.

Examples:

Request syntax with placeholder values


resp = client.describe_ca_certificate({
  certificate_id: "CertificateId", # required
})

Response structure


resp.certificate_description.certificate_arn #=> String
resp.certificate_description.certificate_id #=> String
resp.certificate_description.status #=> String, one of "ACTIVE", "INACTIVE"
resp.certificate_description.certificate_pem #=> String
resp.certificate_description.owned_by #=> String
resp.certificate_description.creation_date #=> Time
resp.certificate_description.auto_registration_status #=> String, one of "ENABLE", "DISABLE"
resp.registration_config.template_body #=> String
resp.registration_config.role_arn #=> String

Options Hash (options):

  • :certificate_id (required, String)

    The CA certificate identifier.

Returns:

#describe_certificate(options = {}) ⇒ Types::DescribeCertificateResponse

Gets information about the specified certificate.

Examples:

Request syntax with placeholder values


resp = client.describe_certificate({
  certificate_id: "CertificateId", # required
})

Response structure


resp.certificate_description.certificate_arn #=> String
resp.certificate_description.certificate_id #=> String
resp.certificate_description.ca_certificate_id #=> String
resp.certificate_description.status #=> String, one of "ACTIVE", "INACTIVE", "REVOKED", "PENDING_TRANSFER", "REGISTER_INACTIVE", "PENDING_ACTIVATION"
resp.certificate_description.certificate_pem #=> String
resp.certificate_description.owned_by #=> String
resp.certificate_description.previous_owned_by #=> String
resp.certificate_description.creation_date #=> Time
resp.certificate_description.last_modified_date #=> Time
resp.certificate_description.transfer_data.transfer_message #=> String
resp.certificate_description.transfer_data.reject_reason #=> String
resp.certificate_description.transfer_data.transfer_date #=> Time
resp.certificate_description.transfer_data.accept_date #=> Time
resp.certificate_description.transfer_data.reject_date #=> Time

Options Hash (options):

  • :certificate_id (required, String)

    The ID of the certificate.

Returns:

#describe_default_authorizer(options = {}) ⇒ Types::DescribeDefaultAuthorizerResponse

Describes the default authorizer.

Examples:

Request syntax with placeholder values


resp = client.describe_default_authorizer()

Response structure


resp.authorizer_description.authorizer_name #=> String
resp.authorizer_description.authorizer_arn #=> String
resp.authorizer_description.authorizer_function_arn #=> String
resp.authorizer_description.token_key_name #=> String
resp.authorizer_description.token_signing_public_keys #=> Hash
resp.authorizer_description.token_signing_public_keys["KeyName"] #=> String
resp.authorizer_description.status #=> String, one of "ACTIVE", "INACTIVE"
resp.authorizer_description.creation_date #=> Time
resp.authorizer_description.last_modified_date #=> Time

Returns:

#describe_endpoint(options = {}) ⇒ Types::DescribeEndpointResponse

Returns a unique endpoint specific to the AWS account making the call.

Examples:

Request syntax with placeholder values


resp = client.describe_endpoint({
  endpoint_type: "EndpointType",
})

Response structure


resp.endpoint_address #=> String

Options Hash (options):

  • :endpoint_type (String)

    The endpoint type.

Returns:

#describe_event_configurations(options = {}) ⇒ Types::DescribeEventConfigurationsResponse

Describes event configurations.

Examples:

Request syntax with placeholder values


resp = client.describe_event_configurations()

Response structure


resp.event_configurations #=> Hash
resp.event_configurations["EventType"].enabled #=> true/false
resp.creation_date #=> Time
resp.last_modified_date #=> Time

Returns:

#describe_index(options = {}) ⇒ Types::DescribeIndexResponse

Describes a search index.

Examples:

Request syntax with placeholder values


resp = client.describe_index({
  index_name: "IndexName", # required
})

Response structure


resp.index_name #=> String
resp.index_status #=> String, one of "ACTIVE", "BUILDING", "REBUILDING"
resp.schema #=> String

Options Hash (options):

  • :index_name (required, String)

    The index name.

Returns:

#describe_job(options = {}) ⇒ Types::DescribeJobResponse

Describes a job.

Examples:

Request syntax with placeholder values


resp = client.describe_job({
  job_id: "JobId", # required
})

Response structure


resp.document_source #=> String
resp.job.job_arn #=> String
resp.job.job_id #=> String
resp.job.target_selection #=> String, one of "CONTINUOUS", "SNAPSHOT"
resp.job.status #=> String, one of "IN_PROGRESS", "CANCELED", "COMPLETED"
resp.job.comment #=> String
resp.job.targets #=> Array
resp.job.targets[0] #=> String
resp.job.description #=> String
resp.job.presigned_url_config.role_arn #=> String
resp.job.presigned_url_config.expires_in_sec #=> Integer
resp.job.job_executions_rollout_config.maximum_per_minute #=> Integer
resp.job.created_at #=> Time
resp.job.last_updated_at #=> Time
resp.job.completed_at #=> Time
resp.job.job_process_details.processing_targets #=> Array
resp.job.job_process_details.processing_targets[0] #=> String
resp.job.job_process_details.number_of_canceled_things #=> Integer
resp.job.job_process_details.number_of_succeeded_things #=> Integer
resp.job.job_process_details.number_of_failed_things #=> Integer
resp.job.job_process_details.number_of_rejected_things #=> Integer
resp.job.job_process_details.number_of_queued_things #=> Integer
resp.job.job_process_details.number_of_in_progress_things #=> Integer
resp.job.job_process_details.number_of_removed_things #=> Integer
resp.job.document_parameters #=> Hash
resp.job.document_parameters["ParameterKey"] #=> String

Options Hash (options):

  • :job_id (required, String)

    The unique identifier you assigned to this job when it was created.

Returns:

#describe_job_execution(options = {}) ⇒ Types::DescribeJobExecutionResponse

Describes a job execution.

Examples:

Request syntax with placeholder values


resp = client.describe_job_execution({
  job_id: "JobId", # required
  thing_name: "ThingName", # required
  execution_number: 1,
})

Response structure


resp.execution.job_id #=> String
resp.execution.status #=> String, one of "QUEUED", "IN_PROGRESS", "SUCCEEDED", "FAILED", "REJECTED", "REMOVED", "CANCELED"
resp.execution.status_details.details_map #=> Hash
resp.execution.status_details.details_map["DetailsKey"] #=> String
resp.execution.thing_arn #=> String
resp.execution.queued_at #=> Time
resp.execution.started_at #=> Time
resp.execution.last_updated_at #=> Time
resp.execution.execution_number #=> Integer

Options Hash (options):

  • :job_id (required, String)

    The unique identifier you assigned to this job when it was created.

  • :thing_name (required, String)

    The name of the thing on which the job execution is running.

  • :execution_number (Integer)

    A string (consisting of the digits \"0\" through \"9\" which is used to specify a particular job execution on a particular device.

Returns:

#describe_role_alias(options = {}) ⇒ Types::DescribeRoleAliasResponse

Describes a role alias.

Examples:

Request syntax with placeholder values


resp = client.describe_role_alias({
  role_alias: "RoleAlias", # required
})

Response structure


resp.role_alias_description.role_alias #=> String
resp.role_alias_description.role_arn #=> String
resp.role_alias_description.owner #=> String
resp.role_alias_description.credential_duration_seconds #=> Integer
resp.role_alias_description.creation_date #=> Time
resp.role_alias_description.last_modified_date #=> Time

Options Hash (options):

  • :role_alias (required, String)

    The role alias to describe.

Returns:

#describe_thing(options = {}) ⇒ Types::DescribeThingResponse

Gets information about the specified thing.

Examples:

Request syntax with placeholder values


resp = client.describe_thing({
  thing_name: "ThingName", # required
})

Response structure


resp.default_client_id #=> String
resp.thing_name #=> String
resp.thing_id #=> String
resp.thing_arn #=> String
resp.thing_type_name #=> String
resp.attributes #=> Hash
resp.attributes["AttributeName"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.version #=> Integer

Options Hash (options):

  • :thing_name (required, String)

    The name of the thing.

Returns:

#describe_thing_group(options = {}) ⇒ Types::DescribeThingGroupResponse

Describe a thing group.

Examples:

Request syntax with placeholder values


resp = client.describe_thing_group({
  thing_group_name: "ThingGroupName", # required
})

Response structure


resp.thing_group_name #=> String
resp.thing_group_id #=> String
resp.thing_group_arn #=> String
resp.version #=> Integer
resp.thing_group_properties.thing_group_description #=> String
resp.thing_group_properties.attribute_payload.attributes #=> Hash
resp.thing_group_properties.attribute_payload.attributes["AttributeName"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.thing_group_properties.attribute_payload.merge #=> true/false
resp..parent_group_name #=> String
resp..root_to_parent_thing_groups #=> Array
resp..root_to_parent_thing_groups[0].group_name #=> String
resp..root_to_parent_thing_groups[0].group_arn #=> String
resp..creation_date #=> Time

Options Hash (options):

  • :thing_group_name (required, String)

    The name of the thing group.

Returns:

#describe_thing_registration_task(options = {}) ⇒ Types::DescribeThingRegistrationTaskResponse

Describes a bulk thing provisioning task.

Examples:

Request syntax with placeholder values


resp = client.describe_thing_registration_task({
  task_id: "TaskId", # required
})

Response structure


resp.task_id #=> String
resp.creation_date #=> Time
resp.last_modified_date #=> Time
resp.template_body #=> String
resp.input_file_bucket #=> String
resp.input_file_key #=> String
resp.role_arn #=> String
resp.status #=> String, one of "InProgress", "Completed", "Failed", "Cancelled", "Cancelling"
resp.message #=> String
resp.success_count #=> Integer
resp.failure_count #=> Integer
resp.percentage_progress #=> Integer

Options Hash (options):

  • :task_id (required, String)

    The task ID.

Returns:

#describe_thing_type(options = {}) ⇒ Types::DescribeThingTypeResponse

Gets information about the specified thing type.

Examples:

Request syntax with placeholder values


resp = client.describe_thing_type({
  thing_type_name: "ThingTypeName", # required
})

Response structure


resp.thing_type_name #=> String
resp.thing_type_id #=> String
resp.thing_type_arn #=> String
resp.thing_type_properties.thing_type_description #=> String
resp.thing_type_properties.searchable_attributes #=> Array
resp.thing_type_properties.searchable_attributes[0] #=> String
resp..deprecated #=> true/false
resp..deprecation_date #=> Time
resp..creation_date #=> Time

Options Hash (options):

  • :thing_type_name (required, String)

    The name of the thing type.

Returns:

#detach_policy(options = {}) ⇒ Struct

Detaches a policy from the specified target.

Examples:

Request syntax with placeholder values


resp = client.detach_policy({
  policy_name: "PolicyName", # required
  target: "PolicyTarget", # required
})

Options Hash (options):

  • :policy_name (required, String)

    The policy to detach.

  • :target (required, String)

    The target from which the policy will be detached.

Returns:

  • (Struct)

    Returns an empty response.

#detach_principal_policy(options = {}) ⇒ Struct

Removes the specified policy from the specified certificate.

Note: This API is deprecated. Please use DetachPolicy instead.

Examples:

Request syntax with placeholder values


resp = client.detach_principal_policy({
  policy_name: "PolicyName", # required
  principal: "Principal", # required
})

Options Hash (options):

  • :policy_name (required, String)

    The name of the policy to detach.

  • :principal (required, String)

    The principal.

    If the principal is a certificate, specify the certificate ARN. If the principal is an Amazon Cognito identity, specify the identity ID.

Returns:

  • (Struct)

    Returns an empty response.

#detach_thing_principal(options = {}) ⇒ Struct

Detaches the specified principal from the specified thing.

Examples:

Request syntax with placeholder values


resp = client.detach_thing_principal({
  thing_name: "ThingName", # required
  principal: "Principal", # required
})

Options Hash (options):

  • :thing_name (required, String)

    The name of the thing.

  • :principal (required, String)

    If the principal is a certificate, this value must be ARN of the certificate. If the principal is an Amazon Cognito identity, this value must be the ID of the Amazon Cognito identity.

Returns:

  • (Struct)

    Returns an empty response.

#disable_topic_rule(options = {}) ⇒ Struct

Disables the rule.

Examples:

Request syntax with placeholder values


resp = client.disable_topic_rule({
  rule_name: "RuleName", # required
})

Options Hash (options):

  • :rule_name (required, String)

    The name of the rule to disable.

Returns:

  • (Struct)

    Returns an empty response.

#enable_topic_rule(options = {}) ⇒ Struct

Enables the rule.

Examples:

Request syntax with placeholder values


resp = client.enable_topic_rule({
  rule_name: "RuleName", # required
})

Options Hash (options):

  • :rule_name (required, String)

    The name of the topic rule to enable.

Returns:

  • (Struct)

    Returns an empty response.

#get_effective_policies(options = {}) ⇒ Types::GetEffectivePoliciesResponse

Gets effective policies.

Examples:

Request syntax with placeholder values


resp = client.get_effective_policies({
  principal: "Principal",
  cognito_identity_pool_id: "CognitoIdentityPoolId",
  thing_name: "ThingName",
})

Response structure


resp.effective_policies #=> Array
resp.effective_policies[0].policy_name #=> String
resp.effective_policies[0].policy_arn #=> String
resp.effective_policies[0].policy_document #=> String

Options Hash (options):

  • :principal (String)

    The principal.

  • :cognito_identity_pool_id (String)

    The Cognito identity pool ID.

  • :thing_name (String)

    The thing name.

Returns:

#get_indexing_configuration(options = {}) ⇒ Types::GetIndexingConfigurationResponse

Gets the search configuration.

Examples:

Request syntax with placeholder values


resp = client.get_indexing_configuration()

Response structure


resp.thing_indexing_configuration.thing_indexing_mode #=> String, one of "OFF", "REGISTRY", "REGISTRY_AND_SHADOW"

Returns:

#get_job_document(options = {}) ⇒ Types::GetJobDocumentResponse

Gets a job document.

Examples:

Request syntax with placeholder values


resp = client.get_job_document({
  job_id: "JobId", # required
})

Response structure


resp.document #=> String

Options Hash (options):

  • :job_id (required, String)

    The unique identifier you assigned to this job when it was created.

Returns:

#get_logging_options(options = {}) ⇒ Types::GetLoggingOptionsResponse

Gets the logging options.

Examples:

Request syntax with placeholder values


resp = client.get_logging_options()

Response structure


resp.role_arn #=> String
resp.log_level #=> String, one of "DEBUG", "INFO", "ERROR", "WARN", "DISABLED"

Returns:

#get_policy(options = {}) ⇒ Types::GetPolicyResponse

Gets information about the specified policy with the policy document of the default version.

Examples:

Request syntax with placeholder values


resp = client.get_policy({
  policy_name: "PolicyName", # required
})

Response structure


resp.policy_name #=> String
resp.policy_arn #=> String
resp.policy_document #=> String
resp.default_version_id #=> String

Options Hash (options):

  • :policy_name (required, String)

    The name of the policy.

Returns:

#get_policy_version(options = {}) ⇒ Types::GetPolicyVersionResponse

Gets information about the specified policy version.

Examples:

Request syntax with placeholder values


resp = client.get_policy_version({
  policy_name: "PolicyName", # required
  policy_version_id: "PolicyVersionId", # required
})

Response structure


resp.policy_arn #=> String
resp.policy_name #=> String
resp.policy_document #=> String
resp.policy_version_id #=> String
resp.is_default_version #=> true/false

Options Hash (options):

  • :policy_name (required, String)

    The name of the policy.

  • :policy_version_id (required, String)

    The policy version ID.

Returns:

#get_registration_code(options = {}) ⇒ Types::GetRegistrationCodeResponse

Gets a registration code used to register a CA certificate with AWS IoT.

Examples:

Request syntax with placeholder values


resp = client.get_registration_code()

Response structure


resp.registration_code #=> String

Returns:

#get_topic_rule(options = {}) ⇒ Types::GetTopicRuleResponse

Gets information about the rule.

Examples:

Request syntax with placeholder values


resp = client.get_topic_rule({
  rule_name: "RuleName", # required
})

Response structure


resp.rule_arn #=> String
resp.rule.rule_name #=> String
resp.rule.sql #=> String
resp.rule.description #=> String
resp.rule.created_at #=> Time
resp.rule.actions #=> Array
resp.rule.actions[0].dynamo_db.table_name #=> String
resp.rule.actions[0].dynamo_db.role_arn #=> String
resp.rule.actions[0].dynamo_db.operation #=> String
resp.rule.actions[0].dynamo_db.hash_key_field #=> String
resp.rule.actions[0].dynamo_db.hash_key_value #=> String
resp.rule.actions[0].dynamo_db.hash_key_type #=> String, one of "STRING", "NUMBER"
resp.rule.actions[0].dynamo_db.range_key_field #=> String
resp.rule.actions[0].dynamo_db.range_key_value #=> String
resp.rule.actions[0].dynamo_db.range_key_type #=> String, one of "STRING", "NUMBER"
resp.rule.actions[0].dynamo_db.payload_field #=> String
resp.rule.actions[0].dynamo_d_bv_2.role_arn #=> String
resp.rule.actions[0].dynamo_d_bv_2.put_item.table_name #=> String
resp.rule.actions[0].lambda.function_arn #=> String
resp.rule.actions[0].sns.target_arn #=> String
resp.rule.actions[0].sns.role_arn #=> String
resp.rule.actions[0].sns.message_format #=> String, one of "RAW", "JSON"
resp.rule.actions[0].sqs.role_arn #=> String
resp.rule.actions[0].sqs.queue_url #=> String
resp.rule.actions[0].sqs.use_base_64 #=> true/false
resp.rule.actions[0].kinesis.role_arn #=> String
resp.rule.actions[0].kinesis.stream_name #=> String
resp.rule.actions[0].kinesis.partition_key #=> String
resp.rule.actions[0].republish.role_arn #=> String
resp.rule.actions[0].republish.topic #=> String
resp.rule.actions[0].s3.role_arn #=> String
resp.rule.actions[0].s3.bucket_name #=> String
resp.rule.actions[0].s3.key #=> String
resp.rule.actions[0].s3.canned_acl #=> String, one of "private", "public-read", "public-read-write", "aws-exec-read", "authenticated-read", "bucket-owner-read", "bucket-owner-full-control", "log-delivery-write"
resp.rule.actions[0].firehose.role_arn #=> String
resp.rule.actions[0].firehose.delivery_stream_name #=> String
resp.rule.actions[0].firehose.separator #=> String
resp.rule.actions[0].cloudwatch_metric.role_arn #=> String
resp.rule.actions[0].cloudwatch_metric.metric_namespace #=> String
resp.rule.actions[0].cloudwatch_metric.metric_name #=> String
resp.rule.actions[0].cloudwatch_metric.metric_value #=> String
resp.rule.actions[0].cloudwatch_metric.metric_unit #=> String
resp.rule.actions[0].cloudwatch_metric.metric_timestamp #=> String
resp.rule.actions[0].cloudwatch_alarm.role_arn #=> String
resp.rule.actions[0].cloudwatch_alarm.alarm_name #=> String
resp.rule.actions[0].cloudwatch_alarm.state_reason #=> String
resp.rule.actions[0].cloudwatch_alarm.state_value #=> String
resp.rule.actions[0].elasticsearch.role_arn #=> String
resp.rule.actions[0].elasticsearch.endpoint #=> String
resp.rule.actions[0].elasticsearch.index #=> String
resp.rule.actions[0].elasticsearch.type #=> String
resp.rule.actions[0].elasticsearch.id #=> String
resp.rule.actions[0].salesforce.token #=> String
resp.rule.actions[0].salesforce.url #=> String
resp.rule.rule_disabled #=> true/false
resp.rule.aws_iot_sql_version #=> String
resp.rule.error_action.dynamo_db.table_name #=> String
resp.rule.error_action.dynamo_db.role_arn #=> String
resp.rule.error_action.dynamo_db.operation #=> String
resp.rule.error_action.dynamo_db.hash_key_field #=> String
resp.rule.error_action.dynamo_db.hash_key_value #=> String
resp.rule.error_action.dynamo_db.hash_key_type #=> String, one of "STRING", "NUMBER"
resp.rule.error_action.dynamo_db.range_key_field #=> String
resp.rule.error_action.dynamo_db.range_key_value #=> String
resp.rule.error_action.dynamo_db.range_key_type #=> String, one of "STRING", "NUMBER"
resp.rule.error_action.dynamo_db.payload_field #=> String
resp.rule.error_action.dynamo_d_bv_2.role_arn #=> String
resp.rule.error_action.dynamo_d_bv_2.put_item.table_name #=> String
resp.rule.error_action.lambda.function_arn #=> String
resp.rule.error_action.sns.target_arn #=> String
resp.rule.error_action.sns.role_arn #=> String
resp.rule.error_action.sns.message_format #=> String, one of "RAW", "JSON"
resp.rule.error_action.sqs.role_arn #=> String
resp.rule.error_action.sqs.queue_url #=> String
resp.rule.error_action.sqs.use_base_64 #=> true/false
resp.rule.error_action.kinesis.role_arn #=> String
resp.rule.error_action.kinesis.stream_name #=> String
resp.rule.error_action.kinesis.partition_key #=> String
resp.rule.error_action.republish.role_arn #=> String
resp.rule.error_action.republish.topic #=> String
resp.rule.error_action.s3.role_arn #=> String
resp.rule.error_action.s3.bucket_name #=> String
resp.rule.error_action.s3.key #=> String
resp.rule.error_action.s3.canned_acl #=> String, one of "private", "public-read", "public-read-write", "aws-exec-read", "authenticated-read", "bucket-owner-read", "bucket-owner-full-control", "log-delivery-write"
resp.rule.error_action.firehose.role_arn #=> String
resp.rule.error_action.firehose.delivery_stream_name #=> String
resp.rule.error_action.firehose.separator #=> String
resp.rule.error_action.cloudwatch_metric.role_arn #=> String
resp.rule.error_action.cloudwatch_metric.metric_namespace #=> String
resp.rule.error_action.cloudwatch_metric.metric_name #=> String
resp.rule.error_action.cloudwatch_metric.metric_value #=> String
resp.rule.error_action.cloudwatch_metric.metric_unit #=> String
resp.rule.error_action.cloudwatch_metric.metric_timestamp #=> String
resp.rule.error_action.cloudwatch_alarm.role_arn #=> String
resp.rule.error_action.cloudwatch_alarm.alarm_name #=> String
resp.rule.error_action.cloudwatch_alarm.state_reason #=> String
resp.rule.error_action.cloudwatch_alarm.state_value #=> String
resp.rule.error_action.elasticsearch.role_arn #=> String
resp.rule.error_action.elasticsearch.endpoint #=> String
resp.rule.error_action.elasticsearch.index #=> String
resp.rule.error_action.elasticsearch.type #=> String
resp.rule.error_action.elasticsearch.id #=> String
resp.rule.error_action.salesforce.token #=> String
resp.rule.error_action.salesforce.url #=> String

Options Hash (options):

  • :rule_name (required, String)

    The name of the rule.

Returns:

#get_v2_logging_options(options = {}) ⇒ Types::GetV2LoggingOptionsResponse

Gets the fine grained logging options.

Examples:

Request syntax with placeholder values


resp = client.get_v2_logging_options()

Response structure


resp.role_arn #=> String
resp.default_log_level #=> String, one of "DEBUG", "INFO", "ERROR", "WARN", "DISABLED"
resp.disable_all_logs #=> true/false

Returns:

#list_attached_policies(options = {}) ⇒ Types::ListAttachedPoliciesResponse

Lists the policies attached to the specified thing group.

Examples:

Request syntax with placeholder values


resp = client.list_attached_policies({
  target: "PolicyTarget", # required
  recursive: false,
  marker: "Marker",
  page_size: 1,
})

Response structure


resp.policies #=> Array
resp.policies[0].policy_name #=> String
resp.policies[0].policy_arn #=> String
resp.next_marker #=> String

Options Hash (options):

  • :target (required, String)

    The group for which the policies will be listed.

  • :recursive (Boolean)

    When true, recursively list attached policies.

  • :marker (String)

    The token to retrieve the next set of results.

  • :page_size (Integer)

    The maximum number of results to be returned per request.

Returns:

#list_authorizers(options = {}) ⇒ Types::ListAuthorizersResponse

Lists the authorizers registered in your account.

Examples:

Request syntax with placeholder values


resp = client.list_authorizers({
  page_size: 1,
  marker: "Marker",
  ascending_order: false,
  status: "ACTIVE", # accepts ACTIVE, INACTIVE
})

Response structure


resp.authorizers #=> Array
resp.authorizers[0].authorizer_name #=> String
resp.authorizers[0].authorizer_arn #=> String
resp.next_marker #=> String

Options Hash (options):

  • :page_size (Integer)

    The maximum number of results to return at one time.

  • :marker (String)

    A marker used to get the next set of results.

  • :ascending_order (Boolean)

    Return the list of authorizers in ascending alphabetical order.

  • :status (String)

    The status of the list authorizers request.

Returns:

#list_ca_certificates(options = {}) ⇒ Types::ListCACertificatesResponse

Lists the CA certificates registered for your AWS account.

The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional results.

Examples:

Request syntax with placeholder values


resp = client.list_ca_certificates({
  page_size: 1,
  marker: "Marker",
  ascending_order: false,
})

Response structure


resp.certificates #=> Array
resp.certificates[0].certificate_arn #=> String
resp.certificates[0].certificate_id #=> String
resp.certificates[0].status #=> String, one of "ACTIVE", "INACTIVE"
resp.certificates[0].creation_date #=> Time
resp.next_marker #=> String

Options Hash (options):

  • :page_size (Integer)

    The result page size.

  • :marker (String)

    The marker for the next set of results.

  • :ascending_order (Boolean)

    Determines the order of the results.

Returns:

#list_certificates(options = {}) ⇒ Types::ListCertificatesResponse

Lists the certificates registered in your AWS account.

The results are paginated with a default page size of 25. You can use the returned marker to retrieve additional results.

Examples:

Request syntax with placeholder values


resp = client.list_certificates({
  page_size: 1,
  marker: "Marker",
  ascending_order: false,
})

Response structure


resp.certificates #=> Array
resp.certificates[0].certificate_arn #=> String
resp.certificates[0].certificate_id #=> String
resp.certificates[0].status #=> String, one of "ACTIVE", "INACTIVE", "REVOKED", "PENDING_TRANSFER", "REGISTER_INACTIVE", "PENDING_ACTIVATION"
resp.certificates[0].creation_date #=> Time
resp.next_marker #=> String

Options Hash (options):

  • :page_size (Integer)

    The result page size.

  • :marker (String)

    The marker for the next set of results.

  • :ascending_order (Boolean)

    Specifies the order for results. If True, the results are returned in ascending order, based on the creation date.

Returns:

#list_certificates_by_ca(options = {}) ⇒ Types::ListCertificatesByCAResponse

List the device certificates signed by the specified CA certificate.

Examples:

Request syntax with placeholder values


resp = client.list_certificates_by_ca({
  ca_certificate_id: "CertificateId", # required
  page_size: 1,
  marker: "Marker",
  ascending_order: false,
})

Response structure


resp.certificates #=> Array
resp.certificates[0].certificate_arn #=> String
resp.certificates[0].certificate_id #=> String
resp.certificates[0].status #=> String, one of "ACTIVE", "INACTIVE", "REVOKED", "PENDING_TRANSFER", "REGISTER_INACTIVE", "PENDING_ACTIVATION"
resp.certificates[0].creation_date #=> Time
resp.next_marker #=> String

Options Hash (options):

  • :ca_certificate_id (required, String)

    The ID of the CA certificate. This operation will list all registered device certificate that were signed by this CA certificate.

  • :page_size (Integer)

    The result page size.

  • :marker (String)

    The marker for the next set of results.

  • :ascending_order (Boolean)

    Specifies the order for results. If True, the results are returned in ascending order, based on the creation date.

Returns:

#list_indices(options = {}) ⇒ Types::ListIndicesResponse

Lists the search indices.

Examples:

Request syntax with placeholder values


resp = client.list_indices({
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.index_names #=> Array
resp.index_names[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The token used to get the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return at one time.

Returns:

#list_job_executions_for_job(options = {}) ⇒ Types::ListJobExecutionsForJobResponse

Lists the job executions for a job.

Examples:

Request syntax with placeholder values


resp = client.list_job_executions_for_job({
  job_id: "JobId", # required
  status: "QUEUED", # accepts QUEUED, IN_PROGRESS, SUCCEEDED, FAILED, REJECTED, REMOVED, CANCELED
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.execution_summaries #=> Array
resp.execution_summaries[0].thing_arn #=> String
resp.execution_summaries[0].job_execution_summary.status #=> String, one of "QUEUED", "IN_PROGRESS", "SUCCEEDED", "FAILED", "REJECTED", "REMOVED", "CANCELED"
resp.execution_summaries[0].job_execution_summary.queued_at #=> Time
resp.execution_summaries[0].job_execution_summary.started_at #=> Time
resp.execution_summaries[0].job_execution_summary.last_updated_at #=> Time
resp.execution_summaries[0].job_execution_summary.execution_number #=> Integer
resp.next_token #=> String

Options Hash (options):

  • :job_id (required, String)

    The unique identifier you assigned to this job when it was created.

  • :status (String)

    The status of the job.

  • :max_results (Integer)

    The maximum number of results to be returned per request.

  • :next_token (String)

    The token to retrieve the next set of results.

Returns:

#list_job_executions_for_thing(options = {}) ⇒ Types::ListJobExecutionsForThingResponse

Lists the job executions for the specified thing.

Examples:

Request syntax with placeholder values


resp = client.list_job_executions_for_thing({
  thing_name: "ThingName", # required
  status: "QUEUED", # accepts QUEUED, IN_PROGRESS, SUCCEEDED, FAILED, REJECTED, REMOVED, CANCELED
  max_results: 1,
  next_token: "NextToken",
})

Response structure


resp.execution_summaries #=> Array
resp.execution_summaries[0].job_id #=> String
resp.execution_summaries[0].job_execution_summary.status #=> String, one of "QUEUED", "IN_PROGRESS", "SUCCEEDED", "FAILED", "REJECTED", "REMOVED", "CANCELED"
resp.execution_summaries[0].job_execution_summary.queued_at #=> Time
resp.execution_summaries[0].job_execution_summary.started_at #=> Time
resp.execution_summaries[0].job_execution_summary.last_updated_at #=> Time
resp.execution_summaries[0].job_execution_summary.execution_number #=> Integer
resp.next_token #=> String

Options Hash (options):

  • :thing_name (required, String)

    The thing name.

  • :status (String)

    An optional filter that lets you search for jobs that have the specified status.

  • :max_results (Integer)

    The maximum number of results to be returned per request.

  • :next_token (String)

    The token to retrieve the next set of results.

Returns:

#list_jobs(options = {}) ⇒ Types::ListJobsResponse

Lists jobs.

Examples:

Request syntax with placeholder values


resp = client.list_jobs({
  status: "IN_PROGRESS", # accepts IN_PROGRESS, CANCELED, COMPLETED
  target_selection: "CONTINUOUS", # accepts CONTINUOUS, SNAPSHOT
  max_results: 1,
  next_token: "NextToken",
  thing_group_name: "ThingGroupName",
  thing_group_id: "ThingGroupId",
})

Response structure


resp.jobs #=> Array
resp.jobs[0].job_arn #=> String
resp.jobs[0].job_id #=> String
resp.jobs[0].thing_group_id #=> String
resp.jobs[0].target_selection #=> String, one of "CONTINUOUS", "SNAPSHOT"
resp.jobs[0].status #=> String, one of "IN_PROGRESS", "CANCELED", "COMPLETED"
resp.jobs[0].created_at #=> Time
resp.jobs[0].last_updated_at #=> Time
resp.jobs[0].completed_at #=> Time
resp.next_token #=> String

Options Hash (options):

  • :status (String)

    An optional filter that lets you search for jobs that have the specified status.

  • :target_selection (String)

    Specifies whether the job will continue to run (CONTINUOUS), or will be complete after all those things specified as targets have completed the job (SNAPSHOT). If continuous, the job may also be run on a thing when a change is detected in a target. For example, a job will run on a thing when the thing is added to a target group, even after the job was completed by all things originally in the group.

  • :max_results (Integer)

    The maximum number of results to return per request.

  • :next_token (String)

    The token to retrieve the next set of results.

  • :thing_group_name (String)

    A filter that limits the returned jobs to those for the specified group.

  • :thing_group_id (String)

    A filter that limits the returned jobs to those for the specified group.

Returns:

#list_outgoing_certificates(options = {}) ⇒ Types::ListOutgoingCertificatesResponse

Lists certificates that are being transferred but not yet accepted.

Examples:

Request syntax with placeholder values


resp = client.list_outgoing_certificates({
  page_size: 1,
  marker: "Marker",
  ascending_order: false,
})

Response structure


resp.outgoing_certificates #=> Array
resp.outgoing_certificates[0].certificate_arn #=> String
resp.outgoing_certificates[0].certificate_id #=> String
resp.outgoing_certificates[0].transferred_to #=> String
resp.outgoing_certificates[0].transfer_date #=> Time
resp.outgoing_certificates[0].transfer_message #=> String
resp.outgoing_certificates[0].creation_date #=> Time
resp.next_marker #=> String

Options Hash (options):

  • :page_size (Integer)

    The result page size.

  • :marker (String)

    The marker for the next set of results.

  • :ascending_order (Boolean)

    Specifies the order for results. If True, the results are returned in ascending order, based on the creation date.

Returns:

#list_policies(options = {}) ⇒ Types::ListPoliciesResponse

Lists your policies.

Examples:

Request syntax with placeholder values


resp = client.list_policies({
  marker: "Marker",
  page_size: 1,
  ascending_order: false,
})

Response structure


resp.policies #=> Array
resp.policies[0].policy_name #=> String
resp.policies[0].policy_arn #=> String
resp.next_marker #=> String

Options Hash (options):

  • :marker (String)

    The marker for the next set of results.

  • :page_size (Integer)

    The result page size.

  • :ascending_order (Boolean)

    Specifies the order for results. If true, the results are returned in ascending creation order.

Returns:

#list_policy_principals(options = {}) ⇒ Types::ListPolicyPrincipalsResponse

Lists the principals associated with the specified policy.

Note: This API is deprecated. Please use ListTargetsForPolicy instead.

Examples:

Request syntax with placeholder values


resp = client.list_policy_principals({
  policy_name: "PolicyName", # required
  marker: "Marker",
  page_size: 1,
  ascending_order: false,
})

Response structure


resp.principals #=> Array
resp.principals[0] #=> String
resp.next_marker #=> String

Options Hash (options):

  • :policy_name (required, String)

    The policy name.

  • :marker (String)

    The marker for the next set of results.

  • :page_size (Integer)

    The result page size.

  • :ascending_order (Boolean)

    Specifies the order for results. If true, the results are returned in ascending creation order.

Returns:

#list_policy_versions(options = {}) ⇒ Types::ListPolicyVersionsResponse

Lists the versions of the specified policy and identifies the default version.

Examples:

Request syntax with placeholder values


resp = client.list_policy_versions({
  policy_name: "PolicyName", # required
})

Response structure


resp.policy_versions #=> Array
resp.policy_versions[0].version_id #=> String
resp.policy_versions[0].is_default_version #=> true/false
resp.policy_versions[0].create_date #=> Time

Options Hash (options):

  • :policy_name (required, String)

    The policy name.

Returns:

#list_principal_policies(options = {}) ⇒ Types::ListPrincipalPoliciesResponse

Lists the policies attached to the specified principal. If you use an Cognito identity, the ID must be in AmazonCognito Identity format.

Note: This API is deprecated. Please use ListAttachedPolicies instead.

Examples:

Request syntax with placeholder values


resp = client.list_principal_policies({
  principal: "Principal", # required
  marker: "Marker",
  page_size: 1,
  ascending_order: false,
})

Response structure


resp.policies #=> Array
resp.policies[0].policy_name #=> String
resp.policies[0].policy_arn #=> String
resp.next_marker #=> String

Options Hash (options):

  • :principal (required, String)

    The principal.

  • :marker (String)

    The marker for the next set of results.

  • :page_size (Integer)

    The result page size.

  • :ascending_order (Boolean)

    Specifies the order for results. If true, results are returned in ascending creation order.

Returns:

#list_principal_things(options = {}) ⇒ Types::ListPrincipalThingsResponse

Lists the things associated with the specified principal.

Examples:

Request syntax with placeholder values


resp = client.list_principal_things({
  next_token: "NextToken",
  max_results: 1,
  principal: "Principal", # required
})

Response structure


resp.things #=> Array
resp.things[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The token used to get the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return in this operation.

  • :principal (required, String)

    The principal.

Returns:

#list_role_aliases(options = {}) ⇒ Types::ListRoleAliasesResponse

Lists the role aliases registered in your account.

Examples:

Request syntax with placeholder values


resp = client.list_role_aliases({
  page_size: 1,
  marker: "Marker",
  ascending_order: false,
})

Response structure


resp.role_aliases #=> Array
resp.role_aliases[0] #=> String
resp.next_marker #=> String

Options Hash (options):

  • :page_size (Integer)

    The maximum number of results to return at one time.

  • :marker (String)

    A marker used to get the next set of results.

  • :ascending_order (Boolean)

    Return the list of role aliases in ascending alphabetical order.

Returns:

#list_targets_for_policy(options = {}) ⇒ Types::ListTargetsForPolicyResponse

List targets for the specified policy.

Examples:

Request syntax with placeholder values


resp = client.list_targets_for_policy({
  policy_name: "PolicyName", # required
  marker: "Marker",
  page_size: 1,
})

Response structure


resp.targets #=> Array
resp.targets[0] #=> String
resp.next_marker #=> String

Options Hash (options):

  • :policy_name (required, String)

    The policy name.

  • :marker (String)

    A marker used to get the next set of results.

  • :page_size (Integer)

    The maximum number of results to return at one time.

Returns:

#list_thing_groups(options = {}) ⇒ Types::ListThingGroupsResponse

List the thing groups in your account.

Examples:

Request syntax with placeholder values


resp = client.list_thing_groups({
  next_token: "NextToken",
  max_results: 1,
  parent_group: "ThingGroupName",
  name_prefix_filter: "ThingGroupName",
  recursive: false,
})

Response structure


resp.thing_groups #=> Array
resp.thing_groups[0].group_name #=> String
resp.thing_groups[0].group_arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The token used to get the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return at one time.

  • :parent_group (String)

    A filter that limits the results to those with the specified parent group.

  • :name_prefix_filter (String)

    A filter that limits the results to those with the specified name prefix.

  • :recursive (Boolean)

    If true, return child groups as well.

Returns:

#list_thing_groups_for_thing(options = {}) ⇒ Types::ListThingGroupsForThingResponse

List the thing groups to which the specified thing belongs.

Examples:

Request syntax with placeholder values


resp = client.list_thing_groups_for_thing({
  thing_name: "ThingName", # required
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.thing_groups #=> Array
resp.thing_groups[0].group_name #=> String
resp.thing_groups[0].group_arn #=> String
resp.next_token #=> String

Options Hash (options):

  • :thing_name (required, String)

    The thing name.

  • :next_token (String)

    The token used to get the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return at one time.

Returns:

#list_thing_principals(options = {}) ⇒ Types::ListThingPrincipalsResponse

Lists the principals associated with the specified thing.

Examples:

Request syntax with placeholder values


resp = client.list_thing_principals({
  thing_name: "ThingName", # required
})

Response structure


resp.principals #=> Array
resp.principals[0] #=> String

Options Hash (options):

  • :thing_name (required, String)

    The name of the thing.

Returns:

#list_thing_registration_task_reports(options = {}) ⇒ Types::ListThingRegistrationTaskReportsResponse

Information about the thing registration tasks.

Examples:

Request syntax with placeholder values


resp = client.list_thing_registration_task_reports({
  task_id: "TaskId", # required
  report_type: "ERRORS", # required, accepts ERRORS, RESULTS
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.resource_links #=> Array
resp.resource_links[0] #=> String
resp.report_type #=> String, one of "ERRORS", "RESULTS"
resp.next_token #=> String

Options Hash (options):

  • :task_id (required, String)

    The id of the task.

  • :report_type (required, String)

    The type of task report.

  • :next_token (String)

    The token to retrieve the next set of results.

  • :max_results (Integer)

    The maximum number of results to return per request.

Returns:

#list_thing_registration_tasks(options = {}) ⇒ Types::ListThingRegistrationTasksResponse

List bulk thing provisioning tasks.

Examples:

Request syntax with placeholder values


resp = client.list_thing_registration_tasks({
  next_token: "NextToken",
  max_results: 1,
  status: "InProgress", # accepts InProgress, Completed, Failed, Cancelled, Cancelling
})

Response structure


resp.task_ids #=> Array
resp.task_ids[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The token used to get the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return at one time.

  • :status (String)

    The status of the bulk thing provisioning task.

Returns:

#list_thing_types(options = {}) ⇒ Types::ListThingTypesResponse

Lists the existing thing types.

Examples:

Request syntax with placeholder values


resp = client.list_thing_types({
  next_token: "NextToken",
  max_results: 1,
  thing_type_name: "ThingTypeName",
})

Response structure


resp.thing_types #=> Array
resp.thing_types[0].thing_type_name #=> String
resp.thing_types[0].thing_type_arn #=> String
resp.thing_types[0].thing_type_properties.thing_type_description #=> String
resp.thing_types[0].thing_type_properties.searchable_attributes #=> Array
resp.thing_types[0].thing_type_properties.searchable_attributes[0] #=> String
resp.thing_types[0]..deprecated #=> true/false
resp.thing_types[0]..deprecation_date #=> Time
resp.thing_types[0]..creation_date #=> Time
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The token for the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return in this operation.

  • :thing_type_name (String)

    The name of the thing type.

Returns:

#list_things(options = {}) ⇒ Types::ListThingsResponse

Lists your things. Use the attributeName and attributeValue parameters to filter your things. For example, calling ListThings with attributeName=Color and attributeValue=Red retrieves all things in the registry that contain an attribute Color with the value Red.

Examples:

Request syntax with placeholder values


resp = client.list_things({
  next_token: "NextToken",
  max_results: 1,
  attribute_name: "AttributeName",
  attribute_value: "AttributeValue",
  thing_type_name: "ThingTypeName",
})

Response structure


resp.things #=> Array
resp.things[0].thing_name #=> String
resp.things[0].thing_type_name #=> String
resp.things[0].thing_arn #=> String
resp.things[0].attributes #=> Hash
resp.things[0].attributes["AttributeName"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.things[0].version #=> Integer
resp.next_token #=> String

Options Hash (options):

  • :next_token (String)

    The token used to get the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return in this operation.

  • :attribute_name (String)

    The attribute name used to search for things.

  • :attribute_value (String)

    The attribute value used to search for things.

  • :thing_type_name (String)

    The name of the thing type used to search for things.

Returns:

#list_things_in_thing_group(options = {}) ⇒ Types::ListThingsInThingGroupResponse

Lists the things in the specified group.

Examples:

Request syntax with placeholder values


resp = client.list_things_in_thing_group({
  thing_group_name: "ThingGroupName", # required
  recursive: false,
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.things #=> Array
resp.things[0] #=> String
resp.next_token #=> String

Options Hash (options):

  • :thing_group_name (required, String)

    The thing group name.

  • :recursive (Boolean)

    When true, list things in this thing group and in all child groups as well.

  • :next_token (String)

    The token used to get the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return at one time.

Returns:

#list_topic_rules(options = {}) ⇒ Types::ListTopicRulesResponse

Lists the rules for the specific topic.

Examples:

Request syntax with placeholder values


resp = client.list_topic_rules({
  topic: "Topic",
  max_results: 1,
  next_token: "NextToken",
  rule_disabled: false,
})

Response structure


resp.rules #=> Array
resp.rules[0].rule_arn #=> String
resp.rules[0].rule_name #=> String
resp.rules[0].topic_pattern #=> String
resp.rules[0].created_at #=> Time
resp.rules[0].rule_disabled #=> true/false
resp.next_token #=> String

Options Hash (options):

  • :topic (String)

    The topic.

  • :max_results (Integer)

    The maximum number of results to return.

  • :next_token (String)

    A token used to retrieve the next value.

  • :rule_disabled (Boolean)

    Specifies whether the rule is disabled.

Returns:

#list_v2_logging_levels(options = {}) ⇒ Types::ListV2LoggingLevelsResponse

Lists logging levels.

Examples:

Request syntax with placeholder values


resp = client.list_v2_logging_levels({
  target_type: "DEFAULT", # accepts DEFAULT, THING_GROUP
  next_token: "NextToken",
  max_results: 1,
})

Response structure


resp.log_target_configurations #=> Array
resp.log_target_configurations[0].log_target.target_type #=> String, one of "DEFAULT", "THING_GROUP"
resp.log_target_configurations[0].log_target.target_name #=> String
resp.log_target_configurations[0].log_level #=> String, one of "DEBUG", "INFO", "ERROR", "WARN", "DISABLED"
resp.next_token #=> String

Options Hash (options):

  • :target_type (String)

    The type of resource for which you are configuring logging. Must be THING_Group.

  • :next_token (String)

    The token used to get the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return at one time.

Returns:

#register_ca_certificate(options = {}) ⇒ Types::RegisterCACertificateResponse

Registers a CA certificate with AWS IoT. This CA certificate can then be used to sign device certificates, which can be then registered with AWS IoT. You can register up to 10 CA certificates per AWS account that have the same subject field. This enables you to have up to 10 certificate authorities sign your device certificates. If you have more than one CA certificate registered, make sure you pass the CA certificate when you register your device certificates with the RegisterCertificate API.

Examples:

Request syntax with placeholder values


resp = client.register_ca_certificate({
  ca_certificate: "CertificatePem", # required
  verification_certificate: "CertificatePem", # required
  set_as_active: false,
  allow_auto_registration: false,
  registration_config: {
    template_body: "TemplateBody",
    role_arn: "RoleArn",
  },
})

Response structure


resp.certificate_arn #=> String
resp.certificate_id #=> String

Options Hash (options):

  • :ca_certificate (required, String)

    The CA certificate.

  • :verification_certificate (required, String)

    The private key verification certificate.

  • :set_as_active (Boolean)

    A boolean value that specifies if the CA certificate is set to active.

  • :allow_auto_registration (Boolean)

    Allows this CA certificate to be used for auto registration of device certificates.

  • :registration_config (Types::RegistrationConfig)

    Information about the registration configuration.

Returns:

#register_certificate(options = {}) ⇒ Types::RegisterCertificateResponse

Registers a device certificate with AWS IoT. If you have more than one CA certificate that has the same subject field, you must specify the CA certificate that was used to sign the device certificate being registered.

Examples:

Request syntax with placeholder values


resp = client.register_certificate({
  certificate_pem: "CertificatePem", # required
  ca_certificate_pem: "CertificatePem",
  set_as_active: false,
  status: "ACTIVE", # accepts ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, REGISTER_INACTIVE, PENDING_ACTIVATION
})

Response structure


resp.certificate_arn #=> String
resp.certificate_id #=> String

Options Hash (options):

  • :certificate_pem (required, String)

    The certificate data, in PEM format.

  • :ca_certificate_pem (String)

    The CA certificate used to sign the device certificate being registered.

  • :set_as_active (Boolean)

    A boolean value that specifies if the CA certificate is set to active.

  • :status (String)

    The status of the register certificate request.

Returns:

#register_thing(options = {}) ⇒ Types::RegisterThingResponse

Provisions a thing.

Examples:

Request syntax with placeholder values


resp = client.register_thing({
  template_body: "TemplateBody", # required
  parameters: {
    "Parameter" => "Value",
  },
})

Response structure


resp.certificate_pem #=> String
resp.resource_arns #=> Hash
resp.resource_arns["ResourceLogicalId"] #=> String

Options Hash (options):

  • :template_body (required, String)

    The provisioning template.

  • :parameters (Hash<String,String>)

    The parameters for provisioning a thing.

Returns:

#reject_certificate_transfer(options = {}) ⇒ Struct

Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, the certificate status changes from PENDING_TRANSFER to INACTIVE.

To check for pending certificate transfers, call ListCertificates to enumerate your certificates.

This operation can only be called by the transfer destination. After it is called, the certificate will be returned to the source's account in the INACTIVE state.

Examples:

Request syntax with placeholder values


resp = client.reject_certificate_transfer({
  certificate_id: "CertificateId", # required
  reject_reason: "Message",
})

Options Hash (options):

  • :certificate_id (required, String)

    The ID of the certificate.

  • :reject_reason (String)

    The reason the certificate transfer was rejected.

Returns:

  • (Struct)

    Returns an empty response.

#remove_thing_from_thing_group(options = {}) ⇒ Struct

Remove the specified thing from the specified group.

Examples:

Request syntax with placeholder values


resp = client.remove_thing_from_thing_group({
  thing_group_name: "ThingGroupName",
  thing_group_arn: "ThingGroupArn",
  thing_name: "ThingName",
  thing_arn: "ThingArn",
})

Options Hash (options):

  • :thing_group_name (String)

    The group name.

  • :thing_group_arn (String)

    The group ARN.

  • :thing_name (String)

    The name of the thing to remove from the group.

  • :thing_arn (String)

    The ARN of the thing to remove from the group.

Returns:

  • (Struct)

    Returns an empty response.

#replace_topic_rule(options = {}) ⇒ Struct

Replaces the rule. You must specify all parameters for the new rule. Creating rules is an administrator-level action. Any user who has permission to create rules will be able to access data processed by the rule.

Examples:

Request syntax with placeholder values


resp = client.replace_topic_rule({
  rule_name: "RuleName", # required
  topic_rule_payload: { # required
    sql: "SQL", # required
    description: "Description",
    actions: [ # required
      {
        dynamo_db: {
          table_name: "TableName", # required
          role_arn: "AwsArn", # required
          operation: "DynamoOperation",
          hash_key_field: "HashKeyField", # required
          hash_key_value: "HashKeyValue", # required
          hash_key_type: "STRING", # accepts STRING, NUMBER
          range_key_field: "RangeKeyField",
          range_key_value: "RangeKeyValue",
          range_key_type: "STRING", # accepts STRING, NUMBER
          payload_field: "PayloadField",
        },
        dynamo_d_bv_2: {
          role_arn: "AwsArn",
          put_item: {
            table_name: "TableName", # required
          },
        },
        lambda: {
          function_arn: "FunctionArn", # required
        },
        sns: {
          target_arn: "AwsArn", # required
          role_arn: "AwsArn", # required
          message_format: "RAW", # accepts RAW, JSON
        },
        sqs: {
          role_arn: "AwsArn", # required
          queue_url: "QueueUrl", # required
          use_base_64: false,
        },
        kinesis: {
          role_arn: "AwsArn", # required
          stream_name: "StreamName", # required
          partition_key: "PartitionKey",
        },
        republish: {
          role_arn: "AwsArn", # required
          topic: "TopicPattern", # required
        },
        s3: {
          role_arn: "AwsArn", # required
          bucket_name: "BucketName", # required
          key: "Key", # required
          canned_acl: "private", # accepts private, public-read, public-read-write, aws-exec-read, authenticated-read, bucket-owner-read, bucket-owner-full-control, log-delivery-write
        },
        firehose: {
          role_arn: "AwsArn", # required
          delivery_stream_name: "DeliveryStreamName", # required
          separator: "FirehoseSeparator",
        },
        cloudwatch_metric: {
          role_arn: "AwsArn", # required
          metric_namespace: "MetricNamespace", # required
          metric_name: "MetricName", # required
          metric_value: "MetricValue", # required
          metric_unit: "MetricUnit", # required
          metric_timestamp: "MetricTimestamp",
        },
        cloudwatch_alarm: {
          role_arn: "AwsArn", # required
          alarm_name: "AlarmName", # required
          state_reason: "StateReason", # required
          state_value: "StateValue", # required
        },
        elasticsearch: {
          role_arn: "AwsArn", # required
          endpoint: "ElasticsearchEndpoint", # required
          index: "ElasticsearchIndex", # required
          type: "ElasticsearchType", # required
          id: "ElasticsearchId", # required
        },
        salesforce: {
          token: "SalesforceToken", # required
          url: "SalesforceEndpoint", # required
        },
      },
    ],
    rule_disabled: false,
    aws_iot_sql_version: "AwsIotSqlVersion",
    error_action: {
      dynamo_db: {
        table_name: "TableName", # required
        role_arn: "AwsArn", # required
        operation: "DynamoOperation",
        hash_key_field: "HashKeyField", # required
        hash_key_value: "HashKeyValue", # required
        hash_key_type: "STRING", # accepts STRING, NUMBER
        range_key_field: "RangeKeyField",
        range_key_value: "RangeKeyValue",
        range_key_type: "STRING", # accepts STRING, NUMBER
        payload_field: "PayloadField",
      },
      dynamo_d_bv_2: {
        role_arn: "AwsArn",
        put_item: {
          table_name: "TableName", # required
        },
      },
      lambda: {
        function_arn: "FunctionArn", # required
      },
      sns: {
        target_arn: "AwsArn", # required
        role_arn: "AwsArn", # required
        message_format: "RAW", # accepts RAW, JSON
      },
      sqs: {
        role_arn: "AwsArn", # required
        queue_url: "QueueUrl", # required
        use_base_64: false,
      },
      kinesis: {
        role_arn: "AwsArn", # required
        stream_name: "StreamName", # required
        partition_key: "PartitionKey",
      },
      republish: {
        role_arn: "AwsArn", # required
        topic: "TopicPattern", # required
      },
      s3: {
        role_arn: "AwsArn", # required
        bucket_name: "BucketName", # required
        key: "Key", # required
        canned_acl: "private", # accepts private, public-read, public-read-write, aws-exec-read, authenticated-read, bucket-owner-read, bucket-owner-full-control, log-delivery-write
      },
      firehose: {
        role_arn: "AwsArn", # required
        delivery_stream_name: "DeliveryStreamName", # required
        separator: "FirehoseSeparator",
      },
      cloudwatch_metric: {
        role_arn: "AwsArn", # required
        metric_namespace: "MetricNamespace", # required
        metric_name: "MetricName", # required
        metric_value: "MetricValue", # required
        metric_unit: "MetricUnit", # required
        metric_timestamp: "MetricTimestamp",
      },
      cloudwatch_alarm: {
        role_arn: "AwsArn", # required
        alarm_name: "AlarmName", # required
        state_reason: "StateReason", # required
        state_value: "StateValue", # required
      },
      elasticsearch: {
        role_arn: "AwsArn", # required
        endpoint: "ElasticsearchEndpoint", # required
        index: "ElasticsearchIndex", # required
        type: "ElasticsearchType", # required
        id: "ElasticsearchId", # required
      },
      salesforce: {
        token: "SalesforceToken", # required
        url: "SalesforceEndpoint", # required
      },
    },
  },
})

Options Hash (options):

  • :rule_name (required, String)

    The name of the rule.

  • :topic_rule_payload (required, Types::TopicRulePayload)

    The rule payload.

Returns:

  • (Struct)

    Returns an empty response.

#search_index(options = {}) ⇒ Types::SearchIndexResponse

The query search index.

Examples:

Request syntax with placeholder values


resp = client.search_index({
  index_name: "IndexName",
  query_string: "QueryString", # required
  next_token: "NextToken",
  max_results: 1,
  query_version: "QueryVersion",
})

Response structure


resp.next_token #=> String
resp.things #=> Array
resp.things[0].thing_name #=> String
resp.things[0].thing_id #=> String
resp.things[0].thing_type_name #=> String
resp.things[0].thing_group_names #=> Array
resp.things[0].thing_group_names[0] #=> String
resp.things[0].attributes #=> Hash
resp.things[0].attributes["AttributeName"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.things[0].shadow #=> String

Options Hash (options):

  • :index_name (String)

    The search index name.

  • :query_string (required, String)

    The search query string.

  • :next_token (String)

    The token used to get the next set of results, or null if there are no additional results.

  • :max_results (Integer)

    The maximum number of results to return at one time.

  • :query_version (String)

    The query version.

Returns:

#set_default_authorizer(options = {}) ⇒ Types::SetDefaultAuthorizerResponse

Sets the default authorizer. This will be used if a websocket connection is made without specifying an authorizer.

Examples:

Request syntax with placeholder values


resp = client.set_default_authorizer({
  authorizer_name: "AuthorizerName", # required
})

Response structure


resp.authorizer_name #=> String
resp.authorizer_arn #=> String

Options Hash (options):

  • :authorizer_name (required, String)

    The authorizer name.

Returns:

#set_default_policy_version(options = {}) ⇒ Struct

Sets the specified version of the specified policy as the policy's default (operative) version. This action affects all certificates to which the policy is attached. To list the principals the policy is attached to, use the ListPrincipalPolicy API.

Examples:

Request syntax with placeholder values


resp = client.set_default_policy_version({
  policy_name: "PolicyName", # required
  policy_version_id: "PolicyVersionId", # required
})

Options Hash (options):

  • :policy_name (required, String)

    The policy name.

  • :policy_version_id (required, String)

    The policy version ID.

Returns:

  • (Struct)

    Returns an empty response.

#set_logging_options(options = {}) ⇒ Struct

Sets the logging options.

Examples:

Request syntax with placeholder values


resp = client.set_logging_options({
  logging_options_payload: { # required
    role_arn: "AwsArn", # required
    log_level: "DEBUG", # accepts DEBUG, INFO, ERROR, WARN, DISABLED
  },
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

#set_v2_logging_level(options = {}) ⇒ Struct

Sets the logging level.

Examples:

Request syntax with placeholder values


resp = client.set_v2_logging_level({
  log_target: { # required
    target_type: "DEFAULT", # required, accepts DEFAULT, THING_GROUP
    target_name: "LogTargetName",
  },
  log_level: "DEBUG", # required, accepts DEBUG, INFO, ERROR, WARN, DISABLED
})

Options Hash (options):

  • :log_target (required, Types::LogTarget)

    The log target.

  • :log_level (required, String)

    The log level.

Returns:

  • (Struct)

    Returns an empty response.

#set_v2_logging_options(options = {}) ⇒ Struct

Sets the logging options for the V2 logging service.

Examples:

Request syntax with placeholder values


resp = client.set_v2_logging_options({
  role_arn: "AwsArn",
  default_log_level: "DEBUG", # accepts DEBUG, INFO, ERROR, WARN, DISABLED
  disable_all_logs: false,
})

Options Hash (options):

  • :role_arn (String)

    The role ARN that allows IoT to write to Cloudwatch logs.

  • :default_log_level (String)

    The default logging level.

  • :disable_all_logs (Boolean)

    Set to true to disable all logs, otherwise set to false.

Returns:

  • (Struct)

    Returns an empty response.

#start_thing_registration_task(options = {}) ⇒ Types::StartThingRegistrationTaskResponse

Creates a bulk thing provisioning task.

Examples:

Request syntax with placeholder values


resp = client.start_thing_registration_task({
  template_body: "TemplateBody", # required
  input_file_bucket: "RegistryS3BucketName", # required
  input_file_key: "RegistryS3KeyName", # required
  role_arn: "RoleArn", # required
})

Response structure


resp.task_id #=> String

Options Hash (options):

  • :template_body (required, String)

    The provisioning template.

  • :input_file_bucket (required, String)

    The S3 bucket that contains the input file.

  • :input_file_key (required, String)

    The name of input file within the S3 bucket. This file contains a newline delimited JSON file. Each line contains the parameter values to provision one device (thing).

  • :role_arn (required, String)

    The IAM role ARN that grants permission the input file.

Returns:

#stop_thing_registration_task(options = {}) ⇒ Struct

Cancels a bulk thing provisioning task.

Examples:

Request syntax with placeholder values


resp = client.stop_thing_registration_task({
  task_id: "TaskId", # required
})

Options Hash (options):

  • :task_id (required, String)

    The bulk thing provisioning task ID.

Returns:

  • (Struct)

    Returns an empty response.

#test_authorization(options = {}) ⇒ Types::TestAuthorizationResponse

Test custom authorization.

Examples:

Request syntax with placeholder values


resp = client.test_authorization({
  principal: "Principal",
  cognito_identity_pool_id: "CognitoIdentityPoolId",
  auth_infos: [ # required
    {
      action_type: "PUBLISH", # accepts PUBLISH, SUBSCRIBE, RECEIVE, CONNECT
      resources: ["Resource"],
    },
  ],
  client_id: "ClientId",
  policy_names_to_add: ["PolicyName"],
  policy_names_to_skip: ["PolicyName"],
})

Response structure


resp.auth_results #=> Array
resp.auth_results[0].auth_info.action_type #=> String, one of "PUBLISH", "SUBSCRIBE", "RECEIVE", "CONNECT"
resp.auth_results[0].auth_info.resources #=> Array
resp.auth_results[0].auth_info.resources[0] #=> String
resp.auth_results[0].allowed.policies #=> Array
resp.auth_results[0].allowed.policies[0].policy_name #=> String
resp.auth_results[0].allowed.policies[0].policy_arn #=> String
resp.auth_results[0].denied.implicit_deny.policies #=> Array
resp.auth_results[0].denied.implicit_deny.policies[0].policy_name #=> String
resp.auth_results[0].denied.implicit_deny.policies[0].policy_arn #=> String
resp.auth_results[0].denied.explicit_deny.policies #=> Array
resp.auth_results[0].denied.explicit_deny.policies[0].policy_name #=> String
resp.auth_results[0].denied.explicit_deny.policies[0].policy_arn #=> String
resp.auth_results[0].auth_decision #=> String, one of "ALLOWED", "EXPLICIT_DENY", "IMPLICIT_DENY"
resp.auth_results[0].missing_context_values #=> Array
resp.auth_results[0].missing_context_values[0] #=> String

Options Hash (options):

  • :principal (String)

    The principal.

  • :cognito_identity_pool_id (String)

    The Cognito identity pool ID.

  • :auth_infos (required, Array<Types::AuthInfo>)

    A list of authorization info objects. Simulating authorization will create a response for each authInfo object in the list.

  • :client_id (String)

    The MQTT client ID.

  • :policy_names_to_add (Array<String>)

    When testing custom authorization, the policies specified here are treated as if they are attached to the principal being authorized.

  • :policy_names_to_skip (Array<String>)

    When testing custom authorization, the policies specified here are treated as if they are not attached to the principal being authorized.

Returns:

#test_invoke_authorizer(options = {}) ⇒ Types::TestInvokeAuthorizerResponse

Invoke the specified custom authorizer for testing purposes.

Examples:

Request syntax with placeholder values


resp = client.test_invoke_authorizer({
  authorizer_name: "AuthorizerName", # required
  token: "Token", # required
  token_signature: "TokenSignature", # required
})

Response structure


resp.is_authenticated #=> true/false
resp.principal_id #=> String
resp.policy_documents #=> Array
resp.policy_documents[0] #=> String
resp.refresh_after_in_seconds #=> Integer
resp.disconnect_after_in_seconds #=> Integer

Options Hash (options):

  • :authorizer_name (required, String)

    The custom authorizer name.

  • :token (required, String)

    The token returned by your custom authentication service.

  • :token_signature (required, String)

    The signature made with the token and your custom authentication service\'s private key.

Returns:

#transfer_certificate(options = {}) ⇒ Types::TransferCertificateResponse

Transfers the specified certificate to the specified AWS account.

You can cancel the transfer until it is acknowledged by the recipient.

No notification is sent to the transfer destination's account. It is up to the caller to notify the transfer target.

The certificate being transferred must not be in the ACTIVE state. You can use the UpdateCertificate API to deactivate it.

The certificate must not have any policies attached to it. You can use the DetachPrincipalPolicy API to detach them.

Examples:

Request syntax with placeholder values


resp = client.transfer_certificate({
  certificate_id: "CertificateId", # required
  target_aws_account: "AwsAccountId", # required
  transfer_message: "Message",
})

Response structure


resp.transferred_certificate_arn #=> String

Options Hash (options):

  • :certificate_id (required, String)

    The ID of the certificate.

  • :target_aws_account (required, String)

    The AWS account.

  • :transfer_message (String)

    The transfer message.

Returns:

#update_authorizer(options = {}) ⇒ Types::UpdateAuthorizerResponse

Updates an authorizer.

Examples:

Request syntax with placeholder values


resp = client.update_authorizer({
  authorizer_name: "AuthorizerName", # required
  authorizer_function_arn: "AuthorizerFunctionArn",
  token_key_name: "TokenKeyName",
  token_signing_public_keys: {
    "KeyName" => "KeyValue",
  },
  status: "ACTIVE", # accepts ACTIVE, INACTIVE
})

Response structure


resp.authorizer_name #=> String
resp.authorizer_arn #=> String

Options Hash (options):

  • :authorizer_name (required, String)

    The authorizer name.

  • :authorizer_function_arn (String)

    The ARN of the authorizer\'s Lambda function.

  • :token_key_name (String)

    The key used to extract the token from the HTTP headers.

  • :token_signing_public_keys (Hash<String,String>)

    The public keys used to verify the token signature.

  • :status (String)

    The status of the update authorizer request.

Returns:

#update_ca_certificate(options = {}) ⇒ Struct

Updates a registered CA certificate.

Examples:

Request syntax with placeholder values


resp = client.update_ca_certificate({
  certificate_id: "CertificateId", # required
  new_status: "ACTIVE", # accepts ACTIVE, INACTIVE
  new_auto_registration_status: "ENABLE", # accepts ENABLE, DISABLE
  registration_config: {
    template_body: "TemplateBody",
    role_arn: "RoleArn",
  },
  remove_auto_registration: false,
})

Options Hash (options):

  • :certificate_id (required, String)

    The CA certificate identifier.

  • :new_status (String)

    The updated status of the CA certificate.

    Note: The status value REGISTER_INACTIVE is deprecated and should not be used.

  • :new_auto_registration_status (String)

    The new value for the auto registration status. Valid values are: \"ENABLE\" or \"DISABLE\".

  • :registration_config (Types::RegistrationConfig)

    Information about the registration configuration.

  • :remove_auto_registration (Boolean)

    If true, remove auto registration.

Returns:

  • (Struct)

    Returns an empty response.

#update_certificate(options = {}) ⇒ Struct

Updates the status of the specified certificate. This operation is idempotent.

Moving a certificate from the ACTIVE state (including REVOKED) will not disconnect currently connected devices, but these devices will be unable to reconnect.

The ACTIVE state is required to authenticate devices connecting to AWS IoT using a certificate.

Examples:

Request syntax with placeholder values


resp = client.update_certificate({
  certificate_id: "CertificateId", # required
  new_status: "ACTIVE", # required, accepts ACTIVE, INACTIVE, REVOKED, PENDING_TRANSFER, REGISTER_INACTIVE, PENDING_ACTIVATION
})

Options Hash (options):

  • :certificate_id (required, String)

    The ID of the certificate.

  • :new_status (required, String)

    The new status.

    Note: Setting the status to PENDING_TRANSFER will result in an exception being thrown. PENDING_TRANSFER is a status used internally by AWS IoT. It is not intended for developer use.

    Note: The status value REGISTER_INACTIVE is deprecated and should not be used.

Returns:

  • (Struct)

    Returns an empty response.

#update_event_configurations(options = {}) ⇒ Struct

Updates the event configurations.

Examples:

Request syntax with placeholder values


resp = client.update_event_configurations({
  event_configurations: {
    "THING" => {
      enabled: false,
    },
  },
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

#update_indexing_configuration(options = {}) ⇒ Struct

Updates the search configuration.

Examples:

Request syntax with placeholder values


resp = client.update_indexing_configuration({
  thing_indexing_configuration: {
    thing_indexing_mode: "OFF", # accepts OFF, REGISTRY, REGISTRY_AND_SHADOW
  },
})

Options Hash (options):

Returns:

  • (Struct)

    Returns an empty response.

#update_role_alias(options = {}) ⇒ Types::UpdateRoleAliasResponse

Updates a role alias.

Examples:

Request syntax with placeholder values


resp = client.update_role_alias({
  role_alias: "RoleAlias", # required
  role_arn: "RoleArn",
  credential_duration_seconds: 1,
})

Response structure


resp.role_alias #=> String
resp.role_alias_arn #=> String

Options Hash (options):

  • :role_alias (required, String)

    The role alias to update.

  • :role_arn (String)

    The role ARN.

  • :credential_duration_seconds (Integer)

    The number of seconds the credential will be valid.

Returns:

#update_thing(options = {}) ⇒ Struct

Updates the data for a thing.

Examples:

Request syntax with placeholder values


resp = client.update_thing({
  thing_name: "ThingName", # required
  thing_type_name: "ThingTypeName",
  attribute_payload: {
    attributes: {
      "AttributeName" => "AttributeValue",
    },
    merge: false,
  },
  expected_version: 1,
  remove_thing_type: false,
})

Options Hash (options):

  • :thing_name (required, String)

    The name of the thing to update.

  • :thing_type_name (String)

    The name of the thing type.

  • :attribute_payload (Types::AttributePayload)

    A list of thing attributes, a JSON string containing name-value pairs. For example:

    `{\"attributes\":{\"name1\":\"value2\"}}`

    This data is used to add new attributes or update existing attributes.

  • :expected_version (Integer)

    The expected version of the thing record in the registry. If the version of the record in the registry does not match the expected version specified in the request, the UpdateThing request is rejected with a VersionConflictException.

  • :remove_thing_type (Boolean)

    Remove a thing type association. If true, the association is removed.

Returns:

  • (Struct)

    Returns an empty response.

#update_thing_group(options = {}) ⇒ Types::UpdateThingGroupResponse

Update a thing group.

Examples:

Request syntax with placeholder values


resp = client.update_thing_group({
  thing_group_name: "ThingGroupName", # required
  thing_group_properties: { # required
    thing_group_description: "ThingGroupDescription",
    attribute_payload: {
      attributes: {
        "AttributeName" => "AttributeValue",
      },
      merge: false,
    },
  },
  expected_version: 1,
})

Response structure


resp.version #=> Integer

Options Hash (options):

  • :thing_group_name (required, String)

    The thing group to update.

  • :thing_group_properties (required, Types::ThingGroupProperties)

    The thing group properties.

  • :expected_version (Integer)

    The expected version of the thing group. If this does not match the version of the thing group being updated, the update will fail.

Returns:

#update_thing_groups_for_thing(options = {}) ⇒ Struct

Updates the groups to which the thing belongs.

Examples:

Request syntax with placeholder values


resp = client.update_thing_groups_for_thing({
  thing_name: "ThingName",
  thing_groups_to_add: ["ThingGroupName"],
  thing_groups_to_remove: ["ThingGroupName"],
})

Options Hash (options):

  • :thing_name (String)

    The thing whose group memberships will be updated.

  • :thing_groups_to_add (Array<String>)

    The groups to which the thing will be added.

  • :thing_groups_to_remove (Array<String>)

    The groups from which the thing will be removed.

Returns:

  • (Struct)

    Returns an empty response.

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

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

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.