/*
* Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.iot;
import java.util.*;
import com.amazonaws.*;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.metrics.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.services.iot.model.*;
import com.amazonaws.services.iot.model.transform.*;
/**
* Client for accessing AWS IoT. All service calls made using this client are
* blocking, and will not return until the service call completes.
*
* IoT provides secure, bi-directional communication between Internet-connected
* devices (such as sensors, actuators, embedded devices, or smart appliances)
* and the Amazon Web Services cloud. You can discover your custom IoT-Data
* endpoint to communicate with, configure rules for data processing and
* integration with other services, organize resources associated with each
* device (Registry), configure logging, and create and manage policies and
* credentials to authenticate devices.
*
* jsonErrorUnmarshallers;
/**
* Constructs a new client to invoke service methods on AWSIot. A
* credentials provider chain will be used that searches for credentials in
* this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2
* metadata service
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @see DefaultAWSCredentialsProviderChain
*/
@Deprecated
public AWSIotClient() {
this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration());
}
/**
* Constructs a new client to invoke service methods on AWSIot. A
* credentials provider chain will be used that searches for credentials in
* this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2
* metadata service
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param clientConfiguration The client configuration options controlling
* how this client connects to AWSIot (ex: proxy settings, retry
* counts, etc.).
* @see DefaultAWSCredentialsProviderChain
*/
@Deprecated
public AWSIotClient(ClientConfiguration clientConfiguration) {
this(new DefaultAWSCredentialsProviderChain(), clientConfiguration);
}
/**
* Constructs a new client to invoke service methods on AWSIot using the
* specified AWS account credentials.
*
* The client requests are authenticated using the {@link AWSCredentials}
* provided in this constructor. Static AWSCredentials can be passed for
* quick testing. However, it is strongly recommended to use Amazon Cognito
* vended temporary credentials for use in production. This can be achieved
* by using {@link AWSMobileClient}. Please see
* https://aws-amplify.github.io/docs/android/authentication for
* instructions on how to enable {@link AWSMobileClient}.
*
*
* AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
* @Override
* public void onResult(final UserStateDetails details) {
* AWSIotClient client = new AWSIotClient(AWSMobileClient.getInstance());
* }
*
* @Override
* public void onError(final Exception e) {
* e.printStackTrace();
* }
* });
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentials The AWS credentials (access key ID and secret key)
* to use when authenticating with AWS services.
*/
public AWSIotClient(AWSCredentials awsCredentials) {
this(awsCredentials, new ClientConfiguration());
}
/**
* Constructs a new client to invoke service methods on AWSIot using the
* specified AWS account credentials and client configuration options.
*
* The client requests are authenticated using the {@link AWSCredentials}
* provided in this constructor. Static AWSCredentials can be passed for
* quick testing. However, it is strongly recommended to use Amazon Cognito
* vended temporary credentials for use in production. This can be achieved
* by using {@link AWSMobileClient}. Please see
* https://aws-amplify.github.io/docs/android/authentication for
* instructions on how to enable {@link AWSMobileClient}.
*
*
* AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
* @Override
* public void onResult(final UserStateDetails details) {
* AWSIotClient client = new AWSIotClient(AWSMobileClient.getInstance());
* }
*
* @Override
* public void onError(final Exception e) {
* e.printStackTrace();
* }
* });
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentials The AWS credentials (access key ID and secret key)
* to use when authenticating with AWS services.
* @param clientConfiguration The client configuration options controlling
* how this client connects to AWSIot (ex: proxy settings, retry
* counts, etc.).
*/
public AWSIotClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {
this(new StaticCredentialsProvider(awsCredentials), clientConfiguration);
}
/**
* Constructs a new client to invoke service methods on AWSIot using the
* specified AWS account credentials provider.
*
* The client requests are authenticated using the {@link AWSCredentials}
* provided by the {@link AWSCredentialsProvider}. Static AWSCredentials can
* be passed for quick testing. However, it is strongly recommended to use
* Amazon Cognito vended temporary credentials for use in production. This
* can be achieved by using {@link AWSMobileClient}. Please see
* https://aws-amplify.github.io/docs/android/authentication for
* instructions on how to enable {@link AWSMobileClient}.
*
*
* AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
* @Override
* public void onResult(final UserStateDetails details) {
* AWSIotClient client = new AWSIotClient(AWSMobileClient.getInstance());
* }
*
* @Override
* public void onError(final Exception e) {
* e.printStackTrace();
* }
* });
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentialsProvider The AWS credentials provider which will
* provide credentials to authenticate requests with AWS
* services.
*/
public AWSIotClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, new ClientConfiguration());
}
/**
* Constructs a new client to invoke service methods on AWSIot using the
* specified AWS account credentials provider and client configuration
* options.
*
* The client requests are authenticated using the {@link AWSCredentials}
* provided by the {@link AWSCredentialsProvider}. Static AWSCredentials can
* be passed for quick testing. However, it is strongly recommended to use
* Amazon Cognito vended temporary credentials for use in production. This
* can be achieved by using {@link AWSMobileClient}. Please see
* https://aws-amplify.github.io/docs/android/authentication for
* instructions on how to enable {@link AWSMobileClient}.
*
*
* AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
* @Override
* public void onResult(final UserStateDetails details) {
* AWSIotClient client = new AWSIotClient(AWSMobileClient.getInstance());
* }
*
* @Override
* public void onError(final Exception e) {
* e.printStackTrace();
* }
* });
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentialsProvider The AWS credentials provider which will
* provide credentials to authenticate requests with AWS
* services.
* @param clientConfiguration The client configuration options controlling
* how this client connects to AWSIot (ex: proxy settings, retry
* counts, etc.).
*/
public AWSIotClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, new UrlHttpClient(clientConfiguration));
}
/**
* Constructs a new client to invoke service methods on AWSIot using the
* specified AWS account credentials provider, client configuration options
* and request metric collector.
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentialsProvider The AWS credentials provider which will
* provide credentials to authenticate requests with AWS
* services.
* @param clientConfiguration The client configuration options controlling
* how this client connects to AWSIot (ex: proxy settings, retry
* counts, etc.).
* @param requestMetricCollector optional request metric collector
*/
@Deprecated
public AWSIotClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector) {
super(adjustClientConfiguration(clientConfiguration), requestMetricCollector);
this.awsCredentialsProvider = awsCredentialsProvider;
init();
}
/**
* Constructs a new client to invoke service methods on AWSIot using the
* specified AWS account credentials provider, client configuration options
* and request metric collector.
*
* The client requests are authenticated using the {@link AWSCredentials}
* provided by the {@link AWSCredentialsProvider}. Static AWSCredentials can
* be passed for quick testing. However, it is strongly recommended to use
* Amazon Cognito vended temporary credentials for use in production. This
* can be achieved by using {@link AWSMobileClient}. Please see
* https://aws-amplify.github.io/docs/android/authentication for
* instructions on how to enable {@link AWSMobileClient}.
*
*
* AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() {
* @Override
* public void onResult(final UserStateDetails details) {
* AWSIotClient client = new AWSIotClient(AWSMobileClient.getInstance());
* }
*
* @Override
* public void onError(final Exception e) {
* e.printStackTrace();
* }
* });
*
*
* All service calls made using this new client object are blocking, and
* will not return until the service call completes.
*
* @param awsCredentialsProvider The AWS credentials provider which will
* provide credentials to authenticate requests with AWS
* services.
* @param clientConfiguration The client configuration options controlling
* how this client connects to AWSIot (ex: proxy settings, retry
* counts, etc.).
* @param httpClient A http client
*/
public AWSIotClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration, HttpClient httpClient) {
super(adjustClientConfiguration(clientConfiguration), httpClient);
this.awsCredentialsProvider = awsCredentialsProvider;
init();
}
private void init() {
jsonErrorUnmarshallers = new ArrayList();
jsonErrorUnmarshallers.add(new CertificateConflictExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new CertificateStateExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new CertificateValidationExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ConflictExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ConflictingResourceUpdateExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new DeleteConflictExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new IndexNotReadyExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new InternalExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new InternalFailureExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new InternalServerExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new InvalidAggregationExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new InvalidQueryExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new InvalidRequestExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new InvalidResponseExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new InvalidStateTransitionExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new LimitExceededExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new MalformedPolicyExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new NotConfiguredExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new RegistrationCodeValidationExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ResourceAlreadyExistsExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ResourceNotFoundExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ResourceRegistrationFailureExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ServiceQuotaExceededExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ServiceUnavailableExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new SqlParseExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new TaskAlreadyExistsExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ThrottlingExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new TransferAlreadyCompletedExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new TransferConflictExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new UnauthorizedExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new ValidationExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new VersionConflictExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new VersionsLimitExceededExceptionUnmarshaller());
jsonErrorUnmarshallers.add(new JsonErrorUnmarshaller());
// calling this.setEndPoint(...) will also modify the signer accordingly
setServiceNameIntern("iot");
this.setEndpoint("iot.us-east-1.amazonaws.com");
this.endpointPrefix = "iot";
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain(
"/com/amazonaws/services/iot/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain(
"/com/amazonaws/services/iot/request.handler2s"));
}
private static ClientConfiguration adjustClientConfiguration(ClientConfiguration orig) {
ClientConfiguration config = orig;
return config;
}
/**
*
* 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.
*
*
* Requires permission to access the AcceptCertificateTransfer action.
*
*
* @param acceptCertificateTransferRequest
* The input for the AcceptCertificateTransfer operation.
*
* @throws ResourceNotFoundException
* @throws TransferAlreadyCompletedException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public void acceptCertificateTransfer(
AcceptCertificateTransferRequest acceptCertificateTransferRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(acceptCertificateTransferRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AcceptCertificateTransferRequestMarshaller()
.marshall(acceptCertificateTransferRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
JsonResponseHandler responseHandler = new JsonResponseHandler(null);
invoke(request, responseHandler, executionContext);
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Adds a thing to a billing group.
*
*
* Requires permission to access the AddThingToBillingGroup action.
*
*
* @param addThingToBillingGroupRequest
* @return addThingToBillingGroupResult The response from the
* AddThingToBillingGroup service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws ResourceNotFoundException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public AddThingToBillingGroupResult addThingToBillingGroup(
AddThingToBillingGroupRequest addThingToBillingGroupRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(addThingToBillingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AddThingToBillingGroupRequestMarshaller()
.marshall(addThingToBillingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new AddThingToBillingGroupResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Adds a thing to a thing group.
*
*
* Requires permission to access the AddThingToThingGroup action.
*
*
* @param addThingToThingGroupRequest
* @return addThingToThingGroupResult The response from the
* AddThingToThingGroup service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws ResourceNotFoundException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public AddThingToThingGroupResult addThingToThingGroup(
AddThingToThingGroupRequest addThingToThingGroupRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(addThingToThingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AddThingToThingGroupRequestMarshaller()
.marshall(addThingToThingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new AddThingToThingGroupResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Associates a group with a continuous job. The following criteria must be
* met:
*
*
* -
*
* The job must have been created with the targetSelection
* field set to "CONTINUOUS".
*
*
* -
*
* The job status must currently be "IN_PROGRESS".
*
*
* -
*
* The total number of targets associated with a job must not exceed 100.
*
*
*
*
* Requires permission to access the AssociateTargetsWithJob action.
*
*
* @param associateTargetsWithJobRequest
* @return associateTargetsWithJobResult The response from the
* AssociateTargetsWithJob service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceNotFoundException
* @throws LimitExceededException
* @throws ThrottlingException
* @throws ServiceUnavailableException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public AssociateTargetsWithJobResult associateTargetsWithJob(
AssociateTargetsWithJobRequest associateTargetsWithJobRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(associateTargetsWithJobRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AssociateTargetsWithJobRequestMarshaller()
.marshall(associateTargetsWithJobRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new AssociateTargetsWithJobResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Attaches the specified policy to the specified principal (certificate or
* other credential).
*
*
* Requires permission to access the AttachPolicy action.
*
*
* @param attachPolicyRequest
* @throws ResourceNotFoundException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws LimitExceededException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public void attachPolicy(AttachPolicyRequest attachPolicyRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(attachPolicyRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachPolicyRequestMarshaller().marshall(attachPolicyRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
JsonResponseHandler responseHandler = new JsonResponseHandler(null);
invoke(request, responseHandler, executionContext);
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Attaches the specified policy to the specified principal (certificate or
* other credential).
*
*
* Note: This action is deprecated and works as expected for backward
* compatibility, but we won't add enhancements. Use AttachPolicy
* instead.
*
*
* Requires permission to access the AttachPrincipalPolicy action.
*
*
* @param attachPrincipalPolicyRequest
* The input for the AttachPrincipalPolicy operation.
*
* @throws ResourceNotFoundException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws LimitExceededException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
@Deprecated
public void attachPrincipalPolicy(AttachPrincipalPolicyRequest attachPrincipalPolicyRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(attachPrincipalPolicyRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachPrincipalPolicyRequestMarshaller()
.marshall(attachPrincipalPolicyRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
JsonResponseHandler responseHandler = new JsonResponseHandler(null);
invoke(request, responseHandler, executionContext);
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Associates a Device Defender security profile with a thing group or this
* account. Each thing group or account can have up to five security
* profiles associated with it.
*
*
* Requires permission to access the AttachSecurityProfile action.
*
*
* @param attachSecurityProfileRequest
* @return attachSecurityProfileResult The response from the
* AttachSecurityProfile service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceNotFoundException
* @throws LimitExceededException
* @throws VersionConflictException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public AttachSecurityProfileResult attachSecurityProfile(
AttachSecurityProfileRequest attachSecurityProfileRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(attachSecurityProfileRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachSecurityProfileRequestMarshaller()
.marshall(attachSecurityProfileRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new AttachSecurityProfileResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Attaches the specified principal to the specified thing. A principal can
* be X.509 certificates, Amazon Cognito identities or federated identities.
*
*
* Requires permission to access the AttachThingPrincipal action.
*
*
* @param attachThingPrincipalRequest
* The input for the AttachThingPrincipal operation.
*
* @return attachThingPrincipalResult The response from the
* AttachThingPrincipal service method, as returned by AWS IoT.
* @throws ResourceNotFoundException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public AttachThingPrincipalResult attachThingPrincipal(
AttachThingPrincipalRequest attachThingPrincipalRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(attachThingPrincipalRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AttachThingPrincipalRequestMarshaller()
.marshall(attachThingPrincipalRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new AttachThingPrincipalResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Cancels a mitigation action task that is in progress. If the task is not
* in progress, an InvalidRequestException occurs.
*
*
* Requires permission to access the CancelAuditMitigationActionsTask action.
*
*
* @param cancelAuditMitigationActionsTaskRequest
* @return cancelAuditMitigationActionsTaskResult The response from the
* CancelAuditMitigationActionsTask service method, as returned by
* AWS IoT.
* @throws ResourceNotFoundException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CancelAuditMitigationActionsTaskResult cancelAuditMitigationActionsTask(
CancelAuditMitigationActionsTaskRequest cancelAuditMitigationActionsTaskRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(cancelAuditMitigationActionsTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelAuditMitigationActionsTaskRequestMarshaller()
.marshall(cancelAuditMitigationActionsTaskRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CancelAuditMitigationActionsTaskResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Cancels an audit that is in progress. The audit can be either scheduled
* or on demand. If the audit isn't in progress, an
* "InvalidRequestException" occurs.
*
*
* Requires permission to access the CancelAuditTask action.
*
*
* @param cancelAuditTaskRequest
* @return cancelAuditTaskResult The response from the CancelAuditTask
* service method, as returned by AWS IoT.
* @throws ResourceNotFoundException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CancelAuditTaskResult cancelAuditTask(CancelAuditTaskRequest cancelAuditTaskRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(cancelAuditTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelAuditTaskRequestMarshaller().marshall(cancelAuditTaskRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CancelAuditTaskResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* 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, 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.
*
*
* Requires permission to access the CancelCertificateTransfer action.
*
*
* @param cancelCertificateTransferRequest
* The input for the CancelCertificateTransfer operation.
*
* @throws ResourceNotFoundException
* @throws TransferAlreadyCompletedException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public void cancelCertificateTransfer(
CancelCertificateTransferRequest cancelCertificateTransferRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(cancelCertificateTransferRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelCertificateTransferRequestMarshaller()
.marshall(cancelCertificateTransferRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
JsonResponseHandler responseHandler = new JsonResponseHandler(null);
invoke(request, responseHandler, executionContext);
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Cancels a Device Defender ML Detect mitigation action.
*
*
* Requires permission to access the CancelDetectMitigationActionsTask action.
*
*
* @param cancelDetectMitigationActionsTaskRequest
* @return cancelDetectMitigationActionsTaskResult The response from the
* CancelDetectMitigationActionsTask service method, as returned by
* AWS IoT.
* @throws ResourceNotFoundException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CancelDetectMitigationActionsTaskResult cancelDetectMitigationActionsTask(
CancelDetectMitigationActionsTaskRequest cancelDetectMitigationActionsTaskRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(cancelDetectMitigationActionsTaskRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelDetectMitigationActionsTaskRequestMarshaller()
.marshall(cancelDetectMitigationActionsTaskRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CancelDetectMitigationActionsTaskResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Cancels a job.
*
*
* Requires permission to access the CancelJob action.
*
*
* @param cancelJobRequest
* @return cancelJobResult The response from the CancelJob service method,
* as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceNotFoundException
* @throws ThrottlingException
* @throws ServiceUnavailableException
* @throws LimitExceededException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CancelJobResult cancelJob(CancelJobRequest cancelJobRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(cancelJobRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelJobRequestMarshaller().marshall(cancelJobRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CancelJobResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Cancels the execution of a job for a given thing.
*
*
* Requires permission to access the CancelJobExecution action.
*
*
* @param cancelJobExecutionRequest
* @throws InvalidRequestException
* @throws InvalidStateTransitionException
* @throws ResourceNotFoundException
* @throws ThrottlingException
* @throws ServiceUnavailableException
* @throws VersionConflictException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public void cancelJobExecution(CancelJobExecutionRequest cancelJobExecutionRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(cancelJobExecutionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CancelJobExecutionRequestMarshaller()
.marshall(cancelJobExecutionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
JsonResponseHandler responseHandler = new JsonResponseHandler(null);
invoke(request, responseHandler, executionContext);
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Clears the default authorizer.
*
*
* Requires permission to access the ClearDefaultAuthorizer action.
*
*
* @param clearDefaultAuthorizerRequest
* @return clearDefaultAuthorizerResult The response from the
* ClearDefaultAuthorizer service method, as returned by AWS IoT.
* @throws ResourceNotFoundException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public ClearDefaultAuthorizerResult clearDefaultAuthorizer(
ClearDefaultAuthorizerRequest clearDefaultAuthorizerRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(clearDefaultAuthorizerRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ClearDefaultAuthorizerRequestMarshaller()
.marshall(clearDefaultAuthorizerRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new ClearDefaultAuthorizerResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Confirms a topic rule destination. When you create a rule requiring a
* destination, IoT sends a confirmation message to the endpoint or base
* address you specify. The message includes a token which you pass back
* when calling ConfirmTopicRuleDestination
to confirm that you
* own or have access to the endpoint.
*
*
* Requires permission to access the ConfirmTopicRuleDestination action.
*
*
* @param confirmTopicRuleDestinationRequest
* @return confirmTopicRuleDestinationResult The response from the
* ConfirmTopicRuleDestination service method, as returned by AWS
* IoT.
* @throws InternalException
* @throws InvalidRequestException
* @throws ServiceUnavailableException
* @throws UnauthorizedException
* @throws ConflictingResourceUpdateException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public ConfirmTopicRuleDestinationResult confirmTopicRuleDestination(
ConfirmTopicRuleDestinationRequest confirmTopicRuleDestinationRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(confirmTopicRuleDestinationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ConfirmTopicRuleDestinationRequestMarshaller()
.marshall(confirmTopicRuleDestinationRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new ConfirmTopicRuleDestinationResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a Device Defender audit suppression.
*
*
* Requires permission to access the CreateAuditSuppression action.
*
*
* @param createAuditSuppressionRequest
* @return createAuditSuppressionResult The response from the
* CreateAuditSuppression service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceAlreadyExistsException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws LimitExceededException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateAuditSuppressionResult createAuditSuppression(
CreateAuditSuppressionRequest createAuditSuppressionRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createAuditSuppressionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateAuditSuppressionRequestMarshaller()
.marshall(createAuditSuppressionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateAuditSuppressionResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates an authorizer.
*
*
* Requires permission to access the CreateAuthorizer action.
*
*
* @param createAuthorizerRequest
* @return createAuthorizerResult The response from the CreateAuthorizer
* service method, as returned by AWS IoT.
* @throws ResourceAlreadyExistsException
* @throws InvalidRequestException
* @throws LimitExceededException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateAuthorizerResult createAuthorizer(CreateAuthorizerRequest createAuthorizerRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createAuthorizerRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateAuthorizerRequestMarshaller().marshall(createAuthorizerRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateAuthorizerResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a billing group.
*
*
* Requires permission to access the CreateBillingGroup action.
*
*
* @param createBillingGroupRequest
* @return createBillingGroupResult The response from the CreateBillingGroup
* service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceAlreadyExistsException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateBillingGroupResult createBillingGroup(
CreateBillingGroupRequest createBillingGroupRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createBillingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateBillingGroupRequestMarshaller()
.marshall(createBillingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateBillingGroupResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates an X.509 certificate using the specified certificate signing
* request.
*
*
* Requires permission to access the CreateCertificateFromCsr action.
*
*
*
* 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.
* For supported certificates, consult Certificate signing algorithms supported by IoT.
*
*
*
* 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. In the
* following commands, we assume that 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
Amazon
* Web Services CLI command to create a certificate for the corresponding
* CSR.
*
*
* You can also run the aws iot create-certificate-from-csr
* part of the command 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"
*
*
* @param createCertificateFromCsrRequest
* The input for the CreateCertificateFromCsr operation.
*
* @return createCertificateFromCsrResult The response from the
* CreateCertificateFromCsr service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateCertificateFromCsrResult createCertificateFromCsr(
CreateCertificateFromCsrRequest createCertificateFromCsrRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createCertificateFromCsrRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateCertificateFromCsrRequestMarshaller()
.marshall(createCertificateFromCsrRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateCertificateFromCsrResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Use this API to define a Custom Metric published by your devices to
* Device Defender.
*
*
* Requires permission to access the CreateCustomMetric action.
*
*
* @param createCustomMetricRequest
* @return createCustomMetricResult The response from the CreateCustomMetric
* service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws LimitExceededException
* @throws ResourceAlreadyExistsException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateCustomMetricResult createCustomMetric(
CreateCustomMetricRequest createCustomMetricRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createCustomMetricRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateCustomMetricRequestMarshaller()
.marshall(createCustomMetricRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateCustomMetricResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Create a dimension that you can use to limit the scope of a metric used
* in a security profile for IoT Device Defender. For example, using a
* TOPIC_FILTER
dimension, you can narrow down the scope of the
* metric only to MQTT topics whose name match the pattern specified in the
* dimension.
*
*
* Requires permission to access the CreateDimension action.
*
*
* @param createDimensionRequest
* @return createDimensionResult The response from the CreateDimension
* service method, as returned by AWS IoT.
* @throws InternalFailureException
* @throws InvalidRequestException
* @throws LimitExceededException
* @throws ResourceAlreadyExistsException
* @throws ThrottlingException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateDimensionResult createDimension(CreateDimensionRequest createDimensionRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createDimensionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDimensionRequestMarshaller().marshall(createDimensionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateDimensionResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a domain configuration.
*
*
* Requires permission to access the CreateDomainConfiguration action.
*
*
* @param createDomainConfigurationRequest
* @return createDomainConfigurationResult The response from the
* CreateDomainConfiguration service method, as returned by AWS IoT.
* @throws LimitExceededException
* @throws CertificateValidationException
* @throws ResourceAlreadyExistsException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws InvalidRequestException
* @throws UnauthorizedException
* @throws ThrottlingException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateDomainConfigurationResult createDomainConfiguration(
CreateDomainConfigurationRequest createDomainConfigurationRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createDomainConfigurationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDomainConfigurationRequestMarshaller()
.marshall(createDomainConfigurationRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateDomainConfigurationResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a dynamic thing group.
*
*
* Requires permission to access the CreateDynamicThingGroup action.
*
*
* @param createDynamicThingGroupRequest
* @return createDynamicThingGroupResult The response from the
* CreateDynamicThingGroup service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceAlreadyExistsException
* @throws ResourceNotFoundException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws InvalidQueryException
* @throws LimitExceededException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateDynamicThingGroupResult createDynamicThingGroup(
CreateDynamicThingGroupRequest createDynamicThingGroupRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createDynamicThingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDynamicThingGroupRequestMarshaller()
.marshall(createDynamicThingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateDynamicThingGroupResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a fleet metric.
*
*
* Requires permission to access the CreateFleetMetric action.
*
*
* @param createFleetMetricRequest
* @return createFleetMetricResult The response from the CreateFleetMetric
* service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws LimitExceededException
* @throws ResourceAlreadyExistsException
* @throws ResourceNotFoundException
* @throws InvalidQueryException
* @throws InvalidAggregationException
* @throws IndexNotReadyException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateFleetMetricResult createFleetMetric(
CreateFleetMetricRequest createFleetMetricRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createFleetMetricRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateFleetMetricRequestMarshaller()
.marshall(createFleetMetricRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateFleetMetricResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a job.
*
*
* Requires permission to access the CreateJob action.
*
*
* @param createJobRequest
* @return createJobResult The response from the CreateJob service method,
* as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceNotFoundException
* @throws ResourceAlreadyExistsException
* @throws LimitExceededException
* @throws ThrottlingException
* @throws ServiceUnavailableException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateJobResult createJob(CreateJobRequest createJobRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createJobRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateJobRequestMarshaller().marshall(createJobRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateJobResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a job template.
*
*
* Requires permission to access the CreateJobTemplate action.
*
*
* @param createJobTemplateRequest
* @return createJobTemplateResult The response from the CreateJobTemplate
* service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceNotFoundException
* @throws ConflictException
* @throws LimitExceededException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateJobTemplateResult createJobTemplate(
CreateJobTemplateRequest createJobTemplateRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createJobTemplateRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateJobTemplateRequestMarshaller()
.marshall(createJobTemplateRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateJobTemplateResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a 2048-bit RSA key pair and issues an X.509 certificate using the
* issued public key. You can also call
* CreateKeysAndCertificate
over MQTT from a device, for more
* information, see Provisioning MQTT API.
*
*
* Note This is the only time IoT issues the private key for this
* certificate, so it is important to keep it in a secure location.
*
*
* Requires permission to access the CreateKeysAndCertificate action.
*
*
* @param createKeysAndCertificateRequest
* The input for the CreateKeysAndCertificate operation.
*
*
* Requires permission to access the CreateKeysAndCertificateRequest action.
*
* @return createKeysAndCertificateResult The response from the
* CreateKeysAndCertificate service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateKeysAndCertificateResult createKeysAndCertificate(
CreateKeysAndCertificateRequest createKeysAndCertificateRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createKeysAndCertificateRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateKeysAndCertificateRequestMarshaller()
.marshall(createKeysAndCertificateRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateKeysAndCertificateResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Defines an action that can be applied to audit findings by using
* StartAuditMitigationActionsTask. Only certain types of mitigation actions
* can be applied to specific check names. For more information, see Mitigation actions. Each mitigation action can apply only one type
* of change.
*
*
* Requires permission to access the CreateMitigationAction action.
*
*
* @param createMitigationActionRequest
* @return createMitigationActionResult The response from the
* CreateMitigationAction service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceAlreadyExistsException
* @throws LimitExceededException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateMitigationActionResult createMitigationAction(
CreateMitigationActionRequest createMitigationActionRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createMitigationActionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateMitigationActionRequestMarshaller()
.marshall(createMitigationActionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateMitigationActionResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates an IoT OTA update on a target group of things or groups.
*
*
* Requires permission to access the CreateOTAUpdate action.
*
*
* @param createOTAUpdateRequest
* @return createOTAUpdateResult The response from the CreateOTAUpdate
* service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws LimitExceededException
* @throws ResourceNotFoundException
* @throws ResourceAlreadyExistsException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws InternalFailureException
* @throws ServiceUnavailableException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateOTAUpdateResult createOTAUpdate(CreateOTAUpdateRequest createOTAUpdateRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createOTAUpdateRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateOTAUpdateRequestMarshaller().marshall(createOTAUpdateRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateOTAUpdateResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates an IoT software package that can be deployed to your fleet.
*
*
* Requires permission to access the CreatePackage and GetIndexingConfiguration actions.
*
*
* @param createPackageRequest
* @return createPackageResult The response from the CreatePackage service
* method, as returned by AWS IoT.
* @throws ThrottlingException
* @throws ConflictException
* @throws InternalServerException
* @throws ValidationException
* @throws ServiceQuotaExceededException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreatePackageResult createPackage(CreatePackageRequest createPackageRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createPackageRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreatePackageRequestMarshaller().marshall(createPackageRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreatePackageResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a new version for an existing IoT software package.
*
*
* Requires permission to access the CreatePackageVersion and GetIndexingConfiguration actions.
*
*
* @param createPackageVersionRequest
* @return createPackageVersionResult The response from the
* CreatePackageVersion service method, as returned by AWS IoT.
* @throws ThrottlingException
* @throws ConflictException
* @throws InternalServerException
* @throws ValidationException
* @throws ServiceQuotaExceededException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreatePackageVersionResult createPackageVersion(
CreatePackageVersionRequest createPackageVersionRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createPackageVersionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreatePackageVersionRequestMarshaller()
.marshall(createPackageVersionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreatePackageVersionResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates an 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.
*
*
* Requires permission to access the CreatePolicy action.
*
*
* @param createPolicyRequest
* The input for the CreatePolicy operation.
*
* @return createPolicyResult The response from the CreatePolicy service
* method, as returned by AWS IoT.
* @throws ResourceAlreadyExistsException
* @throws MalformedPolicyException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreatePolicyResult createPolicy(CreatePolicyRequest createPolicyRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createPolicyRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreatePolicyRequestMarshaller().marshall(createPolicyRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreatePolicyResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a new version of the specified 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).
*
*
* Requires permission to access the CreatePolicyVersion action.
*
*
* @param createPolicyVersionRequest
* The input for the CreatePolicyVersion operation.
*
* @return createPolicyVersionResult The response from the
* CreatePolicyVersion service method, as returned by AWS IoT.
* @throws ResourceNotFoundException
* @throws MalformedPolicyException
* @throws VersionsLimitExceededException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreatePolicyVersionResult createPolicyVersion(
CreatePolicyVersionRequest createPolicyVersionRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createPolicyVersionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreatePolicyVersionRequestMarshaller()
.marshall(createPolicyVersionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreatePolicyVersionResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a provisioning claim.
*
*
* Requires permission to access the CreateProvisioningClaim action.
*
*
* @param createProvisioningClaimRequest
* @return createProvisioningClaimResult The response from the
* CreateProvisioningClaim service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceNotFoundException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateProvisioningClaimResult createProvisioningClaim(
CreateProvisioningClaimRequest createProvisioningClaimRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createProvisioningClaimRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateProvisioningClaimRequestMarshaller()
.marshall(createProvisioningClaimRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateProvisioningClaimResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a provisioning template.
*
*
* Requires permission to access the CreateProvisioningTemplate action.
*
*
* @param createProvisioningTemplateRequest
* @return createProvisioningTemplateResult The response from the
* CreateProvisioningTemplate service method, as returned by AWS
* IoT.
* @throws InternalFailureException
* @throws InvalidRequestException
* @throws LimitExceededException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ResourceAlreadyExistsException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateProvisioningTemplateResult createProvisioningTemplate(
CreateProvisioningTemplateRequest createProvisioningTemplateRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createProvisioningTemplateRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateProvisioningTemplateRequestMarshaller()
.marshall(createProvisioningTemplateRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateProvisioningTemplateResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a new version of a provisioning template.
*
*
* Requires permission to access the CreateProvisioningTemplateVersion action.
*
*
* @param createProvisioningTemplateVersionRequest
* @return createProvisioningTemplateVersionResult The response from the
* CreateProvisioningTemplateVersion service method, as returned by
* AWS IoT.
* @throws VersionsLimitExceededException
* @throws InternalFailureException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws ResourceNotFoundException
* @throws UnauthorizedException
* @throws ConflictingResourceUpdateException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateProvisioningTemplateVersionResult createProvisioningTemplateVersion(
CreateProvisioningTemplateVersionRequest createProvisioningTemplateVersionRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createProvisioningTemplateVersionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateProvisioningTemplateVersionRequestMarshaller()
.marshall(createProvisioningTemplateVersionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateProvisioningTemplateVersionResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a role alias.
*
*
* Requires permission to access the CreateRoleAlias action.
*
*
* @param createRoleAliasRequest
* @return createRoleAliasResult The response from the CreateRoleAlias
* service method, as returned by AWS IoT.
* @throws ResourceAlreadyExistsException
* @throws InvalidRequestException
* @throws LimitExceededException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateRoleAliasResult createRoleAlias(CreateRoleAliasRequest createRoleAliasRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createRoleAliasRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateRoleAliasRequestMarshaller().marshall(createRoleAliasRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateRoleAliasResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a scheduled audit that is run at a specified time interval.
*
*
* Requires permission to access the CreateScheduledAudit action.
*
*
* @param createScheduledAuditRequest
* @return createScheduledAuditResult The response from the
* CreateScheduledAudit service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceAlreadyExistsException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws LimitExceededException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateScheduledAuditResult createScheduledAudit(
CreateScheduledAuditRequest createScheduledAuditRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createScheduledAuditRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateScheduledAuditRequestMarshaller()
.marshall(createScheduledAuditRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateScheduledAuditResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a Device Defender security profile.
*
*
* Requires permission to access the CreateSecurityProfile action.
*
*
* @param createSecurityProfileRequest
* @return createSecurityProfileResult The response from the
* CreateSecurityProfile service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceAlreadyExistsException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateSecurityProfileResult createSecurityProfile(
CreateSecurityProfileRequest createSecurityProfileRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createSecurityProfileRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateSecurityProfileRequestMarshaller()
.marshall(createSecurityProfileRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateSecurityProfileResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a stream for delivering one or more large files in chunks over
* MQTT. A stream transports data bytes in chunks or blocks packaged as MQTT
* messages from a source like S3. You can have one or more files associated
* with a stream.
*
*
* Requires permission to access the CreateStream action.
*
*
* @param createStreamRequest
* @return createStreamResult The response from the CreateStream service
* method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws LimitExceededException
* @throws ResourceNotFoundException
* @throws ResourceAlreadyExistsException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateStreamResult createStream(CreateStreamRequest createStreamRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createStreamRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateStreamRequestMarshaller().marshall(createStreamRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateStreamResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a thing record in the registry. If this call is made multiple
* times using the same thing name and configuration, the call will succeed.
* If this call is made with the same thing name but different configuration
* a ResourceAlreadyExistsException
is thrown.
*
*
*
* This is a control plane operation. See Authorization for information about authorizing control plane
* actions.
*
*
*
* Requires permission to access the CreateThing action.
*
*
* @param createThingRequest
* The input for the CreateThing operation.
*
* @return createThingResult The response from the CreateThing service
* method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws ResourceAlreadyExistsException
* @throws ResourceNotFoundException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateThingResult createThing(CreateThingRequest createThingRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createThingRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateThingRequestMarshaller().marshall(createThingRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateThingResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Create a thing group.
*
*
*
* This is a control plane operation. See Authorization for information about authorizing control plane
* actions.
*
*
*
* Requires permission to access the CreateThingGroup action.
*
*
* @param createThingGroupRequest
* @return createThingGroupResult The response from the CreateThingGroup
* service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ResourceAlreadyExistsException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateThingGroupResult createThingGroup(CreateThingGroupRequest createThingGroupRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createThingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateThingGroupRequestMarshaller().marshall(createThingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateThingGroupResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a new thing type.
*
*
* Requires permission to access the CreateThingType action.
*
*
* @param createThingTypeRequest
* The input for the CreateThingType operation.
*
* @return createThingTypeResult The response from the CreateThingType
* service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws ResourceAlreadyExistsException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateThingTypeResult createThingType(CreateThingTypeRequest createThingTypeRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createThingTypeRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateThingTypeRequestMarshaller().marshall(createThingTypeRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateThingTypeResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* 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.
*
*
* Requires permission to access the CreateTopicRule action.
*
*
* @param createTopicRuleRequest
* The input for the CreateTopicRule operation.
*
* @throws SqlParseException
* @throws InternalException
* @throws InvalidRequestException
* @throws ResourceAlreadyExistsException
* @throws ServiceUnavailableException
* @throws ConflictingResourceUpdateException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public void createTopicRule(CreateTopicRuleRequest createTopicRuleRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createTopicRuleRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateTopicRuleRequestMarshaller().marshall(createTopicRuleRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
JsonResponseHandler responseHandler = new JsonResponseHandler(null);
invoke(request, responseHandler, executionContext);
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Creates a topic rule destination. The destination must be confirmed prior
* to use.
*
*
* Requires permission to access the CreateTopicRuleDestination action.
*
*
* @param createTopicRuleDestinationRequest
* @return createTopicRuleDestinationResult The response from the
* CreateTopicRuleDestination service method, as returned by AWS
* IoT.
* @throws InternalException
* @throws InvalidRequestException
* @throws ResourceAlreadyExistsException
* @throws ServiceUnavailableException
* @throws ConflictingResourceUpdateException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public CreateTopicRuleDestinationResult createTopicRuleDestination(
CreateTopicRuleDestinationRequest createTopicRuleDestinationRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(createTopicRuleDestinationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateTopicRuleDestinationRequestMarshaller()
.marshall(createTopicRuleDestinationRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new CreateTopicRuleDestinationResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Restores the default settings for Device Defender audits for this
* account. Any configuration data you entered is deleted and all audit
* checks are reset to disabled.
*
*
* Requires permission to access the DeleteAccountAuditConfiguration action.
*
*
* @param deleteAccountAuditConfigurationRequest
* @return deleteAccountAuditConfigurationResult The response from the
* DeleteAccountAuditConfiguration service method, as returned by
* AWS IoT.
* @throws InvalidRequestException
* @throws ResourceNotFoundException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public DeleteAccountAuditConfigurationResult deleteAccountAuditConfiguration(
DeleteAccountAuditConfigurationRequest deleteAccountAuditConfigurationRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(deleteAccountAuditConfigurationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteAccountAuditConfigurationRequestMarshaller()
.marshall(deleteAccountAuditConfigurationRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new DeleteAccountAuditConfigurationResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Deletes a Device Defender audit suppression.
*
*
* Requires permission to access the DeleteAuditSuppression action.
*
*
* @param deleteAuditSuppressionRequest
* @return deleteAuditSuppressionResult The response from the
* DeleteAuditSuppression service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public DeleteAuditSuppressionResult deleteAuditSuppression(
DeleteAuditSuppressionRequest deleteAuditSuppressionRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(deleteAuditSuppressionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteAuditSuppressionRequestMarshaller()
.marshall(deleteAuditSuppressionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new DeleteAuditSuppressionResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Deletes an authorizer.
*
*
* Requires permission to access the DeleteAuthorizer action.
*
*
* @param deleteAuthorizerRequest
* @return deleteAuthorizerResult The response from the DeleteAuthorizer
* service method, as returned by AWS IoT.
* @throws DeleteConflictException
* @throws ResourceNotFoundException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public DeleteAuthorizerResult deleteAuthorizer(DeleteAuthorizerRequest deleteAuthorizerRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(deleteAuthorizerRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteAuthorizerRequestMarshaller().marshall(deleteAuthorizerRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new DeleteAuthorizerResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Deletes the billing group.
*
*
* Requires permission to access the DeleteBillingGroup action.
*
*
* @param deleteBillingGroupRequest
* @return deleteBillingGroupResult The response from the DeleteBillingGroup
* service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws VersionConflictException
* @throws ThrottlingException
* @throws InternalFailureException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public DeleteBillingGroupResult deleteBillingGroup(
DeleteBillingGroupRequest deleteBillingGroupRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(deleteBillingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteBillingGroupRequestMarshaller()
.marshall(deleteBillingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new DeleteBillingGroupResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Deletes a registered CA certificate.
*
*
* Requires permission to access the DeleteCACertificate action.
*
*
* @param deleteCACertificateRequest
* Input for the DeleteCACertificate operation.
*
* @return deleteCACertificateResult The response from the
* DeleteCACertificate service method, as returned by AWS IoT.
* @throws InvalidRequestException
* @throws CertificateStateException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws ResourceNotFoundException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public DeleteCACertificateResult deleteCACertificate(
DeleteCACertificateRequest deleteCACertificateRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(deleteCACertificateRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteCACertificateRequestMarshaller()
.marshall(deleteCACertificateRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
Unmarshaller unmarshaller = new DeleteCACertificateResultJsonUnmarshaller();
JsonResponseHandler responseHandler = new JsonResponseHandler(
unmarshaller);
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
awsRequestMetrics.endEvent(Field.ClientExecuteTime);
endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);
}
}
/**
*
* Deletes the specified certificate.
*
*
* A certificate cannot be deleted if it has a policy or IoT thing attached
* to it or if its status is set to ACTIVE. To delete a certificate, first
* use the DetachPolicy action to detach all policies. Next, use the
* UpdateCertificate action to set the certificate to the INACTIVE
* status.
*
*
* Requires permission to access the DeleteCertificate action.
*
*
* @param deleteCertificateRequest
* The input for the DeleteCertificate operation.
*
* @throws CertificateStateException
* @throws DeleteConflictException
* @throws InvalidRequestException
* @throws ThrottlingException
* @throws UnauthorizedException
* @throws ServiceUnavailableException
* @throws InternalFailureException
* @throws ResourceNotFoundException
* @throws AmazonClientException If any internal errors are encountered
* inside the client while attempting to make the request or
* handle the response. For example if a network connection is
* not available.
* @throws AmazonServiceException If an error response is returned by AWS
* IoT indicating either a problem with the data in the request,
* or a server side issue.
*/
public void deleteCertificate(DeleteCertificateRequest deleteCertificateRequest)
throws AmazonServiceException, AmazonClientException {
ExecutionContext executionContext = createExecutionContext(deleteCertificateRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteCertificateRequestMarshaller()
.marshall(deleteCertificateRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
JsonResponseHandler