software.amazon.awssdk.services.route53recoveryreadiness.DefaultRoute53RecoveryReadinessClient Maven / Gradle / Ivy
/*
* Copyright 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 software.amazon.awssdk.services.route53recoveryreadiness;
import java.util.Collections;
import java.util.List;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.route53recoveryreadiness.model.AccessDeniedException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ConflictException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateCellRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateCellResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateCrossAccountAuthorizationRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateCrossAccountAuthorizationResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateReadinessCheckRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateReadinessCheckResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateRecoveryGroupRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateRecoveryGroupResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateResourceSetRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.CreateResourceSetResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteCellRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteCellResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteCrossAccountAuthorizationRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteCrossAccountAuthorizationResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteReadinessCheckRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteReadinessCheckResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteRecoveryGroupRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteRecoveryGroupResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteResourceSetRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.DeleteResourceSetResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetArchitectureRecommendationsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetArchitectureRecommendationsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetCellReadinessSummaryRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetCellReadinessSummaryResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetCellRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetCellResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckResourceStatusRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckResourceStatusResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckStatusRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetReadinessCheckStatusResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetRecoveryGroupReadinessSummaryRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetRecoveryGroupReadinessSummaryResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetRecoveryGroupRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetRecoveryGroupResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetResourceSetRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.GetResourceSetResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.InternalServerException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListCellsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListCellsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListCrossAccountAuthorizationsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListCrossAccountAuthorizationsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListReadinessChecksRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListReadinessChecksResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListRecoveryGroupsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListRecoveryGroupsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListResourceSetsRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListResourceSetsResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListRulesRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListRulesResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListTagsForResourcesRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ListTagsForResourcesResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ResourceNotFoundException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.Route53RecoveryReadinessException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.TagResourceRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.TagResourceResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ThrottlingException;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UntagResourceRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UntagResourceResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateCellRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateCellResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateReadinessCheckRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateReadinessCheckResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateRecoveryGroupRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateRecoveryGroupResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateResourceSetRequest;
import software.amazon.awssdk.services.route53recoveryreadiness.model.UpdateResourceSetResponse;
import software.amazon.awssdk.services.route53recoveryreadiness.model.ValidationException;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateCellRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateCrossAccountAuthorizationRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateReadinessCheckRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateRecoveryGroupRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.CreateResourceSetRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteCellRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteCrossAccountAuthorizationRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteReadinessCheckRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteRecoveryGroupRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.DeleteResourceSetRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetArchitectureRecommendationsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetCellReadinessSummaryRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetCellRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetReadinessCheckRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetReadinessCheckResourceStatusRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetReadinessCheckStatusRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetRecoveryGroupReadinessSummaryRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetRecoveryGroupRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.GetResourceSetRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListCellsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListCrossAccountAuthorizationsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListReadinessChecksRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListRecoveryGroupsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListResourceSetsRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListRulesRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.ListTagsForResourcesRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UpdateCellRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UpdateReadinessCheckRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UpdateRecoveryGroupRequestMarshaller;
import software.amazon.awssdk.services.route53recoveryreadiness.transform.UpdateResourceSetRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link Route53RecoveryReadinessClient}.
*
* @see Route53RecoveryReadinessClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultRoute53RecoveryReadinessClient implements Route53RecoveryReadinessClient {
private static final Logger log = Logger.loggerFor(DefaultRoute53RecoveryReadinessClient.class);
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
private final Route53RecoveryReadinessServiceClientConfiguration serviceClientConfiguration;
protected DefaultRoute53RecoveryReadinessClient(
Route53RecoveryReadinessServiceClientConfiguration serviceClientConfiguration,
SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.serviceClientConfiguration = serviceClientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Creates a cell in an account.
*
*
* @param createCellRequest
* @return Result of the CreateCell operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws ConflictException
* 409 response - Conflict exception. You might be using a predefined variable.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.CreateCell
* @see AWS API Documentation
*/
@Override
public CreateCellResponse createCell(CreateCellRequest createCellRequest) throws ThrottlingException, ValidationException,
InternalServerException, ConflictException, AccessDeniedException, AwsServiceException, SdkClientException,
Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateCellResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createCellRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCell");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("CreateCell")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(createCellRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateCellRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a cross-account readiness authorization. This lets you authorize another account to work with Route 53
* Application Recovery Controller, for example, to check the readiness status of resources in a separate account.
*
*
* @param createCrossAccountAuthorizationRequest
* @return Result of the CreateCrossAccountAuthorization operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws ConflictException
* 409 response - Conflict exception. You might be using a predefined variable.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.CreateCrossAccountAuthorization
* @see AWS API Documentation
*/
@Override
public CreateCrossAccountAuthorizationResponse createCrossAccountAuthorization(
CreateCrossAccountAuthorizationRequest createCrossAccountAuthorizationRequest) throws ThrottlingException,
ValidationException, InternalServerException, ConflictException, AccessDeniedException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateCrossAccountAuthorizationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createCrossAccountAuthorizationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCrossAccountAuthorization");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateCrossAccountAuthorization").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createCrossAccountAuthorizationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateCrossAccountAuthorizationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a readiness check in an account. A readiness check monitors a resource set in your application, such as a
* set of Amazon Aurora instances, that Application Recovery Controller is auditing recovery readiness for. The
* audits run once every minute on every resource that's associated with a readiness check.
*
*
* @param createReadinessCheckRequest
* @return Result of the CreateReadinessCheck operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws ConflictException
* 409 response - Conflict exception. You might be using a predefined variable.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.CreateReadinessCheck
* @see AWS API Documentation
*/
@Override
public CreateReadinessCheckResponse createReadinessCheck(CreateReadinessCheckRequest createReadinessCheckRequest)
throws ThrottlingException, ValidationException, InternalServerException, ConflictException, AccessDeniedException,
AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateReadinessCheckResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createReadinessCheckRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateReadinessCheck");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateReadinessCheck").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createReadinessCheckRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateReadinessCheckRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a recovery group in an account. A recovery group corresponds to an application and includes a list of the
* cells that make up the application.
*
*
* @param createRecoveryGroupRequest
* @return Result of the CreateRecoveryGroup operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws ConflictException
* 409 response - Conflict exception. You might be using a predefined variable.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.CreateRecoveryGroup
* @see AWS API Documentation
*/
@Override
public CreateRecoveryGroupResponse createRecoveryGroup(CreateRecoveryGroupRequest createRecoveryGroupRequest)
throws ThrottlingException, ValidationException, InternalServerException, ConflictException, AccessDeniedException,
AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateRecoveryGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createRecoveryGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateRecoveryGroup");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateRecoveryGroup").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createRecoveryGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateRecoveryGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a resource set. A resource set is a set of resources of one type that span multiple cells. You can
* associate a resource set with a readiness check to monitor the resources for failover readiness.
*
*
* @param createResourceSetRequest
* @return Result of the CreateResourceSet operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws ConflictException
* 409 response - Conflict exception. You might be using a predefined variable.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.CreateResourceSet
* @see AWS API Documentation
*/
@Override
public CreateResourceSetResponse createResourceSet(CreateResourceSetRequest createResourceSetRequest)
throws ThrottlingException, ValidationException, InternalServerException, ConflictException, AccessDeniedException,
AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateResourceSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createResourceSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateResourceSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateResourceSet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createResourceSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateResourceSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Delete a cell. When successful, the response code is 204, with no response body.
*
*
* @param deleteCellRequest
* @return Result of the DeleteCell operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.DeleteCell
* @see AWS API Documentation
*/
@Override
public DeleteCellResponse deleteCell(DeleteCellRequest deleteCellRequest) throws ResourceNotFoundException,
ThrottlingException, ValidationException, InternalServerException, AccessDeniedException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteCellResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCellRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCell");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("DeleteCell")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(deleteCellRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteCellRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes cross account readiness authorization.
*
*
* @param deleteCrossAccountAuthorizationRequest
* @return Result of the DeleteCrossAccountAuthorization operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.DeleteCrossAccountAuthorization
* @see AWS API Documentation
*/
@Override
public DeleteCrossAccountAuthorizationResponse deleteCrossAccountAuthorization(
DeleteCrossAccountAuthorizationRequest deleteCrossAccountAuthorizationRequest) throws ThrottlingException,
ValidationException, InternalServerException, AccessDeniedException, AwsServiceException, SdkClientException,
Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCrossAccountAuthorizationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteCrossAccountAuthorizationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCrossAccountAuthorization");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteCrossAccountAuthorization").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteCrossAccountAuthorizationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteCrossAccountAuthorizationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a readiness check.
*
*
* @param deleteReadinessCheckRequest
* @return Result of the DeleteReadinessCheck operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.DeleteReadinessCheck
* @see AWS API Documentation
*/
@Override
public DeleteReadinessCheckResponse deleteReadinessCheck(DeleteReadinessCheckRequest deleteReadinessCheckRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteReadinessCheckResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteReadinessCheckRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteReadinessCheck");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteReadinessCheck").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteReadinessCheckRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteReadinessCheckRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a recovery group.
*
*
* @param deleteRecoveryGroupRequest
* @return Result of the DeleteRecoveryGroup operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.DeleteRecoveryGroup
* @see AWS API Documentation
*/
@Override
public DeleteRecoveryGroupResponse deleteRecoveryGroup(DeleteRecoveryGroupRequest deleteRecoveryGroupRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteRecoveryGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteRecoveryGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteRecoveryGroup");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteRecoveryGroup").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteRecoveryGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteRecoveryGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a resource set.
*
*
* @param deleteResourceSetRequest
* @return Result of the DeleteResourceSet operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.DeleteResourceSet
* @see AWS API Documentation
*/
@Override
public DeleteResourceSetResponse deleteResourceSet(DeleteResourceSetRequest deleteResourceSetRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteResourceSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourceSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourceSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteResourceSet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteResourceSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteResourceSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets recommendations about architecture designs for improving resiliency for an application, based on a recovery
* group.
*
*
* @param getArchitectureRecommendationsRequest
* @return Result of the GetArchitectureRecommendations operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.GetArchitectureRecommendations
* @see AWS API Documentation
*/
@Override
public GetArchitectureRecommendationsResponse getArchitectureRecommendations(
GetArchitectureRecommendationsRequest getArchitectureRecommendationsRequest) throws ResourceNotFoundException,
ThrottlingException, ValidationException, InternalServerException, AccessDeniedException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetArchitectureRecommendationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getArchitectureRecommendationsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetArchitectureRecommendations");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetArchitectureRecommendations").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getArchitectureRecommendationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetArchitectureRecommendationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets information about a cell including cell name, cell Amazon Resource Name (ARN), ARNs of nested cells for this
* cell, and a list of those cell ARNs with their associated recovery group ARNs.
*
*
* @param getCellRequest
* @return Result of the GetCell operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.GetCell
* @see AWS API Documentation
*/
@Override
public GetCellResponse getCell(GetCellRequest getCellRequest) throws ResourceNotFoundException, ThrottlingException,
ValidationException, InternalServerException, AccessDeniedException, AwsServiceException, SdkClientException,
Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetCellResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getCellRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCell");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetCell").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getCellRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new GetCellRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets readiness for a cell. Aggregates the readiness of all the resources that are associated with the cell into a
* single value.
*
*
* @param getCellReadinessSummaryRequest
* @return Result of the GetCellReadinessSummary operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.GetCellReadinessSummary
* @see AWS API Documentation
*/
@Override
public GetCellReadinessSummaryResponse getCellReadinessSummary(GetCellReadinessSummaryRequest getCellReadinessSummaryRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetCellReadinessSummaryResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getCellReadinessSummaryRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCellReadinessSummary");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetCellReadinessSummary").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getCellReadinessSummaryRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetCellReadinessSummaryRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets details about a readiness check.
*
*
* @param getReadinessCheckRequest
* @return Result of the GetReadinessCheck operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.GetReadinessCheck
* @see AWS API Documentation
*/
@Override
public GetReadinessCheckResponse getReadinessCheck(GetReadinessCheckRequest getReadinessCheckRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetReadinessCheckResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getReadinessCheckRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetReadinessCheck");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetReadinessCheck").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getReadinessCheckRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetReadinessCheckRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets individual readiness status for a readiness check. To see the overall readiness status for a recovery group,
* that considers the readiness status for all the readiness checks in the recovery group, use
* GetRecoveryGroupReadinessSummary.
*
*
* @param getReadinessCheckResourceStatusRequest
* @return Result of the GetReadinessCheckResourceStatus operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.GetReadinessCheckResourceStatus
* @see AWS API Documentation
*/
@Override
public GetReadinessCheckResourceStatusResponse getReadinessCheckResourceStatus(
GetReadinessCheckResourceStatusRequest getReadinessCheckResourceStatusRequest) throws ResourceNotFoundException,
ThrottlingException, ValidationException, InternalServerException, AccessDeniedException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetReadinessCheckResourceStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getReadinessCheckResourceStatusRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetReadinessCheckResourceStatus");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetReadinessCheckResourceStatus").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getReadinessCheckResourceStatusRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetReadinessCheckResourceStatusRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets the readiness status for an individual readiness check. To see the overall readiness status for a recovery
* group, that considers the readiness status for all the readiness checks in a recovery group, use
* GetRecoveryGroupReadinessSummary.
*
*
* @param getReadinessCheckStatusRequest
* @return Result of the GetReadinessCheckStatus operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.GetReadinessCheckStatus
* @see AWS API Documentation
*/
@Override
public GetReadinessCheckStatusResponse getReadinessCheckStatus(GetReadinessCheckStatusRequest getReadinessCheckStatusRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetReadinessCheckStatusResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getReadinessCheckStatusRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetReadinessCheckStatus");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetReadinessCheckStatus").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getReadinessCheckStatusRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetReadinessCheckStatusRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Gets details about a recovery group, including a list of the cells that are included in it.
*
*
* @param getRecoveryGroupRequest
* @return Result of the GetRecoveryGroup operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.GetRecoveryGroup
* @see AWS API Documentation
*/
@Override
public GetRecoveryGroupResponse getRecoveryGroup(GetRecoveryGroupRequest getRecoveryGroupRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetRecoveryGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getRecoveryGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRecoveryGroup");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetRecoveryGroup").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getRecoveryGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetRecoveryGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Displays a summary of information about a recovery group's readiness status. Includes the readiness checks for
* resources in the recovery group and the readiness status of each one.
*
*
* @param getRecoveryGroupReadinessSummaryRequest
* @return Result of the GetRecoveryGroupReadinessSummary operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.GetRecoveryGroupReadinessSummary
* @see AWS API Documentation
*/
@Override
public GetRecoveryGroupReadinessSummaryResponse getRecoveryGroupReadinessSummary(
GetRecoveryGroupReadinessSummaryRequest getRecoveryGroupReadinessSummaryRequest) throws ResourceNotFoundException,
ThrottlingException, ValidationException, InternalServerException, AccessDeniedException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetRecoveryGroupReadinessSummaryResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getRecoveryGroupReadinessSummaryRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRecoveryGroupReadinessSummary");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetRecoveryGroupReadinessSummary").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getRecoveryGroupReadinessSummaryRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetRecoveryGroupReadinessSummaryRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Displays the details about a resource set, including a list of the resources in the set.
*
*
* @param getResourceSetRequest
* @return Result of the GetResourceSet operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.GetResourceSet
* @see AWS API Documentation
*/
@Override
public GetResourceSetResponse getResourceSet(GetResourceSetRequest getResourceSetRequest) throws ResourceNotFoundException,
ThrottlingException, ValidationException, InternalServerException, AccessDeniedException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetResourceSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getResourceSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResourceSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetResourceSet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getResourceSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetResourceSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the cells for an account.
*
*
* @param listCellsRequest
* @return Result of the ListCells operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.ListCells
* @see AWS API Documentation
*/
@Override
public ListCellsResponse listCells(ListCellsRequest listCellsRequest) throws ThrottlingException, ValidationException,
InternalServerException, AccessDeniedException, AwsServiceException, SdkClientException,
Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListCellsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listCellsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCells");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListCells").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listCellsRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new ListCellsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the cross-account readiness authorizations that are in place for an account.
*
*
* @param listCrossAccountAuthorizationsRequest
* @return Result of the ListCrossAccountAuthorizations operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.ListCrossAccountAuthorizations
* @see AWS API Documentation
*/
@Override
public ListCrossAccountAuthorizationsResponse listCrossAccountAuthorizations(
ListCrossAccountAuthorizationsRequest listCrossAccountAuthorizationsRequest) throws ThrottlingException,
ValidationException, InternalServerException, AccessDeniedException, AwsServiceException, SdkClientException,
Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListCrossAccountAuthorizationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listCrossAccountAuthorizationsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCrossAccountAuthorizations");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListCrossAccountAuthorizations").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listCrossAccountAuthorizationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListCrossAccountAuthorizationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the readiness checks for an account.
*
*
* @param listReadinessChecksRequest
* @return Result of the ListReadinessChecks operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.ListReadinessChecks
* @see AWS API Documentation
*/
@Override
public ListReadinessChecksResponse listReadinessChecks(ListReadinessChecksRequest listReadinessChecksRequest)
throws ThrottlingException, ValidationException, InternalServerException, AccessDeniedException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListReadinessChecksResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listReadinessChecksRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListReadinessChecks");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListReadinessChecks").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listReadinessChecksRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListReadinessChecksRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the recovery groups in an account.
*
*
* @param listRecoveryGroupsRequest
* @return Result of the ListRecoveryGroups operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.ListRecoveryGroups
* @see AWS API Documentation
*/
@Override
public ListRecoveryGroupsResponse listRecoveryGroups(ListRecoveryGroupsRequest listRecoveryGroupsRequest)
throws ThrottlingException, ValidationException, InternalServerException, AccessDeniedException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListRecoveryGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listRecoveryGroupsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRecoveryGroups");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListRecoveryGroups").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listRecoveryGroupsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListRecoveryGroupsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the resource sets in an account.
*
*
* @param listResourceSetsRequest
* @return Result of the ListResourceSets operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.ListResourceSets
* @see AWS API Documentation
*/
@Override
public ListResourceSetsResponse listResourceSets(ListResourceSetsRequest listResourceSetsRequest) throws ThrottlingException,
ValidationException, InternalServerException, AccessDeniedException, AwsServiceException, SdkClientException,
Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListResourceSetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listResourceSetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListResourceSets");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListResourceSets").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listResourceSetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListResourceSetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists all readiness rules, or lists the readiness rules for a specific resource type.
*
*
* @param listRulesRequest
* @return Result of the ListRules operation returned by the service.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.ListRules
* @see AWS API Documentation
*/
@Override
public ListRulesResponse listRules(ListRulesRequest listRulesRequest) throws ThrottlingException, ValidationException,
InternalServerException, AccessDeniedException, AwsServiceException, SdkClientException,
Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListRulesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listRulesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRules");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListRules").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listRulesRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new ListRulesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the tags for a resource.
*
*
* @param listTagsForResourcesRequest
* @return Result of the ListTagsForResources operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.ListTagsForResources
* @see AWS API Documentation
*/
@Override
public ListTagsForResourcesResponse listTagsForResources(ListTagsForResourcesRequest listTagsForResourcesRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourcesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourcesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResources");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResources").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listTagsForResourcesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourcesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds a tag to a resource.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.TagResource
* @see AWS API Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ResourceNotFoundException,
ValidationException, InternalServerException, AwsServiceException, SdkClientException,
Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(tagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes a tag from a resource.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.UntagResource
* @see AWS API Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException,
ValidationException, InternalServerException, AwsServiceException, SdkClientException,
Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates a cell to replace the list of nested cells with a new list of nested cells.
*
*
* @param updateCellRequest
* @return Result of the UpdateCell operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.UpdateCell
* @see AWS API Documentation
*/
@Override
public UpdateCellResponse updateCell(UpdateCellRequest updateCellRequest) throws ResourceNotFoundException,
ThrottlingException, ValidationException, InternalServerException, AccessDeniedException, AwsServiceException,
SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateCellResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCellRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCell");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("UpdateCell")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(updateCellRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateCellRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates a readiness check.
*
*
* @param updateReadinessCheckRequest
* Name of a readiness check to describe.
* @return Result of the UpdateReadinessCheck operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.UpdateReadinessCheck
* @see AWS API Documentation
*/
@Override
public UpdateReadinessCheckResponse updateReadinessCheck(UpdateReadinessCheckRequest updateReadinessCheckRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateReadinessCheckResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateReadinessCheckRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateReadinessCheck");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateReadinessCheck").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateReadinessCheckRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateReadinessCheckRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates a recovery group.
*
*
* @param updateRecoveryGroupRequest
* Name of a recovery group.
* @return Result of the UpdateRecoveryGroup operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.UpdateRecoveryGroup
* @see AWS API Documentation
*/
@Override
public UpdateRecoveryGroupResponse updateRecoveryGroup(UpdateRecoveryGroupRequest updateRecoveryGroupRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateRecoveryGroupResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateRecoveryGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateRecoveryGroup");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateRecoveryGroup").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateRecoveryGroupRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateRecoveryGroupRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates a resource set.
*
*
* @param updateResourceSetRequest
* Name of a resource set.
* @return Result of the UpdateResourceSet operation returned by the service.
* @throws ResourceNotFoundException
* 404 response - Malformed query string. The query string contains a syntax error or resource not found.
* @throws ThrottlingException
* 429 response - Limit exceeded exception or too many requests exception.
* @throws ValidationException
* 400 response - Multiple causes. For example, you might have a malformed query string, an input parameter
* might be out of range, or you used parameters together incorrectly.
* @throws InternalServerException
* 500 response - Internal service error or temporary service error. Retry the request.
* @throws AccessDeniedException
* 403 response - Access denied exception. You do not have sufficient access to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws Route53RecoveryReadinessException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample Route53RecoveryReadinessClient.UpdateResourceSet
* @see AWS API Documentation
*/
@Override
public UpdateResourceSetResponse updateResourceSet(UpdateResourceSetRequest updateResourceSetRequest)
throws ResourceNotFoundException, ThrottlingException, ValidationException, InternalServerException,
AccessDeniedException, AwsServiceException, SdkClientException, Route53RecoveryReadinessException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateResourceSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateResourceSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Route53 Recovery Readiness");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateResourceSet");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateResourceSet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateResourceSetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateResourceSetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
RequestOverrideConfiguration requestOverrideConfiguration) {
List publishers = null;
if (requestOverrideConfiguration != null) {
publishers = requestOverrideConfiguration.metricPublishers();
}
if (publishers == null || publishers.isEmpty()) {
publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS);
}
if (publishers == null) {
publishers = Collections.emptyList();
}
return publishers;
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(Route53RecoveryReadinessException::builder)
.protocol(AwsJsonProtocol.REST_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("AccessDeniedException")
.exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ConflictException")
.exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(409).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ThrottlingException")
.exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ValidationException")
.exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InternalServerException")
.exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build());
}
@Override
public final Route53RecoveryReadinessServiceClientConfiguration serviceClientConfiguration() {
return this.serviceClientConfiguration;
}
@Override
public void close() {
clientHandler.close();
}
}