/** * 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 OpsWorks { namespace Model { /** *

Describes a load-based auto scaling upscaling or downscaling threshold * configuration, which specifies when AWS OpsWorks Stacks starts or stops * load-based instances.

See Also:

AWS * API Reference

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

The number of instances to add or remove when the load exceeds a * threshold.

*/ inline int GetInstanceCount() const{ return m_instanceCount; } /** *

The number of instances to add or remove when the load exceeds a * threshold.

*/ inline bool InstanceCountHasBeenSet() const { return m_instanceCountHasBeenSet; } /** *

The number of instances to add or remove when the load exceeds a * threshold.

*/ inline void SetInstanceCount(int value) { m_instanceCountHasBeenSet = true; m_instanceCount = value; } /** *

The number of instances to add or remove when the load exceeds a * threshold.

*/ inline AutoScalingThresholds& WithInstanceCount(int value) { SetInstanceCount(value); return *this;} /** *

The amount of time, in minutes, that the load must exceed a threshold before * more instances are added or removed.

*/ inline int GetThresholdsWaitTime() const{ return m_thresholdsWaitTime; } /** *

The amount of time, in minutes, that the load must exceed a threshold before * more instances are added or removed.

*/ inline bool ThresholdsWaitTimeHasBeenSet() const { return m_thresholdsWaitTimeHasBeenSet; } /** *

The amount of time, in minutes, that the load must exceed a threshold before * more instances are added or removed.

*/ inline void SetThresholdsWaitTime(int value) { m_thresholdsWaitTimeHasBeenSet = true; m_thresholdsWaitTime = value; } /** *

The amount of time, in minutes, that the load must exceed a threshold before * more instances are added or removed.

*/ inline AutoScalingThresholds& WithThresholdsWaitTime(int value) { SetThresholdsWaitTime(value); return *this;} /** *

The amount of time (in minutes) after a scaling event occurs that AWS * OpsWorks Stacks should ignore metrics and suppress additional scaling events. * For example, AWS OpsWorks Stacks adds new instances following an upscaling event * but the instances won't start reducing the load until they have been booted and * configured. There is no point in raising additional scaling events during that * operation, which typically takes several minutes. IgnoreMetricsTime * allows you to direct AWS OpsWorks Stacks to suppress scaling events long enough * to get the new instances online.

*/ inline int GetIgnoreMetricsTime() const{ return m_ignoreMetricsTime; } /** *

The amount of time (in minutes) after a scaling event occurs that AWS * OpsWorks Stacks should ignore metrics and suppress additional scaling events. * For example, AWS OpsWorks Stacks adds new instances following an upscaling event * but the instances won't start reducing the load until they have been booted and * configured. There is no point in raising additional scaling events during that * operation, which typically takes several minutes. IgnoreMetricsTime * allows you to direct AWS OpsWorks Stacks to suppress scaling events long enough * to get the new instances online.

*/ inline bool IgnoreMetricsTimeHasBeenSet() const { return m_ignoreMetricsTimeHasBeenSet; } /** *

The amount of time (in minutes) after a scaling event occurs that AWS * OpsWorks Stacks should ignore metrics and suppress additional scaling events. * For example, AWS OpsWorks Stacks adds new instances following an upscaling event * but the instances won't start reducing the load until they have been booted and * configured. There is no point in raising additional scaling events during that * operation, which typically takes several minutes. IgnoreMetricsTime * allows you to direct AWS OpsWorks Stacks to suppress scaling events long enough * to get the new instances online.

*/ inline void SetIgnoreMetricsTime(int value) { m_ignoreMetricsTimeHasBeenSet = true; m_ignoreMetricsTime = value; } /** *

The amount of time (in minutes) after a scaling event occurs that AWS * OpsWorks Stacks should ignore metrics and suppress additional scaling events. * For example, AWS OpsWorks Stacks adds new instances following an upscaling event * but the instances won't start reducing the load until they have been booted and * configured. There is no point in raising additional scaling events during that * operation, which typically takes several minutes. IgnoreMetricsTime * allows you to direct AWS OpsWorks Stacks to suppress scaling events long enough * to get the new instances online.

*/ inline AutoScalingThresholds& WithIgnoreMetricsTime(int value) { SetIgnoreMetricsTime(value); return *this;} /** *

The CPU utilization threshold, as a percent of the available CPU. A value of * -1 disables the threshold.

*/ inline double GetCpuThreshold() const{ return m_cpuThreshold; } /** *

The CPU utilization threshold, as a percent of the available CPU. A value of * -1 disables the threshold.

*/ inline bool CpuThresholdHasBeenSet() const { return m_cpuThresholdHasBeenSet; } /** *

The CPU utilization threshold, as a percent of the available CPU. A value of * -1 disables the threshold.

*/ inline void SetCpuThreshold(double value) { m_cpuThresholdHasBeenSet = true; m_cpuThreshold = value; } /** *

The CPU utilization threshold, as a percent of the available CPU. A value of * -1 disables the threshold.

*/ inline AutoScalingThresholds& WithCpuThreshold(double value) { SetCpuThreshold(value); return *this;} /** *

The memory utilization threshold, as a percent of the available memory. A * value of -1 disables the threshold.

*/ inline double GetMemoryThreshold() const{ return m_memoryThreshold; } /** *

The memory utilization threshold, as a percent of the available memory. A * value of -1 disables the threshold.

*/ inline bool MemoryThresholdHasBeenSet() const { return m_memoryThresholdHasBeenSet; } /** *

The memory utilization threshold, as a percent of the available memory. A * value of -1 disables the threshold.

*/ inline void SetMemoryThreshold(double value) { m_memoryThresholdHasBeenSet = true; m_memoryThreshold = value; } /** *

The memory utilization threshold, as a percent of the available memory. A * value of -1 disables the threshold.

*/ inline AutoScalingThresholds& WithMemoryThreshold(double value) { SetMemoryThreshold(value); return *this;} /** *

The load threshold. A value of -1 disables the threshold. For more * information about how load is computed, see Load * (computing).

*/ inline double GetLoadThreshold() const{ return m_loadThreshold; } /** *

The load threshold. A value of -1 disables the threshold. For more * information about how load is computed, see Load * (computing).

*/ inline bool LoadThresholdHasBeenSet() const { return m_loadThresholdHasBeenSet; } /** *

The load threshold. A value of -1 disables the threshold. For more * information about how load is computed, see Load * (computing).

*/ inline void SetLoadThreshold(double value) { m_loadThresholdHasBeenSet = true; m_loadThreshold = value; } /** *

The load threshold. A value of -1 disables the threshold. For more * information about how load is computed, see Load * (computing).

*/ inline AutoScalingThresholds& WithLoadThreshold(double value) { SetLoadThreshold(value); return *this;} /** *

Custom Cloudwatch auto scaling alarms, to be used as thresholds. This * parameter takes a list of up to five alarm names, which are case sensitive and * must be in the same region as the stack.

To use custom alarms, you * must update your service role to allow cloudwatch:DescribeAlarms. * You can either have AWS OpsWorks Stacks update the role for you when you first * use this feature or you can edit the role manually. For more information, see Allowing * AWS OpsWorks Stacks to Act on Your Behalf.

*/ inline const Aws::Vector& GetAlarms() const{ return m_alarms; } /** *

Custom Cloudwatch auto scaling alarms, to be used as thresholds. This * parameter takes a list of up to five alarm names, which are case sensitive and * must be in the same region as the stack.

To use custom alarms, you * must update your service role to allow cloudwatch:DescribeAlarms. * You can either have AWS OpsWorks Stacks update the role for you when you first * use this feature or you can edit the role manually. For more information, see Allowing * AWS OpsWorks Stacks to Act on Your Behalf.

*/ inline bool AlarmsHasBeenSet() const { return m_alarmsHasBeenSet; } /** *

Custom Cloudwatch auto scaling alarms, to be used as thresholds. This * parameter takes a list of up to five alarm names, which are case sensitive and * must be in the same region as the stack.

To use custom alarms, you * must update your service role to allow cloudwatch:DescribeAlarms. * You can either have AWS OpsWorks Stacks update the role for you when you first * use this feature or you can edit the role manually. For more information, see Allowing * AWS OpsWorks Stacks to Act on Your Behalf.

*/ inline void SetAlarms(const Aws::Vector& value) { m_alarmsHasBeenSet = true; m_alarms = value; } /** *

Custom Cloudwatch auto scaling alarms, to be used as thresholds. This * parameter takes a list of up to five alarm names, which are case sensitive and * must be in the same region as the stack.

To use custom alarms, you * must update your service role to allow cloudwatch:DescribeAlarms. * You can either have AWS OpsWorks Stacks update the role for you when you first * use this feature or you can edit the role manually. For more information, see Allowing * AWS OpsWorks Stacks to Act on Your Behalf.

*/ inline void SetAlarms(Aws::Vector&& value) { m_alarmsHasBeenSet = true; m_alarms = std::move(value); } /** *

Custom Cloudwatch auto scaling alarms, to be used as thresholds. This * parameter takes a list of up to five alarm names, which are case sensitive and * must be in the same region as the stack.

To use custom alarms, you * must update your service role to allow cloudwatch:DescribeAlarms. * You can either have AWS OpsWorks Stacks update the role for you when you first * use this feature or you can edit the role manually. For more information, see Allowing * AWS OpsWorks Stacks to Act on Your Behalf.

*/ inline AutoScalingThresholds& WithAlarms(const Aws::Vector& value) { SetAlarms(value); return *this;} /** *

Custom Cloudwatch auto scaling alarms, to be used as thresholds. This * parameter takes a list of up to five alarm names, which are case sensitive and * must be in the same region as the stack.

To use custom alarms, you * must update your service role to allow cloudwatch:DescribeAlarms. * You can either have AWS OpsWorks Stacks update the role for you when you first * use this feature or you can edit the role manually. For more information, see Allowing * AWS OpsWorks Stacks to Act on Your Behalf.

*/ inline AutoScalingThresholds& WithAlarms(Aws::Vector&& value) { SetAlarms(std::move(value)); return *this;} /** *

Custom Cloudwatch auto scaling alarms, to be used as thresholds. This * parameter takes a list of up to five alarm names, which are case sensitive and * must be in the same region as the stack.

To use custom alarms, you * must update your service role to allow cloudwatch:DescribeAlarms. * You can either have AWS OpsWorks Stacks update the role for you when you first * use this feature or you can edit the role manually. For more information, see Allowing * AWS OpsWorks Stacks to Act on Your Behalf.

*/ inline AutoScalingThresholds& AddAlarms(const Aws::String& value) { m_alarmsHasBeenSet = true; m_alarms.push_back(value); return *this; } /** *

Custom Cloudwatch auto scaling alarms, to be used as thresholds. This * parameter takes a list of up to five alarm names, which are case sensitive and * must be in the same region as the stack.

To use custom alarms, you * must update your service role to allow cloudwatch:DescribeAlarms. * You can either have AWS OpsWorks Stacks update the role for you when you first * use this feature or you can edit the role manually. For more information, see Allowing * AWS OpsWorks Stacks to Act on Your Behalf.

*/ inline AutoScalingThresholds& AddAlarms(Aws::String&& value) { m_alarmsHasBeenSet = true; m_alarms.push_back(std::move(value)); return *this; } /** *

Custom Cloudwatch auto scaling alarms, to be used as thresholds. This * parameter takes a list of up to five alarm names, which are case sensitive and * must be in the same region as the stack.

To use custom alarms, you * must update your service role to allow cloudwatch:DescribeAlarms. * You can either have AWS OpsWorks Stacks update the role for you when you first * use this feature or you can edit the role manually. For more information, see Allowing * AWS OpsWorks Stacks to Act on Your Behalf.

*/ inline AutoScalingThresholds& AddAlarms(const char* value) { m_alarmsHasBeenSet = true; m_alarms.push_back(value); return *this; } private: int m_instanceCount; bool m_instanceCountHasBeenSet = false; int m_thresholdsWaitTime; bool m_thresholdsWaitTimeHasBeenSet = false; int m_ignoreMetricsTime; bool m_ignoreMetricsTimeHasBeenSet = false; double m_cpuThreshold; bool m_cpuThresholdHasBeenSet = false; double m_memoryThreshold; bool m_memoryThresholdHasBeenSet = false; double m_loadThreshold; bool m_loadThresholdHasBeenSet = false; Aws::Vector m_alarms; bool m_alarmsHasBeenSet = false; }; } // namespace Model } // namespace OpsWorks } // namespace Aws