com.amazonaws.services.autoscaling
Class AmazonAutoScalingClient

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceClient
      extended by com.amazonaws.services.autoscaling.AmazonAutoScalingClient
All Implemented Interfaces:
AmazonAutoScaling
Direct Known Subclasses:
AmazonAutoScalingAsyncClient

public class AmazonAutoScalingClient
extends AmazonWebServiceClient
implements AmazonAutoScaling

Client for accessing AmazonAutoScaling. All service calls made using this client are blocking, and will not return until the service call completes.

Amazon Auto Scaling is an easy-to-use web service designed to automatically launch or terminate EC2 instances based on user defined triggers. Users can set up Auto Scaling groups and associate triggers with these groups to automatically scale computing resources based on parameters such as bandwidth usage or CPU utilization. Auto Scaling groups can work across multiple Availability Zones - distinct physical locations for the hosted EC2 instances - so that if an Availability Zone becomes unhealthy or unavailable, Auto Scaling will automatically re-distribute applications to a healthy Availability Zone.


Constructor Summary
AmazonAutoScalingClient(AWSCredentials awsCredentials)
          Constructs a new client to invoke service methods on AmazonAutoScaling using the specified AWS account credentials.
AmazonAutoScalingClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
          Constructs a new client to invoke service methods on AmazonAutoScaling using the specified AWS account credentials and client configuration options.
 
Method Summary
 void createAutoScalingGroup(CreateAutoScalingGroupRequest createAutoScalingGroupRequest)
           Creates a new Auto Scaling group with the specified name.
 void createLaunchConfiguration(CreateLaunchConfigurationRequest createLaunchConfigurationRequest)
           Creates a new launch configuration.
 void createOrUpdateScalingTrigger(CreateOrUpdateScalingTriggerRequest createOrUpdateScalingTriggerRequest)
           Sets the parameters that govern how and when to scale an AutoScaling group.
 void deleteAutoScalingGroup(DeleteAutoScalingGroupRequest deleteAutoScalingGroupRequest)
           Deletes all configuration for the specified AutoScalingGroup and deletes the group.
 void deleteLaunchConfiguration(DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest)
           Deletes the specified LaunchConfiguration.
 void deleteTrigger(DeleteTriggerRequest deleteTriggerRequest)
           Deletes the specified trigger.
 DescribeAutoScalingGroupsResult describeAutoScalingGroups()
           Returns a full description of the AutoScalingGroup instances specified in the given list.
 DescribeAutoScalingGroupsResult describeAutoScalingGroups(DescribeAutoScalingGroupsRequest describeAutoScalingGroupsRequest)
           Returns a full description of the AutoScalingGroup instances specified in the given list.
 DescribeLaunchConfigurationsResult describeLaunchConfigurations()
           Returns a full description of the launch configurations given the specified names.
 DescribeLaunchConfigurationsResult describeLaunchConfigurations(DescribeLaunchConfigurationsRequest describeLaunchConfigurationsRequest)
           Returns a full description of the launch configurations given the specified names.
 DescribeScalingActivitiesResult describeScalingActivities(DescribeScalingActivitiesRequest describeScalingActivitiesRequest)
           Returns the scaling activities for the specified Auto Scaling group.
 DescribeTriggersResult describeTriggers(DescribeTriggersRequest describeTriggersRequest)
           Returns a full description of the specified AutoScalingGroup's triggers.
 void setDesiredCapacity(SetDesiredCapacityRequest setDesiredCapacityRequest)
           Adjusts the desired size of the AutoScalingGroup by initiating scaling activities.
 TerminateInstanceInAutoScalingGroupResult terminateInstanceInAutoScalingGroup(TerminateInstanceInAutoScalingGroupRequest terminateInstanceInAutoScalingGroupRequest)
           Terminates the specified instance.
 void updateAutoScalingGroup(UpdateAutoScalingGroupRequest updateAutoScalingGroupRequest)
           Updates the configuration for the specified AutoScalingGroup.
 
Methods inherited from class com.amazonaws.AmazonWebServiceClient
setEndpoint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.amazonaws.services.autoscaling.AmazonAutoScaling
setEndpoint
 

Constructor Detail

AmazonAutoScalingClient

public AmazonAutoScalingClient(AWSCredentials awsCredentials)
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.

Parameters:
awsCredentials - The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.

AmazonAutoScalingClient

public AmazonAutoScalingClient(AWSCredentials awsCredentials,
                               ClientConfiguration 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.

Parameters:
awsCredentials - The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
clientConfiguration - The client configuration options controlling how this client connects to AmazonAutoScaling (ex: proxy settings, retry counts, etc.).
Method Detail

deleteLaunchConfiguration

public void deleteLaunchConfiguration(DeleteLaunchConfigurationRequest deleteLaunchConfigurationRequest)
                               throws AmazonServiceException,
                                      AmazonClientException

Deletes the specified LaunchConfiguration.

The specified LaunchConfiguration must not be currently attached to any Auto Scaling group. Once this call completes, the launch configuration is no longer available for use.

Specified by:
deleteLaunchConfiguration in interface AmazonAutoScaling
Parameters:
deleteLaunchConfigurationRequest - Container for the necessary parameters to execute the DeleteLaunchConfiguration service method on AmazonAutoScaling.
Throws:
ResourceInUseException
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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

describeTriggers

public DescribeTriggersResult describeTriggers(DescribeTriggersRequest describeTriggersRequest)
                                        throws AmazonServiceException,
                                               AmazonClientException

Returns a full description of the specified AutoScalingGroup's triggers.

Specified by:
describeTriggers in interface AmazonAutoScaling
Parameters:
describeTriggersRequest - Container for the necessary parameters to execute the DescribeTriggers service method on AmazonAutoScaling.
Returns:
The response from the DescribeTriggers 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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

updateAutoScalingGroup

public void updateAutoScalingGroup(UpdateAutoScalingGroupRequest updateAutoScalingGroupRequest)
                            throws AmazonServiceException,
                                   AmazonClientException

Updates the configuration for the specified AutoScalingGroup.

The new settings are registered upon the completion of this call. Any launch configuration settings take effect on any triggers after this call returns. Triggers that are currently in progress aren't affected.

NOTE: If the new values are specified for the MinSize or MaxSize parameters, then there will be an implicit call to SetDesiredCapacity to set the group to the new MaxSize. All optional parameters are left unchanged if not passed in the request.

Specified by:
updateAutoScalingGroup in interface AmazonAutoScaling
Parameters:
updateAutoScalingGroupRequest - Container for the necessary parameters to execute the UpdateAutoScalingGroup service method on AmazonAutoScaling.
Throws:
ScalingActivityInProgressException
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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

createAutoScalingGroup

public void createAutoScalingGroup(CreateAutoScalingGroupRequest createAutoScalingGroupRequest)
                            throws AmazonServiceException,
                                   AmazonClientException

Creates a new Auto Scaling group with the specified name. Once the creation request is completed, the AutoScalingGroup is ready to be used in other calls.

NOTE: The client must not have already used up their entire quota of AutoScaling groups in order for this call to be successful.

Specified by:
createAutoScalingGroup in interface AmazonAutoScaling
Parameters:
createAutoScalingGroupRequest - Container for the necessary parameters to execute the CreateAutoScalingGroup service method on AmazonAutoScaling.
Throws:
LimitExceededException
AlreadyExistsException
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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

deleteTrigger

public void deleteTrigger(DeleteTriggerRequest deleteTriggerRequest)
                   throws AmazonServiceException,
                          AmazonClientException

Deletes the specified trigger.

If a trigger is currently in progress, the trigger continues to run until its activities complete.

Specified by:
deleteTrigger in interface AmazonAutoScaling
Parameters:
deleteTriggerRequest - Container for the necessary parameters to execute the DeleteTrigger 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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

terminateInstanceInAutoScalingGroup

public TerminateInstanceInAutoScalingGroupResult terminateInstanceInAutoScalingGroup(TerminateInstanceInAutoScalingGroupRequest terminateInstanceInAutoScalingGroupRequest)
                                                                              throws AmazonServiceException,
                                                                                     AmazonClientException

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.

Specified by:
terminateInstanceInAutoScalingGroup in interface AmazonAutoScaling
Parameters:
terminateInstanceInAutoScalingGroupRequest - Container for the necessary parameters to execute the TerminateInstanceInAutoScalingGroup service method on AmazonAutoScaling.
Returns:
The response from the TerminateInstanceInAutoScalingGroup service method, as returned by AmazonAutoScaling.
Throws:
ScalingActivityInProgressException
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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

createOrUpdateScalingTrigger

public void createOrUpdateScalingTrigger(CreateOrUpdateScalingTriggerRequest createOrUpdateScalingTriggerRequest)
                                  throws AmazonServiceException,
                                         AmazonClientException

Sets the parameters that govern how and when to scale an AutoScaling group.

Specified by:
createOrUpdateScalingTrigger in interface AmazonAutoScaling
Parameters:
createOrUpdateScalingTriggerRequest - Container for the necessary parameters to execute the CreateOrUpdateScalingTrigger service method on AmazonAutoScaling.
Throws:
LimitExceededException
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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

describeAutoScalingGroups

public DescribeAutoScalingGroupsResult describeAutoScalingGroups(DescribeAutoScalingGroupsRequest describeAutoScalingGroupsRequest)
                                                          throws AmazonServiceException,
                                                                 AmazonClientException

Returns a full description of the AutoScalingGroup instances specified in the given list. This includes all Amazon EC2 instances that are members of the Auto Scaling group. If a list of names is not provided, then the full details of all AutoScalingGroups is returned.

Specified by:
describeAutoScalingGroups in interface AmazonAutoScaling
Parameters:
describeAutoScalingGroupsRequest - Container for the necessary parameters to execute the DescribeAutoScalingGroups service method on AmazonAutoScaling.
Returns:
The response from the DescribeAutoScalingGroups 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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

createLaunchConfiguration

public void createLaunchConfiguration(CreateLaunchConfigurationRequest createLaunchConfigurationRequest)
                               throws AmazonServiceException,
                                      AmazonClientException

Creates a new launch configuration. Once created, the new launch configuration is available for immediate use.

NOTE: The launch configuration name used must be unique, within the scope of the client's AWS account, and the maximum limit of launch configurations must not yet have been met, or else the call will fail.

Specified by:
createLaunchConfiguration in interface AmazonAutoScaling
Parameters:
createLaunchConfigurationRequest - Container for the necessary parameters to execute the CreateLaunchConfiguration service method on AmazonAutoScaling.
Throws:
LimitExceededException
AlreadyExistsException
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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

describeLaunchConfigurations

public DescribeLaunchConfigurationsResult describeLaunchConfigurations(DescribeLaunchConfigurationsRequest describeLaunchConfigurationsRequest)
                                                                throws AmazonServiceException,
                                                                       AmazonClientException

Returns a full description of the launch configurations given the specified names.

If no names are specified, then the full details of all launch configurations are returned.

Specified by:
describeLaunchConfigurations in interface AmazonAutoScaling
Parameters:
describeLaunchConfigurationsRequest - Container for the necessary parameters to execute the DescribeLaunchConfigurations service method on AmazonAutoScaling.
Returns:
The response from the DescribeLaunchConfigurations 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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

describeScalingActivities

public DescribeScalingActivitiesResult describeScalingActivities(DescribeScalingActivitiesRequest describeScalingActivitiesRequest)
                                                          throws AmazonServiceException,
                                                                 AmazonClientException

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 will be sorted by completion time. Activities that have no completion time are considered as using the most recent possible time.

Specified by:
describeScalingActivities in interface AmazonAutoScaling
Parameters:
describeScalingActivitiesRequest - Container for the necessary parameters to execute the DescribeScalingActivities service method on AmazonAutoScaling.
Returns:
The response from the DescribeScalingActivities service method, as returned by AmazonAutoScaling.
Throws:
InvalidNextTokenException
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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

setDesiredCapacity

public void setDesiredCapacity(SetDesiredCapacityRequest setDesiredCapacityRequest)
                        throws AmazonServiceException,
                               AmazonClientException

Adjusts the desired size of the AutoScalingGroup by initiating scaling activities. When reducing the size of the group, it is not possible to define which EC2 instances will be terminated. This applies to any auto-scaling decisions that might result in the termination of instances.

Specified by:
setDesiredCapacity in interface AmazonAutoScaling
Parameters:
setDesiredCapacityRequest - Container for the necessary parameters to execute the SetDesiredCapacity service method on AmazonAutoScaling.
Throws:
ScalingActivityInProgressException
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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

deleteAutoScalingGroup

public void deleteAutoScalingGroup(DeleteAutoScalingGroupRequest deleteAutoScalingGroupRequest)
                            throws AmazonServiceException,
                                   AmazonClientException

Deletes all configuration for the specified AutoScalingGroup and deletes the group.

In order to successfully call this API, no triggers can be currently in progress. Once this call successfully executes, no further triggers will begin, and the specified AutoScalingGroup will not be available for use in other API calls.

NOTE: The client cannot delete an AutoScalingGroup if it contains instances or if there are scaling activities in progress. Before attempting to delete an AutoScalingGroup, call the UpdateAutoScalingGroup operation to set the minimum and maximum size of the AutoScalingGroup to zero. This will remove all instances and avoid problems with a previously set trigger preventing the deletion of the AutoScalingGroup.

Specified by:
deleteAutoScalingGroup in interface AmazonAutoScaling
Parameters:
deleteAutoScalingGroupRequest - Container for the necessary parameters to execute the DeleteAutoScalingGroup service method on AmazonAutoScaling.
Throws:
ScalingActivityInProgressException
ResourceInUseException
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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

describeAutoScalingGroups

public DescribeAutoScalingGroupsResult describeAutoScalingGroups()
                                                          throws AmazonServiceException,
                                                                 AmazonClientException

Returns a full description of the AutoScalingGroup instances specified in the given list. This includes all Amazon EC2 instances that are members of the Auto Scaling group. If a list of names is not provided, then the full details of all AutoScalingGroups is returned.

Specified by:
describeAutoScalingGroups in interface AmazonAutoScaling
Returns:
The response from the DescribeAutoScalingGroups 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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.

describeLaunchConfigurations

public DescribeLaunchConfigurationsResult describeLaunchConfigurations()
                                                                throws AmazonServiceException,
                                                                       AmazonClientException

Returns a full description of the launch configurations given the specified names.

If no names are specified, then the full details of all launch configurations are returned.

Specified by:
describeLaunchConfigurations in interface AmazonAutoScaling
Returns:
The response from the DescribeLaunchConfigurations 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.
AmazonServiceException - If an error response is returned by AmazonAutoScaling indicating either a problem with the data in the request, or a server side issue.


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.