
com.amazonaws.services.autoscaling.model.PutScalingPolicyRequest Maven / Gradle / Ivy
Show all versions of aws-android-sdk-autoscaling Show documentation
/*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
package com.amazonaws.services.autoscaling.model;
import java.io.Serializable;
import com.amazonaws.AmazonWebServiceRequest;
/**
* Container for the parameters to the {@link com.amazonaws.services.autoscaling.AmazonAutoScaling#putScalingPolicy(PutScalingPolicyRequest) 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 .
*
*
* @see com.amazonaws.services.autoscaling.AmazonAutoScaling#putScalingPolicy(PutScalingPolicyRequest)
*/
public class PutScalingPolicyRequest extends AmazonWebServiceRequest implements Serializable {
/**
* The name or ARN of the group.
*
* Constraints:
* Length: 1 - 1600
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*/
private String autoScalingGroupName;
/**
* The name of the policy.
*
* Constraints:
* Length: 1 - 255
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*/
private String policyName;
/**
* The policy type. Valid values are 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]*
*/
private String policyType;
/**
* The adjustment type. Valid values are 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]*
*/
private String adjustmentType;
/**
* Available for backward compatibility. Use
* MinAdjustmentMagnitude
instead.
*/
private Integer minAdjustmentStep;
/**
* 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 Integer minAdjustmentMagnitude;
/**
* 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.
*/
private Integer scalingAdjustment;
/**
* 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.
*/
private Integer cooldown;
/**
* 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
.
*
* Constraints:
* Length: 1 - 32
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*/
private String metricAggregationType;
/**
* 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.
*/
private com.amazonaws.internal.ListWithAutoConstructFlag stepAdjustments;
/**
* 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
.
*/
private Integer estimatedInstanceWarmup;
/**
* The name or ARN of the group.
*
* Constraints:
* Length: 1 - 1600
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @return The name or ARN of the group.
*/
public String getAutoScalingGroupName() {
return autoScalingGroupName;
}
/**
* The name or ARN of the group.
*
* Constraints:
* Length: 1 - 1600
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @param autoScalingGroupName The name or ARN of the group.
*/
public void setAutoScalingGroupName(String autoScalingGroupName) {
this.autoScalingGroupName = autoScalingGroupName;
}
/**
* The name or ARN of the group.
*
* 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]*
*
* @param autoScalingGroupName The name or ARN of the group.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withAutoScalingGroupName(String autoScalingGroupName) {
this.autoScalingGroupName = autoScalingGroupName;
return this;
}
/**
* The name of the policy.
*
* Constraints:
* Length: 1 - 255
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @return The name of the policy.
*/
public String getPolicyName() {
return policyName;
}
/**
* The name of the policy.
*
* Constraints:
* Length: 1 - 255
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @param policyName The name of the policy.
*/
public void setPolicyName(String policyName) {
this.policyName = policyName;
}
/**
* The name of the policy.
*
* 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]*
*
* @param policyName The name of the policy.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withPolicyName(String policyName) {
this.policyName = policyName;
return this;
}
/**
* The policy type. Valid values are 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]*
*
* @return The policy type. Valid values are SimpleScaling
and
* StepScaling
. If the policy type is null, the value is
* treated as SimpleScaling
.
*/
public String getPolicyType() {
return policyType;
}
/**
* The policy type. Valid values are 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]*
*
* @param policyType The policy type. Valid values are SimpleScaling
and
* StepScaling
. If the policy type is null, the value is
* treated as SimpleScaling
.
*/
public void setPolicyType(String policyType) {
this.policyType = policyType;
}
/**
* The policy type. Valid values are 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]*
*
* @param policyType The policy type. Valid values are SimpleScaling
and
* StepScaling
. If the policy type is null, the value is
* treated as SimpleScaling
.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withPolicyType(String policyType) {
this.policyType = policyType;
return this;
}
/**
* The adjustment type. Valid values are 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]*
*
* @return The adjustment type. Valid values are ChangeInCapacity
,
* ExactCapacity
, and PercentChangeInCapacity
.
*
For more information, see Dynamic
* Scaling in the Auto Scaling Developer Guide.
*/
public String getAdjustmentType() {
return adjustmentType;
}
/**
* The adjustment type. Valid values are 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]*
*
* @param adjustmentType The adjustment type. Valid values are ChangeInCapacity
,
* ExactCapacity
, and PercentChangeInCapacity
.
*
For more information, see Dynamic
* Scaling in the Auto Scaling Developer Guide.
*/
public void setAdjustmentType(String adjustmentType) {
this.adjustmentType = adjustmentType;
}
/**
* The adjustment type. Valid values are 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]*
*
* @param adjustmentType The adjustment type. Valid values are ChangeInCapacity
,
* ExactCapacity
, and PercentChangeInCapacity
.
*
For more information, see Dynamic
* Scaling in the Auto Scaling Developer Guide.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withAdjustmentType(String adjustmentType) {
this.adjustmentType = adjustmentType;
return this;
}
/**
* Available for backward compatibility. Use
* MinAdjustmentMagnitude
instead.
*
* @return Available for backward compatibility. Use
* MinAdjustmentMagnitude
instead.
*/
public Integer getMinAdjustmentStep() {
return minAdjustmentStep;
}
/**
* Available for backward compatibility. Use
* MinAdjustmentMagnitude
instead.
*
* @param minAdjustmentStep Available for backward compatibility. Use
* MinAdjustmentMagnitude
instead.
*/
public void setMinAdjustmentStep(Integer minAdjustmentStep) {
this.minAdjustmentStep = minAdjustmentStep;
}
/**
* Available for backward compatibility. Use
* MinAdjustmentMagnitude
instead.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param minAdjustmentStep Available for backward compatibility. Use
* MinAdjustmentMagnitude
instead.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withMinAdjustmentStep(Integer minAdjustmentStep) {
this.minAdjustmentStep = minAdjustmentStep;
return this;
}
/**
* 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
.
*
* @return 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 getMinAdjustmentMagnitude() {
return 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
.
*
* @param 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 setMinAdjustmentMagnitude(Integer minAdjustmentMagnitude) {
this.minAdjustmentMagnitude = 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
.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param 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
.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withMinAdjustmentMagnitude(Integer minAdjustmentMagnitude) {
this.minAdjustmentMagnitude = minAdjustmentMagnitude;
return this;
}
/**
* 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.
*
* @return 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 getScalingAdjustment() {
return 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.
*
* @param 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 void setScalingAdjustment(Integer scalingAdjustment) {
this.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.
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.
*
* @param 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.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withScalingAdjustment(Integer scalingAdjustment) {
this.scalingAdjustment = scalingAdjustment;
return this;
}
/**
* 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.
*
* @return 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 Integer getCooldown() {
return 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.
*
* @param 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 void setCooldown(Integer cooldown) {
this.cooldown = 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.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param 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.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withCooldown(Integer cooldown) {
this.cooldown = cooldown;
return this;
}
/**
* 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
.
*
* Constraints:
* Length: 1 - 32
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @return 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 String getMetricAggregationType() {
return 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
.
*
* Constraints:
* Length: 1 - 32
* Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*
*
* @param 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 void setMetricAggregationType(String metricAggregationType) {
this.metricAggregationType = 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
.
*
* 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]*
*
* @param 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
.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withMetricAggregationType(String metricAggregationType) {
this.metricAggregationType = metricAggregationType;
return this;
}
/**
* 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.
*
* @return 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 java.util.List getStepAdjustments() {
if (stepAdjustments == null) {
stepAdjustments = new com.amazonaws.internal.ListWithAutoConstructFlag();
stepAdjustments.setAutoConstruct(true);
}
return 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.
*
* @param 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 void setStepAdjustments(java.util.Collection stepAdjustments) {
if (stepAdjustments == null) {
this.stepAdjustments = null;
return;
}
com.amazonaws.internal.ListWithAutoConstructFlag stepAdjustmentsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(stepAdjustments.size());
stepAdjustmentsCopy.addAll(stepAdjustments);
this.stepAdjustments = stepAdjustmentsCopy;
}
/**
* 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.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param 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.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withStepAdjustments(StepAdjustment... stepAdjustments) {
if (getStepAdjustments() == null) setStepAdjustments(new java.util.ArrayList(stepAdjustments.length));
for (StepAdjustment value : stepAdjustments) {
getStepAdjustments().add(value);
}
return this;
}
/**
* 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.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param 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.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withStepAdjustments(java.util.Collection stepAdjustments) {
if (stepAdjustments == null) {
this.stepAdjustments = null;
} else {
com.amazonaws.internal.ListWithAutoConstructFlag stepAdjustmentsCopy = new com.amazonaws.internal.ListWithAutoConstructFlag(stepAdjustments.size());
stepAdjustmentsCopy.addAll(stepAdjustments);
this.stepAdjustments = stepAdjustmentsCopy;
}
return this;
}
/**
* 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
.
*
* @return 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 Integer getEstimatedInstanceWarmup() {
return 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
.
*
* @param 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 void setEstimatedInstanceWarmup(Integer estimatedInstanceWarmup) {
this.estimatedInstanceWarmup = 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
.
*
* Returns a reference to this object so that method calls can be chained together.
*
* @param 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
.
*
* @return A reference to this updated object so that method calls can be chained
* together.
*/
public PutScalingPolicyRequest withEstimatedInstanceWarmup(Integer estimatedInstanceWarmup) {
this.estimatedInstanceWarmup = estimatedInstanceWarmup;
return this;
}
/**
* Returns a string representation of this object; useful for testing and
* debugging.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAutoScalingGroupName() != null) sb.append("AutoScalingGroupName: " + getAutoScalingGroupName() + ",");
if (getPolicyName() != null) sb.append("PolicyName: " + getPolicyName() + ",");
if (getPolicyType() != null) sb.append("PolicyType: " + getPolicyType() + ",");
if (getAdjustmentType() != null) sb.append("AdjustmentType: " + getAdjustmentType() + ",");
if (getMinAdjustmentStep() != null) sb.append("MinAdjustmentStep: " + getMinAdjustmentStep() + ",");
if (getMinAdjustmentMagnitude() != null) sb.append("MinAdjustmentMagnitude: " + getMinAdjustmentMagnitude() + ",");
if (getScalingAdjustment() != null) sb.append("ScalingAdjustment: " + getScalingAdjustment() + ",");
if (getCooldown() != null) sb.append("Cooldown: " + getCooldown() + ",");
if (getMetricAggregationType() != null) sb.append("MetricAggregationType: " + getMetricAggregationType() + ",");
if (getStepAdjustments() != null) sb.append("StepAdjustments: " + getStepAdjustments() + ",");
if (getEstimatedInstanceWarmup() != null) sb.append("EstimatedInstanceWarmup: " + getEstimatedInstanceWarmup() );
sb.append("}");
return sb.toString();
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAutoScalingGroupName() == null) ? 0 : getAutoScalingGroupName().hashCode());
hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode());
hashCode = prime * hashCode + ((getPolicyType() == null) ? 0 : getPolicyType().hashCode());
hashCode = prime * hashCode + ((getAdjustmentType() == null) ? 0 : getAdjustmentType().hashCode());
hashCode = prime * hashCode + ((getMinAdjustmentStep() == null) ? 0 : getMinAdjustmentStep().hashCode());
hashCode = prime * hashCode + ((getMinAdjustmentMagnitude() == null) ? 0 : getMinAdjustmentMagnitude().hashCode());
hashCode = prime * hashCode + ((getScalingAdjustment() == null) ? 0 : getScalingAdjustment().hashCode());
hashCode = prime * hashCode + ((getCooldown() == null) ? 0 : getCooldown().hashCode());
hashCode = prime * hashCode + ((getMetricAggregationType() == null) ? 0 : getMetricAggregationType().hashCode());
hashCode = prime * hashCode + ((getStepAdjustments() == null) ? 0 : getStepAdjustments().hashCode());
hashCode = prime * hashCode + ((getEstimatedInstanceWarmup() == null) ? 0 : getEstimatedInstanceWarmup().hashCode());
return hashCode;
}
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null) return false;
if (obj instanceof PutScalingPolicyRequest == false) return false;
PutScalingPolicyRequest other = (PutScalingPolicyRequest)obj;
if (other.getAutoScalingGroupName() == null ^ this.getAutoScalingGroupName() == null) return false;
if (other.getAutoScalingGroupName() != null && other.getAutoScalingGroupName().equals(this.getAutoScalingGroupName()) == false) return false;
if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false;
if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false;
if (other.getPolicyType() == null ^ this.getPolicyType() == null) return false;
if (other.getPolicyType() != null && other.getPolicyType().equals(this.getPolicyType()) == false) return false;
if (other.getAdjustmentType() == null ^ this.getAdjustmentType() == null) return false;
if (other.getAdjustmentType() != null && other.getAdjustmentType().equals(this.getAdjustmentType()) == false) return false;
if (other.getMinAdjustmentStep() == null ^ this.getMinAdjustmentStep() == null) return false;
if (other.getMinAdjustmentStep() != null && other.getMinAdjustmentStep().equals(this.getMinAdjustmentStep()) == false) return false;
if (other.getMinAdjustmentMagnitude() == null ^ this.getMinAdjustmentMagnitude() == null) return false;
if (other.getMinAdjustmentMagnitude() != null && other.getMinAdjustmentMagnitude().equals(this.getMinAdjustmentMagnitude()) == false) return false;
if (other.getScalingAdjustment() == null ^ this.getScalingAdjustment() == null) return false;
if (other.getScalingAdjustment() != null && other.getScalingAdjustment().equals(this.getScalingAdjustment()) == false) return false;
if (other.getCooldown() == null ^ this.getCooldown() == null) return false;
if (other.getCooldown() != null && other.getCooldown().equals(this.getCooldown()) == false) return false;
if (other.getMetricAggregationType() == null ^ this.getMetricAggregationType() == null) return false;
if (other.getMetricAggregationType() != null && other.getMetricAggregationType().equals(this.getMetricAggregationType()) == false) return false;
if (other.getStepAdjustments() == null ^ this.getStepAdjustments() == null) return false;
if (other.getStepAdjustments() != null && other.getStepAdjustments().equals(this.getStepAdjustments()) == false) return false;
if (other.getEstimatedInstanceWarmup() == null ^ this.getEstimatedInstanceWarmup() == null) return false;
if (other.getEstimatedInstanceWarmup() != null && other.getEstimatedInstanceWarmup().equals(this.getEstimatedInstanceWarmup()) == false) return false;
return true;
}
}