public class AbstractAWSIot extends Object implements AWSIot
AWSIot
. Convenient method forms pass
through to the corresponding overload that takes a request object, which
throws an UnsupportedOperationException
.Modifier and Type | Method and Description |
---|---|
void |
acceptCertificateTransfer(AcceptCertificateTransferRequest request)
Accepts a pending certificate transfer.
|
void |
attachPrincipalPolicy(AttachPrincipalPolicyRequest request)
Attaches the specified policy to the specified principal (certificate or
other credential).
|
AttachThingPrincipalResult |
attachThingPrincipal(AttachThingPrincipalRequest request)
Attaches the specified principal to the specified thing.
|
void |
cancelCertificateTransfer(CancelCertificateTransferRequest request)
Cancels a pending transfer for the specified certificate.
|
CreateCertificateFromCsrResult |
createCertificateFromCsr(CreateCertificateFromCsrRequest request)
Creates an X.509 certificate using the specified certificate signing
request.
|
CreateKeysAndCertificateResult |
createKeysAndCertificate(CreateKeysAndCertificateRequest request)
Creates a 2048 bit RSA key pair and issues an X.509 certificate using the
issued public key.
|
CreatePolicyResult |
createPolicy(CreatePolicyRequest request)
Creates an AWS IoT policy.
|
CreatePolicyVersionResult |
createPolicyVersion(CreatePolicyVersionRequest request)
Creates a new version of the specified AWS IoT policy.
|
CreateThingResult |
createThing(CreateThingRequest request)
Creates a thing in the thing registry.
|
void |
createTopicRule(CreateTopicRuleRequest request)
Creates a rule.
|
void |
deleteCertificate(DeleteCertificateRequest request)
Deletes the specified certificate.
|
void |
deletePolicy(DeletePolicyRequest request)
Deletes the specified policy.
|
void |
deletePolicyVersion(DeletePolicyVersionRequest request)
Deletes the specified version of the specified policy.
|
DeleteThingResult |
deleteThing(DeleteThingRequest request)
Deletes the specified thing from the Thing Registry.
|
void |
deleteTopicRule(DeleteTopicRuleRequest request)
Deletes the specified rule.
|
DescribeCertificateResult |
describeCertificate(DescribeCertificateRequest request)
Gets information about the specified certificate.
|
DescribeEndpointResult |
describeEndpoint(DescribeEndpointRequest request)
Returns a unique endpoint specific to the AWS account making the call.
|
DescribeThingResult |
describeThing(DescribeThingRequest request)
Gets information about the specified thing.
|
void |
detachPrincipalPolicy(DetachPrincipalPolicyRequest request)
Removes the specified policy from the specified certificate.
|
DetachThingPrincipalResult |
detachThingPrincipal(DetachThingPrincipalRequest request)
Detaches the specified principal from the specified thing.
|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Returns additional metadata for a previously executed successful request,
typically used for debugging issues where a service isn't acting as
expected.
|
GetLoggingOptionsResult |
getLoggingOptions(GetLoggingOptionsRequest request)
Gets the logging options.
|
GetPolicyResult |
getPolicy(GetPolicyRequest request)
Gets information about the specified policy with the policy document of
the default version.
|
GetPolicyVersionResult |
getPolicyVersion(GetPolicyVersionRequest request)
Gets information about the specified policy version.
|
GetTopicRuleResult |
getTopicRule(GetTopicRuleRequest request)
Gets information about the specified rule.
|
ListCertificatesResult |
listCertificates(ListCertificatesRequest request)
Lists your certificates.
|
ListPoliciesResult |
listPolicies(ListPoliciesRequest request)
Lists your policies.
|
ListPolicyVersionsResult |
listPolicyVersions(ListPolicyVersionsRequest request)
Lists the versions of the specified policy, and identifies the default
version.
|
ListPrincipalPoliciesResult |
listPrincipalPolicies(ListPrincipalPoliciesRequest request)
Lists the policies attached to the specified principal.
|
ListPrincipalThingsResult |
listPrincipalThings(ListPrincipalThingsRequest request)
Lists the things associated with the specified principal.
|
ListThingPrincipalsResult |
listThingPrincipals(ListThingPrincipalsRequest request)
Lists the principals associated with the specified thing.
|
ListThingsResult |
listThings(ListThingsRequest request)
Lists your things.
|
ListTopicRulesResult |
listTopicRules(ListTopicRulesRequest request)
Lists the rules for the specific topic.
|
void |
rejectCertificateTransfer(RejectCertificateTransferRequest request)
Rejects a pending certificate transfer.
|
void |
replaceTopicRule(ReplaceTopicRuleRequest request)
Replaces the specified rule.
|
void |
setDefaultPolicyVersion(SetDefaultPolicyVersionRequest request)
Sets the specified version of the specified policy as the policy's
default (operative) version.
|
void |
setEndpoint(String endpoint)
Overrides the default endpoint for this client
("https://iot.us-east-1.amazonaws.com").
|
void |
setLoggingOptions(SetLoggingOptionsRequest request)
Sets the logging options.
|
void |
setRegion(Region region)
An alternative to
AWSIot.setEndpoint(String) , sets the regional
endpoint for this client's service calls. |
void |
shutdown()
Shuts down this client object, releasing any resources that might be held
open.
|
TransferCertificateResult |
transferCertificate(TransferCertificateRequest request)
Transfers the specified certificate to the specified AWS account.
|
void |
updateCertificate(UpdateCertificateRequest request)
Updates the status of the specified certificate.
|
UpdateThingResult |
updateThing(UpdateThingRequest request)
Updates the data for a thing.
|
public void setEndpoint(String endpoint)
AWSIot
Callers can pass in just the endpoint (ex: "iot.us-east-1.amazonaws.com")
or a full URL, including the protocol (ex:
"https://iot.us-east-1.amazonaws.com"). If the protocol is not specified
here, the default protocol from this client's ClientConfiguration
will be used, which by default is HTTPS.
For more information on using AWS regions with the AWS SDK for Java, and a complete list of all available endpoints for all AWS services, see: http://developer.amazonwebservices.com/connect/entry.jspa?externalID= 3912
This method is not threadsafe. An endpoint should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.
setEndpoint
in interface AWSIot
endpoint
- The endpoint (ex: "iot.us-east-1.amazonaws.com") or a full URL,
including the protocol (ex: "https://iot.us-east-1.amazonaws.com")
of the region specific AWS endpoint this client will communicate
with.public void setRegion(Region region)
AWSIot
AWSIot.setEndpoint(String)
, sets the regional
endpoint for this client's service calls. Callers can use this method to
control which AWS region they want to work with.
By default, all service endpoints in all regions use the https protocol.
To use http instead, specify it in the ClientConfiguration
supplied at construction.
This method is not threadsafe. A region should be configured when the client is created and before any service requests are made. Changing it afterwards creates inevitable race conditions for any service requests in transit or retrying.
setRegion
in interface AWSIot
region
- The region this client will communicate with. See
Region.getRegion(com.amazonaws.regions.Regions)
for
accessing a given region. Must not be null and must be a region
where the service is available.Region.getRegion(com.amazonaws.regions.Regions)
,
Region.createClient(Class,
com.amazonaws.auth.AWSCredentialsProvider, ClientConfiguration)
,
Region.isServiceSupported(String)
public void acceptCertificateTransfer(AcceptCertificateTransferRequest request)
AWSIot
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.
acceptCertificateTransfer
in interface AWSIot
request
- The input for the AcceptCertificateTransfer operation.public void attachPrincipalPolicy(AttachPrincipalPolicyRequest request)
AWSIot
Attaches the specified policy to the specified principal (certificate or other credential).
attachPrincipalPolicy
in interface AWSIot
request
- The input for the AttachPrincipalPolicy operation.public AttachThingPrincipalResult attachThingPrincipal(AttachThingPrincipalRequest request)
AWSIot
Attaches the specified principal to the specified thing.
attachThingPrincipal
in interface AWSIot
request
- The input for the AttachThingPrincipal operation.public void cancelCertificateTransfer(CancelCertificateTransferRequest request)
AWSIot
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. Once the destination account has accepted the transfer, the transfer may no longer be cancelled.
After a certificate transfer is cancelled, the status of the certificate changes from PENDING_TRANSFER to INACTIVE.
cancelCertificateTransfer
in interface AWSIot
request
- The input for the CancelCertificateTransfer operation.public CreateCertificateFromCsrResult createCertificateFromCsr(CreateCertificateFromCsrRequest request)
AWSIot
Creates an X.509 certificate using the specified certificate signing request.
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 and copying multiple .csr files into that directory and 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 OSX, 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 filename 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 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"
createCertificateFromCsr
in interface AWSIot
request
- The input for the CreateCertificateFromCsr operation.public CreateKeysAndCertificateResult createKeysAndCertificate(CreateKeysAndCertificateRequest request)
AWSIot
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. It is important to keep track of the private key.
createKeysAndCertificate
in interface AWSIot
request
- The input for the CreateKeysAndCertificate operation.public CreatePolicyResult createPolicy(CreatePolicyRequest request)
AWSIot
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.
createPolicy
in interface AWSIot
request
- The input for the CreatePolicy operation.public CreatePolicyVersionResult createPolicyVersion(CreatePolicyVersionRequest request)
AWSIot
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 delete an existing version using DeletePolicyVersion before you create a new version.
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 that the policy is attached to.
createPolicyVersion
in interface AWSIot
request
- The input for the CreatePolicyVersion operation.public CreateThingResult createThing(CreateThingRequest request)
AWSIot
Creates a thing in the thing registry.
createThing
in interface AWSIot
request
- The input for the CreateThing operation.public void createTopicRule(CreateTopicRuleRequest request)
AWSIot
Creates a rule.
createTopicRule
in interface AWSIot
request
- The input for the CreateTopicRule operation.public void deleteCertificate(DeleteCertificateRequest request)
AWSIot
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 detach all policies using the DetachPrincipalPolicy API. Next use the UpdateCertificate API to set the certificate to the INACTIVE status.
deleteCertificate
in interface AWSIot
request
- The input for the DeleteCertificate operation.public void deletePolicy(DeletePolicyRequest request)
AWSIot
Deletes the specified policy.
A policy cannot be deleted if it has non-default versions and/or it is attached to any certificate.
To delete a policy, delete all non-default versions of the policy using the DeletePolicyVersion API, detach the policy from any certificate using the DetachPrincipalPolicy API, and then use the DeletePolicy API to delete the policy.
When a policy is deleted using DeletePolicy, its default version is deleted with it.
deletePolicy
in interface AWSIot
request
- The input for the DeletePolicy operation.public void deletePolicyVersion(DeletePolicyVersionRequest request)
AWSIot
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.
deletePolicyVersion
in interface AWSIot
request
- The input for the DeletePolicyVersion operation.public DeleteThingResult deleteThing(DeleteThingRequest request)
AWSIot
Deletes the specified thing from the Thing Registry.
deleteThing
in interface AWSIot
request
- The input for the DeleteThing operation.public void deleteTopicRule(DeleteTopicRuleRequest request)
AWSIot
Deletes the specified rule.
deleteTopicRule
in interface AWSIot
request
- The input for the DeleteTopicRule operation.public DescribeCertificateResult describeCertificate(DescribeCertificateRequest request)
AWSIot
Gets information about the specified certificate.
describeCertificate
in interface AWSIot
request
- The input for the DescribeCertificate operation.public DescribeEndpointResult describeEndpoint(DescribeEndpointRequest request)
AWSIot
Returns a unique endpoint specific to the AWS account making the call. You specify the following URI when updating state information for your thing: https://endpoint/things/thingName/shadow.
describeEndpoint
in interface AWSIot
request
- The input for the DescribeEndpoint operation.public DescribeThingResult describeThing(DescribeThingRequest request)
AWSIot
Gets information about the specified thing.
describeThing
in interface AWSIot
request
- The input for the DescribeThing operation.public void detachPrincipalPolicy(DetachPrincipalPolicyRequest request)
AWSIot
Removes the specified policy from the specified certificate.
detachPrincipalPolicy
in interface AWSIot
request
- The input for the DetachPrincipalPolicy operation.public DetachThingPrincipalResult detachThingPrincipal(DetachThingPrincipalRequest request)
AWSIot
Detaches the specified principal from the specified thing.
detachThingPrincipal
in interface AWSIot
request
- The input for the DetachThingPrincipal operation.public GetLoggingOptionsResult getLoggingOptions(GetLoggingOptionsRequest request)
AWSIot
Gets the logging options.
getLoggingOptions
in interface AWSIot
request
- The input for the GetLoggingOptions operation.public GetPolicyResult getPolicy(GetPolicyRequest request)
AWSIot
Gets information about the specified policy with the policy document of the default version.
public GetPolicyVersionResult getPolicyVersion(GetPolicyVersionRequest request)
AWSIot
Gets information about the specified policy version.
getPolicyVersion
in interface AWSIot
request
- The input for the GetPolicyVersion operation.public GetTopicRuleResult getTopicRule(GetTopicRuleRequest request)
AWSIot
Gets information about the specified rule.
getTopicRule
in interface AWSIot
request
- The input for the GetTopicRule operation.public ListCertificatesResult listCertificates(ListCertificatesRequest request)
AWSIot
Lists your certificates.
The results are paginated with a default page size of 25. You can retrieve additional results using the returned marker.
listCertificates
in interface AWSIot
request
- The input for the ListCertificates operation.public ListPoliciesResult listPolicies(ListPoliciesRequest request)
AWSIot
Lists your policies.
listPolicies
in interface AWSIot
request
- The input for the ListPolicies operation.public ListPolicyVersionsResult listPolicyVersions(ListPolicyVersionsRequest request)
AWSIot
Lists the versions of the specified policy, and identifies the default version.
listPolicyVersions
in interface AWSIot
request
- The input for the ListPolicyVersions operation.public ListPrincipalPoliciesResult listPrincipalPolicies(ListPrincipalPoliciesRequest request)
AWSIot
Lists the policies attached to the specified principal. If you use an Amazon Cognito identity, the ID needs to be in Amazon Cognito Identity format.
listPrincipalPolicies
in interface AWSIot
request
- The input for the ListPrincipalPolicies operation.public ListPrincipalThingsResult listPrincipalThings(ListPrincipalThingsRequest request)
AWSIot
Lists the things associated with the specified principal.
listPrincipalThings
in interface AWSIot
request
- The input for the ListPrincipalThings operation.public ListThingPrincipalsResult listThingPrincipals(ListThingPrincipalsRequest request)
AWSIot
Lists the principals associated with the specified thing.
listThingPrincipals
in interface AWSIot
request
- The input for the ListThingPrincipal operation.public ListThingsResult listThings(ListThingsRequest request)
AWSIot
Lists your things. You can pass an AttributeName and/or AttributeValue to filter your things. For example: "ListThings where AttributeName=Color and AttributeValue=Red"
listThings
in interface AWSIot
request
- The input for the ListThings operation.public ListTopicRulesResult listTopicRules(ListTopicRulesRequest request)
AWSIot
Lists the rules for the specific topic.
listTopicRules
in interface AWSIot
request
- The input for the ListTopicRules operation.public void rejectCertificateTransfer(RejectCertificateTransferRequest request)
AWSIot
Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, the certificate status changes from PENDING_TRANFER to INACTIVE.
To check for pending certificate transfers, call ListCertificates to enumerate your certificates.
This operation can only be called by the transfer destination. Once called, the certificate will be returned to the source's account in the INACTIVE state.
rejectCertificateTransfer
in interface AWSIot
request
- The input for the RejectCertificateTransfer operation.public void replaceTopicRule(ReplaceTopicRuleRequest request)
AWSIot
Replaces the specified rule. You must specify all parameters for the new rule.
replaceTopicRule
in interface AWSIot
request
- The input for the ReplaceTopicRule operation.public void setDefaultPolicyVersion(SetDefaultPolicyVersionRequest request)
AWSIot
Sets the specified version of the specified policy as the policy's default (operative) version. This action affects all certificates that the policy is attached to. To list the principals the policy is attached to, use the ListPrincipalPolicy API.
setDefaultPolicyVersion
in interface AWSIot
request
- The input for the SetDefaultPolicyVersion operation.public void setLoggingOptions(SetLoggingOptionsRequest request)
AWSIot
Sets the logging options.
setLoggingOptions
in interface AWSIot
request
- The input for the SetLoggingOptions operation.public TransferCertificateResult transferCertificate(TransferCertificateRequest request)
AWSIot
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. It can be deactivated using the UpdateCertificate API.
The certificate must not have any policies attached to it. These can be detached using the DetachPrincipalPolicy API.
transferCertificate
in interface AWSIot
request
- The input for the TransferCertificate operation.public void updateCertificate(UpdateCertificateRequest request)
AWSIot
Updates the status of the specified certificate. This operation is idempotent.
Moving a cert from the ACTIVE state (including REVOKED) will NOT disconnect currently-connected devices, although these devices will be unable to reconnect.
The ACTIVE state is required to authenticate devices connecting to AWS IoT using a certificate.
updateCertificate
in interface AWSIot
request
- The input for the UpdateCertificate operation.public UpdateThingResult updateThing(UpdateThingRequest request)
AWSIot
Updates the data for a thing.
updateThing
in interface AWSIot
request
- The input for the UpdateThing operation.public void shutdown()
AWSIot
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
AWSIot
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing a request.
getCachedResponseMetadata
in interface AWSIot
request
- The originally executed request.Copyright © 2013 Amazon Web Services, Inc. All Rights Reserved.