public class ScalingPolicy extends Object implements Serializable, Cloneable
Describes a scaling policy.
| Constructor and Description |
|---|
ScalingPolicy() |
| Modifier and Type | Method and Description |
|---|---|
ScalingPolicy |
clone() |
boolean |
equals(Object obj) |
String |
getAdjustmentType()
The adjustment type, which specifies how
ScalingAdjustment is interpreted. |
List<Alarm> |
getAlarms()
The CloudWatch alarms related to the policy.
|
String |
getAutoScalingGroupName()
The name of the Auto Scaling group associated with this scaling
policy.
|
Integer |
getCooldown()
The amount of time, in seconds, after a scaling activity completes
before any further trigger-related scaling activities can start.
|
Integer |
getEstimatedInstanceWarmup()
The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.
|
String |
getMetricAggregationType()
The aggregation type for the CloudWatch metrics.
|
Integer |
getMinAdjustmentMagnitude()
The minimum number of instances to scale.
|
Integer |
getMinAdjustmentStep()
Available for backward compatibility.
|
String |
getPolicyARN()
The Amazon Resource Name (ARN) of the policy.
|
String |
getPolicyName()
The name of the scaling policy.
|
String |
getPolicyType()
The policy type.
|
Integer |
getScalingAdjustment()
The amount by which to scale, based on the specified adjustment type.
|
List<StepAdjustment> |
getStepAdjustments()
A set of adjustments that enable you to scale based on the size of the
alarm breach.
|
int |
hashCode() |
void |
setAdjustmentType(String adjustmentType)
The adjustment type, which specifies how
ScalingAdjustment is interpreted. |
void |
setAlarms(Collection<Alarm> alarms)
The CloudWatch alarms related to the policy.
|
void |
setAutoScalingGroupName(String autoScalingGroupName)
The name of the Auto Scaling group associated with this scaling
policy.
|
void |
setCooldown(Integer cooldown)
The amount of time, in seconds, after a scaling activity completes
before any further trigger-related scaling activities can start.
|
void |
setEstimatedInstanceWarmup(Integer estimatedInstanceWarmup)
The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.
|
void |
setMetricAggregationType(String metricAggregationType)
The aggregation type for the CloudWatch metrics.
|
void |
setMinAdjustmentMagnitude(Integer minAdjustmentMagnitude)
The minimum number of instances to scale.
|
void |
setMinAdjustmentStep(Integer minAdjustmentStep)
Available for backward compatibility.
|
void |
setPolicyARN(String policyARN)
The Amazon Resource Name (ARN) of the policy.
|
void |
setPolicyName(String policyName)
The name of the scaling policy.
|
void |
setPolicyType(String policyType)
The policy type.
|
void |
setScalingAdjustment(Integer scalingAdjustment)
The amount by which to scale, based on the specified adjustment type.
|
void |
setStepAdjustments(Collection<StepAdjustment> stepAdjustments)
A set of adjustments that enable you to scale based on the size of the
alarm breach.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
ScalingPolicy |
withAdjustmentType(String adjustmentType)
The adjustment type, which specifies how
ScalingAdjustment is interpreted. |
ScalingPolicy |
withAlarms(Alarm... alarms)
The CloudWatch alarms related to the policy.
|
ScalingPolicy |
withAlarms(Collection<Alarm> alarms)
The CloudWatch alarms related to the policy.
|
ScalingPolicy |
withAutoScalingGroupName(String autoScalingGroupName)
The name of the Auto Scaling group associated with this scaling
policy.
|
ScalingPolicy |
withCooldown(Integer cooldown)
The amount of time, in seconds, after a scaling activity completes
before any further trigger-related scaling activities can start.
|
ScalingPolicy |
withEstimatedInstanceWarmup(Integer estimatedInstanceWarmup)
The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.
|
ScalingPolicy |
withMetricAggregationType(String metricAggregationType)
The aggregation type for the CloudWatch metrics.
|
ScalingPolicy |
withMinAdjustmentMagnitude(Integer minAdjustmentMagnitude)
The minimum number of instances to scale.
|
ScalingPolicy |
withMinAdjustmentStep(Integer minAdjustmentStep)
Available for backward compatibility.
|
ScalingPolicy |
withPolicyARN(String policyARN)
The Amazon Resource Name (ARN) of the policy.
|
ScalingPolicy |
withPolicyName(String policyName)
The name of the scaling policy.
|
ScalingPolicy |
withPolicyType(String policyType)
The policy type.
|
ScalingPolicy |
withScalingAdjustment(Integer scalingAdjustment)
The amount by which to scale, based on the specified adjustment type.
|
ScalingPolicy |
withStepAdjustments(Collection<StepAdjustment> stepAdjustments)
A set of adjustments that enable you to scale based on the size of the
alarm breach.
|
ScalingPolicy |
withStepAdjustments(StepAdjustment... stepAdjustments)
A set of adjustments that enable you to scale based on the size of the
alarm breach.
|
public String getAutoScalingGroupName()
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
public void setAutoScalingGroupName(String autoScalingGroupName)
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
autoScalingGroupName - The name of the Auto Scaling group associated with this scaling
policy.public ScalingPolicy withAutoScalingGroupName(String autoScalingGroupName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
autoScalingGroupName - The name of the Auto Scaling group associated with this scaling
policy.public String getPolicyName()
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
public void setPolicyName(String policyName)
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
policyName - The name of the scaling policy.public ScalingPolicy withPolicyName(String policyName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
policyName - The name of the scaling policy.public String getPolicyARN()
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
public void setPolicyARN(String policyARN)
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
policyARN - The Amazon Resource Name (ARN) of the policy.public ScalingPolicy withPolicyARN(String policyARN)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
policyARN - The Amazon Resource Name (ARN) of the policy.public String getPolicyType()
SimpleScaling and
StepScaling.
Constraints:
Length: 1 - 64
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
SimpleScaling and
StepScaling.public void setPolicyType(String policyType)
SimpleScaling and
StepScaling.
Constraints:
Length: 1 - 64
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
policyType - The policy type. Valid values are SimpleScaling and
StepScaling.public ScalingPolicy withPolicyType(String policyType)
SimpleScaling and
StepScaling.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 64
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
policyType - The policy type. Valid values are SimpleScaling and
StepScaling.public String getAdjustmentType()
ScalingAdjustment is interpreted. Valid values are
ChangeInCapacity, ExactCapacity, and
PercentChangeInCapacity.
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
ScalingAdjustment is interpreted. Valid values are
ChangeInCapacity, ExactCapacity, and
PercentChangeInCapacity.public void setAdjustmentType(String adjustmentType)
ScalingAdjustment is interpreted. Valid values are
ChangeInCapacity, ExactCapacity, and
PercentChangeInCapacity.
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
adjustmentType - The adjustment type, which specifies how
ScalingAdjustment is interpreted. Valid values are
ChangeInCapacity, ExactCapacity, and
PercentChangeInCapacity.public ScalingPolicy withAdjustmentType(String adjustmentType)
ScalingAdjustment is interpreted. Valid values are
ChangeInCapacity, ExactCapacity, and
PercentChangeInCapacity.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
adjustmentType - The adjustment type, which specifies how
ScalingAdjustment is interpreted. Valid values are
ChangeInCapacity, ExactCapacity, and
PercentChangeInCapacity.public Integer getMinAdjustmentStep()
MinAdjustmentMagnitude instead.MinAdjustmentMagnitude instead.public void setMinAdjustmentStep(Integer minAdjustmentStep)
MinAdjustmentMagnitude instead.minAdjustmentStep - Available for backward compatibility. Use
MinAdjustmentMagnitude instead.public ScalingPolicy withMinAdjustmentStep(Integer minAdjustmentStep)
MinAdjustmentMagnitude instead.
Returns a reference to this object so that method calls can be chained together.
minAdjustmentStep - Available for backward compatibility. Use
MinAdjustmentMagnitude instead.public Integer getMinAdjustmentMagnitude()
AdjustmentType is PercentChangeInCapacity,
the scaling policy changes the DesiredCapacity of the
Auto Scaling group by at least this many instances. Otherwise, the
error is ValidationError.AdjustmentType is PercentChangeInCapacity,
the scaling policy changes the DesiredCapacity of the
Auto Scaling group by at least this many instances. Otherwise, the
error is ValidationError.public void setMinAdjustmentMagnitude(Integer minAdjustmentMagnitude)
AdjustmentType is PercentChangeInCapacity,
the scaling policy changes the DesiredCapacity of the
Auto Scaling group by at least this many instances. Otherwise, the
error is ValidationError.minAdjustmentMagnitude - The minimum number of instances to scale. If the value of
AdjustmentType is PercentChangeInCapacity,
the scaling policy changes the DesiredCapacity of the
Auto Scaling group by at least this many instances. Otherwise, the
error is ValidationError.public ScalingPolicy withMinAdjustmentMagnitude(Integer minAdjustmentMagnitude)
AdjustmentType is PercentChangeInCapacity,
the scaling policy changes the DesiredCapacity of the
Auto Scaling group by at least this many instances. Otherwise, the
error is ValidationError.
Returns a reference to this object so that method calls can be chained together.
minAdjustmentMagnitude - The minimum number of instances to scale. If the value of
AdjustmentType is PercentChangeInCapacity,
the scaling policy changes the DesiredCapacity of the
Auto Scaling group by at least this many instances. Otherwise, the
error is ValidationError.public Integer getScalingAdjustment()
public void setScalingAdjustment(Integer scalingAdjustment)
scalingAdjustment - The amount by which to scale, based on the specified adjustment type.
A positive value adds to the current capacity while a negative number
removes from the current capacity.public ScalingPolicy withScalingAdjustment(Integer scalingAdjustment)
Returns a reference to this object so that method calls can be chained together.
scalingAdjustment - The amount by which to scale, based on the specified adjustment type.
A positive value adds to the current capacity while a negative number
removes from the current capacity.public Integer getCooldown()
public void setCooldown(Integer cooldown)
cooldown - The amount of time, in seconds, after a scaling activity completes
before any further trigger-related scaling activities can start.public ScalingPolicy withCooldown(Integer cooldown)
Returns a reference to this object so that method calls can be chained together.
cooldown - The amount of time, in seconds, after a scaling activity completes
before any further trigger-related scaling activities can start.public List<StepAdjustment> getStepAdjustments()
public void setStepAdjustments(Collection<StepAdjustment> stepAdjustments)
stepAdjustments - A set of adjustments that enable you to scale based on the size of the
alarm breach.public ScalingPolicy withStepAdjustments(StepAdjustment... stepAdjustments)
NOTE: This method appends the values to the existing list (if
any). Use setStepAdjustments(java.util.Collection) or withStepAdjustments(java.util.Collection) if you want to override
the existing values.
Returns a reference to this object so that method calls can be chained together.
stepAdjustments - A set of adjustments that enable you to scale based on the size of the
alarm breach.public ScalingPolicy withStepAdjustments(Collection<StepAdjustment> stepAdjustments)
Returns a reference to this object so that method calls can be chained together.
stepAdjustments - A set of adjustments that enable you to scale based on the size of the
alarm breach.public String getMetricAggregationType()
Minimum, Maximum, and Average.
Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
Minimum, Maximum, and Average.public void setMetricAggregationType(String metricAggregationType)
Minimum, Maximum, and Average.
Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
metricAggregationType - The aggregation type for the CloudWatch metrics. Valid values are
Minimum, Maximum, and Average.public ScalingPolicy withMetricAggregationType(String metricAggregationType)
Minimum, Maximum, and Average.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
metricAggregationType - The aggregation type for the CloudWatch metrics. Valid values are
Minimum, Maximum, and Average.public Integer getEstimatedInstanceWarmup()
public void setEstimatedInstanceWarmup(Integer estimatedInstanceWarmup)
estimatedInstanceWarmup - The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.public ScalingPolicy withEstimatedInstanceWarmup(Integer estimatedInstanceWarmup)
Returns a reference to this object so that method calls can be chained together.
estimatedInstanceWarmup - The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.public List<Alarm> getAlarms()
public void setAlarms(Collection<Alarm> alarms)
alarms - The CloudWatch alarms related to the policy.public ScalingPolicy withAlarms(Alarm... alarms)
NOTE: This method appends the values to the existing list (if
any). Use setAlarms(java.util.Collection) or withAlarms(java.util.Collection) if you want to override the
existing values.
Returns a reference to this object so that method calls can be chained together.
alarms - The CloudWatch alarms related to the policy.public ScalingPolicy withAlarms(Collection<Alarm> alarms)
Returns a reference to this object so that method calls can be chained together.
alarms - The CloudWatch alarms related to the policy.public String toString()
toString in class ObjectObject.toString()public ScalingPolicy clone()
Copyright © 2015. All rights reserved.