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

Class: Aws::IoT::Client

Inherits:
Seahorse::Client::Base show all
Includes:
ClientStubs
Defined in:
gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

API Operations collapse

Instance Method Summary collapse

Methods included from ClientStubs

#stub_data, #stub_responses

Methods inherited from Seahorse::Client::Base

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

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(*args) ⇒ Client

Returns a new instance of Client

Parameters:

  • options (Hash)

    a customizable set of options



142
143
144
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 142

def initialize(*args)
  super
end

Instance Method Details

#accept_certificate_transfer(params = {}) ⇒ 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,
})

Parameters:

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

    ({})

Options Hash (params):

  • :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.



171
172
173
174
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 171

def accept_certificate_transfer(params = {}, options = {})
  req = build_request(:accept_certificate_transfer, params)
  req.send_request(options)
end

#attach_principal_policy(params = {}) ⇒ Struct

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

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :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.



197
198
199
200
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 197

def attach_principal_policy(params = {}, options = {})
  req = build_request(:attach_principal_policy, params)
  req.send_request(options)
end

#attach_thing_principal(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :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.



221
222
223
224
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 221

def attach_thing_principal(params = {}, options = {})
  req = build_request(:attach_thing_principal, params)
  req.send_request(options)
end

#cancel_certificate_transfer(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :certificate_id (required, String)

    The ID of the certificate.

Returns:

  • (Struct)

    Returns an empty response.



251
252
253
254
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 251

def cancel_certificate_transfer(params = {}, options = {})
  req = build_request(:cancel_certificate_transfer, params)
  req.send_request(options)
end

#create_certificate_from_csr(params = {}) ⇒ 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 | %{aws 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

Parameters:

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

    ({})

Options Hash (params):

  • :certificate_signing_request (required, String)

    The certificate signing request (CSR).

  • :set_as_active (Boolean)

    Specifies whether the certificate is active.

Returns:



332
333
334
335
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 332

def create_certificate_from_csr(params = {}, options = {})
  req = build_request(:create_certificate_from_csr, params)
  req.send_request(options)
end

#create_keys_and_certificate(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :set_as_active (Boolean)

    Specifies whether the certificate is active.

Returns:



369
370
371
372
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 369

def create_keys_and_certificate(params = {}, options = {})
  req = build_request(:create_keys_and_certificate, params)
  req.send_request(options)
end

#create_policy(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



411
412
413
414
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 411

def create_policy(params = {}, options = {})
  req = build_request(:create_policy, params)
  req.send_request(options)
end

#create_policy_version(params = {}) ⇒ 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 #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :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 whitespaces

  • :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:



464
465
466
467
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 464

def create_policy_version(params = {}, options = {})
  req = build_request(:create_policy_version, params)
  req.send_request(options)
end

#create_thing(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



508
509
510
511
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 508

def create_thing(params = {}, options = {})
  req = build_request(:create_thing, params)
  req.send_request(options)
end

#create_thing_type(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



545
546
547
548
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 545

def create_thing_type(params = {}, options = {})
  req = build_request(:create_thing_type, params)
  req.send_request(options)
end

#create_topic_rule(params = {}) ⇒ 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",
  },
})

Parameters:

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

    ({})

Options Hash (params):

  • :rule_name (required, String)

    The name of the rule.

  • :topic_rule_payload (required, Types::TopicRulePayload)

    The rule payload.

Returns:

  • (Struct)

    Returns an empty response.



656
657
658
659
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 656

def create_topic_rule(params = {}, options = {})
  req = build_request(:create_topic_rule, params)
  req.send_request(options)
end

#delete_ca_certificate(params = {}) ⇒ Struct

Deletes a registered CA certificate.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :certificate_id (required, String)

    The ID of the certificate to delete.

Returns:

  • (Struct)

    Returns an empty response.



676
677
678
679
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 676

def delete_ca_certificate(params = {}, options = {})
  req = build_request(:delete_ca_certificate, params)
  req.send_request(options)
end

#delete_certificate(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :certificate_id (required, String)

    The ID of the certificate.

Returns:

  • (Struct)

    Returns an empty response.



701
702
703
704
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 701

def delete_certificate(params = {}, options = {})
  req = build_request(:delete_certificate, params)
  req.send_request(options)
end

#delete_policy(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :policy_name (required, String)

    The name of the policy to delete.

Returns:

  • (Struct)

    Returns an empty response.



732
733
734
735
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 732

def delete_policy(params = {}, options = {})
  req = build_request(:delete_policy, params)
  req.send_request(options)
end

#delete_policy_version(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :policy_name (required, String)

    The name of the policy.

  • :policy_version_id (required, String)

    The policy version ID.

Returns:

  • (Struct)

    Returns an empty response.



760
761
762
763
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 760

def delete_policy_version(params = {}, options = {})
  req = build_request(:delete_policy_version, params)
  req.send_request(options)
end

#delete_registration_code(params = {}) ⇒ Struct

Deletes a CA certificate registration code.

Parameters:

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

    ({})

Returns:

  • (Struct)

    Returns an empty response.



771
772
773
774
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 771

def delete_registration_code(params = {}, options = {})
  req = build_request(:delete_registration_code, params)
  req.send_request(options)
end

#delete_thing(params = {}) ⇒ Struct

Deletes the specified thing.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :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.



798
799
800
801
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 798

def delete_thing(params = {}, options = {})
  req = build_request(:delete_thing, params)
  req.send_request(options)
end

#delete_thing_type(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :thing_type_name (required, String)

    The name of the thing type.

Returns:

  • (Struct)

    Returns an empty response.



823
824
825
826
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 823

def delete_thing_type(params = {}, options = {})
  req = build_request(:delete_thing_type, params)
  req.send_request(options)
end

#delete_topic_rule(params = {}) ⇒ Struct

Deletes the specified rule.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :rule_name (required, String)

    The name of the rule.

Returns:

  • (Struct)

    Returns an empty response.



843
844
845
846
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 843

def delete_topic_rule(params = {}, options = {})
  req = build_request(:delete_topic_rule, params)
  req.send_request(options)
end

#deprecate_thing_type(params = {}) ⇒ 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,
})

Parameters:

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

    ({})

Options Hash (params):

  • :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.



870
871
872
873
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 870

def deprecate_thing_type(params = {}, options = {})
  req = build_request(:deprecate_thing_type, params)
  req.send_request(options)
end

#describe_ca_certificate(params = {}) ⇒ 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"

Parameters:

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

    ({})

Options Hash (params):

  • :certificate_id (required, String)

    The CA certificate identifier.

Returns:



902
903
904
905
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 902

def describe_ca_certificate(params = {}, options = {})
  req = build_request(:describe_ca_certificate, params)
  req.send_request(options)
end

#describe_certificate(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :certificate_id (required, String)

    The ID of the certificate.

Returns:



941
942
943
944
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 941

def describe_certificate(params = {}, options = {})
  req = build_request(:describe_certificate, params)
  req.send_request(options)
end

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

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

Examples:

Response structure


resp.endpoint_address #=> String

Parameters:

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

    ({})

Returns:



958
959
960
961
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 958

def describe_endpoint(params = {}, options = {})
  req = build_request(:describe_endpoint, params)
  req.send_request(options)
end

#describe_thing(params = {}) ⇒ 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_type_name #=> String
resp.attributes #=> Hash
resp.attributes["AttributeName"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.version #=> Integer

Parameters:

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

    ({})

Options Hash (params):

  • :thing_name (required, String)

    The name of the thing.

Returns:



993
994
995
996
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 993

def describe_thing(params = {}, options = {})
  req = build_request(:describe_thing, params)
  req.send_request(options)
end

#describe_thing_type(params = {}) ⇒ 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_properties.thing_type_description #=> String
resp.thing_type_properties.searchable_attributes #=> Array
resp.thing_type_properties.searchable_attributes[0] #=> String
resp..deprecated #=> Boolean
resp..deprecation_date #=> Time
resp..creation_date #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :thing_type_name (required, String)

    The name of the thing type.

Returns:



1027
1028
1029
1030
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1027

def describe_thing_type(params = {}, options = {})
  req = build_request(:describe_thing_type, params)
  req.send_request(options)
end

#detach_principal_policy(params = {}) ⇒ Struct

Removes the specified policy from the specified certificate.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :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.



1054
1055
1056
1057
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1054

def detach_principal_policy(params = {}, options = {})
  req = build_request(:detach_principal_policy, params)
  req.send_request(options)
end

#detach_thing_principal(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :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.



1080
1081
1082
1083
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1080

def detach_thing_principal(params = {}, options = {})
  req = build_request(:detach_thing_principal, params)
  req.send_request(options)
end

#disable_topic_rule(params = {}) ⇒ Struct

Disables the specified rule.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :rule_name (required, String)

    The name of the rule to disable.

Returns:

  • (Struct)

    Returns an empty response.



1100
1101
1102
1103
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1100

def disable_topic_rule(params = {}, options = {})
  req = build_request(:disable_topic_rule, params)
  req.send_request(options)
end

#enable_topic_rule(params = {}) ⇒ Struct

Enables the specified rule.

Examples:

Request syntax with placeholder values


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

Parameters:

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

    ({})

Options Hash (params):

  • :rule_name (required, String)

    The name of the topic rule to enable.

Returns:

  • (Struct)

    Returns an empty response.



1120
1121
1122
1123
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1120

def enable_topic_rule(params = {}, options = {})
  req = build_request(:enable_topic_rule, params)
  req.send_request(options)
end

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

Gets the logging options.

Examples:

Response structure


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

Parameters:

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

    ({})

Returns:



1139
1140
1141
1142
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1139

def get_logging_options(params = {}, options = {})
  req = build_request(:get_logging_options, params)
  req.send_request(options)
end

#get_policy(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :policy_name (required, String)

    The name of the policy.

Returns:



1172
1173
1174
1175
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1172

def get_policy(params = {}, options = {})
  req = build_request(:get_policy, params)
  req.send_request(options)
end

#get_policy_version(params = {}) ⇒ 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 #=> Boolean

Parameters:

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

    ({})

Options Hash (params):

  • :policy_name (required, String)

    The name of the policy.

  • :policy_version_id (required, String)

    The policy version ID.

Returns:



1210
1211
1212
1213
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1210

def get_policy_version(params = {}, options = {})
  req = build_request(:get_policy_version, params)
  req.send_request(options)
end

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

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

Examples:

Response structure


resp.registration_code #=> String

Parameters:

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

    ({})

Returns:



1228
1229
1230
1231
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1228

def get_registration_code(params = {}, options = {})
  req = build_request(:get_registration_code, params)
  req.send_request(options)
end

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

Gets information about the specified 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 #=> Boolean
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 #=> Boolean
resp.rule.aws_iot_sql_version #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :rule_name (required, String)

    The name of the rule.

Returns:



1310
1311
1312
1313
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1310

def get_topic_rule(params = {}, options = {})
  req = build_request(:get_topic_rule, params)
  req.send_request(options)
end

#list_ca_certificates(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1353
1354
1355
1356
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1353

def list_ca_certificates(params = {}, options = {})
  req = build_request(:list_ca_certificates, params)
  req.send_request(options)
end

#list_certificates(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1397
1398
1399
1400
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1397

def list_certificates(params = {}, options = {})
  req = build_request(:list_certificates, params)
  req.send_request(options)
end

#list_certificates_by_ca(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1443
1444
1445
1446
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1443

def list_certificates_by_ca(params = {}, options = {})
  req = build_request(:list_certificates_by_ca, params)
  req.send_request(options)
end

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

Lists certificates that are being transfered 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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1486
1487
1488
1489
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1486

def list_outgoing_certificates(params = {}, options = {})
  req = build_request(:list_outgoing_certificates, params)
  req.send_request(options)
end

#list_policies(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1525
1526
1527
1528
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1525

def list_policies(params = {}, options = {})
  req = build_request(:list_policies, params)
  req.send_request(options)
end

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

Lists the principals associated with the specified policy.

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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1567
1568
1569
1570
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1567

def list_policy_principals(params = {}, options = {})
  req = build_request(:list_policy_principals, params)
  req.send_request(options)
end

#list_policy_versions(params = {}) ⇒ 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 #=> Boolean
resp.policy_versions[0].create_date #=> Time

Parameters:

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

    ({})

Options Hash (params):

  • :policy_name (required, String)

    The policy name.

Returns:



1597
1598
1599
1600
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1597

def list_policy_versions(params = {}, options = {})
  req = build_request(:list_policy_versions, params)
  req.send_request(options)
end

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

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

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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1646
1647
1648
1649
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1646

def list_principal_policies(params = {}, options = {})
  req = build_request(:list_principal_policies, params)
  req.send_request(options)
end

#list_principal_things(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :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.

  • :principal (required, String)

    The principal.

Returns:



1684
1685
1686
1687
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1684

def list_principal_things(params = {}, options = {})
  req = build_request(:list_principal_things, params)
  req.send_request(options)
end

#list_thing_principals(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :thing_name (required, String)

    The name of the thing.

Returns:



1711
1712
1713
1714
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1711

def list_thing_principals(params = {}, options = {})
  req = build_request(:list_thing_principals, params)
  req.send_request(options)
end

#list_thing_types(params = {}) ⇒ 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_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 #=> Boolean
resp.thing_types[0]..deprecation_date #=> Time
resp.thing_types[0]..creation_date #=> Time
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1755
1756
1757
1758
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1755

def list_thing_types(params = {}, options = {})
  req = build_request(:list_thing_types, params)
  req.send_request(options)
end

#list_things(params = {}) ⇒ 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].attributes #=> Hash
resp.things[0].attributes["AttributeName"] #=> <Hash,Array,String,Numeric,Boolean,IO,Set,nil>
resp.things[0].version #=> Integer
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :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.

  • :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:



1809
1810
1811
1812
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1809

def list_things(params = {}, options = {})
  req = build_request(:list_things, params)
  req.send_request(options)
end

#list_topic_rules(params = {}) ⇒ 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 #=> Boolean
resp.next_token #=> String

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1854
1855
1856
1857
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1854

def list_topic_rules(params = {}, options = {})
  req = build_request(:list_topic_rules, params)
  req.send_request(options)
end

#register_ca_certificate(params = {}) ⇒ 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,
})

Response structure


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

Parameters:

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

    ({})

Options Hash (params):

  • :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.

Returns:



1902
1903
1904
1905
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1902

def register_ca_certificate(params = {}, options = {})
  req = build_request(:register_ca_certificate, params)
  req.send_request(options)
end

#register_certificate(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :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:



1946
1947
1948
1949
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1946

def register_certificate(params = {}, options = {})
  req = build_request(:register_certificate, params)
  req.send_request(options)
end

#reject_certificate_transfer(params = {}) ⇒ 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",
})

Parameters:

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

    ({})

Options Hash (params):

  • :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.



1979
1980
1981
1982
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 1979

def reject_certificate_transfer(params = {}, options = {})
  req = build_request(:reject_certificate_transfer, params)
  req.send_request(options)
end

#replace_topic_rule(params = {}) ⇒ Struct

Replaces the specified 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",
  },
})

Parameters:

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

    ({})

Options Hash (params):

  • :rule_name (required, String)

    The name of the rule.

  • :topic_rule_payload (required, Types::TopicRulePayload)

    The rule payload.

Returns:

  • (Struct)

    Returns an empty response.



2091
2092
2093
2094
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 2091

def replace_topic_rule(params = {}, options = {})
  req = build_request(:replace_topic_rule, params)
  req.send_request(options)
end

#set_default_policy_version(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :policy_name (required, String)

    The policy name.

  • :policy_version_id (required, String)

    The policy version ID.

Returns:

  • (Struct)

    Returns an empty response.



2118
2119
2120
2121
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 2118

def set_default_policy_version(params = {}, options = {})
  req = build_request(:set_default_policy_version, params)
  req.send_request(options)
end

#set_logging_options(params = {}) ⇒ 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
  },
})

Parameters:

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

    ({})

Options Hash (params):

Returns:

  • (Struct)

    Returns an empty response.



2141
2142
2143
2144
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 2141

def set_logging_options(params = {}, options = {})
  req = build_request(:set_logging_options, params)
  req.send_request(options)
end

#transfer_certificate(params = {}) ⇒ 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

Parameters:

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

    ({})

Options Hash (params):

  • :certificate_id (required, String)

    The ID of the certificate.

  • :target_aws_account (required, String)

    The AWS account.

  • :transfer_message (String)

    The transfer message.

Returns:



2186
2187
2188
2189
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 2186

def transfer_certificate(params = {}, options = {})
  req = build_request(:transfer_certificate, params)
  req.send_request(options)
end

#update_ca_certificate(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :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".

Returns:

  • (Struct)

    Returns an empty response.



2218
2219
2220
2221
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 2218

def update_ca_certificate(params = {}, options = {})
  req = build_request(:update_ca_certificate, params)
  req.send_request(options)
end

#update_certificate(params = {}) ⇒ 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
})

Parameters:

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

    ({})

Options Hash (params):

  • :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.



2257
2258
2259
2260
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 2257

def update_certificate(params = {}, options = {})
  req = build_request(:update_certificate, params)
  req.send_request(options)
end

#update_thing(params = {}) ⇒ 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,
})

Parameters:

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

    ({})

Options Hash (params):

  • :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 assocation is removed.

Returns:

  • (Struct)

    Returns an empty response.



2307
2308
2309
2310
# File 'gems/aws-sdk-iot/lib/aws-sdk-iot/client.rb', line 2307

def update_thing(params = {}, options = {})
  req = build_request(:update_thing, params)
  req.send_request(options)
end