public class ScalingPolicy
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Describes a scaling policy.
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
adjustmentType
The adjustment type, which specifies how
ScalingAdjustment
is interpreted. |
private SdkInternalList<Alarm> |
alarms
The CloudWatch alarms related to the policy.
|
private java.lang.String |
autoScalingGroupName
The name of the Auto Scaling group associated with this scaling policy.
|
private java.lang.Integer |
cooldown
The amount of time, in seconds, after a scaling activity completes before
any further trigger-related scaling activities can start.
|
private java.lang.Integer |
estimatedInstanceWarmup
The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.
|
private java.lang.String |
metricAggregationType
The aggregation type for the CloudWatch metrics.
|
private java.lang.Integer |
minAdjustmentMagnitude
The minimum number of instances to scale.
|
private java.lang.Integer |
minAdjustmentStep
Available for backward compatibility.
|
private java.lang.String |
policyARN
The Amazon Resource Name (ARN) of the policy.
|
private java.lang.String |
policyName
The name of the scaling policy.
|
private java.lang.String |
policyType
The policy type.
|
private java.lang.Integer |
scalingAdjustment
The amount by which to scale, based on the specified adjustment type.
|
private SdkInternalList<StepAdjustment> |
stepAdjustments
A set of adjustments that enable you to scale based on the size of the
alarm breach.
|
Constructor and Description |
---|
ScalingPolicy() |
Modifier and Type | Method and Description |
---|---|
ScalingPolicy |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAdjustmentType()
The adjustment type, which specifies how
ScalingAdjustment
is interpreted. |
java.util.List<Alarm> |
getAlarms()
The CloudWatch alarms related to the policy.
|
java.lang.String |
getAutoScalingGroupName()
The name of the Auto Scaling group associated with this scaling policy.
|
java.lang.Integer |
getCooldown()
The amount of time, in seconds, after a scaling activity completes before
any further trigger-related scaling activities can start.
|
java.lang.Integer |
getEstimatedInstanceWarmup()
The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.
|
java.lang.String |
getMetricAggregationType()
The aggregation type for the CloudWatch metrics.
|
java.lang.Integer |
getMinAdjustmentMagnitude()
The minimum number of instances to scale.
|
java.lang.Integer |
getMinAdjustmentStep()
Available for backward compatibility.
|
java.lang.String |
getPolicyARN()
The Amazon Resource Name (ARN) of the policy.
|
java.lang.String |
getPolicyName()
The name of the scaling policy.
|
java.lang.String |
getPolicyType()
The policy type.
|
java.lang.Integer |
getScalingAdjustment()
The amount by which to scale, based on the specified adjustment type.
|
java.util.List<StepAdjustment> |
getStepAdjustments()
A set of adjustments that enable you to scale based on the size of the
alarm breach.
|
int |
hashCode() |
void |
setAdjustmentType(java.lang.String adjustmentType)
The adjustment type, which specifies how
ScalingAdjustment
is interpreted. |
void |
setAlarms(java.util.Collection<Alarm> alarms)
The CloudWatch alarms related to the policy.
|
void |
setAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group associated with this scaling policy.
|
void |
setCooldown(java.lang.Integer cooldown)
The amount of time, in seconds, after a scaling activity completes before
any further trigger-related scaling activities can start.
|
void |
setEstimatedInstanceWarmup(java.lang.Integer estimatedInstanceWarmup)
The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.
|
void |
setMetricAggregationType(java.lang.String metricAggregationType)
The aggregation type for the CloudWatch metrics.
|
void |
setMinAdjustmentMagnitude(java.lang.Integer minAdjustmentMagnitude)
The minimum number of instances to scale.
|
void |
setMinAdjustmentStep(java.lang.Integer minAdjustmentStep)
Available for backward compatibility.
|
void |
setPolicyARN(java.lang.String policyARN)
The Amazon Resource Name (ARN) of the policy.
|
void |
setPolicyName(java.lang.String policyName)
The name of the scaling policy.
|
void |
setPolicyType(java.lang.String policyType)
The policy type.
|
void |
setScalingAdjustment(java.lang.Integer scalingAdjustment)
The amount by which to scale, based on the specified adjustment type.
|
void |
setStepAdjustments(java.util.Collection<StepAdjustment> stepAdjustments)
A set of adjustments that enable you to scale based on the size of the
alarm breach.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
ScalingPolicy |
withAdjustmentType(java.lang.String adjustmentType)
The adjustment type, which specifies how
ScalingAdjustment
is interpreted. |
ScalingPolicy |
withAlarms(Alarm... alarms)
The CloudWatch alarms related to the policy.
|
ScalingPolicy |
withAlarms(java.util.Collection<Alarm> alarms)
The CloudWatch alarms related to the policy.
|
ScalingPolicy |
withAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group associated with this scaling policy.
|
ScalingPolicy |
withCooldown(java.lang.Integer cooldown)
The amount of time, in seconds, after a scaling activity completes before
any further trigger-related scaling activities can start.
|
ScalingPolicy |
withEstimatedInstanceWarmup(java.lang.Integer estimatedInstanceWarmup)
The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.
|
ScalingPolicy |
withMetricAggregationType(java.lang.String metricAggregationType)
The aggregation type for the CloudWatch metrics.
|
ScalingPolicy |
withMinAdjustmentMagnitude(java.lang.Integer minAdjustmentMagnitude)
The minimum number of instances to scale.
|
ScalingPolicy |
withMinAdjustmentStep(java.lang.Integer minAdjustmentStep)
Available for backward compatibility.
|
ScalingPolicy |
withPolicyARN(java.lang.String policyARN)
The Amazon Resource Name (ARN) of the policy.
|
ScalingPolicy |
withPolicyName(java.lang.String policyName)
The name of the scaling policy.
|
ScalingPolicy |
withPolicyType(java.lang.String policyType)
The policy type.
|
ScalingPolicy |
withScalingAdjustment(java.lang.Integer scalingAdjustment)
The amount by which to scale, based on the specified adjustment type.
|
ScalingPolicy |
withStepAdjustments(java.util.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.
|
private java.lang.String autoScalingGroupName
The name of the Auto Scaling group associated with this scaling policy.
private java.lang.String policyName
The name of the scaling policy.
private java.lang.String policyARN
The Amazon Resource Name (ARN) of the policy.
private java.lang.String policyType
The policy type. Valid values are SimpleScaling
and
StepScaling
.
private java.lang.String adjustmentType
The adjustment type, which specifies how ScalingAdjustment
is interpreted. Valid values are ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
private java.lang.Integer minAdjustmentStep
Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.
private java.lang.Integer 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
.
private java.lang.Integer 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.
private java.lang.Integer cooldown
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
private SdkInternalList<StepAdjustment> stepAdjustments
A set of adjustments that enable you to scale based on the size of the alarm breach.
private java.lang.String metricAggregationType
The aggregation type for the CloudWatch metrics. Valid values are
Minimum
, Maximum
, and Average
.
private java.lang.Integer estimatedInstanceWarmup
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.
private SdkInternalList<Alarm> alarms
The CloudWatch alarms related to the policy.
public void setAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group associated with this scaling policy.
autoScalingGroupName
- The name of the Auto Scaling group associated with this scaling
policy.public java.lang.String getAutoScalingGroupName()
The name of the Auto Scaling group associated with this scaling policy.
public ScalingPolicy withAutoScalingGroupName(java.lang.String autoScalingGroupName)
The name of the Auto Scaling group associated with this scaling policy.
autoScalingGroupName
- The name of the Auto Scaling group associated with this scaling
policy.public void setPolicyName(java.lang.String policyName)
The name of the scaling policy.
policyName
- The name of the scaling policy.public java.lang.String getPolicyName()
The name of the scaling policy.
public ScalingPolicy withPolicyName(java.lang.String policyName)
The name of the scaling policy.
policyName
- The name of the scaling policy.public void setPolicyARN(java.lang.String policyARN)
The Amazon Resource Name (ARN) of the policy.
policyARN
- The Amazon Resource Name (ARN) of the policy.public java.lang.String getPolicyARN()
The Amazon Resource Name (ARN) of the policy.
public ScalingPolicy withPolicyARN(java.lang.String policyARN)
The Amazon Resource Name (ARN) of the policy.
policyARN
- The Amazon Resource Name (ARN) of the policy.public void setPolicyType(java.lang.String policyType)
The policy type. Valid values are SimpleScaling
and
StepScaling
.
policyType
- The policy type. Valid values are SimpleScaling
and
StepScaling
.public java.lang.String getPolicyType()
The policy type. Valid values are SimpleScaling
and
StepScaling
.
SimpleScaling
and
StepScaling
.public ScalingPolicy withPolicyType(java.lang.String policyType)
The policy type. Valid values are SimpleScaling
and
StepScaling
.
policyType
- The policy type. Valid values are SimpleScaling
and
StepScaling
.public void setAdjustmentType(java.lang.String adjustmentType)
The adjustment type, which specifies how ScalingAdjustment
is interpreted. Valid values are ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
adjustmentType
- The adjustment type, which specifies how
ScalingAdjustment
is interpreted. Valid values are
ChangeInCapacity
, ExactCapacity
, and
PercentChangeInCapacity
.public java.lang.String getAdjustmentType()
The adjustment type, which specifies how ScalingAdjustment
is interpreted. Valid values are ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
ScalingAdjustment
is interpreted. Valid values are
ChangeInCapacity
, ExactCapacity
, and
PercentChangeInCapacity
.public ScalingPolicy withAdjustmentType(java.lang.String adjustmentType)
The adjustment type, which specifies how ScalingAdjustment
is interpreted. Valid values are ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
adjustmentType
- The adjustment type, which specifies how
ScalingAdjustment
is interpreted. Valid values are
ChangeInCapacity
, ExactCapacity
, and
PercentChangeInCapacity
.public void setMinAdjustmentStep(java.lang.Integer minAdjustmentStep)
Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.
minAdjustmentStep
- Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.public java.lang.Integer getMinAdjustmentStep()
Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.
MinAdjustmentMagnitude
instead.public ScalingPolicy withMinAdjustmentStep(java.lang.Integer minAdjustmentStep)
Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.
minAdjustmentStep
- Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.public void setMinAdjustmentMagnitude(java.lang.Integer 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
.
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 java.lang.Integer getMinAdjustmentMagnitude()
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
.
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(java.lang.Integer 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
.
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 void setScalingAdjustment(java.lang.Integer 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.
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 java.lang.Integer getScalingAdjustment()
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(java.lang.Integer 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.
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 void setCooldown(java.lang.Integer cooldown)
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
cooldown
- The amount of time, in seconds, after a scaling activity completes
before any further trigger-related scaling activities can start.public java.lang.Integer getCooldown()
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
public ScalingPolicy withCooldown(java.lang.Integer cooldown)
The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
cooldown
- The amount of time, in seconds, after a scaling activity completes
before any further trigger-related scaling activities can start.public java.util.List<StepAdjustment> getStepAdjustments()
A set of adjustments that enable you to scale based on the size of the alarm breach.
public void setStepAdjustments(java.util.Collection<StepAdjustment> stepAdjustments)
A set of adjustments that enable you to scale based on the size of the alarm breach.
stepAdjustments
- A set of adjustments that enable you to scale based on the size of
the alarm breach.public ScalingPolicy withStepAdjustments(StepAdjustment... stepAdjustments)
A set of adjustments that enable you to scale based on the size of the alarm breach.
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.
stepAdjustments
- A set of adjustments that enable you to scale based on the size of
the alarm breach.public ScalingPolicy withStepAdjustments(java.util.Collection<StepAdjustment> stepAdjustments)
A set of adjustments that enable you to scale based on the size of the alarm breach.
stepAdjustments
- A set of adjustments that enable you to scale based on the size of
the alarm breach.public void setMetricAggregationType(java.lang.String metricAggregationType)
The aggregation type for the CloudWatch metrics. Valid values are
Minimum
, Maximum
, and Average
.
metricAggregationType
- The aggregation type for the CloudWatch metrics. Valid values are
Minimum
, Maximum
, and
Average
.public java.lang.String getMetricAggregationType()
The aggregation type for the CloudWatch metrics. Valid values are
Minimum
, Maximum
, and Average
.
Minimum
, Maximum
, and
Average
.public ScalingPolicy withMetricAggregationType(java.lang.String metricAggregationType)
The aggregation type for the CloudWatch metrics. Valid values are
Minimum
, Maximum
, and Average
.
metricAggregationType
- The aggregation type for the CloudWatch metrics. Valid values are
Minimum
, Maximum
, and
Average
.public void setEstimatedInstanceWarmup(java.lang.Integer estimatedInstanceWarmup)
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.
estimatedInstanceWarmup
- The estimated time, in seconds, until a newly launched instance
can contribute to the CloudWatch metrics.public java.lang.Integer getEstimatedInstanceWarmup()
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.
public ScalingPolicy withEstimatedInstanceWarmup(java.lang.Integer estimatedInstanceWarmup)
The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics.
estimatedInstanceWarmup
- The estimated time, in seconds, until a newly launched instance
can contribute to the CloudWatch metrics.public java.util.List<Alarm> getAlarms()
The CloudWatch alarms related to the policy.
public void setAlarms(java.util.Collection<Alarm> alarms)
The CloudWatch alarms related to the policy.
alarms
- The CloudWatch alarms related to the policy.public ScalingPolicy withAlarms(Alarm... alarms)
The CloudWatch alarms related to the policy.
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.
alarms
- The CloudWatch alarms related to the policy.public ScalingPolicy withAlarms(java.util.Collection<Alarm> alarms)
The CloudWatch alarms related to the policy.
alarms
- The CloudWatch alarms related to the policy.public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public ScalingPolicy clone()
clone
in class java.lang.Object