/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace ApplicationAutoScaling { namespace Model { /** *

Represents a target tracking scaling policy configuration to use with * Application Auto Scaling.

For more information, see Target * tracking scaling policies in the Application Auto Scaling User * Guide.

See Also:

AWS * API Reference

*/ class TargetTrackingScalingPolicyConfiguration { public: AWS_APPLICATIONAUTOSCALING_API TargetTrackingScalingPolicyConfiguration(); AWS_APPLICATIONAUTOSCALING_API TargetTrackingScalingPolicyConfiguration(Aws::Utils::Json::JsonView jsonValue); AWS_APPLICATIONAUTOSCALING_API TargetTrackingScalingPolicyConfiguration& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_APPLICATIONAUTOSCALING_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The target value for the metric. Although this property accepts numbers of * type Double, it won't accept values that are either too small or too large. * Values must be in the range of -2^360 to 2^360. The value must be a valid number * based on the choice of metric. For example, if the metric is CPU utilization, * then the target value is a percent value that represents how much of the CPU can * be used before scaling out.

If the scaling policy specifies the * ALBRequestCountPerTarget predefined metric, specify the target * utilization as the optimal average request count per target during any * one-minute interval.

*/ inline double GetTargetValue() const{ return m_targetValue; } /** *

The target value for the metric. Although this property accepts numbers of * type Double, it won't accept values that are either too small or too large. * Values must be in the range of -2^360 to 2^360. The value must be a valid number * based on the choice of metric. For example, if the metric is CPU utilization, * then the target value is a percent value that represents how much of the CPU can * be used before scaling out.

If the scaling policy specifies the * ALBRequestCountPerTarget predefined metric, specify the target * utilization as the optimal average request count per target during any * one-minute interval.

*/ inline bool TargetValueHasBeenSet() const { return m_targetValueHasBeenSet; } /** *

The target value for the metric. Although this property accepts numbers of * type Double, it won't accept values that are either too small or too large. * Values must be in the range of -2^360 to 2^360. The value must be a valid number * based on the choice of metric. For example, if the metric is CPU utilization, * then the target value is a percent value that represents how much of the CPU can * be used before scaling out.

If the scaling policy specifies the * ALBRequestCountPerTarget predefined metric, specify the target * utilization as the optimal average request count per target during any * one-minute interval.

*/ inline void SetTargetValue(double value) { m_targetValueHasBeenSet = true; m_targetValue = value; } /** *

The target value for the metric. Although this property accepts numbers of * type Double, it won't accept values that are either too small or too large. * Values must be in the range of -2^360 to 2^360. The value must be a valid number * based on the choice of metric. For example, if the metric is CPU utilization, * then the target value is a percent value that represents how much of the CPU can * be used before scaling out.

If the scaling policy specifies the * ALBRequestCountPerTarget predefined metric, specify the target * utilization as the optimal average request count per target during any * one-minute interval.

*/ inline TargetTrackingScalingPolicyConfiguration& WithTargetValue(double value) { SetTargetValue(value); return *this;} /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline const PredefinedMetricSpecification& GetPredefinedMetricSpecification() const{ return m_predefinedMetricSpecification; } /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline bool PredefinedMetricSpecificationHasBeenSet() const { return m_predefinedMetricSpecificationHasBeenSet; } /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline void SetPredefinedMetricSpecification(const PredefinedMetricSpecification& value) { m_predefinedMetricSpecificationHasBeenSet = true; m_predefinedMetricSpecification = value; } /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline void SetPredefinedMetricSpecification(PredefinedMetricSpecification&& value) { m_predefinedMetricSpecificationHasBeenSet = true; m_predefinedMetricSpecification = std::move(value); } /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline TargetTrackingScalingPolicyConfiguration& WithPredefinedMetricSpecification(const PredefinedMetricSpecification& value) { SetPredefinedMetricSpecification(value); return *this;} /** *

A predefined metric. You can specify either a predefined metric or a * customized metric.

*/ inline TargetTrackingScalingPolicyConfiguration& WithPredefinedMetricSpecification(PredefinedMetricSpecification&& value) { SetPredefinedMetricSpecification(std::move(value)); return *this;} /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline const CustomizedMetricSpecification& GetCustomizedMetricSpecification() const{ return m_customizedMetricSpecification; } /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline bool CustomizedMetricSpecificationHasBeenSet() const { return m_customizedMetricSpecificationHasBeenSet; } /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline void SetCustomizedMetricSpecification(const CustomizedMetricSpecification& value) { m_customizedMetricSpecificationHasBeenSet = true; m_customizedMetricSpecification = value; } /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline void SetCustomizedMetricSpecification(CustomizedMetricSpecification&& value) { m_customizedMetricSpecificationHasBeenSet = true; m_customizedMetricSpecification = std::move(value); } /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline TargetTrackingScalingPolicyConfiguration& WithCustomizedMetricSpecification(const CustomizedMetricSpecification& value) { SetCustomizedMetricSpecification(value); return *this;} /** *

A customized metric. You can specify either a predefined metric or a * customized metric.

*/ inline TargetTrackingScalingPolicyConfiguration& WithCustomizedMetricSpecification(CustomizedMetricSpecification&& value) { SetCustomizedMetricSpecification(std::move(value)); return *this;} /** *

The amount of time, in seconds, to wait for a previous scale-out activity to * take effect. For more information and for default values, see Define * cooldown periods in the Application Auto Scaling User Guide.

*/ inline int GetScaleOutCooldown() const{ return m_scaleOutCooldown; } /** *

The amount of time, in seconds, to wait for a previous scale-out activity to * take effect. For more information and for default values, see Define * cooldown periods in the Application Auto Scaling User Guide.

*/ inline bool ScaleOutCooldownHasBeenSet() const { return m_scaleOutCooldownHasBeenSet; } /** *

The amount of time, in seconds, to wait for a previous scale-out activity to * take effect. For more information and for default values, see Define * cooldown periods in the Application Auto Scaling User Guide.

*/ inline void SetScaleOutCooldown(int value) { m_scaleOutCooldownHasBeenSet = true; m_scaleOutCooldown = value; } /** *

The amount of time, in seconds, to wait for a previous scale-out activity to * take effect. For more information and for default values, see Define * cooldown periods in the Application Auto Scaling User Guide.

*/ inline TargetTrackingScalingPolicyConfiguration& WithScaleOutCooldown(int value) { SetScaleOutCooldown(value); return *this;} /** *

The amount of time, in seconds, after a scale-in activity completes before * another scale-in activity can start. For more information and for default * values, see Define * cooldown periods in the Application Auto Scaling User Guide.

*/ inline int GetScaleInCooldown() const{ return m_scaleInCooldown; } /** *

The amount of time, in seconds, after a scale-in activity completes before * another scale-in activity can start. For more information and for default * values, see Define * cooldown periods in the Application Auto Scaling User Guide.

*/ inline bool ScaleInCooldownHasBeenSet() const { return m_scaleInCooldownHasBeenSet; } /** *

The amount of time, in seconds, after a scale-in activity completes before * another scale-in activity can start. For more information and for default * values, see Define * cooldown periods in the Application Auto Scaling User Guide.

*/ inline void SetScaleInCooldown(int value) { m_scaleInCooldownHasBeenSet = true; m_scaleInCooldown = value; } /** *

The amount of time, in seconds, after a scale-in activity completes before * another scale-in activity can start. For more information and for default * values, see Define * cooldown periods in the Application Auto Scaling User Guide.

*/ inline TargetTrackingScalingPolicyConfiguration& WithScaleInCooldown(int value) { SetScaleInCooldown(value); return *this;} /** *

Indicates whether scale in by the target tracking scaling policy is disabled. * If the value is true, scale in is disabled and the target tracking * scaling policy won't remove capacity from the scalable target. Otherwise, scale * in is enabled and the target tracking scaling policy can remove capacity from * the scalable target. The default value is false.

*/ inline bool GetDisableScaleIn() const{ return m_disableScaleIn; } /** *

Indicates whether scale in by the target tracking scaling policy is disabled. * If the value is true, scale in is disabled and the target tracking * scaling policy won't remove capacity from the scalable target. Otherwise, scale * in is enabled and the target tracking scaling policy can remove capacity from * the scalable target. The default value is false.

*/ inline bool DisableScaleInHasBeenSet() const { return m_disableScaleInHasBeenSet; } /** *

Indicates whether scale in by the target tracking scaling policy is disabled. * If the value is true, scale in is disabled and the target tracking * scaling policy won't remove capacity from the scalable target. Otherwise, scale * in is enabled and the target tracking scaling policy can remove capacity from * the scalable target. The default value is false.

*/ inline void SetDisableScaleIn(bool value) { m_disableScaleInHasBeenSet = true; m_disableScaleIn = value; } /** *

Indicates whether scale in by the target tracking scaling policy is disabled. * If the value is true, scale in is disabled and the target tracking * scaling policy won't remove capacity from the scalable target. Otherwise, scale * in is enabled and the target tracking scaling policy can remove capacity from * the scalable target. The default value is false.

*/ inline TargetTrackingScalingPolicyConfiguration& WithDisableScaleIn(bool value) { SetDisableScaleIn(value); return *this;} private: double m_targetValue; bool m_targetValueHasBeenSet = false; PredefinedMetricSpecification m_predefinedMetricSpecification; bool m_predefinedMetricSpecificationHasBeenSet = false; CustomizedMetricSpecification m_customizedMetricSpecification; bool m_customizedMetricSpecificationHasBeenSet = false; int m_scaleOutCooldown; bool m_scaleOutCooldownHasBeenSet = false; int m_scaleInCooldown; bool m_scaleInCooldownHasBeenSet = false; bool m_disableScaleIn; bool m_disableScaleInHasBeenSet = false; }; } // namespace Model } // namespace ApplicationAutoScaling } // namespace Aws