com.amazonaws.services.autoscaling.AmazonAutoScalingClient Maven / Gradle / Ivy
Show all versions of aws-sdk-android Show documentation
/*
* Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.autoscaling;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import java.util.Map.Entry;
import com.amazonaws.*;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.services.autoscaling.model.*;
import com.amazonaws.services.autoscaling.model.transform.*;
/**
* Client for accessing AmazonAutoScaling. All service calls made
* using this client are blocking, and will not return until the service call
* completes.
*
* Auto Scaling
* Auto Scaling is a web service designed to automatically launch or
* terminate Amazon Elastic Compute Cloud (Amazon EC2) instances based on
* user-defined policies, schedules, and health checks. This service is
* used in conjunction with Amazon CloudWatch and Elastic Load Balancing
* services.
*
*
* Auto Scaling provides APIs that you can call by submitting a Query
* Request. Query requests are HTTP or HTTPS requests that use the HTTP
* verbs GET or POST and a Query parameter named Action or
* Operation that specifies the API you are calling. Action is
* used throughout this documentation, although Operation is also
* supported for backward compatibility with other Amazon Web Services
* (AWS) Query APIs.
*
*
* Calling the API using a Query request is the most direct way to access
* the web service, but requires that your application handle low-level
* details such as generating the hash to sign the request and error
* handling. The benefit of calling the service using a Query request is
* that you are assured of having access to the complete functionality of
* the API. For information about signing a a query request, see
* Use Query Requests to Call Auto Scaling APIs
*
*
*
* This guide provides detailed information about Auto Scaling actions,
* data types, parameters, and errors. For detailed information about
* Auto Scaling features and their associated API actions, go to the
* Auto Scaling Developer Guide
* .
*
*
* This reference is based on the current WSDL, which is available at:
*
*
*
* http://autoscaling.amazonaws.com/doc/2011-01-01/AutoScaling.wsdl
*
*
*
* Endpoints
*
*
* The examples in this guide assume that your instances are launched in
* the US East (Northern Virginia) region and use us-east-1 as the
* endpoint.
*
*
* You can set up your Auto Scaling infrastructure in other AWS regions.
* For information about this product's regions and endpoints, see
* Regions and Endpoints
* in the Amazon Web Services General Reference.
*
*/
public class AmazonAutoScalingClient extends AmazonWebServiceClient implements AmazonAutoScaling {
/** Provider for AWS credentials. */
private AWSCredentialsProvider awsCredentialsProvider;
/**
* List of exception unmarshallers for all AmazonAutoScaling exceptions.
*/
protected final List> exceptionUnmarshallers
= new ArrayList>();
/**
* Constructs a new client to invoke service methods on
* AmazonAutoScaling. A credentials provider chain will be used
* that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
*
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @see DefaultAWSCredentialsProviderChain
*/
public AmazonAutoScalingClient() {
this(new DefaultAWSCredentialsProviderChain(), new ClientConfiguration());
}
/**
* Constructs a new client to invoke service methods on
* AmazonAutoScaling. A credentials provider chain will be used
* that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
*
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param clientConfiguration The client configuration options controlling how this
* client connects to AmazonAutoScaling
* (ex: proxy settings, retry counts, etc.).
*
* @see DefaultAWSCredentialsProviderChain
*/
public AmazonAutoScalingClient(ClientConfiguration clientConfiguration) {
this(new DefaultAWSCredentialsProviderChain(), clientConfiguration);
}
/**
* Constructs a new client to invoke service methods on
* AmazonAutoScaling using the specified AWS account credentials.
*
*
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param awsCredentials The AWS credentials (access key ID and secret key) to use
* when authenticating with AWS services.
*/
public AmazonAutoScalingClient(AWSCredentials awsCredentials) {
this(awsCredentials, new ClientConfiguration());
}
/**
* Constructs a new client to invoke service methods on
* AmazonAutoScaling using the specified AWS account credentials
* and client configuration options.
*
*
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param awsCredentials The AWS credentials (access key ID and secret key) to use
* when authenticating with AWS services.
* @param clientConfiguration The client configuration options controlling how this
* client connects to AmazonAutoScaling
* (ex: proxy settings, retry counts, etc.).
*/
public AmazonAutoScalingClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {
super(clientConfiguration);
this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials);
init();
}
/**
* Constructs a new client to invoke service methods on
* AmazonAutoScaling using the specified AWS account credentials provider.
*
*
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials
* to authenticate requests with AWS services.
*/
public AmazonAutoScalingClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, new ClientConfiguration());
}
/**
* Constructs a new client to invoke service methods on
* AmazonAutoScaling using the specified AWS account credentials
* provider and client configuration options.
*
*
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials
* to authenticate requests with AWS services.
* @param clientConfiguration The client configuration options controlling how this
* client connects to AmazonAutoScaling
* (ex: proxy settings, retry counts, etc.).
*/
public AmazonAutoScalingClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, null);
}
/**
* Constructs a new client to invoke service methods on
* AmazonAutoScaling using the specified AWS account credentials
* provider, client configuration options, and request metric collector.
*
*
* All service calls made using this new client object are blocking, and will not
* return until the service call completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials
* to authenticate requests with AWS services.
* @param clientConfiguration The client configuration options controlling how this
* client connects to AmazonAutoScaling
* (ex: proxy settings, retry counts, etc.).
* @param requestMetricCollector optional request metric collector
*/
public AmazonAutoScalingClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector) {
super(clientConfiguration, requestMetricCollector);
this.awsCredentialsProvider = awsCredentialsProvider;
init();
}
private void init() {
exceptionUnmarshallers.add(new InvalidNextTokenExceptionUnmarshaller());
exceptionUnmarshallers.add(new ScalingActivityInProgressExceptionUnmarshaller());
exceptionUnmarshallers.add(new LimitExceededExceptionUnmarshaller());
exceptionUnmarshallers.add(new AlreadyExistsExceptionUnmarshaller());
exceptionUnmarshallers.add(new ResourceInUseExceptionUnmarshaller());
exceptionUnmarshallers.add(new StandardErrorUnmarshaller());
// calling this.setEndPoint(...) will also modify the signer accordingly
this.setEndpoint("autoscaling.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain(
"/com/amazonaws/services/autoscaling/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain(
"/com/amazonaws/services/autoscaling/request.handler2s"));
}
/**
*
* Returns the limits for the Auto Scaling resources currently allowed
* for your AWS account.
*
*
* Your AWS account comes with default limits on resources for Auto
* Scaling. There is a default limit of 20
Auto Scaling
* groups and 100
launch configurations per region.
*
*
* If you reach the limits for the number of Auto Scaling groups or the
* launch configurations, you can go to the
* Support Center
* and place a request to raise the limits.
*
*
* @param describeAccountLimitsRequest Container for the necessary
* parameters to execute the DescribeAccountLimits service method on
* AmazonAutoScaling.
*
* @return The response from the DescribeAccountLimits service method, as
* returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAccountLimitsResult describeAccountLimits(DescribeAccountLimitsRequest describeAccountLimitsRequest) {
ExecutionContext executionContext = createExecutionContext(describeAccountLimitsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeAccountLimitsRequestMarshaller().marshall(describeAccountLimitsRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeAccountLimitsResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a full description of each Auto Scaling group in the given
* list. This includes all Amazon EC2 instances that are members of the
* group. If a list of names is not provided, the service returns the
* full details of all Auto Scaling groups.
*
*
* This action supports pagination by returning a token if there are
* more pages to retrieve. To get the next page, call this action again
* with the returned token as the NextToken
parameter.
*
*
* @param describeAutoScalingGroupsRequest Container for the necessary
* parameters to execute the DescribeAutoScalingGroups service method on
* AmazonAutoScaling.
*
* @return The response from the DescribeAutoScalingGroups service
* method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAutoScalingGroupsResult describeAutoScalingGroups(DescribeAutoScalingGroupsRequest describeAutoScalingGroupsRequest) {
ExecutionContext executionContext = createExecutionContext(describeAutoScalingGroupsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeAutoScalingGroupsRequestMarshaller().marshall(describeAutoScalingGroupsRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeAutoScalingGroupsResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Enables monitoring of group metrics for the Auto Scaling group
* specified in AutoScalingGroupName
. You can specify the
* list of enabled metrics with the Metrics
parameter.
*
*
* Auto Scaling metrics collection can be turned on only if the
* InstanceMonitoring
flag, in the Auto Scaling group's
* launch configuration, is set to True
.
*
*
* @param enableMetricsCollectionRequest Container for the necessary
* parameters to execute the EnableMetricsCollection service method on
* AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void enableMetricsCollection(EnableMetricsCollectionRequest enableMetricsCollectionRequest) {
ExecutionContext executionContext = createExecutionContext(enableMetricsCollectionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new EnableMetricsCollectionRequestMarshaller().marshall(enableMetricsCollectionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Resumes all suspended Auto Scaling processes for an Auto Scaling
* group. For information on suspending and resuming Auto Scaling
* process, see
* Suspend and Resume Auto Scaling Process
* .
*
*
* @param resumeProcessesRequest Container for the necessary parameters
* to execute the ResumeProcesses service method on AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void resumeProcesses(ResumeProcessesRequest resumeProcessesRequest) {
ExecutionContext executionContext = createExecutionContext(resumeProcessesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new ResumeProcessesRequestMarshaller().marshall(resumeProcessesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Deletes the specified LaunchConfiguration.
*
*
* The specified 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 Container for the necessary
* parameters to execute the DeleteLaunchConfiguration service method on
* AmazonAutoScaling.
*
*
* @throws ResourceInUseException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void deleteLaunchConfiguration(DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest) {
ExecutionContext executionContext = createExecutionContext(deleteLaunchConfigurationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DeleteLaunchConfigurationRequestMarshaller().marshall(deleteLaunchConfigurationRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Returns descriptions of what each policy does. This action supports
* pagination. If the response includes a token, there are more records
* available. To get the additional records, repeat the request with the
* response token as the NextToken
parameter.
*
*
* @param describePoliciesRequest Container for the necessary parameters
* to execute the DescribePolicies service method on AmazonAutoScaling.
*
* @return The response from the DescribePolicies service method, as
* returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribePoliciesResult describePolicies(DescribePoliciesRequest describePoliciesRequest) {
ExecutionContext executionContext = createExecutionContext(describePoliciesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribePoliciesRequestMarshaller().marshall(describePoliciesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribePoliciesResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns scaling process types for use in the ResumeProcesses and
* SuspendProcesses actions.
*
*
* @param describeScalingProcessTypesRequest Container for the necessary
* parameters to execute the DescribeScalingProcessTypes service method
* on AmazonAutoScaling.
*
* @return The response from the DescribeScalingProcessTypes service
* method, as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeScalingProcessTypesResult describeScalingProcessTypes(DescribeScalingProcessTypesRequest describeScalingProcessTypesRequest) {
ExecutionContext executionContext = createExecutionContext(describeScalingProcessTypesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeScalingProcessTypesRequestMarshaller().marshall(describeScalingProcessTypesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeScalingProcessTypesResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a new Auto Scaling group with the specified name and other
* attributes. When the creation request is completed, the Auto Scaling
* group is ready to be used in other calls.
*
*
* NOTE: The Auto Scaling group name must be unique within the
* scope of your AWS account.
*
*
* @param createAutoScalingGroupRequest Container for the necessary
* parameters to execute the CreateAutoScalingGroup service method on
* AmazonAutoScaling.
*
*
* @throws LimitExceededException
* @throws AlreadyExistsException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void createAutoScalingGroup(CreateAutoScalingGroupRequest createAutoScalingGroupRequest) {
ExecutionContext executionContext = createExecutionContext(createAutoScalingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new CreateAutoScalingGroupRequestMarshaller().marshall(createAutoScalingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Attaches one or more Amazon EC2 instances to an existing Auto Scaling
* group. After the instance(s) is attached, it becomes a part of the
* Auto Scaling group.
*
*
* For more information, see
* Attach Amazon EC2 Instance(s) to Your Existing Auto Scaling Group
* in the Auto Scaling Developer Guide .
*
*
* @param attachInstancesRequest Container for the necessary parameters
* to execute the AttachInstances service method on AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void attachInstances(AttachInstancesRequest attachInstancesRequest) {
ExecutionContext executionContext = createExecutionContext(attachInstancesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new AttachInstancesRequestMarshaller().marshall(attachInstancesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Returns the scaling activities for the specified Auto Scaling group.
*
*
* If the specified ActivityIds
list is empty, all the
* activities from the past six weeks are returned. Activities are sorted
* by the start time. Activities still in progress appear first on the
* list.
*
*
* This action supports pagination. If the response includes a token,
* there are more records available. To get the additional records,
* repeat the request with the response token as the
* NextToken
parameter.
*
*
* @param describeScalingActivitiesRequest Container for the necessary
* parameters to execute the DescribeScalingActivities service method on
* AmazonAutoScaling.
*
* @return The response from the DescribeScalingActivities service
* method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeScalingActivitiesResult describeScalingActivities(DescribeScalingActivitiesRequest describeScalingActivitiesRequest) {
ExecutionContext executionContext = createExecutionContext(describeScalingActivitiesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeScalingActivitiesRequestMarshaller().marshall(describeScalingActivitiesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeScalingActivitiesResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a list of notification actions associated with Auto Scaling
* groups for specified events.
*
*
* @param describeNotificationConfigurationsRequest Container for the
* necessary parameters to execute the DescribeNotificationConfigurations
* service method on AmazonAutoScaling.
*
* @return The response from the DescribeNotificationConfigurations
* service method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeNotificationConfigurationsResult describeNotificationConfigurations(DescribeNotificationConfigurationsRequest describeNotificationConfigurationsRequest) {
ExecutionContext executionContext = createExecutionContext(describeNotificationConfigurationsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeNotificationConfigurationsRequestMarshaller().marshall(describeNotificationConfigurationsRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeNotificationConfigurationsResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a list of all termination policies supported by Auto Scaling.
*
*
* @param describeTerminationPolicyTypesRequest Container for the
* necessary parameters to execute the DescribeTerminationPolicyTypes
* service method on AmazonAutoScaling.
*
* @return The response from the DescribeTerminationPolicyTypes service
* method, as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeTerminationPolicyTypesResult describeTerminationPolicyTypes(DescribeTerminationPolicyTypesRequest describeTerminationPolicyTypesRequest) {
ExecutionContext executionContext = createExecutionContext(describeTerminationPolicyTypesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeTerminationPolicyTypesRequestMarshaller().marshall(describeTerminationPolicyTypesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeTerminationPolicyTypesResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the Auto Scaling group tags.
*
*
* You can use filters to limit results when describing tags. For
* example, you can query for tags of a particular Auto Scaling group.
* You can specify multiple values for a filter. A tag must match at
* least one of the specified values for it to be included in the
* results.
*
*
* You can also specify multiple filters. The result includes
* information for a particular tag only if it matches all your filters.
* If there's no match, no special message is returned.
*
*
* @param describeTagsRequest Container for the necessary parameters to
* execute the DescribeTags service method on AmazonAutoScaling.
*
* @return The response from the DescribeTags service method, as returned
* by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeTagsResult describeTags(DescribeTagsRequest describeTagsRequest) {
ExecutionContext executionContext = createExecutionContext(describeTagsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeTagsRequestMarshaller().marshall(describeTagsRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeTagsResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Removes the specified tags or a set of tags from a set of resources.
*
*
* @param deleteTagsRequest Container for the necessary parameters to
* execute the DeleteTags service method on AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void deleteTags(DeleteTagsRequest deleteTagsRequest) {
ExecutionContext executionContext = createExecutionContext(deleteTagsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DeleteTagsRequestMarshaller().marshall(deleteTagsRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Executes the specified policy.
*
*
* @param executePolicyRequest Container for the necessary parameters to
* execute the ExecutePolicy service method on AmazonAutoScaling.
*
*
* @throws ScalingActivityInProgressException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void executePolicy(ExecutePolicyRequest executePolicyRequest) {
ExecutionContext executionContext = createExecutionContext(executePolicyRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new ExecutePolicyRequestMarshaller().marshall(executePolicyRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Creates or updates a policy for an Auto Scaling group. To update an
* existing policy, use the existing policy name and set the parameter(s)
* you want to change. Any existing parameter not changed in an update to
* an existing policy is not changed in this update request.
*
*
* @param putScalingPolicyRequest Container for the necessary parameters
* to execute the PutScalingPolicy service method on AmazonAutoScaling.
*
* @return The response from the PutScalingPolicy service method, as
* returned by AmazonAutoScaling.
*
* @throws LimitExceededException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public PutScalingPolicyResult putScalingPolicy(PutScalingPolicyRequest putScalingPolicyRequest) {
ExecutionContext executionContext = createExecutionContext(putScalingPolicyRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new PutScalingPolicyRequestMarshaller().marshall(putScalingPolicyRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new PutScalingPolicyResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Configures an Auto Scaling group to send notifications when specified
* events take place. Subscribers to this topic can have messages for
* events delivered to an endpoint such as a web server or email address.
*
*
* For more information see
* Get Email Notifications When Your Auto Scaling Group Changes
*
*
*
* A new PutNotificationConfiguration
overwrites an
* existing configuration.
*
*
* @param putNotificationConfigurationRequest Container for the necessary
* parameters to execute the PutNotificationConfiguration service method
* on AmazonAutoScaling.
*
*
* @throws LimitExceededException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void putNotificationConfiguration(PutNotificationConfigurationRequest putNotificationConfigurationRequest) {
ExecutionContext executionContext = createExecutionContext(putNotificationConfigurationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new PutNotificationConfigurationRequestMarshaller().marshall(putNotificationConfigurationRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Deletes a policy created by PutScalingPolicy.
*
*
* @param deletePolicyRequest Container for the necessary parameters to
* execute the DeletePolicy service method on AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void deletePolicy(DeletePolicyRequest deletePolicyRequest) {
ExecutionContext executionContext = createExecutionContext(deletePolicyRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DeletePolicyRequestMarshaller().marshall(deletePolicyRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Deletes notifications created by PutNotificationConfiguration.
*
*
* @param deleteNotificationConfigurationRequest Container for the
* necessary parameters to execute the DeleteNotificationConfiguration
* service method on AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void deleteNotificationConfiguration(DeleteNotificationConfigurationRequest deleteNotificationConfigurationRequest) {
ExecutionContext executionContext = createExecutionContext(deleteNotificationConfigurationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DeleteNotificationConfigurationRequestMarshaller().marshall(deleteNotificationConfigurationRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Deletes a scheduled action previously created using the
* PutScheduledUpdateGroupAction.
*
*
* @param deleteScheduledActionRequest Container for the necessary
* parameters to execute the DeleteScheduledAction service method on
* AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void deleteScheduledAction(DeleteScheduledActionRequest deleteScheduledActionRequest) {
ExecutionContext executionContext = createExecutionContext(deleteScheduledActionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DeleteScheduledActionRequestMarshaller().marshall(deleteScheduledActionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Sets the health status of a specified instance that belongs to any of
* your Auto Scaling groups.
*
*
* For more information, see
* Configure Health Checks for Your Auto Scaling group
* .
*
*
* @param setInstanceHealthRequest Container for the necessary parameters
* to execute the SetInstanceHealth service method on AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void setInstanceHealth(SetInstanceHealthRequest setInstanceHealthRequest) {
ExecutionContext executionContext = createExecutionContext(setInstanceHealthRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new SetInstanceHealthRequestMarshaller().marshall(setInstanceHealthRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Returns a list of all notification types that are supported by Auto
* Scaling.
*
*
* @param describeAutoScalingNotificationTypesRequest Container for the
* necessary parameters to execute the
* DescribeAutoScalingNotificationTypes service method on
* AmazonAutoScaling.
*
* @return The response from the DescribeAutoScalingNotificationTypes
* service method, as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAutoScalingNotificationTypesResult describeAutoScalingNotificationTypes(DescribeAutoScalingNotificationTypesRequest describeAutoScalingNotificationTypesRequest) {
ExecutionContext executionContext = createExecutionContext(describeAutoScalingNotificationTypesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeAutoScalingNotificationTypesRequestMarshaller().marshall(describeAutoScalingNotificationTypesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeAutoScalingNotificationTypesResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates new tags or updates existing tags for an Auto Scaling group.
*
*
* NOTE: A tag's definition is composed of a resource ID,
* resource type, key and value, and the propagate flag. Value and the
* propagate flag are optional parameters. See the Request Parameters for
* more information.
*
*
* For information on creating tags for your Auto Scaling group, see
* Tag Your Auto Scaling Groups and Amazon EC2 Instances
* .
*
*
* @param createOrUpdateTagsRequest Container for the necessary
* parameters to execute the CreateOrUpdateTags service method on
* AmazonAutoScaling.
*
*
* @throws LimitExceededException
* @throws AlreadyExistsException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void createOrUpdateTags(CreateOrUpdateTagsRequest createOrUpdateTagsRequest) {
ExecutionContext executionContext = createExecutionContext(createOrUpdateTagsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new CreateOrUpdateTagsRequestMarshaller().marshall(createOrUpdateTagsRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Suspends Auto Scaling processes for an Auto Scaling group. To suspend
* specific process types, specify them by name with the
* ScalingProcesses.member.N
parameter. To suspend all
* process types, omit the ScalingProcesses.member.N
* parameter.
*
*
* IMPORTANT: Suspending either of the two primary process types,
* Launch or Terminate, can prevent other process types from functioning
* properly.
*
*
* To resume processes that have been suspended, use ResumeProcesses For
* more information on suspending and resuming Auto Scaling process, see
* Suspend and Resume Auto Scaling Process
* .
*
*
* @param suspendProcessesRequest Container for the necessary parameters
* to execute the SuspendProcesses service method on AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void suspendProcesses(SuspendProcessesRequest suspendProcessesRequest) {
ExecutionContext executionContext = createExecutionContext(suspendProcessesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new SuspendProcessesRequestMarshaller().marshall(suspendProcessesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Creates a new launch configuration. The launch configuration name
* must be unique within the scope of the client's AWS account. The
* maximum limit of launch configurations, which by default is 100, must
* not yet have been met; otherwise, the call will fail. When created,
* the new launch configuration is available for immediate use.
*
*
* @param createLaunchConfigurationRequest Container for the necessary
* parameters to execute the CreateLaunchConfiguration service method on
* AmazonAutoScaling.
*
*
* @throws LimitExceededException
* @throws AlreadyExistsException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void createLaunchConfiguration(CreateLaunchConfigurationRequest createLaunchConfigurationRequest) {
ExecutionContext executionContext = createExecutionContext(createLaunchConfigurationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new CreateLaunchConfigurationRequestMarshaller().marshall(createLaunchConfigurationRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Returns a description of each Auto Scaling instance in the
* InstanceIds
list. If a list is not provided, the service
* returns the full details of all instances up to a maximum of 50. By
* default, the service returns a list of 20 items.
*
*
* This action supports pagination by returning a token if there are
* more pages to retrieve. To get the next page, call this action again
* with the returned token as the NextToken
parameter.
*
*
* @param describeAutoScalingInstancesRequest Container for the necessary
* parameters to execute the DescribeAutoScalingInstances service method
* on AmazonAutoScaling.
*
* @return The response from the DescribeAutoScalingInstances service
* method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAutoScalingInstancesResult describeAutoScalingInstances(DescribeAutoScalingInstancesRequest describeAutoScalingInstancesRequest) {
ExecutionContext executionContext = createExecutionContext(describeAutoScalingInstancesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeAutoScalingInstancesRequestMarshaller().marshall(describeAutoScalingInstancesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeAutoScalingInstancesResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified Auto Scaling group if the group has no
* instances and no scaling activities in progress.
*
*
* NOTE: To remove all instances before calling
* DeleteAutoScalingGroup, you can call UpdateAutoScalingGroup to set the
* minimum and maximum size of the AutoScalingGroup to zero.
*
*
* @param deleteAutoScalingGroupRequest Container for the necessary
* parameters to execute the DeleteAutoScalingGroup service method on
* AmazonAutoScaling.
*
*
* @throws ResourceInUseException
* @throws ScalingActivityInProgressException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void deleteAutoScalingGroup(DeleteAutoScalingGroupRequest deleteAutoScalingGroupRequest) {
ExecutionContext executionContext = createExecutionContext(deleteAutoScalingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DeleteAutoScalingGroupRequestMarshaller().marshall(deleteAutoScalingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Disables monitoring of group metrics for the Auto Scaling group
* specified in AutoScalingGroupName
. You can specify the
* list of affected metrics with the Metrics
parameter.
*
*
* @param disableMetricsCollectionRequest Container for the necessary
* parameters to execute the DisableMetricsCollection service method on
* AmazonAutoScaling.
*
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void disableMetricsCollection(DisableMetricsCollectionRequest disableMetricsCollectionRequest) {
ExecutionContext executionContext = createExecutionContext(disableMetricsCollectionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DisableMetricsCollectionRequestMarshaller().marshall(disableMetricsCollectionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Updates the configuration for the specified AutoScalingGroup.
*
*
* NOTE: To update an Auto Scaling group with a launch
* configuration that has the InstanceMonitoring flag set to False, you
* must first ensure that collection of group metrics is disabled.
* Otherwise, calls to UpdateAutoScalingGroup will fail. If you have
* previously enabled group metrics collection, you can disable
* collection of all group metrics by calling DisableMetricsCollection.
*
*
* The new settings are registered upon the completion of this call. Any
* launch configuration settings take effect on any triggers after this
* call returns. Scaling activities that are currently in progress aren't
* affected.
*
*
* NOTE: If a new value is specified for MinSize without
* specifying the value for DesiredCapacity, and if the new MinSize is
* larger than the current size of the Auto Scaling Group, there will be
* an implicit call to SetDesiredCapacity to set the group to the new
* MinSize. If a new value is specified for MaxSize without specifying
* the value for DesiredCapacity, and the new MaxSize is smaller than the
* current size of the Auto Scaling Group, there will be an implicit call
* to SetDesiredCapacity to set the group to the new MaxSize. All other
* optional parameters are left unchanged if not passed in the request.
*
*
* @param updateAutoScalingGroupRequest Container for the necessary
* parameters to execute the UpdateAutoScalingGroup service method on
* AmazonAutoScaling.
*
*
* @throws ScalingActivityInProgressException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void updateAutoScalingGroup(UpdateAutoScalingGroupRequest updateAutoScalingGroupRequest) {
ExecutionContext executionContext = createExecutionContext(updateAutoScalingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new UpdateAutoScalingGroupRequestMarshaller().marshall(updateAutoScalingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Returns a full description of the launch configurations, or the
* specified launch configurations, if they exist.
*
*
* If no name is specified, then the full details of all launch
* configurations are returned.
*
*
* @param describeLaunchConfigurationsRequest Container for the necessary
* parameters to execute the DescribeLaunchConfigurations service method
* on AmazonAutoScaling.
*
* @return The response from the DescribeLaunchConfigurations service
* method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeLaunchConfigurationsResult describeLaunchConfigurations(DescribeLaunchConfigurationsRequest describeLaunchConfigurationsRequest) {
ExecutionContext executionContext = createExecutionContext(describeLaunchConfigurationsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeLaunchConfigurationsRequestMarshaller().marshall(describeLaunchConfigurationsRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeLaunchConfigurationsResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns policy adjustment types for use in the PutScalingPolicy
* action.
*
*
* @param describeAdjustmentTypesRequest Container for the necessary
* parameters to execute the DescribeAdjustmentTypes service method on
* AmazonAutoScaling.
*
* @return The response from the DescribeAdjustmentTypes service method,
* as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAdjustmentTypesResult describeAdjustmentTypes(DescribeAdjustmentTypesRequest describeAdjustmentTypesRequest) {
ExecutionContext executionContext = createExecutionContext(describeAdjustmentTypesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeAdjustmentTypesRequestMarshaller().marshall(describeAdjustmentTypesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeAdjustmentTypesResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists all the actions scheduled for your Auto Scaling group that
* haven't been executed. To see a list of actions already executed, see
* the activity record returned in DescribeScalingActivities.
*
*
* @param describeScheduledActionsRequest Container for the necessary
* parameters to execute the DescribeScheduledActions service method on
* AmazonAutoScaling.
*
* @return The response from the DescribeScheduledActions service method,
* as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeScheduledActionsResult describeScheduledActions(DescribeScheduledActionsRequest describeScheduledActionsRequest) {
ExecutionContext executionContext = createExecutionContext(describeScheduledActionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeScheduledActionsRequestMarshaller().marshall(describeScheduledActionsRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeScheduledActionsResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates or updates a scheduled scaling action for an Auto Scaling
* group. When updating a scheduled scaling action, if you leave a
* parameter unspecified, the corresponding value remains unchanged in
* the affected Auto Scaling group.
*
*
* For information on creating or updating a scheduled action for your
* Auto Scaling group, see
* Scale Based on a Schedule
* .
*
*
* NOTE: Auto Scaling supports the date and time expressed in
* "YYYY-MM-DDThh:mm:ssZ" format in UTC/GMT only.
*
*
* @param putScheduledUpdateGroupActionRequest Container for the
* necessary parameters to execute the PutScheduledUpdateGroupAction
* service method on AmazonAutoScaling.
*
*
* @throws LimitExceededException
* @throws AlreadyExistsException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void putScheduledUpdateGroupAction(PutScheduledUpdateGroupActionRequest putScheduledUpdateGroupActionRequest) {
ExecutionContext executionContext = createExecutionContext(putScheduledUpdateGroupActionRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new PutScheduledUpdateGroupActionRequestMarshaller().marshall(putScheduledUpdateGroupActionRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Returns a list of metrics and a corresponding list of granularities
* for each metric.
*
*
* @param describeMetricCollectionTypesRequest Container for the
* necessary parameters to execute the DescribeMetricCollectionTypes
* service method on AmazonAutoScaling.
*
* @return The response from the DescribeMetricCollectionTypes service
* method, as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeMetricCollectionTypesResult describeMetricCollectionTypes(DescribeMetricCollectionTypesRequest describeMetricCollectionTypesRequest) {
ExecutionContext executionContext = createExecutionContext(describeMetricCollectionTypesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new DescribeMetricCollectionTypesRequestMarshaller().marshall(describeMetricCollectionTypesRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new DescribeMetricCollectionTypesResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Sets the desired size of the specified AutoScalingGroup.
*
*
* @param setDesiredCapacityRequest Container for the necessary
* parameters to execute the SetDesiredCapacity service method on
* AmazonAutoScaling.
*
*
* @throws ScalingActivityInProgressException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public void setDesiredCapacity(SetDesiredCapacityRequest setDesiredCapacityRequest) {
ExecutionContext executionContext = createExecutionContext(setDesiredCapacityRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new SetDesiredCapacityRequestMarshaller().marshall(setDesiredCapacityRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
invoke(request, null, executionContext);
} finally {
endClientExecution(awsRequestMetrics, request, null);
}
}
/**
*
* Terminates the specified instance. Optionally, the desired group size
* can be adjusted.
*
*
* NOTE: This call simply registers a termination request. The
* termination of the instance cannot happen immediately.
*
*
* @param terminateInstanceInAutoScalingGroupRequest Container for the
* necessary parameters to execute the
* TerminateInstanceInAutoScalingGroup service method on
* AmazonAutoScaling.
*
* @return The response from the TerminateInstanceInAutoScalingGroup
* service method, as returned by AmazonAutoScaling.
*
* @throws ScalingActivityInProgressException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public TerminateInstanceInAutoScalingGroupResult terminateInstanceInAutoScalingGroup(TerminateInstanceInAutoScalingGroupRequest terminateInstanceInAutoScalingGroupRequest) {
ExecutionContext executionContext = createExecutionContext(terminateInstanceInAutoScalingGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
Request request = null;
Response response = null;
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
try {
request = new TerminateInstanceInAutoScalingGroupRequestMarshaller().marshall(terminateInstanceInAutoScalingGroupRequest);
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
response = invoke(request, new TerminateInstanceInAutoScalingGroupResultStaxUnmarshaller(), executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns the limits for the Auto Scaling resources currently allowed
* for your AWS account.
*
*
* Your AWS account comes with default limits on resources for Auto
* Scaling. There is a default limit of 20
Auto Scaling
* groups and 100
launch configurations per region.
*
*
* If you reach the limits for the number of Auto Scaling groups or the
* launch configurations, you can go to the
* Support Center
* and place a request to raise the limits.
*
*
* @return The response from the DescribeAccountLimits service method, as
* returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAccountLimitsResult describeAccountLimits() throws AmazonServiceException, AmazonClientException {
return describeAccountLimits(new DescribeAccountLimitsRequest());
}
/**
*
* Returns a full description of each Auto Scaling group in the given
* list. This includes all Amazon EC2 instances that are members of the
* group. If a list of names is not provided, the service returns the
* full details of all Auto Scaling groups.
*
*
* This action supports pagination by returning a token if there are
* more pages to retrieve. To get the next page, call this action again
* with the returned token as the NextToken
parameter.
*
*
* @return The response from the DescribeAutoScalingGroups service
* method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAutoScalingGroupsResult describeAutoScalingGroups() throws AmazonServiceException, AmazonClientException {
return describeAutoScalingGroups(new DescribeAutoScalingGroupsRequest());
}
/**
*
* Returns descriptions of what each policy does. This action supports
* pagination. If the response includes a token, there are more records
* available. To get the additional records, repeat the request with the
* response token as the NextToken
parameter.
*
*
* @return The response from the DescribePolicies service method, as
* returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribePoliciesResult describePolicies() throws AmazonServiceException, AmazonClientException {
return describePolicies(new DescribePoliciesRequest());
}
/**
*
* Returns scaling process types for use in the ResumeProcesses and
* SuspendProcesses actions.
*
*
* @return The response from the DescribeScalingProcessTypes service
* method, as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeScalingProcessTypesResult describeScalingProcessTypes() throws AmazonServiceException, AmazonClientException {
return describeScalingProcessTypes(new DescribeScalingProcessTypesRequest());
}
/**
*
* Returns the scaling activities for the specified Auto Scaling group.
*
*
* If the specified ActivityIds
list is empty, all the
* activities from the past six weeks are returned. Activities are sorted
* by the start time. Activities still in progress appear first on the
* list.
*
*
* This action supports pagination. If the response includes a token,
* there are more records available. To get the additional records,
* repeat the request with the response token as the
* NextToken
parameter.
*
*
* @return The response from the DescribeScalingActivities service
* method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeScalingActivitiesResult describeScalingActivities() throws AmazonServiceException, AmazonClientException {
return describeScalingActivities(new DescribeScalingActivitiesRequest());
}
/**
*
* Returns a list of notification actions associated with Auto Scaling
* groups for specified events.
*
*
* @return The response from the DescribeNotificationConfigurations
* service method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeNotificationConfigurationsResult describeNotificationConfigurations() throws AmazonServiceException, AmazonClientException {
return describeNotificationConfigurations(new DescribeNotificationConfigurationsRequest());
}
/**
*
* Returns a list of all termination policies supported by Auto Scaling.
*
*
* @return The response from the DescribeTerminationPolicyTypes service
* method, as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeTerminationPolicyTypesResult describeTerminationPolicyTypes() throws AmazonServiceException, AmazonClientException {
return describeTerminationPolicyTypes(new DescribeTerminationPolicyTypesRequest());
}
/**
*
* Lists the Auto Scaling group tags.
*
*
* You can use filters to limit results when describing tags. For
* example, you can query for tags of a particular Auto Scaling group.
* You can specify multiple values for a filter. A tag must match at
* least one of the specified values for it to be included in the
* results.
*
*
* You can also specify multiple filters. The result includes
* information for a particular tag only if it matches all your filters.
* If there's no match, no special message is returned.
*
*
* @return The response from the DescribeTags service method, as returned
* by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeTagsResult describeTags() throws AmazonServiceException, AmazonClientException {
return describeTags(new DescribeTagsRequest());
}
/**
*
* Returns a list of all notification types that are supported by Auto
* Scaling.
*
*
* @return The response from the DescribeAutoScalingNotificationTypes
* service method, as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAutoScalingNotificationTypesResult describeAutoScalingNotificationTypes() throws AmazonServiceException, AmazonClientException {
return describeAutoScalingNotificationTypes(new DescribeAutoScalingNotificationTypesRequest());
}
/**
*
* Returns a description of each Auto Scaling instance in the
* InstanceIds
list. If a list is not provided, the service
* returns the full details of all instances up to a maximum of 50. By
* default, the service returns a list of 20 items.
*
*
* This action supports pagination by returning a token if there are
* more pages to retrieve. To get the next page, call this action again
* with the returned token as the NextToken
parameter.
*
*
* @return The response from the DescribeAutoScalingInstances service
* method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAutoScalingInstancesResult describeAutoScalingInstances() throws AmazonServiceException, AmazonClientException {
return describeAutoScalingInstances(new DescribeAutoScalingInstancesRequest());
}
/**
*
* Returns a full description of the launch configurations, or the
* specified launch configurations, if they exist.
*
*
* If no name is specified, then the full details of all launch
* configurations are returned.
*
*
* @return The response from the DescribeLaunchConfigurations service
* method, as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeLaunchConfigurationsResult describeLaunchConfigurations() throws AmazonServiceException, AmazonClientException {
return describeLaunchConfigurations(new DescribeLaunchConfigurationsRequest());
}
/**
*
* Returns policy adjustment types for use in the PutScalingPolicy
* action.
*
*
* @return The response from the DescribeAdjustmentTypes service method,
* as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeAdjustmentTypesResult describeAdjustmentTypes() throws AmazonServiceException, AmazonClientException {
return describeAdjustmentTypes(new DescribeAdjustmentTypesRequest());
}
/**
*
* Lists all the actions scheduled for your Auto Scaling group that
* haven't been executed. To see a list of actions already executed, see
* the activity record returned in DescribeScalingActivities.
*
*
* @return The response from the DescribeScheduledActions service method,
* as returned by AmazonAutoScaling.
*
* @throws InvalidNextTokenException
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeScheduledActionsResult describeScheduledActions() throws AmazonServiceException, AmazonClientException {
return describeScheduledActions(new DescribeScheduledActionsRequest());
}
/**
*
* Returns a list of metrics and a corresponding list of granularities
* for each metric.
*
*
* @return The response from the DescribeMetricCollectionTypes service
* method, as returned by AmazonAutoScaling.
*
*
* @throws AmazonClientException
* If any internal errors are encountered inside the client while
* attempting to make the request or handle the response. For example
* if a network connection is not available.
* @throws AmazonServiceException
* If an error response is returned by AmazonAutoScaling indicating
* either a problem with the data in the request, or a server side issue.
*/
public DescribeMetricCollectionTypesResult describeMetricCollectionTypes() throws AmazonServiceException, AmazonClientException {
return describeMetricCollectionTypes(new DescribeMetricCollectionTypesRequest());
}
/**
* Returns additional metadata for a previously executed successful, request, typically used for
* debugging issues where a service isn't acting as expected. This data isn't considered part
* of the result data returned by an operation, so it's available through this separate,
* diagnostic interface.
*
* Response metadata is only cached for a limited period of time, so if you need to access
* this extra diagnostic information for an executed request, you should use this method
* to retrieve it as soon as possible after executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none
* is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
private Response invoke(Request request,
Unmarshaller unmarshaller,
ExecutionContext executionContext)
{
request.setEndpoint(endpoint);
request.setTimeOffset(timeOffset);
AmazonWebServiceRequest originalRequest = request.getOriginalRequest();
for (Entry entry : originalRequest.copyPrivateRequestParameters().entrySet()) {
request.addParameter(entry.getKey(), entry.getValue());
}
AWSCredentials credentials = awsCredentialsProvider.getCredentials();
if (originalRequest.getRequestCredentials() != null) {
credentials = originalRequest.getRequestCredentials();
}
executionContext.setCredentials(credentials);
StaxResponseHandler responseHandler = new StaxResponseHandler(unmarshaller);
DefaultErrorResponseHandler errorResponseHandler = new DefaultErrorResponseHandler(exceptionUnmarshallers);
return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}
}