com.amazonaws.services.autoscaling.model
Class SetDesiredCapacityRequest

java.lang.Object
  extended by com.amazonaws.AmazonWebServiceRequest
      extended by com.amazonaws.services.autoscaling.model.SetDesiredCapacityRequest

public class SetDesiredCapacityRequest
extends AmazonWebServiceRequest

Container for the parameters to the SetDesiredCapacity operation.

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 Amazon EC2 instances will be terminated. This applies to any Auto Scaling decisions that might result in terminating instances.

There are two common use cases for SetDesiredCapacity : one for users of the Auto Scaling triggering system, and another for developers who write their own triggering systems. Both use cases relate to the concept of cooldown.

In the first case, if you use the Auto Scaling triggering system, SetDesiredCapacity changes the size of your Auto Scaling group without regard to the cooldown period. This could be useful, for example, if Auto Scaling did something unexpected for some reason. If your cooldown period is 10 minutes, Auto Scaling would normally reject requests to change the size of the group for that entire 10-minute period. The SetDesiredCapacity command allows you to circumvent this restriction and change the size of the group before the end of the cooldown period.

In the second case, if you write your own triggering system, you can use SetDesiredCapacity to control the size of your Auto Scaling group. If you want the same cooldown functionality that Auto Scaling offers, you can configure SetDesiredCapacity to honor cooldown by setting the HonorCooldown parameter to true .

See Also:
AmazonAutoScaling.setDesiredCapacity(SetDesiredCapacityRequest)

Constructor Summary
SetDesiredCapacityRequest()
           
 
Method Summary
 boolean equals(Object obj)
           
 String getAutoScalingGroupName()
          The name of the Auto Scaling group.
 Integer getDesiredCapacity()
          The new capacity setting for the Auto Scaling group.
 Boolean getHonorCooldown()
          By default, SetDesiredCapacity overrides any cooldown period.
 int hashCode()
           
 Boolean isHonorCooldown()
          By default, SetDesiredCapacity overrides any cooldown period.
 void setAutoScalingGroupName(String autoScalingGroupName)
          The name of the Auto Scaling group.
 void setDesiredCapacity(Integer desiredCapacity)
          The new capacity setting for the Auto Scaling group.
 void setHonorCooldown(Boolean honorCooldown)
          By default, SetDesiredCapacity overrides any cooldown period.
 String toString()
          Returns a string representation of this object; useful for testing and debugging.
 SetDesiredCapacityRequest withAutoScalingGroupName(String autoScalingGroupName)
          The name of the Auto Scaling group.
 SetDesiredCapacityRequest withDesiredCapacity(Integer desiredCapacity)
          The new capacity setting for the Auto Scaling group.
 SetDesiredCapacityRequest withHonorCooldown(Boolean honorCooldown)
          By default, SetDesiredCapacity overrides any cooldown period.
 
Methods inherited from class com.amazonaws.AmazonWebServiceRequest
copyPrivateRequestParameters, getDelegationToken, getRequestClientOptions, getRequestCredentials, setDelegationToken, setRequestCredentials
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SetDesiredCapacityRequest

public SetDesiredCapacityRequest()
Method Detail

getAutoScalingGroupName

public String getAutoScalingGroupName()
The name of the Auto Scaling group.

Constraints:
Length: 1 - 1600
Pattern: [ -퟿-�𐀀-􏿿\r\n\t]*

Returns:
The name of the Auto Scaling group.

setAutoScalingGroupName

public void setAutoScalingGroupName(String autoScalingGroupName)
The name of the Auto Scaling group.

Constraints:
Length: 1 - 1600
Pattern: [ -퟿-�𐀀-􏿿\r\n\t]*

Parameters:
autoScalingGroupName - The name of the Auto Scaling group.

withAutoScalingGroupName

public SetDesiredCapacityRequest withAutoScalingGroupName(String autoScalingGroupName)
The name of the Auto Scaling group.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 1600
Pattern: [ -퟿-�𐀀-􏿿\r\n\t]*

Parameters:
autoScalingGroupName - The name of the Auto Scaling group.
Returns:
A reference to this updated object so that method calls can be chained together.

getDesiredCapacity

public Integer getDesiredCapacity()
The new capacity setting for the Auto Scaling group.

Returns:
The new capacity setting for the Auto Scaling group.

setDesiredCapacity

public void setDesiredCapacity(Integer desiredCapacity)
The new capacity setting for the Auto Scaling group.

Parameters:
desiredCapacity - The new capacity setting for the Auto Scaling group.

withDesiredCapacity

public SetDesiredCapacityRequest withDesiredCapacity(Integer desiredCapacity)
The new capacity setting for the Auto Scaling group.

Returns a reference to this object so that method calls can be chained together.

Parameters:
desiredCapacity - The new capacity setting for the Auto Scaling group.
Returns:
A reference to this updated object so that method calls can be chained together.

isHonorCooldown

public Boolean isHonorCooldown()
By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.

Returns:
By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.

setHonorCooldown

public void setHonorCooldown(Boolean honorCooldown)
By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.

Parameters:
honorCooldown - By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.

withHonorCooldown

public SetDesiredCapacityRequest withHonorCooldown(Boolean honorCooldown)
By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.

Returns a reference to this object so that method calls can be chained together.

Parameters:
honorCooldown - By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.
Returns:
A reference to this updated object so that method calls can be chained together.

getHonorCooldown

public Boolean getHonorCooldown()
By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.

Returns:
By default, SetDesiredCapacity overrides any cooldown period. Set to True if you want Auto Scaling to reject this request when the Auto Scaling group is in cooldown.

toString

public String toString()
Returns a string representation of this object; useful for testing and debugging.

Overrides:
toString in class Object
Returns:
A string representation of this object.
See Also:
Object.toString()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


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