public class PutScalingPolicyRequest extends AmazonWebServiceRequest implements Serializable, Cloneable
PutScalingPolicy operation
.
Creates or updates a policy for an Auto Scaling group. To update an existing policy, use the existing policy name and set the parameters you want to change. Any existing parameter not changed in an update to an existing policy is not changed in this update request.
If you exceed your maximum limit of step adjustments, which by default is 20 per region, the call fails. For information about updating this limit, see AWS Service Limits in the Amazon Web Services General Reference .
NOOP
Constructor and Description |
---|
PutScalingPolicyRequest() |
Modifier and Type | Method and Description |
---|---|
PutScalingPolicyRequest |
clone()
Creates a shallow clone of this request.
|
boolean |
equals(Object obj) |
String |
getAdjustmentType()
The adjustment type.
|
String |
getAutoScalingGroupName()
The name or ARN of the group.
|
Integer |
getCooldown()
The amount of time, in seconds, after a scaling activity completes and
before the next scaling activity 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 |
getPolicyName()
The name of the 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.
|
void |
setAutoScalingGroupName(String autoScalingGroupName)
The name or ARN of the group.
|
void |
setCooldown(Integer cooldown)
The amount of time, in seconds, after a scaling activity completes and
before the next scaling activity 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 |
setPolicyName(String policyName)
The name of the 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.
|
PutScalingPolicyRequest |
withAdjustmentType(String adjustmentType)
The adjustment type.
|
PutScalingPolicyRequest |
withAutoScalingGroupName(String autoScalingGroupName)
The name or ARN of the group.
|
PutScalingPolicyRequest |
withCooldown(Integer cooldown)
The amount of time, in seconds, after a scaling activity completes and
before the next scaling activity can start.
|
PutScalingPolicyRequest |
withEstimatedInstanceWarmup(Integer estimatedInstanceWarmup)
The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics.
|
PutScalingPolicyRequest |
withMetricAggregationType(String metricAggregationType)
The aggregation type for the CloudWatch metrics.
|
PutScalingPolicyRequest |
withMinAdjustmentMagnitude(Integer minAdjustmentMagnitude)
The minimum number of instances to scale.
|
PutScalingPolicyRequest |
withMinAdjustmentStep(Integer minAdjustmentStep)
Available for backward compatibility.
|
PutScalingPolicyRequest |
withPolicyName(String policyName)
The name of the policy.
|
PutScalingPolicyRequest |
withPolicyType(String policyType)
The policy type.
|
PutScalingPolicyRequest |
withScalingAdjustment(Integer scalingAdjustment)
The amount by which to scale, based on the specified adjustment type.
|
PutScalingPolicyRequest |
withStepAdjustments(Collection<StepAdjustment> stepAdjustments)
A set of adjustments that enable you to scale based on the size of the
alarm breach.
|
PutScalingPolicyRequest |
withStepAdjustments(StepAdjustment... stepAdjustments)
A set of adjustments that enable you to scale based on the size of the
alarm breach.
|
copyBaseTo, getCustomQueryParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, putCustomQueryParameter, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public String getAutoScalingGroupName()
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
public void setAutoScalingGroupName(String autoScalingGroupName)
Constraints:
Length: 1 - 1600
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
autoScalingGroupName
- The name or ARN of the group.public PutScalingPolicyRequest withAutoScalingGroupName(String autoScalingGroupName)
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]*
autoScalingGroupName
- The name or ARN of the group.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 policy.public PutScalingPolicyRequest 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 policy.public String getPolicyType()
SimpleScaling
and
StepScaling
. If the policy type is null, the value is
treated as SimpleScaling
.
Constraints:
Length: 1 - 64
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
SimpleScaling
and
StepScaling
. If the policy type is null, the value is
treated as SimpleScaling
.public void setPolicyType(String policyType)
SimpleScaling
and
StepScaling
. If the policy type is null, the value is
treated as SimpleScaling
.
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
. If the policy type is null, the value is
treated as SimpleScaling
.public PutScalingPolicyRequest withPolicyType(String policyType)
SimpleScaling
and
StepScaling
. If the policy type is null, the value is
treated as SimpleScaling
.
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
. If the policy type is null, the value is
treated as SimpleScaling
.public String getAdjustmentType()
ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.
public void setAdjustmentType(String adjustmentType)
ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.
Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
adjustmentType
- The adjustment type. Valid values are ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.
public PutScalingPolicyRequest withAdjustmentType(String adjustmentType)
ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.
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. Valid values are ChangeInCapacity
,
ExactCapacity
, and PercentChangeInCapacity
.
For more information, see Dynamic Scaling in the Auto Scaling Developer Guide.
public Integer getMinAdjustmentStep()
MinAdjustmentMagnitude
instead.MinAdjustmentMagnitude
instead.public void setMinAdjustmentStep(Integer minAdjustmentStep)
MinAdjustmentMagnitude
instead.minAdjustmentStep
- Available for backward compatibility. Use
MinAdjustmentMagnitude
instead.public PutScalingPolicyRequest 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 PutScalingPolicyRequest 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()
This parameter is required if
the policy type is SimpleScaling
and not supported
otherwise.
This parameter is required if
the policy type is SimpleScaling
and not supported
otherwise.
public void setScalingAdjustment(Integer scalingAdjustment)
This parameter is required if
the policy type is SimpleScaling
and not supported
otherwise.
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. This parameter is required if
the policy type is SimpleScaling
and not supported
otherwise.
public PutScalingPolicyRequest withScalingAdjustment(Integer scalingAdjustment)
This parameter is required if
the policy type is SimpleScaling
and not supported
otherwise.
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. This parameter is required if
the policy type is SimpleScaling
and not supported
otherwise.
public Integer getCooldown()
This
parameter is not supported unless the policy type is
SimpleScaling
.
For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.
This
parameter is not supported unless the policy type is
SimpleScaling
.
For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.
public void setCooldown(Integer cooldown)
This
parameter is not supported unless the policy type is
SimpleScaling
.
For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.
cooldown
- The amount of time, in seconds, after a scaling activity completes and
before the next scaling activity can start. If this parameter is not
specified, the default cooldown period for the group applies. This
parameter is not supported unless the policy type is
SimpleScaling
.
For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.
public PutScalingPolicyRequest withCooldown(Integer cooldown)
This
parameter is not supported unless the policy type is
SimpleScaling
.
For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.
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 and
before the next scaling activity can start. If this parameter is not
specified, the default cooldown period for the group applies. This
parameter is not supported unless the policy type is
SimpleScaling
.
For more information, see Understanding Auto Scaling Cooldowns in the Auto Scaling Developer Guide.
public String getMetricAggregationType()
Minimum
, Maximum
, and Average
.
If the aggregation type is null, the value is treated as
Average
. This parameter is not supported if the policy
type is SimpleScaling
.
Constraints:
Length: 1 - 32
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
Minimum
, Maximum
, and Average
.
If the aggregation type is null, the value is treated as
Average
. This parameter is not supported if the policy
type is SimpleScaling
.
public void setMetricAggregationType(String metricAggregationType)
Minimum
, Maximum
, and Average
.
If the aggregation type is null, the value is treated as
Average
. This parameter is not supported if the policy
type is SimpleScaling
.
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
.
If the aggregation type is null, the value is treated as
Average
. This parameter is not supported if the policy
type is SimpleScaling
.
public PutScalingPolicyRequest withMetricAggregationType(String metricAggregationType)
Minimum
, Maximum
, and Average
.
If the aggregation type is null, the value is treated as
Average
. This parameter is not supported if the policy
type is SimpleScaling
.
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
.
If the aggregation type is null, the value is treated as
Average
. This parameter is not supported if the policy
type is SimpleScaling
.
public List<StepAdjustment> getStepAdjustments()
This parameter is required if the policy type is
StepScaling
and not supported otherwise.
This parameter is required if the policy type is
StepScaling
and not supported otherwise.
public void setStepAdjustments(Collection<StepAdjustment> stepAdjustments)
This parameter is required if the policy type is
StepScaling
and not supported otherwise.
stepAdjustments
- A set of adjustments that enable you to scale based on the size of the
alarm breach. This parameter is required if the policy type is
StepScaling
and not supported otherwise.
public PutScalingPolicyRequest withStepAdjustments(StepAdjustment... stepAdjustments)
This parameter is required if the policy type is
StepScaling
and not supported otherwise.
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. This parameter is required if the policy type is
StepScaling
and not supported otherwise.
public PutScalingPolicyRequest withStepAdjustments(Collection<StepAdjustment> stepAdjustments)
This parameter is required if the policy type is
StepScaling
and not supported otherwise.
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. This parameter is required if the policy type is
StepScaling
and not supported otherwise.
public Integer getEstimatedInstanceWarmup()
This
parameter is not supported if the policy type is
SimpleScaling
.
This
parameter is not supported if the policy type is
SimpleScaling
.
public void setEstimatedInstanceWarmup(Integer estimatedInstanceWarmup)
This
parameter is not supported if the policy type is
SimpleScaling
.
estimatedInstanceWarmup
- The estimated time, in seconds, until a newly launched instance can
contribute to the CloudWatch metrics. The default is to use the value
specified for the default cooldown period for the group. This
parameter is not supported if the policy type is
SimpleScaling
.
public PutScalingPolicyRequest withEstimatedInstanceWarmup(Integer estimatedInstanceWarmup)
This
parameter is not supported if the policy type is
SimpleScaling
.
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. The default is to use the value
specified for the default cooldown period for the group. This
parameter is not supported if the policy type is
SimpleScaling
.
public String toString()
toString
in class Object
Object.toString()
public PutScalingPolicyRequest clone()
AmazonWebServiceRequest
clone
in class AmazonWebServiceRequest
Object.clone()
Copyright © 2015. All rights reserved.