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

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

See Also:

AWS * API Reference

*/ class TargetTrackingConfiguration { public: AWS_AUTOSCALING_API TargetTrackingConfiguration(); AWS_AUTOSCALING_API TargetTrackingConfiguration(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_AUTOSCALING_API TargetTrackingConfiguration& operator=(const Aws::Utils::Xml::XmlNode& xmlNode); AWS_AUTOSCALING_API void OutputToStream(Aws::OStream& ostream, const char* location, unsigned index, const char* locationValue) const; AWS_AUTOSCALING_API void OutputToStream(Aws::OStream& oStream, const char* location) const; /** *

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

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

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

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

A predefined metric. You must 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 must 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 must specify either a predefined metric or a * customized metric.

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

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

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

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

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

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

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

A customized metric. You must 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 must 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 must specify either a predefined metric or a * customized metric.

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

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

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

The target value for the metric.

Some metrics are based on a * count instead of a percentage, such as the request count for an Application Load * Balancer or the number of messages in an SQS queue. If the scaling policy * specifies one of these metrics, specify the target utilization as the optimal * average request or message count per instance during any one-minute interval. *

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

The target value for the metric.

Some metrics are based on a * count instead of a percentage, such as the request count for an Application Load * Balancer or the number of messages in an SQS queue. If the scaling policy * specifies one of these metrics, specify the target utilization as the optimal * average request or message count per instance during any one-minute interval. *

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

The target value for the metric.

Some metrics are based on a * count instead of a percentage, such as the request count for an Application Load * Balancer or the number of messages in an SQS queue. If the scaling policy * specifies one of these metrics, specify the target utilization as the optimal * average request or message count per instance during any one-minute interval. *

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

The target value for the metric.

Some metrics are based on a * count instead of a percentage, such as the request count for an Application Load * Balancer or the number of messages in an SQS queue. If the scaling policy * specifies one of these metrics, specify the target utilization as the optimal * average request or message count per instance during any one-minute interval. *

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

Indicates whether scaling in by the target tracking scaling policy is * disabled. If scaling in is disabled, the target tracking scaling policy doesn't * remove instances from the Auto Scaling group. Otherwise, the target tracking * scaling policy can remove instances from the Auto Scaling group. The default is * false.

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

Indicates whether scaling in by the target tracking scaling policy is * disabled. If scaling in is disabled, the target tracking scaling policy doesn't * remove instances from the Auto Scaling group. Otherwise, the target tracking * scaling policy can remove instances from the Auto Scaling group. The default is * false.

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

Indicates whether scaling in by the target tracking scaling policy is * disabled. If scaling in is disabled, the target tracking scaling policy doesn't * remove instances from the Auto Scaling group. Otherwise, the target tracking * scaling policy can remove instances from the Auto Scaling group. The default is * false.

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

Indicates whether scaling in by the target tracking scaling policy is * disabled. If scaling in is disabled, the target tracking scaling policy doesn't * remove instances from the Auto Scaling group. Otherwise, the target tracking * scaling policy can remove instances from the Auto Scaling group. The default is * false.

*/ inline TargetTrackingConfiguration& WithDisableScaleIn(bool value) { SetDisableScaleIn(value); return *this;} private: PredefinedMetricSpecification m_predefinedMetricSpecification; bool m_predefinedMetricSpecificationHasBeenSet = false; CustomizedMetricSpecification m_customizedMetricSpecification; bool m_customizedMetricSpecificationHasBeenSet = false; double m_targetValue; bool m_targetValueHasBeenSet = false; bool m_disableScaleIn; bool m_disableScaleInHasBeenSet = false; }; } // namespace Model } // namespace AutoScaling } // namespace Aws