/* * Copyright 2018-2023 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 javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class PutScalingPolicyRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** *
* The name of the Auto Scaling group. *
*/ private String autoScalingGroupName; /** ** The name of the policy. *
*/ private String policyName; /** ** One of the following policy types: *
*
* TargetTrackingScaling
*
* StepScaling
*
* SimpleScaling
(default)
*
* PredictiveScaling
*
* Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid
* values are ChangeInCapacity
, ExactCapacity
, and PercentChangeInCapacity
.
*
* Required if the policy type is StepScaling
or SimpleScaling
. For more information, see
*
* Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
* Available for backward compatibility. Use MinAdjustmentMagnitude
instead.
*
* The minimum value to scale by when the adjustment type is PercentChangeInCapacity
. For example,
* suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a
* MinAdjustmentMagnitude
of 2. If the group has 4 instances and the scaling policy is performed, 25
* percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude
of 2, Amazon EC2 Auto
* Scaling scales out the group by 2 instances.
*
* Valid only if the policy type is StepScaling
or SimpleScaling
. For more information,
* see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
* Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude
to a
* value that is at least as large as your largest instance weight.
*
* 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. For exact capacity, you must specify a * non-negative value. *
*
* Required if the policy type is SimpleScaling
. (Not used with any other policy type.)
*
* A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is * specified here, it overrides the default cooldown. *
*
* Valid only if the policy type is SimpleScaling
. For more information, see Scaling cooldowns for Amazon EC2 Auto
* Scaling in the Amazon EC2 Auto Scaling User Guide.
*
* Default: None *
*/ private Integer cooldown; /** *
* The aggregation type for the CloudWatch metrics. The valid values are Minimum
, Maximum
,
* and Average
. If the aggregation type is null, the value is treated as Average
.
*
* Valid only if the policy type is StepScaling
.
*
* A set of adjustments that enable you to scale based on the size of the alarm breach. *
*
* Required if the policy type is StepScaling
. (Not used with any other policy type.)
*
* Not needed if the default instance warmup is defined for the group. *
** The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This * warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a * warm-up period is specified here, it overrides the default instance warmup. *
*
* Valid only if the policy type is TargetTrackingScaling
or StepScaling
.
*
* The default is to use the value for the default instance warmup defined for the group. If default instance warmup
* is null, then EstimatedInstanceWarmup
falls back to the value of default cooldown.
*
* A target tracking scaling policy. Provides support for predefined or custom metrics. *
** The following predefined metrics are available: *
*
* ASGAverageCPUUtilization
*
* ASGAverageNetworkIn
*
* ASGAverageNetworkOut
*
* ALBRequestCountPerTarget
*
* If you specify ALBRequestCountPerTarget
for the metric, you must specify the
* ResourceLabel
property with the PredefinedMetricSpecification
.
*
* For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is TargetTrackingScaling
.
*
* Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see Disabling a * scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
*/ private Boolean enabled; /** ** A predictive scaling policy. Provides support for predefined and custom metrics. *
** Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count. *
** For more information, see PredictiveScalingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is PredictiveScaling
.
*
* The name of the Auto Scaling group. *
* * @param autoScalingGroupName * The name of the Auto Scaling group. */ public void setAutoScalingGroupName(String autoScalingGroupName) { this.autoScalingGroupName = autoScalingGroupName; } /** ** The name of the Auto Scaling group. *
* * @return The name of the Auto Scaling group. */ public String getAutoScalingGroupName() { return this.autoScalingGroupName; } /** ** The name of the Auto Scaling group. *
* * @param autoScalingGroupName * The name of the Auto Scaling group. * @return Returns a reference to this object so that method calls can be chained together. */ public PutScalingPolicyRequest withAutoScalingGroupName(String autoScalingGroupName) { setAutoScalingGroupName(autoScalingGroupName); return this; } /** ** The name of the policy. *
* * @param policyName * The name of the policy. */ public void setPolicyName(String policyName) { this.policyName = policyName; } /** ** The name of the policy. *
* * @return The name of the policy. */ public String getPolicyName() { return this.policyName; } /** ** The name of the policy. *
* * @param policyName * The name of the policy. * @return Returns a reference to this object so that method calls can be chained together. */ public PutScalingPolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; } /** ** One of the following policy types: *
*
* TargetTrackingScaling
*
* StepScaling
*
* SimpleScaling
(default)
*
* PredictiveScaling
*
* TargetTrackingScaling
*
* StepScaling
*
* SimpleScaling
(default)
*
* PredictiveScaling
*
* One of the following policy types: *
*
* TargetTrackingScaling
*
* StepScaling
*
* SimpleScaling
(default)
*
* PredictiveScaling
*
* TargetTrackingScaling
*
* StepScaling
*
* SimpleScaling
(default)
*
* PredictiveScaling
*
* One of the following policy types: *
*
* TargetTrackingScaling
*
* StepScaling
*
* SimpleScaling
(default)
*
* PredictiveScaling
*
* TargetTrackingScaling
*
* StepScaling
*
* SimpleScaling
(default)
*
* PredictiveScaling
*
* Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid
* values are ChangeInCapacity
, ExactCapacity
, and PercentChangeInCapacity
.
*
* Required if the policy type is StepScaling
or SimpleScaling
. For more information, see
*
* Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
ChangeInCapacity
, ExactCapacity
, and
* PercentChangeInCapacity
.
*
* Required if the policy type is StepScaling
or SimpleScaling
. For more
* information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*/
public void setAdjustmentType(String adjustmentType) {
this.adjustmentType = adjustmentType;
}
/**
*
* Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid
* values are ChangeInCapacity
, ExactCapacity
, and PercentChangeInCapacity
.
*
* Required if the policy type is StepScaling
or SimpleScaling
. For more information, see
*
* Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
ChangeInCapacity
, ExactCapacity
, and
* PercentChangeInCapacity
.
*
* Required if the policy type is StepScaling
or SimpleScaling
. For more
* information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*/
public String getAdjustmentType() {
return this.adjustmentType;
}
/**
*
* Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid
* values are ChangeInCapacity
, ExactCapacity
, and PercentChangeInCapacity
.
*
* Required if the policy type is StepScaling
or SimpleScaling
. For more information, see
*
* Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
ChangeInCapacity
, ExactCapacity
, and
* PercentChangeInCapacity
.
*
* Required if the policy type is StepScaling
or SimpleScaling
. For more
* information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutScalingPolicyRequest withAdjustmentType(String adjustmentType) {
setAdjustmentType(adjustmentType);
return this;
}
/**
*
* Available for backward compatibility. Use MinAdjustmentMagnitude
instead.
*
MinAdjustmentMagnitude
instead.
*/
public void setMinAdjustmentStep(Integer minAdjustmentStep) {
this.minAdjustmentStep = minAdjustmentStep;
}
/**
*
* Available for backward compatibility. Use MinAdjustmentMagnitude
instead.
*
MinAdjustmentMagnitude
instead.
*/
public Integer getMinAdjustmentStep() {
return this.minAdjustmentStep;
}
/**
*
* Available for backward compatibility. Use MinAdjustmentMagnitude
instead.
*
MinAdjustmentMagnitude
instead.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutScalingPolicyRequest withMinAdjustmentStep(Integer minAdjustmentStep) {
setMinAdjustmentStep(minAdjustmentStep);
return this;
}
/**
*
* The minimum value to scale by when the adjustment type is PercentChangeInCapacity
. For example,
* suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a
* MinAdjustmentMagnitude
of 2. If the group has 4 instances and the scaling policy is performed, 25
* percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude
of 2, Amazon EC2 Auto
* Scaling scales out the group by 2 instances.
*
* Valid only if the policy type is StepScaling
or SimpleScaling
. For more information,
* see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
* Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude
to a
* value that is at least as large as your largest instance weight.
*
PercentChangeInCapacity
. For
* example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent
* and you specify a MinAdjustmentMagnitude
of 2. If the group has 4 instances and the scaling
* policy is performed, 25 percent of 4 is 1. However, because you specified a
* MinAdjustmentMagnitude
of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.
*
* Valid only if the policy type is StepScaling
or SimpleScaling
. For more
* information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
* Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude
* to a value that is at least as large as your largest instance weight.
*
* The minimum value to scale by when the adjustment type is PercentChangeInCapacity
. For example,
* suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a
* MinAdjustmentMagnitude
of 2. If the group has 4 instances and the scaling policy is performed, 25
* percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude
of 2, Amazon EC2 Auto
* Scaling scales out the group by 2 instances.
*
* Valid only if the policy type is StepScaling
or SimpleScaling
. For more information,
* see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
* Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude
to a
* value that is at least as large as your largest instance weight.
*
PercentChangeInCapacity
. For
* example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent
* and you specify a MinAdjustmentMagnitude
of 2. If the group has 4 instances and the scaling
* policy is performed, 25 percent of 4 is 1. However, because you specified a
* MinAdjustmentMagnitude
of 2, Amazon EC2 Auto Scaling scales out the group by 2
* instances.
*
* Valid only if the policy type is StepScaling
or SimpleScaling
. For more
* information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
* Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude
* to a value that is at least as large as your largest instance weight.
*
* The minimum value to scale by when the adjustment type is PercentChangeInCapacity
. For example,
* suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a
* MinAdjustmentMagnitude
of 2. If the group has 4 instances and the scaling policy is performed, 25
* percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude
of 2, Amazon EC2 Auto
* Scaling scales out the group by 2 instances.
*
* Valid only if the policy type is StepScaling
or SimpleScaling
. For more information,
* see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
* Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude
to a
* value that is at least as large as your largest instance weight.
*
PercentChangeInCapacity
. For
* example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent
* and you specify a MinAdjustmentMagnitude
of 2. If the group has 4 instances and the scaling
* policy is performed, 25 percent of 4 is 1. However, because you specified a
* MinAdjustmentMagnitude
of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances.
*
* Valid only if the policy type is StepScaling
or SimpleScaling
. For more
* information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide.
*
* Some Auto Scaling groups use instance weights. In this case, set the MinAdjustmentMagnitude
* to a value that is at least as large as your largest instance weight.
*
* 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. For exact capacity, you must specify a * non-negative value. *
*
* Required if the policy type is SimpleScaling
. (Not used with any other policy type.)
*
* Required if the policy type is SimpleScaling
. (Not used with any other policy type.)
*/
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. For exact capacity, you must specify a * non-negative value. *
*
* Required if the policy type is SimpleScaling
. (Not used with any other policy type.)
*
* Required if the policy type is SimpleScaling
. (Not used with any other policy type.)
*/
public Integer getScalingAdjustment() {
return this.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. For exact capacity, you must specify a * non-negative value. *
*
* Required if the policy type is SimpleScaling
. (Not used with any other policy type.)
*
* Required if the policy type is SimpleScaling
. (Not used with any other policy type.)
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutScalingPolicyRequest withScalingAdjustment(Integer scalingAdjustment) {
setScalingAdjustment(scalingAdjustment);
return this;
}
/**
*
* A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is * specified here, it overrides the default cooldown. *
*
* Valid only if the policy type is SimpleScaling
. For more information, see Scaling cooldowns for Amazon EC2 Auto
* Scaling in the Amazon EC2 Auto Scaling User Guide.
*
* Default: None *
* * @param cooldown * A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is * specified here, it overrides the default cooldown. *
* Valid only if the policy type is SimpleScaling
. For more information, see Scaling cooldowns for Amazon
* EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
*
* Default: None */ public void setCooldown(Integer cooldown) { this.cooldown = cooldown; } /** *
* A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is * specified here, it overrides the default cooldown. *
*
* Valid only if the policy type is SimpleScaling
. For more information, see Scaling cooldowns for Amazon EC2 Auto
* Scaling in the Amazon EC2 Auto Scaling User Guide.
*
* Default: None *
* * @return A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period * is specified here, it overrides the default cooldown. *
* Valid only if the policy type is SimpleScaling
. For more information, see Scaling cooldowns for Amazon
* EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
*
* Default: None */ public Integer getCooldown() { return this.cooldown; } /** *
* A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is * specified here, it overrides the default cooldown. *
*
* Valid only if the policy type is SimpleScaling
. For more information, see Scaling cooldowns for Amazon EC2 Auto
* Scaling in the Amazon EC2 Auto Scaling User Guide.
*
* Default: None *
* * @param cooldown * A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is * specified here, it overrides the default cooldown. *
* Valid only if the policy type is SimpleScaling
. For more information, see Scaling cooldowns for Amazon
* EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.
*
* Default: None * @return Returns a reference to this object so that method calls can be chained together. */ public PutScalingPolicyRequest withCooldown(Integer cooldown) { setCooldown(cooldown); return this; } /** *
* The aggregation type for the CloudWatch metrics. The valid values are Minimum
, Maximum
,
* and Average
. If the aggregation type is null, the value is treated as Average
.
*
* Valid only if the policy type is StepScaling
.
*
Minimum
,
* Maximum
, and Average
. If the aggregation type is null, the value is treated as
* Average
.
*
* Valid only if the policy type is StepScaling
.
*/
public void setMetricAggregationType(String metricAggregationType) {
this.metricAggregationType = metricAggregationType;
}
/**
*
* The aggregation type for the CloudWatch metrics. The valid values are Minimum
, Maximum
,
* and Average
. If the aggregation type is null, the value is treated as Average
.
*
* Valid only if the policy type is StepScaling
.
*
Minimum
,
* Maximum
, and Average
. If the aggregation type is null, the value is treated as
* Average
.
*
* Valid only if the policy type is StepScaling
.
*/
public String getMetricAggregationType() {
return this.metricAggregationType;
}
/**
*
* The aggregation type for the CloudWatch metrics. The valid values are Minimum
, Maximum
,
* and Average
. If the aggregation type is null, the value is treated as Average
.
*
* Valid only if the policy type is StepScaling
.
*
Minimum
,
* Maximum
, and Average
. If the aggregation type is null, the value is treated as
* Average
.
*
* Valid only if the policy type is StepScaling
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutScalingPolicyRequest withMetricAggregationType(String metricAggregationType) {
setMetricAggregationType(metricAggregationType);
return this;
}
/**
*
* A set of adjustments that enable you to scale based on the size of the alarm breach. *
*
* Required if the policy type is StepScaling
. (Not used with any other policy type.)
*
* Required if the policy type is
* A set of adjustments that enable you to scale based on the size of the alarm breach.
*
* Required if the policy type is StepScaling
. (Not used with any other policy type.)
*/
public java.util.ListStepScaling
. (Not used with any other policy type.)
*
* Required if the policy type is
* A set of adjustments that enable you to scale based on the size of the alarm breach.
*
* Required if the policy type is
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setStepAdjustments(java.util.Collection)} or {@link #withStepAdjustments(java.util.Collection)} if you
* want to override the existing values.
* StepScaling
. (Not used with any other policy type.)
*/
public void setStepAdjustments(java.util.CollectionStepScaling
. (Not used with any other policy type.)
*
* Required if the policy type is
* A set of adjustments that enable you to scale based on the size of the alarm breach.
*
* Required if the policy type is StepScaling
. (Not used with any other policy type.)
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutScalingPolicyRequest withStepAdjustments(StepAdjustment... stepAdjustments) {
if (this.stepAdjustments == null) {
setStepAdjustments(new com.amazonaws.internal.SdkInternalListStepScaling
. (Not used with any other policy type.)
*
* Required if the policy type is
* Not needed if the default instance warmup is defined for the group.
*
* The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This
* warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a
* warm-up period is specified here, it overrides the default instance warmup.
*
* Valid only if the policy type is
* The default is to use the value for the default instance warmup defined for the group. If default instance warmup
* is null, then StepScaling
. (Not used with any other policy type.)
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutScalingPolicyRequest withStepAdjustments(java.util.CollectionTargetTrackingScaling
or StepScaling
.
* EstimatedInstanceWarmup
falls back to the value of default cooldown.
*
* The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. * This warm-up period applies to instances launched due to a specific target tracking or step scaling * policy. When a warm-up period is specified here, it overrides the default instance warmup. *
*
* Valid only if the policy type is TargetTrackingScaling
or StepScaling
.
*
* The default is to use the value for the default instance warmup defined for the group. If default instance
* warmup is null, then EstimatedInstanceWarmup
falls back to the value of default cooldown.
*
* Not needed if the default instance warmup is defined for the group. *
** The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This * warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a * warm-up period is specified here, it overrides the default instance warmup. *
*
* Valid only if the policy type is TargetTrackingScaling
or StepScaling
.
*
* The default is to use the value for the default instance warmup defined for the group. If default instance warmup
* is null, then EstimatedInstanceWarmup
falls back to the value of default cooldown.
*
* The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. * This warm-up period applies to instances launched due to a specific target tracking or step scaling * policy. When a warm-up period is specified here, it overrides the default instance warmup. *
*
* Valid only if the policy type is TargetTrackingScaling
or StepScaling
.
*
* The default is to use the value for the default instance warmup defined for the group. If default
* instance warmup is null, then EstimatedInstanceWarmup
falls back to the value of default
* cooldown.
*
* Not needed if the default instance warmup is defined for the group. *
** The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This * warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a * warm-up period is specified here, it overrides the default instance warmup. *
*
* Valid only if the policy type is TargetTrackingScaling
or StepScaling
.
*
* The default is to use the value for the default instance warmup defined for the group. If default instance warmup
* is null, then EstimatedInstanceWarmup
falls back to the value of default cooldown.
*
* The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. * This warm-up period applies to instances launched due to a specific target tracking or step scaling * policy. When a warm-up period is specified here, it overrides the default instance warmup. *
*
* Valid only if the policy type is TargetTrackingScaling
or StepScaling
.
*
* The default is to use the value for the default instance warmup defined for the group. If default instance
* warmup is null, then EstimatedInstanceWarmup
falls back to the value of default cooldown.
*
* A target tracking scaling policy. Provides support for predefined or custom metrics. *
** The following predefined metrics are available: *
*
* ASGAverageCPUUtilization
*
* ASGAverageNetworkIn
*
* ASGAverageNetworkOut
*
* ALBRequestCountPerTarget
*
* If you specify ALBRequestCountPerTarget
for the metric, you must specify the
* ResourceLabel
property with the PredefinedMetricSpecification
.
*
* For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is TargetTrackingScaling
.
*
* The following predefined metrics are available: *
*
* ASGAverageCPUUtilization
*
* ASGAverageNetworkIn
*
* ASGAverageNetworkOut
*
* ALBRequestCountPerTarget
*
* If you specify ALBRequestCountPerTarget
for the metric, you must specify the
* ResourceLabel
property with the PredefinedMetricSpecification
.
*
* For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is TargetTrackingScaling
.
*/
public void setTargetTrackingConfiguration(TargetTrackingConfiguration targetTrackingConfiguration) {
this.targetTrackingConfiguration = targetTrackingConfiguration;
}
/**
*
* A target tracking scaling policy. Provides support for predefined or custom metrics. *
** The following predefined metrics are available: *
*
* ASGAverageCPUUtilization
*
* ASGAverageNetworkIn
*
* ASGAverageNetworkOut
*
* ALBRequestCountPerTarget
*
* If you specify ALBRequestCountPerTarget
for the metric, you must specify the
* ResourceLabel
property with the PredefinedMetricSpecification
.
*
* For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is TargetTrackingScaling
.
*
* The following predefined metrics are available: *
*
* ASGAverageCPUUtilization
*
* ASGAverageNetworkIn
*
* ASGAverageNetworkOut
*
* ALBRequestCountPerTarget
*
* If you specify ALBRequestCountPerTarget
for the metric, you must specify the
* ResourceLabel
property with the PredefinedMetricSpecification
.
*
* For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is TargetTrackingScaling
.
*/
public TargetTrackingConfiguration getTargetTrackingConfiguration() {
return this.targetTrackingConfiguration;
}
/**
*
* A target tracking scaling policy. Provides support for predefined or custom metrics. *
** The following predefined metrics are available: *
*
* ASGAverageCPUUtilization
*
* ASGAverageNetworkIn
*
* ASGAverageNetworkOut
*
* ALBRequestCountPerTarget
*
* If you specify ALBRequestCountPerTarget
for the metric, you must specify the
* ResourceLabel
property with the PredefinedMetricSpecification
.
*
* For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is TargetTrackingScaling
.
*
* The following predefined metrics are available: *
*
* ASGAverageCPUUtilization
*
* ASGAverageNetworkIn
*
* ASGAverageNetworkOut
*
* ALBRequestCountPerTarget
*
* If you specify ALBRequestCountPerTarget
for the metric, you must specify the
* ResourceLabel
property with the PredefinedMetricSpecification
.
*
* For more information, see TargetTrackingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is TargetTrackingScaling
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutScalingPolicyRequest withTargetTrackingConfiguration(TargetTrackingConfiguration targetTrackingConfiguration) {
setTargetTrackingConfiguration(targetTrackingConfiguration);
return this;
}
/**
*
* Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see Disabling a * scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
* * @param enabled * Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, * see * Disabling a scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. */ public void setEnabled(Boolean enabled) { this.enabled = enabled; } /** ** Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see Disabling a * scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
* * @return Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more * information, see Disabling a scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User * Guide. */ public Boolean getEnabled() { return this.enabled; } /** ** Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see Disabling a * scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
* * @param enabled * Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, * see * Disabling a scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. * @return Returns a reference to this object so that method calls can be chained together. */ public PutScalingPolicyRequest withEnabled(Boolean enabled) { setEnabled(enabled); return this; } /** ** Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see Disabling a * scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide. *
* * @return Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more * information, see Disabling a scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User * Guide. */ public Boolean isEnabled() { return this.enabled; } /** ** A predictive scaling policy. Provides support for predefined and custom metrics. *
** Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count. *
** For more information, see PredictiveScalingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is PredictiveScaling
.
*
* Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request * count. *
** For more information, see PredictiveScalingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is PredictiveScaling
.
*/
public void setPredictiveScalingConfiguration(PredictiveScalingConfiguration predictiveScalingConfiguration) {
this.predictiveScalingConfiguration = predictiveScalingConfiguration;
}
/**
*
* A predictive scaling policy. Provides support for predefined and custom metrics. *
** Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count. *
** For more information, see PredictiveScalingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is PredictiveScaling
.
*
* Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request * count. *
** For more information, see PredictiveScalingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is PredictiveScaling
.
*/
public PredictiveScalingConfiguration getPredictiveScalingConfiguration() {
return this.predictiveScalingConfiguration;
}
/**
*
* A predictive scaling policy. Provides support for predefined and custom metrics. *
** Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request count. *
** For more information, see PredictiveScalingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is PredictiveScaling
.
*
* Predefined metrics include CPU utilization, network in/out, and the Application Load Balancer request * count. *
** For more information, see PredictiveScalingConfiguration in the Amazon EC2 Auto Scaling API Reference. *
*
* Required if the policy type is PredictiveScaling
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public PutScalingPolicyRequest withPredictiveScalingConfiguration(PredictiveScalingConfiguration predictiveScalingConfiguration) {
setPredictiveScalingConfiguration(predictiveScalingConfiguration);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @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: ").append(getAutoScalingGroupName()).append(",");
if (getPolicyName() != null)
sb.append("PolicyName: ").append(getPolicyName()).append(",");
if (getPolicyType() != null)
sb.append("PolicyType: ").append(getPolicyType()).append(",");
if (getAdjustmentType() != null)
sb.append("AdjustmentType: ").append(getAdjustmentType()).append(",");
if (getMinAdjustmentStep() != null)
sb.append("MinAdjustmentStep: ").append(getMinAdjustmentStep()).append(",");
if (getMinAdjustmentMagnitude() != null)
sb.append("MinAdjustmentMagnitude: ").append(getMinAdjustmentMagnitude()).append(",");
if (getScalingAdjustment() != null)
sb.append("ScalingAdjustment: ").append(getScalingAdjustment()).append(",");
if (getCooldown() != null)
sb.append("Cooldown: ").append(getCooldown()).append(",");
if (getMetricAggregationType() != null)
sb.append("MetricAggregationType: ").append(getMetricAggregationType()).append(",");
if (getStepAdjustments() != null)
sb.append("StepAdjustments: ").append(getStepAdjustments()).append(",");
if (getEstimatedInstanceWarmup() != null)
sb.append("EstimatedInstanceWarmup: ").append(getEstimatedInstanceWarmup()).append(",");
if (getTargetTrackingConfiguration() != null)
sb.append("TargetTrackingConfiguration: ").append(getTargetTrackingConfiguration()).append(",");
if (getEnabled() != null)
sb.append("Enabled: ").append(getEnabled()).append(",");
if (getPredictiveScalingConfiguration() != null)
sb.append("PredictiveScalingConfiguration: ").append(getPredictiveScalingConfiguration());
sb.append("}");
return sb.toString();
}
@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;
if (other.getTargetTrackingConfiguration() == null ^ this.getTargetTrackingConfiguration() == null)
return false;
if (other.getTargetTrackingConfiguration() != null && other.getTargetTrackingConfiguration().equals(this.getTargetTrackingConfiguration()) == false)
return false;
if (other.getEnabled() == null ^ this.getEnabled() == null)
return false;
if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false)
return false;
if (other.getPredictiveScalingConfiguration() == null ^ this.getPredictiveScalingConfiguration() == null)
return false;
if (other.getPredictiveScalingConfiguration() != null
&& other.getPredictiveScalingConfiguration().equals(this.getPredictiveScalingConfiguration()) == false)
return false;
return true;
}
@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());
hashCode = prime * hashCode + ((getTargetTrackingConfiguration() == null) ? 0 : getTargetTrackingConfiguration().hashCode());
hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode());
hashCode = prime * hashCode + ((getPredictiveScalingConfiguration() == null) ? 0 : getPredictiveScalingConfiguration().hashCode());
return hashCode;
}
@Override
public PutScalingPolicyRequest clone() {
return (PutScalingPolicyRequest) super.clone();
}
}