software.amazon.awssdk.services.autoscaling.DefaultAutoScalingAsyncClient Maven / Gradle / Ivy
Show all versions of autoscaling Show documentation
/*
* 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.autoscaling;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
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.query.AwsQueryProtocolFactory;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.autoscaling.internal.AutoScalingServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.autoscaling.model.ActiveInstanceRefreshNotFoundException;
import software.amazon.awssdk.services.autoscaling.model.AlreadyExistsException;
import software.amazon.awssdk.services.autoscaling.model.AttachInstancesRequest;
import software.amazon.awssdk.services.autoscaling.model.AttachInstancesResponse;
import software.amazon.awssdk.services.autoscaling.model.AttachLoadBalancerTargetGroupsRequest;
import software.amazon.awssdk.services.autoscaling.model.AttachLoadBalancerTargetGroupsResponse;
import software.amazon.awssdk.services.autoscaling.model.AttachLoadBalancersRequest;
import software.amazon.awssdk.services.autoscaling.model.AttachLoadBalancersResponse;
import software.amazon.awssdk.services.autoscaling.model.AttachTrafficSourcesRequest;
import software.amazon.awssdk.services.autoscaling.model.AttachTrafficSourcesResponse;
import software.amazon.awssdk.services.autoscaling.model.AutoScalingException;
import software.amazon.awssdk.services.autoscaling.model.BatchDeleteScheduledActionRequest;
import software.amazon.awssdk.services.autoscaling.model.BatchDeleteScheduledActionResponse;
import software.amazon.awssdk.services.autoscaling.model.BatchPutScheduledUpdateGroupActionRequest;
import software.amazon.awssdk.services.autoscaling.model.BatchPutScheduledUpdateGroupActionResponse;
import software.amazon.awssdk.services.autoscaling.model.CancelInstanceRefreshRequest;
import software.amazon.awssdk.services.autoscaling.model.CancelInstanceRefreshResponse;
import software.amazon.awssdk.services.autoscaling.model.CompleteLifecycleActionRequest;
import software.amazon.awssdk.services.autoscaling.model.CompleteLifecycleActionResponse;
import software.amazon.awssdk.services.autoscaling.model.CreateAutoScalingGroupRequest;
import software.amazon.awssdk.services.autoscaling.model.CreateAutoScalingGroupResponse;
import software.amazon.awssdk.services.autoscaling.model.CreateLaunchConfigurationRequest;
import software.amazon.awssdk.services.autoscaling.model.CreateLaunchConfigurationResponse;
import software.amazon.awssdk.services.autoscaling.model.CreateOrUpdateTagsRequest;
import software.amazon.awssdk.services.autoscaling.model.CreateOrUpdateTagsResponse;
import software.amazon.awssdk.services.autoscaling.model.DeleteAutoScalingGroupRequest;
import software.amazon.awssdk.services.autoscaling.model.DeleteAutoScalingGroupResponse;
import software.amazon.awssdk.services.autoscaling.model.DeleteLaunchConfigurationRequest;
import software.amazon.awssdk.services.autoscaling.model.DeleteLaunchConfigurationResponse;
import software.amazon.awssdk.services.autoscaling.model.DeleteLifecycleHookRequest;
import software.amazon.awssdk.services.autoscaling.model.DeleteLifecycleHookResponse;
import software.amazon.awssdk.services.autoscaling.model.DeleteNotificationConfigurationRequest;
import software.amazon.awssdk.services.autoscaling.model.DeleteNotificationConfigurationResponse;
import software.amazon.awssdk.services.autoscaling.model.DeletePolicyRequest;
import software.amazon.awssdk.services.autoscaling.model.DeletePolicyResponse;
import software.amazon.awssdk.services.autoscaling.model.DeleteScheduledActionRequest;
import software.amazon.awssdk.services.autoscaling.model.DeleteScheduledActionResponse;
import software.amazon.awssdk.services.autoscaling.model.DeleteTagsRequest;
import software.amazon.awssdk.services.autoscaling.model.DeleteTagsResponse;
import software.amazon.awssdk.services.autoscaling.model.DeleteWarmPoolRequest;
import software.amazon.awssdk.services.autoscaling.model.DeleteWarmPoolResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeAccountLimitsRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeAccountLimitsResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeAdjustmentTypesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeAdjustmentTypesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeAutoScalingGroupsRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeAutoScalingGroupsResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeAutoScalingInstancesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeAutoScalingInstancesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeAutoScalingNotificationTypesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeAutoScalingNotificationTypesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeInstanceRefreshesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeInstanceRefreshesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeLaunchConfigurationsRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeLaunchConfigurationsResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeLifecycleHookTypesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeLifecycleHookTypesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeLifecycleHooksRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeLifecycleHooksResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeLoadBalancerTargetGroupsRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeLoadBalancerTargetGroupsResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeLoadBalancersRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeLoadBalancersResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeMetricCollectionTypesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeMetricCollectionTypesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeNotificationConfigurationsRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeNotificationConfigurationsResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribePoliciesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribePoliciesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeScalingActivitiesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeScalingActivitiesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeScalingProcessTypesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeScalingProcessTypesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeScheduledActionsRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeScheduledActionsResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeTagsRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeTagsResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeTerminationPolicyTypesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeTerminationPolicyTypesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeTrafficSourcesRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeTrafficSourcesResponse;
import software.amazon.awssdk.services.autoscaling.model.DescribeWarmPoolRequest;
import software.amazon.awssdk.services.autoscaling.model.DescribeWarmPoolResponse;
import software.amazon.awssdk.services.autoscaling.model.DetachInstancesRequest;
import software.amazon.awssdk.services.autoscaling.model.DetachInstancesResponse;
import software.amazon.awssdk.services.autoscaling.model.DetachLoadBalancerTargetGroupsRequest;
import software.amazon.awssdk.services.autoscaling.model.DetachLoadBalancerTargetGroupsResponse;
import software.amazon.awssdk.services.autoscaling.model.DetachLoadBalancersRequest;
import software.amazon.awssdk.services.autoscaling.model.DetachLoadBalancersResponse;
import software.amazon.awssdk.services.autoscaling.model.DetachTrafficSourcesRequest;
import software.amazon.awssdk.services.autoscaling.model.DetachTrafficSourcesResponse;
import software.amazon.awssdk.services.autoscaling.model.DisableMetricsCollectionRequest;
import software.amazon.awssdk.services.autoscaling.model.DisableMetricsCollectionResponse;
import software.amazon.awssdk.services.autoscaling.model.EnableMetricsCollectionRequest;
import software.amazon.awssdk.services.autoscaling.model.EnableMetricsCollectionResponse;
import software.amazon.awssdk.services.autoscaling.model.EnterStandbyRequest;
import software.amazon.awssdk.services.autoscaling.model.EnterStandbyResponse;
import software.amazon.awssdk.services.autoscaling.model.ExecutePolicyRequest;
import software.amazon.awssdk.services.autoscaling.model.ExecutePolicyResponse;
import software.amazon.awssdk.services.autoscaling.model.ExitStandbyRequest;
import software.amazon.awssdk.services.autoscaling.model.ExitStandbyResponse;
import software.amazon.awssdk.services.autoscaling.model.GetPredictiveScalingForecastRequest;
import software.amazon.awssdk.services.autoscaling.model.GetPredictiveScalingForecastResponse;
import software.amazon.awssdk.services.autoscaling.model.InstanceRefreshInProgressException;
import software.amazon.awssdk.services.autoscaling.model.InvalidNextTokenException;
import software.amazon.awssdk.services.autoscaling.model.IrreversibleInstanceRefreshException;
import software.amazon.awssdk.services.autoscaling.model.LimitExceededException;
import software.amazon.awssdk.services.autoscaling.model.PutLifecycleHookRequest;
import software.amazon.awssdk.services.autoscaling.model.PutLifecycleHookResponse;
import software.amazon.awssdk.services.autoscaling.model.PutNotificationConfigurationRequest;
import software.amazon.awssdk.services.autoscaling.model.PutNotificationConfigurationResponse;
import software.amazon.awssdk.services.autoscaling.model.PutScalingPolicyRequest;
import software.amazon.awssdk.services.autoscaling.model.PutScalingPolicyResponse;
import software.amazon.awssdk.services.autoscaling.model.PutScheduledUpdateGroupActionRequest;
import software.amazon.awssdk.services.autoscaling.model.PutScheduledUpdateGroupActionResponse;
import software.amazon.awssdk.services.autoscaling.model.PutWarmPoolRequest;
import software.amazon.awssdk.services.autoscaling.model.PutWarmPoolResponse;
import software.amazon.awssdk.services.autoscaling.model.RecordLifecycleActionHeartbeatRequest;
import software.amazon.awssdk.services.autoscaling.model.RecordLifecycleActionHeartbeatResponse;
import software.amazon.awssdk.services.autoscaling.model.ResourceContentionException;
import software.amazon.awssdk.services.autoscaling.model.ResourceInUseException;
import software.amazon.awssdk.services.autoscaling.model.ResumeProcessesRequest;
import software.amazon.awssdk.services.autoscaling.model.ResumeProcessesResponse;
import software.amazon.awssdk.services.autoscaling.model.RollbackInstanceRefreshRequest;
import software.amazon.awssdk.services.autoscaling.model.RollbackInstanceRefreshResponse;
import software.amazon.awssdk.services.autoscaling.model.ScalingActivityInProgressException;
import software.amazon.awssdk.services.autoscaling.model.ServiceLinkedRoleFailureException;
import software.amazon.awssdk.services.autoscaling.model.SetDesiredCapacityRequest;
import software.amazon.awssdk.services.autoscaling.model.SetDesiredCapacityResponse;
import software.amazon.awssdk.services.autoscaling.model.SetInstanceHealthRequest;
import software.amazon.awssdk.services.autoscaling.model.SetInstanceHealthResponse;
import software.amazon.awssdk.services.autoscaling.model.SetInstanceProtectionRequest;
import software.amazon.awssdk.services.autoscaling.model.SetInstanceProtectionResponse;
import software.amazon.awssdk.services.autoscaling.model.StartInstanceRefreshRequest;
import software.amazon.awssdk.services.autoscaling.model.StartInstanceRefreshResponse;
import software.amazon.awssdk.services.autoscaling.model.SuspendProcessesRequest;
import software.amazon.awssdk.services.autoscaling.model.SuspendProcessesResponse;
import software.amazon.awssdk.services.autoscaling.model.TerminateInstanceInAutoScalingGroupRequest;
import software.amazon.awssdk.services.autoscaling.model.TerminateInstanceInAutoScalingGroupResponse;
import software.amazon.awssdk.services.autoscaling.model.UpdateAutoScalingGroupRequest;
import software.amazon.awssdk.services.autoscaling.model.UpdateAutoScalingGroupResponse;
import software.amazon.awssdk.services.autoscaling.transform.AttachInstancesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.AttachLoadBalancerTargetGroupsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.AttachLoadBalancersRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.AttachTrafficSourcesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.BatchDeleteScheduledActionRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.BatchPutScheduledUpdateGroupActionRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.CancelInstanceRefreshRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.CompleteLifecycleActionRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.CreateAutoScalingGroupRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.CreateLaunchConfigurationRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.CreateOrUpdateTagsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DeleteAutoScalingGroupRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DeleteLaunchConfigurationRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DeleteLifecycleHookRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DeleteNotificationConfigurationRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DeletePolicyRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DeleteScheduledActionRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DeleteTagsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DeleteWarmPoolRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeAccountLimitsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeAdjustmentTypesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeAutoScalingGroupsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeAutoScalingInstancesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeAutoScalingNotificationTypesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeInstanceRefreshesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeLaunchConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeLifecycleHookTypesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeLifecycleHooksRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeLoadBalancerTargetGroupsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeLoadBalancersRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeMetricCollectionTypesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeNotificationConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribePoliciesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeScalingActivitiesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeScalingProcessTypesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeScheduledActionsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeTagsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeTerminationPolicyTypesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeTrafficSourcesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DescribeWarmPoolRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DetachInstancesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DetachLoadBalancerTargetGroupsRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DetachLoadBalancersRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DetachTrafficSourcesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.DisableMetricsCollectionRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.EnableMetricsCollectionRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.EnterStandbyRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.ExecutePolicyRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.ExitStandbyRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.GetPredictiveScalingForecastRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.PutLifecycleHookRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.PutNotificationConfigurationRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.PutScalingPolicyRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.PutScheduledUpdateGroupActionRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.PutWarmPoolRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.RecordLifecycleActionHeartbeatRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.ResumeProcessesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.RollbackInstanceRefreshRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.SetDesiredCapacityRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.SetInstanceHealthRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.SetInstanceProtectionRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.StartInstanceRefreshRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.SuspendProcessesRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.TerminateInstanceInAutoScalingGroupRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.transform.UpdateAutoScalingGroupRequestMarshaller;
import software.amazon.awssdk.services.autoscaling.waiters.AutoScalingAsyncWaiter;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link AutoScalingAsyncClient}.
*
* @see AutoScalingAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultAutoScalingAsyncClient implements AutoScalingAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultAutoScalingAsyncClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.QUERY).build();
private final AsyncClientHandler clientHandler;
private final AwsQueryProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
private final ScheduledExecutorService executorService;
protected DefaultAutoScalingAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init();
this.executorService = clientConfiguration.option(SdkClientOption.SCHEDULED_EXECUTOR_SERVICE);
}
/**
*
* Attaches one or more EC2 instances to the specified Auto Scaling group.
*
*
* When you attach instances, Amazon EC2 Auto Scaling increases the desired capacity of the group by the number of
* instances being attached. If the number of instances being attached plus the desired capacity of the group
* exceeds the maximum size of the group, the operation fails.
*
*
* If there is a Classic Load Balancer attached to your Auto Scaling group, the instances are also registered with
* the load balancer. If there are target groups attached to your Auto Scaling group, the instances are also
* registered with the target groups.
*
*
* For more information, see Detach
* or attach instances in the Amazon EC2 Auto Scaling User Guide.
*
*
* @param attachInstancesRequest
* @return A Java Future containing the result of the AttachInstances operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ServiceLinkedRoleFailureException The service-linked role is not yet ready for use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.AttachInstances
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture attachInstances(AttachInstancesRequest attachInstancesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(attachInstancesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, attachInstancesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AttachInstances");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(AttachInstancesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AttachInstances").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AttachInstancesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(attachInstancesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
*
* This API operation is superseded by AttachTrafficSources, which can attach multiple traffic sources types. We recommend using
* AttachTrafficSources
to simplify how you manage traffic sources. However, we continue to support
* AttachLoadBalancerTargetGroups
. You can use both the original
* AttachLoadBalancerTargetGroups
API operation and AttachTrafficSources
on the same Auto
* Scaling group.
*
*
*
* Attaches one or more target groups to the specified Auto Scaling group.
*
*
* This operation is used with the following load balancer types:
*
*
* -
*
* Application Load Balancer - Operates at the application layer (layer 7) and supports HTTP and HTTPS.
*
*
* -
*
* Network Load Balancer - Operates at the transport layer (layer 4) and supports TCP, TLS, and UDP.
*
*
* -
*
* Gateway Load Balancer - Operates at the network layer (layer 3).
*
*
*
*
* To describe the target groups for an Auto Scaling group, call the DescribeLoadBalancerTargetGroups API. To detach the target group from the Auto Scaling group, call the
* DetachLoadBalancerTargetGroups API.
*
*
* This operation is additive and does not detach existing target groups or Classic Load Balancers from the Auto
* Scaling group.
*
*
* For more information, see Use Elastic Load
* Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto
* Scaling User Guide.
*
*
* @param attachLoadBalancerTargetGroupsRequest
* @return A Java Future containing the result of the AttachLoadBalancerTargetGroups operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ServiceLinkedRoleFailureException The service-linked role is not yet ready for use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.AttachLoadBalancerTargetGroups
* @see AWS API Documentation
*/
@Override
public CompletableFuture attachLoadBalancerTargetGroups(
AttachLoadBalancerTargetGroupsRequest attachLoadBalancerTargetGroupsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(attachLoadBalancerTargetGroupsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
attachLoadBalancerTargetGroupsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AttachLoadBalancerTargetGroups");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(AttachLoadBalancerTargetGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AttachLoadBalancerTargetGroups").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AttachLoadBalancerTargetGroupsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(attachLoadBalancerTargetGroupsRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
*
* This API operation is superseded by https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_AttachTrafficSources.html, which can attach
* multiple traffic sources types. We recommend using AttachTrafficSources
to simplify how you manage
* traffic sources. However, we continue to support AttachLoadBalancers
. You can use both the original
* AttachLoadBalancers
API operation and AttachTrafficSources
on the same Auto Scaling
* group.
*
*
*
* Attaches one or more Classic Load Balancers to the specified Auto Scaling group. Amazon EC2 Auto Scaling
* registers the running instances with these Classic Load Balancers.
*
*
* To describe the load balancers for an Auto Scaling group, call the DescribeLoadBalancers API. To detach a load balancer from the Auto Scaling group, call the DetachLoadBalancers API.
*
*
* This operation is additive and does not detach existing Classic Load Balancers or target groups from the Auto
* Scaling group.
*
*
* For more information, see Use Elastic Load
* Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto
* Scaling User Guide.
*
*
* @param attachLoadBalancersRequest
* @return A Java Future containing the result of the AttachLoadBalancers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ServiceLinkedRoleFailureException The service-linked role is not yet ready for use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.AttachLoadBalancers
* @see AWS API Documentation
*/
@Override
public CompletableFuture attachLoadBalancers(
AttachLoadBalancersRequest attachLoadBalancersRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(attachLoadBalancersRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, attachLoadBalancersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AttachLoadBalancers");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(AttachLoadBalancersResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AttachLoadBalancers").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AttachLoadBalancersRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(attachLoadBalancersRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Attaches one or more traffic sources to the specified Auto Scaling group.
*
*
* You can use any of the following as traffic sources for an Auto Scaling group:
*
*
* -
*
* Application Load Balancer
*
*
* -
*
* Classic Load Balancer
*
*
* -
*
* Gateway Load Balancer
*
*
* -
*
* Network Load Balancer
*
*
* -
*
* VPC Lattice
*
*
*
*
* This operation is additive and does not detach existing traffic sources from the Auto Scaling group.
*
*
* After the operation completes, use the DescribeTrafficSources API to return details about the state of the attachments between traffic sources and
* your Auto Scaling group. To detach a traffic source from the Auto Scaling group, call the DetachTrafficSources API.
*
*
* @param attachTrafficSourcesRequest
* @return A Java Future containing the result of the AttachTrafficSources operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ServiceLinkedRoleFailureException The service-linked role is not yet ready for use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.AttachTrafficSources
* @see AWS API Documentation
*/
@Override
public CompletableFuture attachTrafficSources(
AttachTrafficSourcesRequest attachTrafficSourcesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(attachTrafficSourcesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, attachTrafficSourcesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AttachTrafficSources");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(AttachTrafficSourcesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AttachTrafficSources").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AttachTrafficSourcesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(attachTrafficSourcesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes one or more scheduled actions for the specified Auto Scaling group.
*
*
* @param batchDeleteScheduledActionRequest
* @return A Java Future containing the result of the BatchDeleteScheduledAction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.BatchDeleteScheduledAction
* @see AWS API Documentation
*/
@Override
public CompletableFuture batchDeleteScheduledAction(
BatchDeleteScheduledActionRequest batchDeleteScheduledActionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchDeleteScheduledActionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchDeleteScheduledActionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchDeleteScheduledAction");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(BatchDeleteScheduledActionResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchDeleteScheduledAction").withProtocolMetadata(protocolMetadata)
.withMarshaller(new BatchDeleteScheduledActionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(batchDeleteScheduledActionRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates or updates one or more scheduled scaling actions for an Auto Scaling group.
*
*
* @param batchPutScheduledUpdateGroupActionRequest
* @return A Java Future containing the result of the BatchPutScheduledUpdateGroupAction operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AlreadyExistsException You already have an Auto Scaling group or launch configuration with this name.
*
* - LimitExceededException You have already reached a limit for your Amazon EC2 Auto Scaling resources
* (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see
*
* DescribeAccountLimits in the Amazon EC2 Auto Scaling API Reference.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.BatchPutScheduledUpdateGroupAction
* @see AWS API Documentation
*/
@Override
public CompletableFuture batchPutScheduledUpdateGroupAction(
BatchPutScheduledUpdateGroupActionRequest batchPutScheduledUpdateGroupActionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchPutScheduledUpdateGroupActionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
batchPutScheduledUpdateGroupActionRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchPutScheduledUpdateGroupAction");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(BatchPutScheduledUpdateGroupActionResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchPutScheduledUpdateGroupAction").withProtocolMetadata(protocolMetadata)
.withMarshaller(new BatchPutScheduledUpdateGroupActionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(batchPutScheduledUpdateGroupActionRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Cancels an instance refresh or rollback that is in progress. If an instance refresh or rollback is not in
* progress, an ActiveInstanceRefreshNotFound
error occurs.
*
*
* This operation is part of the instance refresh
* feature in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you
* make configuration changes.
*
*
* When you cancel an instance refresh, this does not roll back any changes that it made. Use the RollbackInstanceRefresh API to roll back instead.
*
*
* @param cancelInstanceRefreshRequest
* @return A Java Future containing the result of the CancelInstanceRefresh operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - LimitExceededException You have already reached a limit for your Amazon EC2 Auto Scaling resources
* (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see
*
* DescribeAccountLimits in the Amazon EC2 Auto Scaling API Reference.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ActiveInstanceRefreshNotFoundException The request failed because an active instance refresh or
* rollback for the specified Auto Scaling group was not found.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.CancelInstanceRefresh
* @see AWS API Documentation
*/
@Override
public CompletableFuture cancelInstanceRefresh(
CancelInstanceRefreshRequest cancelInstanceRefreshRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(cancelInstanceRefreshRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, cancelInstanceRefreshRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CancelInstanceRefresh");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(CancelInstanceRefreshResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CancelInstanceRefresh").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CancelInstanceRefreshRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(cancelInstanceRefreshRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Completes the lifecycle action for the specified token or instance with the specified result.
*
*
* This step is a part of the procedure for adding a lifecycle hook to an Auto Scaling group:
*
*
* -
*
* (Optional) Create a launch template or launch configuration with a user data script that runs while an instance
* is in a wait state due to a lifecycle hook.
*
*
* -
*
* (Optional) Create a Lambda function and a rule that allows Amazon EventBridge to invoke your Lambda function when
* an instance is put into a wait state due to a lifecycle hook.
*
*
* -
*
* (Optional) Create a notification target and an IAM role. The target can be either an Amazon SQS queue or an
* Amazon SNS topic. The role allows Amazon EC2 Auto Scaling to publish lifecycle notifications to the target.
*
*
* -
*
* Create the lifecycle hook. Specify whether the hook is used when the instances launch or terminate.
*
*
* -
*
* If you need more time, record the lifecycle action heartbeat to keep the instance in a wait state.
*
*
* -
*
* If you finish before the timeout period ends, send a callback by using the CompleteLifecycleAction API call.
*
*
*
*
* For more information, see Complete a lifecycle
* action in the Amazon EC2 Auto Scaling User Guide.
*
*
* @param completeLifecycleActionRequest
* @return A Java Future containing the result of the CompleteLifecycleAction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.CompleteLifecycleAction
* @see AWS API Documentation
*/
@Override
public CompletableFuture completeLifecycleAction(
CompleteLifecycleActionRequest completeLifecycleActionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(completeLifecycleActionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, completeLifecycleActionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CompleteLifecycleAction");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(CompleteLifecycleActionResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CompleteLifecycleAction").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CompleteLifecycleActionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(completeLifecycleActionRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* We strongly recommend using a launch template when calling this operation to ensure full functionality for
* Amazon EC2 Auto Scaling and Amazon EC2.
*
*
* Creates an Auto Scaling group with the specified name and attributes.
*
*
* If you exceed your maximum limit of Auto Scaling groups, the call fails. To query this limit, call the DescribeAccountLimits API. For information about updating this limit, see Quotas for Amazon EC2
* Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
*
*
* If you're new to Amazon EC2 Auto Scaling, see the introductory tutorials in Get started
* with Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
*
*
* Every Auto Scaling group has three size properties (DesiredCapacity
, MaxSize
, and
* MinSize
). Usually, you set these sizes based on a specific number of instances. However, if you
* configure a mixed instances policy that defines weights for the instance types, you must specify these sizes with
* the same units that you use for weighting instances.
*
*
* @param createAutoScalingGroupRequest
* @return A Java Future containing the result of the CreateAutoScalingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AlreadyExistsException You already have an Auto Scaling group or launch configuration with this name.
*
* - LimitExceededException You have already reached a limit for your Amazon EC2 Auto Scaling resources
* (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see
*
* DescribeAccountLimits in the Amazon EC2 Auto Scaling API Reference.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ServiceLinkedRoleFailureException The service-linked role is not yet ready for use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.CreateAutoScalingGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture createAutoScalingGroup(
CreateAutoScalingGroupRequest createAutoScalingGroupRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAutoScalingGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createAutoScalingGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAutoScalingGroup");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(CreateAutoScalingGroupResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateAutoScalingGroup").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateAutoScalingGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createAutoScalingGroupRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a launch configuration.
*
*
* If you exceed your maximum limit of launch configurations, the call fails. To query this limit, call the DescribeAccountLimits API. For information about updating this limit, see Quotas for Amazon EC2
* Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
*
*
* For more information, see Launch configurations
* in the Amazon EC2 Auto Scaling User Guide.
*
*
*
* Amazon EC2 Auto Scaling configures instances launched as part of an Auto Scaling group using either a launch
* template or a launch configuration. We strongly recommend that you do not use launch configurations. They do not
* provide full functionality for Amazon EC2 Auto Scaling or Amazon EC2. For information about using launch
* templates, see Launch
* templates in the Amazon EC2 Auto Scaling User Guide.
*
*
*
* @param createLaunchConfigurationRequest
* @return A Java Future containing the result of the CreateLaunchConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - AlreadyExistsException You already have an Auto Scaling group or launch configuration with this name.
*
* - LimitExceededException You have already reached a limit for your Amazon EC2 Auto Scaling resources
* (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see
*
* DescribeAccountLimits in the Amazon EC2 Auto Scaling API Reference.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.CreateLaunchConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture createLaunchConfiguration(
CreateLaunchConfigurationRequest createLaunchConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createLaunchConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createLaunchConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateLaunchConfiguration");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(CreateLaunchConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateLaunchConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateLaunchConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createLaunchConfigurationRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates or updates tags for the specified Auto Scaling group.
*
*
* When you specify a tag with a key that already exists, the operation overwrites the previous tag definition, and
* you do not get an error message.
*
*
* For more information, see Tag Auto Scaling
* groups and instances in the Amazon EC2 Auto Scaling User Guide.
*
*
* @param createOrUpdateTagsRequest
* @return A Java Future containing the result of the CreateOrUpdateTags operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - LimitExceededException You have already reached a limit for your Amazon EC2 Auto Scaling resources
* (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see
*
* DescribeAccountLimits in the Amazon EC2 Auto Scaling API Reference.
* - AlreadyExistsException You already have an Auto Scaling group or launch configuration with this name.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ResourceInUseException The operation can't be performed because the resource is in use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.CreateOrUpdateTags
* @see AWS API Documentation
*/
@Override
public CompletableFuture createOrUpdateTags(CreateOrUpdateTagsRequest createOrUpdateTagsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createOrUpdateTagsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createOrUpdateTagsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateOrUpdateTags");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(CreateOrUpdateTagsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateOrUpdateTags").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateOrUpdateTagsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createOrUpdateTagsRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified Auto Scaling group.
*
*
* If the group has instances or scaling activities in progress, you must specify the option to force the deletion
* in order for it to succeed. The force delete operation will also terminate the EC2 instances. If the group has a
* warm pool, the force delete option also deletes the warm pool.
*
*
* To remove instances from the Auto Scaling group before deleting it, call the DetachInstances API
* with the list of instances and the option to decrement the desired capacity. This ensures that Amazon EC2 Auto
* Scaling does not launch replacement instances.
*
*
* To terminate all instances before deleting the Auto Scaling group, call the UpdateAutoScalingGroup API and set the minimum size and desired capacity of the Auto Scaling group to zero.
*
*
* If the group has scaling policies, deleting the group deletes the policies, the underlying alarm actions, and any
* alarm that no longer has an associated action.
*
*
* For more information, see Delete your Auto Scaling
* infrastructure in the Amazon EC2 Auto Scaling User Guide.
*
*
* @param deleteAutoScalingGroupRequest
* @return A Java Future containing the result of the DeleteAutoScalingGroup operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ScalingActivityInProgressException The operation can't be performed because there are scaling
* activities in progress.
* - ResourceInUseException The operation can't be performed because the resource is in use.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DeleteAutoScalingGroup
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteAutoScalingGroup(
DeleteAutoScalingGroupRequest deleteAutoScalingGroupRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAutoScalingGroupRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAutoScalingGroupRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAutoScalingGroup");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteAutoScalingGroupResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteAutoScalingGroup").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteAutoScalingGroupRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteAutoScalingGroupRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified launch configuration.
*
*
* The launch configuration must not be attached to an Auto Scaling group. When this call completes, the launch
* configuration is no longer available for use.
*
*
* @param deleteLaunchConfigurationRequest
* @return A Java Future containing the result of the DeleteLaunchConfiguration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceInUseException The operation can't be performed because the resource is in use.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DeleteLaunchConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteLaunchConfiguration(
DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteLaunchConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteLaunchConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteLaunchConfiguration");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteLaunchConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteLaunchConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteLaunchConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteLaunchConfigurationRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified lifecycle hook.
*
*
* If there are any outstanding lifecycle actions, they are completed first (ABANDON
for launching
* instances, CONTINUE
for terminating instances).
*
*
* @param deleteLifecycleHookRequest
* @return A Java Future containing the result of the DeleteLifecycleHook operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DeleteLifecycleHook
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteLifecycleHook(
DeleteLifecycleHookRequest deleteLifecycleHookRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteLifecycleHookRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteLifecycleHookRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteLifecycleHook");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteLifecycleHookResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteLifecycleHook").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteLifecycleHookRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteLifecycleHookRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified notification.
*
*
* @param deleteNotificationConfigurationRequest
* @return A Java Future containing the result of the DeleteNotificationConfiguration operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DeleteNotificationConfiguration
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteNotificationConfiguration(
DeleteNotificationConfigurationRequest deleteNotificationConfigurationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteNotificationConfigurationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteNotificationConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteNotificationConfiguration");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteNotificationConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteNotificationConfiguration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteNotificationConfigurationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteNotificationConfigurationRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified scaling policy.
*
*
* Deleting either a step scaling policy or a simple scaling policy deletes the underlying alarm action, but does
* not delete the alarm, even if it no longer has an associated action.
*
*
* For more information, see Delete a scaling
* policy in the Amazon EC2 Auto Scaling User Guide.
*
*
* @param deletePolicyRequest
* @return A Java Future containing the result of the DeletePolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ServiceLinkedRoleFailureException The service-linked role is not yet ready for use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DeletePolicy
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deletePolicy(DeletePolicyRequest deletePolicyRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deletePolicyRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePolicyRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePolicy");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeletePolicyResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeletePolicy").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeletePolicyRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deletePolicyRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified scheduled action.
*
*
* @param deleteScheduledActionRequest
* @return A Java Future containing the result of the DeleteScheduledAction operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DeleteScheduledAction
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteScheduledAction(
DeleteScheduledActionRequest deleteScheduledActionRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteScheduledActionRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteScheduledActionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteScheduledAction");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteScheduledActionResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteScheduledAction").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteScheduledActionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteScheduledActionRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the specified tags.
*
*
* @param deleteTagsRequest
* @return A Java Future containing the result of the DeleteTags operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ResourceInUseException The operation can't be performed because the resource is in use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DeleteTags
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteTags(DeleteTagsRequest deleteTagsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteTagsRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteTagsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteTags");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteTagsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("DeleteTags")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteTagsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteTagsRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes the warm pool for the specified Auto Scaling group.
*
*
* For more information, see Warm pools for
* Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
*
*
* @param deleteWarmPoolRequest
* @return A Java Future containing the result of the DeleteWarmPool operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - LimitExceededException You have already reached a limit for your Amazon EC2 Auto Scaling resources
* (for example, Auto Scaling groups, launch configurations, or lifecycle hooks). For more information, see
*
* DescribeAccountLimits in the Amazon EC2 Auto Scaling API Reference.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ScalingActivityInProgressException The operation can't be performed because there are scaling
* activities in progress.
* - ResourceInUseException The operation can't be performed because the resource is in use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DeleteWarmPool
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteWarmPool(DeleteWarmPoolRequest deleteWarmPoolRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteWarmPoolRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteWarmPoolRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteWarmPool");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DeleteWarmPoolResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteWarmPool").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteWarmPoolRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteWarmPoolRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the current Amazon EC2 Auto Scaling resource quotas for your account.
*
*
* When you establish an Amazon Web Services account, the account has initial quotas on the maximum number of Auto
* Scaling groups and launch configurations that you can create in a given Region. For more information, see Quotas for Amazon EC2
* Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
*
*
* @param describeAccountLimitsRequest
* @return A Java Future containing the result of the DescribeAccountLimits operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeAccountLimits
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeAccountLimits(
DescribeAccountLimitsRequest describeAccountLimitsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAccountLimitsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAccountLimitsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAccountLimits");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeAccountLimitsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeAccountLimits").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeAccountLimitsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeAccountLimitsRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the available adjustment types for step scaling and simple scaling policies.
*
*
* The following adjustment types are supported:
*
*
* -
*
* ChangeInCapacity
*
*
* -
*
* ExactCapacity
*
*
* -
*
* PercentChangeInCapacity
*
*
*
*
* @param describeAdjustmentTypesRequest
* @return A Java Future containing the result of the DescribeAdjustmentTypes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeAdjustmentTypes
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeAdjustmentTypes(
DescribeAdjustmentTypesRequest describeAdjustmentTypesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAdjustmentTypesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAdjustmentTypesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAdjustmentTypes");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeAdjustmentTypesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeAdjustmentTypes").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeAdjustmentTypesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeAdjustmentTypesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets information about the Auto Scaling groups in the account and Region.
*
*
* If you specify Auto Scaling group names, the output includes information for only the specified Auto Scaling
* groups. If you specify filters, the output includes information for only those Auto Scaling groups that meet the
* filter criteria. If you do not specify group names or filters, the output includes information for all Auto
* Scaling groups.
*
*
* This operation also returns information about instances in Auto Scaling groups. To retrieve information about the
* instances in a warm pool, you must call the DescribeWarmPool
* API.
*
*
* @param describeAutoScalingGroupsRequest
* @return A Java Future containing the result of the DescribeAutoScalingGroups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InvalidNextTokenException The
NextToken
value is not valid.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeAutoScalingGroups
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeAutoScalingGroups(
DescribeAutoScalingGroupsRequest describeAutoScalingGroupsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAutoScalingGroupsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAutoScalingGroupsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAutoScalingGroups");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeAutoScalingGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeAutoScalingGroups").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeAutoScalingGroupsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeAutoScalingGroupsRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets information about the Auto Scaling instances in the account and Region.
*
*
* @param describeAutoScalingInstancesRequest
* @return A Java Future containing the result of the DescribeAutoScalingInstances operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InvalidNextTokenException The
NextToken
value is not valid.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeAutoScalingInstances
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeAutoScalingInstances(
DescribeAutoScalingInstancesRequest describeAutoScalingInstancesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAutoScalingInstancesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAutoScalingInstancesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAutoScalingInstances");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeAutoScalingInstancesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeAutoScalingInstances").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeAutoScalingInstancesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeAutoScalingInstancesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the notification types that are supported by Amazon EC2 Auto Scaling.
*
*
* @param describeAutoScalingNotificationTypesRequest
* @return A Java Future containing the result of the DescribeAutoScalingNotificationTypes operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeAutoScalingNotificationTypes
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeAutoScalingNotificationTypes(
DescribeAutoScalingNotificationTypesRequest describeAutoScalingNotificationTypesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAutoScalingNotificationTypesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeAutoScalingNotificationTypesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAutoScalingNotificationTypes");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeAutoScalingNotificationTypesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeAutoScalingNotificationTypes").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeAutoScalingNotificationTypesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeAutoScalingNotificationTypesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets information about the instance refreshes for the specified Auto Scaling group from the previous six weeks.
*
*
* This operation is part of the instance refresh
* feature in Amazon EC2 Auto Scaling, which helps you update instances in your Auto Scaling group after you
* make configuration changes.
*
*
* To help you determine the status of an instance refresh, Amazon EC2 Auto Scaling returns information about the
* instance refreshes you previously initiated, including their status, start time, end time, the percentage of the
* instance refresh that is complete, and the number of instances remaining to update before the instance refresh is
* complete. If a rollback is initiated while an instance refresh is in progress, Amazon EC2 Auto Scaling also
* returns information about the rollback of the instance refresh.
*
*
* @param describeInstanceRefreshesRequest
* @return A Java Future containing the result of the DescribeInstanceRefreshes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InvalidNextTokenException The
NextToken
value is not valid.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeInstanceRefreshes
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeInstanceRefreshes(
DescribeInstanceRefreshesRequest describeInstanceRefreshesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeInstanceRefreshesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeInstanceRefreshesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeInstanceRefreshes");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeInstanceRefreshesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeInstanceRefreshes").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeInstanceRefreshesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeInstanceRefreshesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets information about the launch configurations in the account and Region.
*
*
* @param describeLaunchConfigurationsRequest
* @return A Java Future containing the result of the DescribeLaunchConfigurations operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InvalidNextTokenException The
NextToken
value is not valid.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeLaunchConfigurations
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeLaunchConfigurations(
DescribeLaunchConfigurationsRequest describeLaunchConfigurationsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeLaunchConfigurationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeLaunchConfigurationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLaunchConfigurations");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeLaunchConfigurationsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeLaunchConfigurations").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeLaunchConfigurationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeLaunchConfigurationsRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the available types of lifecycle hooks.
*
*
* The following hook types are supported:
*
*
* -
*
* autoscaling:EC2_INSTANCE_LAUNCHING
*
*
* -
*
* autoscaling:EC2_INSTANCE_TERMINATING
*
*
*
*
* @param describeLifecycleHookTypesRequest
* @return A Java Future containing the result of the DescribeLifecycleHookTypes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeLifecycleHookTypes
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeLifecycleHookTypes(
DescribeLifecycleHookTypesRequest describeLifecycleHookTypesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeLifecycleHookTypesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeLifecycleHookTypesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLifecycleHookTypes");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeLifecycleHookTypesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeLifecycleHookTypes").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeLifecycleHookTypesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeLifecycleHookTypesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets information about the lifecycle hooks for the specified Auto Scaling group.
*
*
* @param describeLifecycleHooksRequest
* @return A Java Future containing the result of the DescribeLifecycleHooks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeLifecycleHooks
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeLifecycleHooks(
DescribeLifecycleHooksRequest describeLifecycleHooksRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeLifecycleHooksRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeLifecycleHooksRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLifecycleHooks");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeLifecycleHooksResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeLifecycleHooks").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeLifecycleHooksRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeLifecycleHooksRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
*
* This API operation is superseded by DescribeTrafficSources, which can describe multiple traffic sources types. We recommend using
* DetachTrafficSources
to simplify how you manage traffic sources. However, we continue to support
* DescribeLoadBalancerTargetGroups
. You can use both the original
* DescribeLoadBalancerTargetGroups
API operation and DescribeTrafficSources
on the same
* Auto Scaling group.
*
*
*
* Gets information about the Elastic Load Balancing target groups for the specified Auto Scaling group.
*
*
* To determine the attachment status of the target group, use the State
element in the response. When
* you attach a target group to an Auto Scaling group, the initial State
value is Adding
.
* The state transitions to Added
after all Auto Scaling instances are registered with the target
* group. If Elastic Load Balancing health checks are enabled for the Auto Scaling group, the state transitions to
* InService
after at least one Auto Scaling instance passes the health check. When the target group is
* in the InService
state, Amazon EC2 Auto Scaling can terminate and replace any instances that are
* reported as unhealthy. If no registered instances pass the health checks, the target group doesn't enter the
* InService
state.
*
*
* Target groups also have an InService
state if you attach them in the CreateAutoScalingGroup API call. If your target group state is InService
, but it is not working
* properly, check the scaling activities by calling DescribeScalingActivities and take any corrective actions necessary.
*
*
* For help with failed health checks, see Troubleshooting Amazon EC2
* Auto Scaling: Health checks in the Amazon EC2 Auto Scaling User Guide. For more information, see Use Elastic Load
* Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto
* Scaling User Guide.
*
*
*
* You can use this operation to describe target groups that were attached by using AttachLoadBalancerTargetGroups, but not for target groups that were attached by using AttachTrafficSources.
*
*
*
* @param describeLoadBalancerTargetGroupsRequest
* @return A Java Future containing the result of the DescribeLoadBalancerTargetGroups operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - InvalidNextTokenException The
NextToken
value is not valid.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeLoadBalancerTargetGroups
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeLoadBalancerTargetGroups(
DescribeLoadBalancerTargetGroupsRequest describeLoadBalancerTargetGroupsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeLoadBalancerTargetGroupsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeLoadBalancerTargetGroupsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLoadBalancerTargetGroups");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeLoadBalancerTargetGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeLoadBalancerTargetGroups").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeLoadBalancerTargetGroupsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeLoadBalancerTargetGroupsRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
*
* This API operation is superseded by DescribeTrafficSources, which can describe multiple traffic sources types. We recommend using
* DescribeTrafficSources
to simplify how you manage traffic sources. However, we continue to support
* DescribeLoadBalancers
. You can use both the original DescribeLoadBalancers
API
* operation and DescribeTrafficSources
on the same Auto Scaling group.
*
*
*
* Gets information about the load balancers for the specified Auto Scaling group.
*
*
* This operation describes only Classic Load Balancers. If you have Application Load Balancers, Network Load
* Balancers, or Gateway Load Balancers, use the DescribeLoadBalancerTargetGroups API instead.
*
*
* To determine the attachment status of the load balancer, use the State
element in the response. When
* you attach a load balancer to an Auto Scaling group, the initial State
value is Adding
.
* The state transitions to Added
after all Auto Scaling instances are registered with the load
* balancer. If Elastic Load Balancing health checks are enabled for the Auto Scaling group, the state transitions
* to InService
after at least one Auto Scaling instance passes the health check. When the load
* balancer is in the InService
state, Amazon EC2 Auto Scaling can terminate and replace any instances
* that are reported as unhealthy. If no registered instances pass the health checks, the load balancer doesn't
* enter the InService
state.
*
*
* Load balancers also have an InService
state if you attach them in the CreateAutoScalingGroup API call. If your load balancer state is InService
, but it is not
* working properly, check the scaling activities by calling DescribeScalingActivities and take any corrective actions necessary.
*
*
* For help with failed health checks, see Troubleshooting Amazon EC2
* Auto Scaling: Health checks in the Amazon EC2 Auto Scaling User Guide. For more information, see Use Elastic Load
* Balancing to distribute traffic across the instances in your Auto Scaling group in the Amazon EC2 Auto
* Scaling User Guide.
*
*
* @param describeLoadBalancersRequest
* @return A Java Future containing the result of the DescribeLoadBalancers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - InvalidNextTokenException The
NextToken
value is not valid.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeLoadBalancers
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeLoadBalancers(
DescribeLoadBalancersRequest describeLoadBalancersRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeLoadBalancersRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeLoadBalancersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLoadBalancers");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeLoadBalancersResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeLoadBalancers").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeLoadBalancersRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeLoadBalancersRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the available CloudWatch metrics for Amazon EC2 Auto Scaling.
*
*
* @param describeMetricCollectionTypesRequest
* @return A Java Future containing the result of the DescribeMetricCollectionTypes operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeMetricCollectionTypes
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeMetricCollectionTypes(
DescribeMetricCollectionTypesRequest describeMetricCollectionTypesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeMetricCollectionTypesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeMetricCollectionTypesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeMetricCollectionTypes");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeMetricCollectionTypesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeMetricCollectionTypes").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeMetricCollectionTypesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeMetricCollectionTypesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets information about the Amazon SNS notifications that are configured for one or more Auto Scaling groups.
*
*
* @param describeNotificationConfigurationsRequest
* @return A Java Future containing the result of the DescribeNotificationConfigurations operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InvalidNextTokenException The
NextToken
value is not valid.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeNotificationConfigurations
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeNotificationConfigurations(
DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeNotificationConfigurationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeNotificationConfigurationsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeNotificationConfigurations");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeNotificationConfigurationsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeNotificationConfigurations").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeNotificationConfigurationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeNotificationConfigurationsRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets information about the scaling policies in the account and Region.
*
*
* @param describePoliciesRequest
* @return A Java Future containing the result of the DescribePolicies operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InvalidNextTokenException The
NextToken
value is not valid.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - ServiceLinkedRoleFailureException The service-linked role is not yet ready for use.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribePolicies
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture describePolicies(DescribePoliciesRequest describePoliciesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describePoliciesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describePoliciesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribePolicies");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribePoliciesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribePolicies").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribePoliciesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describePoliciesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets information about the scaling activities in the account and Region.
*
*
* When scaling events occur, you see a record of the scaling activity in the scaling activities. For more
* information, see Verify a scaling
* activity for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide.
*
*
* If the scaling event succeeds, the value of the StatusCode
element in the response is
* Successful
. If an attempt to launch instances failed, the StatusCode
value is
* Failed
or Cancelled
and the StatusMessage
element in the response
* indicates the cause of the failure. For help interpreting the StatusMessage
, see Troubleshooting Amazon EC2
* Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
*
*
* @param describeScalingActivitiesRequest
* @return A Java Future containing the result of the DescribeScalingActivities operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InvalidNextTokenException The
NextToken
value is not valid.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeScalingActivities
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeScalingActivities(
DescribeScalingActivitiesRequest describeScalingActivitiesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeScalingActivitiesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeScalingActivitiesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeScalingActivities");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeScalingActivitiesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeScalingActivities").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeScalingActivitiesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeScalingActivitiesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Describes the scaling process types for use with the ResumeProcesses and
* SuspendProcesses
* APIs.
*
*
* @param describeScalingProcessTypesRequest
* @return A Java Future containing the result of the DescribeScalingProcessTypes operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeScalingProcessTypes
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeScalingProcessTypes(
DescribeScalingProcessTypesRequest describeScalingProcessTypesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeScalingProcessTypesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeScalingProcessTypesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeScalingProcessTypes");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeScalingProcessTypesResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeScalingProcessTypes").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeScalingProcessTypesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeScalingProcessTypesRequest));
CompletableFuture whenCompleteFuture = null;
whenCompleteFuture = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
return CompletableFutureUtils.forwardExceptionTo(whenCompleteFuture, executeFuture);
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets information about the scheduled actions that haven't run or that have not reached their end time.
*
*
* To describe the scaling activities for scheduled actions that have already run, call the DescribeScalingActivities API.
*
*
* @param describeScheduledActionsRequest
* @return A Java Future containing the result of the DescribeScheduledActions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InvalidNextTokenException The
NextToken
value is not valid.
* - ResourceContentionException You already have a pending update to an Amazon EC2 Auto Scaling resource
* (for example, an Auto Scaling group, instance, or load balancer).
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - AutoScalingException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample AutoScalingAsyncClient.DescribeScheduledActions
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeScheduledActions(
DescribeScheduledActionsRequest describeScheduledActionsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeScheduledActionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeScheduledActionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Auto Scaling");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeScheduledActions");
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(DescribeScheduledActionsResponse::builder);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler();
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeScheduledActions").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeScheduledActionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeScheduledActionsRequest));
CompletableFuture