Table of Contents
IoT.Client¶A low-level client representing AWS IoT:
client = session.create_client('iot')
These are the available methods:
accept_certificate_transfer()attach_principal_policy()attach_thing_principal()can_paginate()cancel_certificate_transfer()create_certificate_from_csr()create_keys_and_certificate()create_policy()create_policy_version()create_thing()create_thing_type()create_topic_rule()delete_ca_certificate()delete_certificate()delete_policy()delete_policy_version()delete_registration_code()delete_thing()delete_thing_type()delete_topic_rule()deprecate_thing_type()describe_ca_certificate()describe_certificate()describe_endpoint()describe_thing()describe_thing_type()detach_principal_policy()detach_thing_principal()disable_topic_rule()enable_topic_rule()generate_presigned_url()get_logging_options()get_paginator()get_policy()get_policy_version()get_registration_code()get_topic_rule()get_waiter()list_ca_certificates()list_certificates()list_certificates_by_ca()list_outgoing_certificates()list_policies()list_policy_principals()list_policy_versions()list_principal_policies()list_principal_things()list_thing_principals()list_thing_types()list_things()list_topic_rules()register_ca_certificate()register_certificate()reject_certificate_transfer()replace_topic_rule()set_default_policy_version()set_logging_options()transfer_certificate()update_ca_certificate()update_certificate()update_thing()accept_certificate_transfer(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.accept_certificate_transfer(
certificateId='string',
setAsActive=True|False
)
| Parameters: |
|
|---|---|
| Returns: | None |
attach_principal_policy(**kwargs)¶Attaches the specified policy to the specified principal (certificate or other credential).
See also: AWS API Documentation
Request Syntax
response = client.attach_principal_policy(
policyName='string',
principal='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
attach_thing_principal(**kwargs)¶Attaches the specified principal to the specified thing.
See also: AWS API Documentation
Request Syntax
response = client.attach_thing_principal(
thingName='string',
principal='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
can_paginate(operation_name)¶Check if an operation can be paginated.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Returns: | True if the operation can be paginated,
False otherwise. |
cancel_certificate_transfer(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.cancel_certificate_transfer(
certificateId='string'
)
| Parameters: | certificateId (string) – [REQUIRED] The ID of the certificate. |
|---|---|
| Returns: | None |
create_certificate_from_csr(**kwargs)¶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”
See also: AWS API Documentation
Request Syntax
response = client.create_certificate_from_csr(
certificateSigningRequest='string',
setAsActive=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'certificateArn': 'string',
'certificateId': 'string',
'certificatePem': 'string'
}
Response Structure
|
create_keys_and_certificate(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_keys_and_certificate(
setAsActive=True|False
)
| Parameters: | setAsActive (boolean) – Specifies whether the certificate is active. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'certificateArn': 'string',
'certificateId': 'string',
'certificatePem': 'string',
'keyPair': {
'PublicKey': 'string',
'PrivateKey': 'string'
}
}
Response Structure
|
create_policy(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_policy(
policyName='string',
policyDocument='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'policyName': 'string',
'policyArn': 'string',
'policyDocument': 'string',
'policyVersionId': 'string'
}
Response Structure
|
create_policy_version(**kwargs)¶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).
See also: AWS API Documentation
Request Syntax
response = client.create_policy_version(
policyName='string',
policyDocument='string',
setAsDefault=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'policyArn': 'string',
'policyDocument': 'string',
'policyVersionId': 'string',
'isDefaultVersion': True|False
}
Response Structure
|
create_thing(**kwargs)¶Creates a thing record in the thing registry.
See also: AWS API Documentation
Request Syntax
response = client.create_thing(
thingName='string',
thingTypeName='string',
attributePayload={
'attributes': {
'string': 'string'
},
'merge': True|False
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'thingName': 'string',
'thingArn': 'string'
}
Response Structure
|
create_thing_type(**kwargs)¶Creates a new thing type.
See also: AWS API Documentation
Request Syntax
response = client.create_thing_type(
thingTypeName='string',
thingTypeProperties={
'thingTypeDescription': 'string',
'searchableAttributes': [
'string',
]
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'thingTypeName': 'string',
'thingTypeArn': 'string'
}
Response Structure
|
create_topic_rule(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.create_topic_rule(
ruleName='string',
topicRulePayload={
'sql': 'string',
'description': 'string',
'actions': [
{
'dynamoDB': {
'tableName': 'string',
'roleArn': 'string',
'operation': 'string',
'hashKeyField': 'string',
'hashKeyValue': 'string',
'hashKeyType': 'STRING'|'NUMBER',
'rangeKeyField': 'string',
'rangeKeyValue': 'string',
'rangeKeyType': 'STRING'|'NUMBER',
'payloadField': 'string'
},
'dynamoDBv2': {
'roleArn': 'string',
'putItem': {
'tableName': 'string'
}
},
'lambda': {
'functionArn': 'string'
},
'sns': {
'targetArn': 'string',
'roleArn': 'string',
'messageFormat': 'RAW'|'JSON'
},
'sqs': {
'roleArn': 'string',
'queueUrl': 'string',
'useBase64': True|False
},
'kinesis': {
'roleArn': 'string',
'streamName': 'string',
'partitionKey': 'string'
},
'republish': {
'roleArn': 'string',
'topic': 'string'
},
's3': {
'roleArn': 'string',
'bucketName': 'string',
'key': 'string',
'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write'
},
'firehose': {
'roleArn': 'string',
'deliveryStreamName': 'string',
'separator': 'string'
},
'cloudwatchMetric': {
'roleArn': 'string',
'metricNamespace': 'string',
'metricName': 'string',
'metricValue': 'string',
'metricUnit': 'string',
'metricTimestamp': 'string'
},
'cloudwatchAlarm': {
'roleArn': 'string',
'alarmName': 'string',
'stateReason': 'string',
'stateValue': 'string'
},
'elasticsearch': {
'roleArn': 'string',
'endpoint': 'string',
'index': 'string',
'type': 'string',
'id': 'string'
},
'salesforce': {
'token': 'string',
'url': 'string'
}
},
],
'ruleDisabled': True|False,
'awsIotSqlVersion': 'string'
}
)
| Parameters: |
|
|---|---|
| Returns: | None |
delete_ca_certificate(**kwargs)¶Deletes a registered CA certificate.
See also: AWS API Documentation
Request Syntax
response = client.delete_ca_certificate(
certificateId='string'
)
| Parameters: | certificateId (string) – [REQUIRED] The ID of the certificate to delete. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
delete_certificate(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_certificate(
certificateId='string'
)
| Parameters: | certificateId (string) – [REQUIRED] The ID of the certificate. |
|---|---|
| Returns: | None |
delete_policy(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_policy(
policyName='string'
)
| Parameters: | policyName (string) – [REQUIRED] The name of the policy to delete. |
|---|---|
| Returns: | None |
delete_policy_version(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_policy_version(
policyName='string',
policyVersionId='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
delete_registration_code()¶Deletes a CA certificate registration code.
See also: AWS API Documentation
Request Syntax
response = client.delete_registration_code()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{}
Response Structure
|
delete_thing(**kwargs)¶Deletes the specified thing.
See also: AWS API Documentation
Request Syntax
response = client.delete_thing(
thingName='string',
expectedVersion=123
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
delete_thing_type(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.delete_thing_type(
thingTypeName='string'
)
| Parameters: | thingTypeName (string) – [REQUIRED] The name of the thing type. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{}
Response Structure
|
delete_topic_rule(**kwargs)¶Deletes the specified rule.
See also: AWS API Documentation
Request Syntax
response = client.delete_topic_rule(
ruleName='string'
)
| Parameters: | ruleName (string) – [REQUIRED] The name of the rule. |
|---|---|
| Returns: | None |
deprecate_thing_type(**kwargs)¶Deprecates a thing type. You can not associate new things with deprecated thing type.
See also: AWS API Documentation
Request Syntax
response = client.deprecate_thing_type(
thingTypeName='string',
undoDeprecate=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
describe_ca_certificate(**kwargs)¶Describes a registered CA certificate.
See also: AWS API Documentation
Request Syntax
response = client.describe_ca_certificate(
certificateId='string'
)
| Parameters: | certificateId (string) – [REQUIRED] The CA certificate identifier. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'certificateDescription': {
'certificateArn': 'string',
'certificateId': 'string',
'status': 'ACTIVE'|'INACTIVE',
'certificatePem': 'string',
'ownedBy': 'string',
'creationDate': datetime(2015, 1, 1),
'autoRegistrationStatus': 'ENABLE'|'DISABLE'
}
}
Response Structure
|
describe_certificate(**kwargs)¶Gets information about the specified certificate.
See also: AWS API Documentation
Request Syntax
response = client.describe_certificate(
certificateId='string'
)
| Parameters: | certificateId (string) – [REQUIRED] The ID of the certificate. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'certificateDescription': {
'certificateArn': 'string',
'certificateId': 'string',
'caCertificateId': 'string',
'status': 'ACTIVE'|'INACTIVE'|'REVOKED'|'PENDING_TRANSFER'|'REGISTER_INACTIVE'|'PENDING_ACTIVATION',
'certificatePem': 'string',
'ownedBy': 'string',
'previousOwnedBy': 'string',
'creationDate': datetime(2015, 1, 1),
'lastModifiedDate': datetime(2015, 1, 1),
'transferData': {
'transferMessage': 'string',
'rejectReason': 'string',
'transferDate': datetime(2015, 1, 1),
'acceptDate': datetime(2015, 1, 1),
'rejectDate': datetime(2015, 1, 1)
}
}
}
Response Structure
|
describe_endpoint()¶Returns a unique endpoint specific to the AWS account making the call.
See also: AWS API Documentation
Request Syntax
response = client.describe_endpoint()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'endpointAddress': 'string'
}
Response Structure
|
describe_thing(**kwargs)¶Gets information about the specified thing.
See also: AWS API Documentation
Request Syntax
response = client.describe_thing(
thingName='string'
)
| Parameters: | thingName (string) – [REQUIRED] The name of the thing. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'defaultClientId': 'string',
'thingName': 'string',
'thingTypeName': 'string',
'attributes': {
'string': 'string'
},
'version': 123
}
Response Structure
|
describe_thing_type(**kwargs)¶Gets information about the specified thing type.
See also: AWS API Documentation
Request Syntax
response = client.describe_thing_type(
thingTypeName='string'
)
| Parameters: | thingTypeName (string) – [REQUIRED] The name of the thing type. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'thingTypeName': 'string',
'thingTypeProperties': {
'thingTypeDescription': 'string',
'searchableAttributes': [
'string',
]
},
'thingTypeMetadata': {
'deprecated': True|False,
'deprecationDate': datetime(2015, 1, 1),
'creationDate': datetime(2015, 1, 1)
}
}
Response Structure
|
detach_principal_policy(**kwargs)¶Removes the specified policy from the specified certificate.
See also: AWS API Documentation
Request Syntax
response = client.detach_principal_policy(
policyName='string',
principal='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
detach_thing_principal(**kwargs)¶Detaches the specified principal from the specified thing.
See also: AWS API Documentation
Request Syntax
response = client.detach_thing_principal(
thingName='string',
principal='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
disable_topic_rule(**kwargs)¶Disables the specified rule.
See also: AWS API Documentation
Request Syntax
response = client.disable_topic_rule(
ruleName='string'
)
| Parameters: | ruleName (string) – [REQUIRED] The name of the rule to disable. |
|---|---|
| Returns: | None |
enable_topic_rule(**kwargs)¶Enables the specified rule.
See also: AWS API Documentation
Request Syntax
response = client.enable_topic_rule(
ruleName='string'
)
| Parameters: | ruleName (string) – [REQUIRED] The name of the topic rule to enable. |
|---|---|
| Returns: | None |
generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)¶Generate a presigned url given a client, its method, and arguments
| Parameters: |
|
|---|---|
| Returns: | The presigned url |
get_logging_options()¶Gets the logging options.
See also: AWS API Documentation
Request Syntax
response = client.get_logging_options()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'roleArn': 'string',
'logLevel': 'DEBUG'|'INFO'|'ERROR'|'WARN'|'DISABLED'
}
Response Structure
|
get_paginator(operation_name)¶Create a paginator for an operation.
| Parameters: | operation_name (string) – The operation name. This is the same name
as the method name on the client. For example, if the
method name is create_foo, and you’d normally invoke the
operation as client.create_foo(**kwargs), if the
create_foo operation can be paginated, you can use the
call client.get_paginator("create_foo"). |
|---|---|
| Raises: | OperationNotPageableError – Raised if the operation is not
pageable. You can use the client.can_paginate method to
check if an operation is pageable. |
| Return type: | L{botocore.paginate.Paginator} |
| Returns: | A paginator object. |
get_policy(**kwargs)¶Gets information about the specified policy with the policy document of the default version.
See also: AWS API Documentation
Request Syntax
response = client.get_policy(
policyName='string'
)
| Parameters: | policyName (string) – [REQUIRED] The name of the policy. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'policyName': 'string',
'policyArn': 'string',
'policyDocument': 'string',
'defaultVersionId': 'string'
}
Response Structure
|
get_policy_version(**kwargs)¶Gets information about the specified policy version.
See also: AWS API Documentation
Request Syntax
response = client.get_policy_version(
policyName='string',
policyVersionId='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'policyArn': 'string',
'policyName': 'string',
'policyDocument': 'string',
'policyVersionId': 'string',
'isDefaultVersion': True|False
}
Response Structure
|
get_registration_code()¶Gets a registration code used to register a CA certificate with AWS IoT.
See also: AWS API Documentation
Request Syntax
response = client.get_registration_code()
| Return type: | dict |
|---|---|
| Returns: | Response Syntax{
'registrationCode': 'string'
}
Response Structure
|
get_topic_rule(**kwargs)¶Gets information about the specified rule.
See also: AWS API Documentation
Request Syntax
response = client.get_topic_rule(
ruleName='string'
)
| Parameters: | ruleName (string) – [REQUIRED] The name of the rule. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'ruleArn': 'string',
'rule': {
'ruleName': 'string',
'sql': 'string',
'description': 'string',
'createdAt': datetime(2015, 1, 1),
'actions': [
{
'dynamoDB': {
'tableName': 'string',
'roleArn': 'string',
'operation': 'string',
'hashKeyField': 'string',
'hashKeyValue': 'string',
'hashKeyType': 'STRING'|'NUMBER',
'rangeKeyField': 'string',
'rangeKeyValue': 'string',
'rangeKeyType': 'STRING'|'NUMBER',
'payloadField': 'string'
},
'dynamoDBv2': {
'roleArn': 'string',
'putItem': {
'tableName': 'string'
}
},
'lambda': {
'functionArn': 'string'
},
'sns': {
'targetArn': 'string',
'roleArn': 'string',
'messageFormat': 'RAW'|'JSON'
},
'sqs': {
'roleArn': 'string',
'queueUrl': 'string',
'useBase64': True|False
},
'kinesis': {
'roleArn': 'string',
'streamName': 'string',
'partitionKey': 'string'
},
'republish': {
'roleArn': 'string',
'topic': 'string'
},
's3': {
'roleArn': 'string',
'bucketName': 'string',
'key': 'string',
'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write'
},
'firehose': {
'roleArn': 'string',
'deliveryStreamName': 'string',
'separator': 'string'
},
'cloudwatchMetric': {
'roleArn': 'string',
'metricNamespace': 'string',
'metricName': 'string',
'metricValue': 'string',
'metricUnit': 'string',
'metricTimestamp': 'string'
},
'cloudwatchAlarm': {
'roleArn': 'string',
'alarmName': 'string',
'stateReason': 'string',
'stateValue': 'string'
},
'elasticsearch': {
'roleArn': 'string',
'endpoint': 'string',
'index': 'string',
'type': 'string',
'id': 'string'
},
'salesforce': {
'token': 'string',
'url': 'string'
}
},
],
'ruleDisabled': True|False,
'awsIotSqlVersion': 'string'
}
}
Response Structure
|
get_waiter(waiter_name)¶list_ca_certificates(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.list_ca_certificates(
pageSize=123,
marker='string',
ascendingOrder=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'certificates': [
{
'certificateArn': 'string',
'certificateId': 'string',
'status': 'ACTIVE'|'INACTIVE',
'creationDate': datetime(2015, 1, 1)
},
],
'nextMarker': 'string'
}
Response Structure
|
list_certificates(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.list_certificates(
pageSize=123,
marker='string',
ascendingOrder=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'certificates': [
{
'certificateArn': 'string',
'certificateId': 'string',
'status': 'ACTIVE'|'INACTIVE'|'REVOKED'|'PENDING_TRANSFER'|'REGISTER_INACTIVE'|'PENDING_ACTIVATION',
'creationDate': datetime(2015, 1, 1)
},
],
'nextMarker': 'string'
}
Response Structure
|
list_certificates_by_ca(**kwargs)¶List the device certificates signed by the specified CA certificate.
See also: AWS API Documentation
Request Syntax
response = client.list_certificates_by_ca(
caCertificateId='string',
pageSize=123,
marker='string',
ascendingOrder=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'certificates': [
{
'certificateArn': 'string',
'certificateId': 'string',
'status': 'ACTIVE'|'INACTIVE'|'REVOKED'|'PENDING_TRANSFER'|'REGISTER_INACTIVE'|'PENDING_ACTIVATION',
'creationDate': datetime(2015, 1, 1)
},
],
'nextMarker': 'string'
}
Response Structure
|
list_outgoing_certificates(**kwargs)¶Lists certificates that are being transfered but not yet accepted.
See also: AWS API Documentation
Request Syntax
response = client.list_outgoing_certificates(
pageSize=123,
marker='string',
ascendingOrder=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'outgoingCertificates': [
{
'certificateArn': 'string',
'certificateId': 'string',
'transferredTo': 'string',
'transferDate': datetime(2015, 1, 1),
'transferMessage': 'string',
'creationDate': datetime(2015, 1, 1)
},
],
'nextMarker': 'string'
}
Response Structure
|
list_policies(**kwargs)¶Lists your policies.
See also: AWS API Documentation
Request Syntax
response = client.list_policies(
marker='string',
pageSize=123,
ascendingOrder=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'policies': [
{
'policyName': 'string',
'policyArn': 'string'
},
],
'nextMarker': 'string'
}
Response Structure
|
list_policy_principals(**kwargs)¶Lists the principals associated with the specified policy.
See also: AWS API Documentation
Request Syntax
response = client.list_policy_principals(
policyName='string',
marker='string',
pageSize=123,
ascendingOrder=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'principals': [
'string',
],
'nextMarker': 'string'
}
Response Structure
|
list_policy_versions(**kwargs)¶Lists the versions of the specified policy and identifies the default version.
See also: AWS API Documentation
Request Syntax
response = client.list_policy_versions(
policyName='string'
)
| Parameters: | policyName (string) – [REQUIRED] The policy name. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'policyVersions': [
{
'versionId': 'string',
'isDefaultVersion': True|False,
'createDate': datetime(2015, 1, 1)
},
]
}
Response Structure
|
list_principal_policies(**kwargs)¶Lists the policies attached to the specified principal. If you use an Cognito identity, the ID must be in AmazonCognito Identity format .
See also: AWS API Documentation
Request Syntax
response = client.list_principal_policies(
principal='string',
marker='string',
pageSize=123,
ascendingOrder=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'policies': [
{
'policyName': 'string',
'policyArn': 'string'
},
],
'nextMarker': 'string'
}
Response Structure
|
list_principal_things(**kwargs)¶Lists the things associated with the specified principal.
See also: AWS API Documentation
Request Syntax
response = client.list_principal_things(
nextToken='string',
maxResults=123,
principal='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'things': [
'string',
],
'nextToken': 'string'
}
Response Structure
|
list_thing_principals(**kwargs)¶Lists the principals associated with the specified thing.
See also: AWS API Documentation
Request Syntax
response = client.list_thing_principals(
thingName='string'
)
| Parameters: | thingName (string) – [REQUIRED] The name of the thing. |
|---|---|
| Return type: | dict |
| Returns: | Response Syntax{
'principals': [
'string',
]
}
Response Structure
|
list_thing_types(**kwargs)¶Lists the existing thing types.
See also: AWS API Documentation
Request Syntax
response = client.list_thing_types(
nextToken='string',
maxResults=123,
thingTypeName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'thingTypes': [
{
'thingTypeName': 'string',
'thingTypeProperties': {
'thingTypeDescription': 'string',
'searchableAttributes': [
'string',
]
},
'thingTypeMetadata': {
'deprecated': True|False,
'deprecationDate': datetime(2015, 1, 1),
'creationDate': datetime(2015, 1, 1)
}
},
],
'nextToken': 'string'
}
Response Structure
|
list_things(**kwargs)¶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 .
See also: AWS API Documentation
Request Syntax
response = client.list_things(
nextToken='string',
maxResults=123,
attributeName='string',
attributeValue='string',
thingTypeName='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'things': [
{
'thingName': 'string',
'thingTypeName': 'string',
'attributes': {
'string': 'string'
},
'version': 123
},
],
'nextToken': 'string'
}
Response Structure
|
list_topic_rules(**kwargs)¶Lists the rules for the specific topic.
See also: AWS API Documentation
Request Syntax
response = client.list_topic_rules(
topic='string',
maxResults=123,
nextToken='string',
ruleDisabled=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'rules': [
{
'ruleArn': 'string',
'ruleName': 'string',
'topicPattern': 'string',
'createdAt': datetime(2015, 1, 1),
'ruleDisabled': True|False
},
],
'nextToken': 'string'
}
Response Structure
|
register_ca_certificate(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.register_ca_certificate(
caCertificate='string',
verificationCertificate='string',
setAsActive=True|False,
allowAutoRegistration=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'certificateArn': 'string',
'certificateId': 'string'
}
Response Structure
|
register_certificate(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.register_certificate(
certificatePem='string',
caCertificatePem='string',
setAsActive=True|False,
status='ACTIVE'|'INACTIVE'|'REVOKED'|'PENDING_TRANSFER'|'REGISTER_INACTIVE'|'PENDING_ACTIVATION'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'certificateArn': 'string',
'certificateId': 'string'
}
Response Structure
|
reject_certificate_transfer(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.reject_certificate_transfer(
certificateId='string',
rejectReason='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
replace_topic_rule(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.replace_topic_rule(
ruleName='string',
topicRulePayload={
'sql': 'string',
'description': 'string',
'actions': [
{
'dynamoDB': {
'tableName': 'string',
'roleArn': 'string',
'operation': 'string',
'hashKeyField': 'string',
'hashKeyValue': 'string',
'hashKeyType': 'STRING'|'NUMBER',
'rangeKeyField': 'string',
'rangeKeyValue': 'string',
'rangeKeyType': 'STRING'|'NUMBER',
'payloadField': 'string'
},
'dynamoDBv2': {
'roleArn': 'string',
'putItem': {
'tableName': 'string'
}
},
'lambda': {
'functionArn': 'string'
},
'sns': {
'targetArn': 'string',
'roleArn': 'string',
'messageFormat': 'RAW'|'JSON'
},
'sqs': {
'roleArn': 'string',
'queueUrl': 'string',
'useBase64': True|False
},
'kinesis': {
'roleArn': 'string',
'streamName': 'string',
'partitionKey': 'string'
},
'republish': {
'roleArn': 'string',
'topic': 'string'
},
's3': {
'roleArn': 'string',
'bucketName': 'string',
'key': 'string',
'cannedAcl': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'|'log-delivery-write'
},
'firehose': {
'roleArn': 'string',
'deliveryStreamName': 'string',
'separator': 'string'
},
'cloudwatchMetric': {
'roleArn': 'string',
'metricNamespace': 'string',
'metricName': 'string',
'metricValue': 'string',
'metricUnit': 'string',
'metricTimestamp': 'string'
},
'cloudwatchAlarm': {
'roleArn': 'string',
'alarmName': 'string',
'stateReason': 'string',
'stateValue': 'string'
},
'elasticsearch': {
'roleArn': 'string',
'endpoint': 'string',
'index': 'string',
'type': 'string',
'id': 'string'
},
'salesforce': {
'token': 'string',
'url': 'string'
}
},
],
'ruleDisabled': True|False,
'awsIotSqlVersion': 'string'
}
)
| Parameters: |
|
|---|---|
| Returns: | None |
set_default_policy_version(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.set_default_policy_version(
policyName='string',
policyVersionId='string'
)
| Parameters: |
|
|---|---|
| Returns: | None |
set_logging_options(**kwargs)¶Sets the logging options.
See also: AWS API Documentation
Request Syntax
response = client.set_logging_options(
loggingOptionsPayload={
'roleArn': 'string',
'logLevel': 'DEBUG'|'INFO'|'ERROR'|'WARN'|'DISABLED'
}
)
| Parameters: | loggingOptionsPayload (dict) – [REQUIRED] The logging options payload.
|
|---|---|
| Returns: | None |
transfer_certificate(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.transfer_certificate(
certificateId='string',
targetAwsAccount='string',
transferMessage='string'
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'transferredCertificateArn': 'string'
}
Response Structure
|
update_ca_certificate(**kwargs)¶Updates a registered CA certificate.
See also: AWS API Documentation
Request Syntax
response = client.update_ca_certificate(
certificateId='string',
newStatus='ACTIVE'|'INACTIVE',
newAutoRegistrationStatus='ENABLE'|'DISABLE'
)
| Parameters: |
|
|---|---|
| Returns: | None |
update_certificate(**kwargs)¶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.
See also: AWS API Documentation
Request Syntax
response = client.update_certificate(
certificateId='string',
newStatus='ACTIVE'|'INACTIVE'|'REVOKED'|'PENDING_TRANSFER'|'REGISTER_INACTIVE'|'PENDING_ACTIVATION'
)
| Parameters: |
|
|---|---|
| Returns: | None |
update_thing(**kwargs)¶Updates the data for a thing.
See also: AWS API Documentation
Request Syntax
response = client.update_thing(
thingName='string',
thingTypeName='string',
attributePayload={
'attributes': {
'string': 'string'
},
'merge': True|False
},
expectedVersion=123,
removeThingType=True|False
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {}
Response Structure
|
The available paginators are:
IoT.Paginator.ListCACertificatesIoT.Paginator.ListCertificatesIoT.Paginator.ListCertificatesByCAIoT.Paginator.ListOutgoingCertificatesIoT.Paginator.ListPoliciesIoT.Paginator.ListPolicyPrincipalsIoT.Paginator.ListPrincipalPoliciesIoT.Paginator.ListPrincipalThingsIoT.Paginator.ListThingTypesIoT.Paginator.ListThingsIoT.Paginator.ListTopicRulesIoT.Paginator.ListCACertificates¶paginator = client.get_paginator('list_ca_certificates')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_ca_certificates().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ascendingOrder=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'certificates': [
{
'certificateArn': 'string',
'certificateId': 'string',
'status': 'ACTIVE'|'INACTIVE',
'creationDate': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListCertificates¶paginator = client.get_paginator('list_certificates')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_certificates().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ascendingOrder=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'certificates': [
{
'certificateArn': 'string',
'certificateId': 'string',
'status': 'ACTIVE'|'INACTIVE'|'REVOKED'|'PENDING_TRANSFER'|'REGISTER_INACTIVE'|'PENDING_ACTIVATION',
'creationDate': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListCertificatesByCA¶paginator = client.get_paginator('list_certificates_by_ca')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_certificates_by_ca().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
caCertificateId='string',
ascendingOrder=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'certificates': [
{
'certificateArn': 'string',
'certificateId': 'string',
'status': 'ACTIVE'|'INACTIVE'|'REVOKED'|'PENDING_TRANSFER'|'REGISTER_INACTIVE'|'PENDING_ACTIVATION',
'creationDate': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListOutgoingCertificates¶paginator = client.get_paginator('list_outgoing_certificates')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_outgoing_certificates().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ascendingOrder=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'outgoingCertificates': [
{
'certificateArn': 'string',
'certificateId': 'string',
'transferredTo': 'string',
'transferDate': datetime(2015, 1, 1),
'transferMessage': 'string',
'creationDate': datetime(2015, 1, 1)
},
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListPolicies¶paginator = client.get_paginator('list_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
ascendingOrder=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'policies': [
{
'policyName': 'string',
'policyArn': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListPolicyPrincipals¶paginator = client.get_paginator('list_policy_principals')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_policy_principals().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
policyName='string',
ascendingOrder=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'principals': [
'string',
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListPrincipalPolicies¶paginator = client.get_paginator('list_principal_policies')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_principal_policies().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
principal='string',
ascendingOrder=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'policies': [
{
'policyName': 'string',
'policyArn': 'string'
},
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListPrincipalThings¶paginator = client.get_paginator('list_principal_things')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_principal_things().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
principal='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'things': [
'string',
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListThingTypes¶paginator = client.get_paginator('list_thing_types')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_thing_types().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
thingTypeName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'thingTypes': [
{
'thingTypeName': 'string',
'thingTypeProperties': {
'thingTypeDescription': 'string',
'searchableAttributes': [
'string',
]
},
'thingTypeMetadata': {
'deprecated': True|False,
'deprecationDate': datetime(2015, 1, 1),
'creationDate': datetime(2015, 1, 1)
}
},
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListThings¶paginator = client.get_paginator('list_things')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_things().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
attributeName='string',
attributeValue='string',
thingTypeName='string',
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'things': [
{
'thingName': 'string',
'thingTypeName': 'string',
'attributes': {
'string': 'string'
},
'version': 123
},
],
'NextToken': 'string'
}
Response Structure
|
IoT.Paginator.ListTopicRules¶paginator = client.get_paginator('list_topic_rules')
paginate(**kwargs)¶Creates an iterator that will paginate through responses from IoT.Client.list_topic_rules().
See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate(
topic='string',
ruleDisabled=True|False,
PaginationConfig={
'MaxItems': 123,
'PageSize': 123,
'StartingToken': 'string'
}
)
| Parameters: |
|
|---|---|
| Return type: | dict |
| Returns: | Response Syntax {
'rules': [
{
'ruleArn': 'string',
'ruleName': 'string',
'topicPattern': 'string',
'createdAt': datetime(2015, 1, 1),
'ruleDisabled': True|False
},
],
'NextToken': 'string'
}
Response Structure
|