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

The definition of a CloudWatch metric alarm, which determines when an * automatic scaling activity is triggered. When the defined alarm conditions are * satisfied, scaling activity begins.

See Also:

AWS * API Reference

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

Determines how the metric specified by MetricName is compared to * the value specified by Threshold.

*/ inline const ComparisonOperator& GetComparisonOperator() const{ return m_comparisonOperator; } /** *

Determines how the metric specified by MetricName is compared to * the value specified by Threshold.

*/ inline bool ComparisonOperatorHasBeenSet() const { return m_comparisonOperatorHasBeenSet; } /** *

Determines how the metric specified by MetricName is compared to * the value specified by Threshold.

*/ inline void SetComparisonOperator(const ComparisonOperator& value) { m_comparisonOperatorHasBeenSet = true; m_comparisonOperator = value; } /** *

Determines how the metric specified by MetricName is compared to * the value specified by Threshold.

*/ inline void SetComparisonOperator(ComparisonOperator&& value) { m_comparisonOperatorHasBeenSet = true; m_comparisonOperator = std::move(value); } /** *

Determines how the metric specified by MetricName is compared to * the value specified by Threshold.

*/ inline CloudWatchAlarmDefinition& WithComparisonOperator(const ComparisonOperator& value) { SetComparisonOperator(value); return *this;} /** *

Determines how the metric specified by MetricName is compared to * the value specified by Threshold.

*/ inline CloudWatchAlarmDefinition& WithComparisonOperator(ComparisonOperator&& value) { SetComparisonOperator(std::move(value)); return *this;} /** *

The number of periods, in five-minute increments, during which the alarm * condition must exist before the alarm triggers automatic scaling activity. The * default value is 1.

*/ inline int GetEvaluationPeriods() const{ return m_evaluationPeriods; } /** *

The number of periods, in five-minute increments, during which the alarm * condition must exist before the alarm triggers automatic scaling activity. The * default value is 1.

*/ inline bool EvaluationPeriodsHasBeenSet() const { return m_evaluationPeriodsHasBeenSet; } /** *

The number of periods, in five-minute increments, during which the alarm * condition must exist before the alarm triggers automatic scaling activity. The * default value is 1.

*/ inline void SetEvaluationPeriods(int value) { m_evaluationPeriodsHasBeenSet = true; m_evaluationPeriods = value; } /** *

The number of periods, in five-minute increments, during which the alarm * condition must exist before the alarm triggers automatic scaling activity. The * default value is 1.

*/ inline CloudWatchAlarmDefinition& WithEvaluationPeriods(int value) { SetEvaluationPeriods(value); return *this;} /** *

The name of the CloudWatch metric that is watched to determine an alarm * condition.

*/ inline const Aws::String& GetMetricName() const{ return m_metricName; } /** *

The name of the CloudWatch metric that is watched to determine an alarm * condition.

*/ inline bool MetricNameHasBeenSet() const { return m_metricNameHasBeenSet; } /** *

The name of the CloudWatch metric that is watched to determine an alarm * condition.

*/ inline void SetMetricName(const Aws::String& value) { m_metricNameHasBeenSet = true; m_metricName = value; } /** *

The name of the CloudWatch metric that is watched to determine an alarm * condition.

*/ inline void SetMetricName(Aws::String&& value) { m_metricNameHasBeenSet = true; m_metricName = std::move(value); } /** *

The name of the CloudWatch metric that is watched to determine an alarm * condition.

*/ inline void SetMetricName(const char* value) { m_metricNameHasBeenSet = true; m_metricName.assign(value); } /** *

The name of the CloudWatch metric that is watched to determine an alarm * condition.

*/ inline CloudWatchAlarmDefinition& WithMetricName(const Aws::String& value) { SetMetricName(value); return *this;} /** *

The name of the CloudWatch metric that is watched to determine an alarm * condition.

*/ inline CloudWatchAlarmDefinition& WithMetricName(Aws::String&& value) { SetMetricName(std::move(value)); return *this;} /** *

The name of the CloudWatch metric that is watched to determine an alarm * condition.

*/ inline CloudWatchAlarmDefinition& WithMetricName(const char* value) { SetMetricName(value); return *this;} /** *

The namespace for the CloudWatch metric. The default is * AWS/ElasticMapReduce.

*/ inline const Aws::String& GetNamespace() const{ return m_namespace; } /** *

The namespace for the CloudWatch metric. The default is * AWS/ElasticMapReduce.

*/ inline bool NamespaceHasBeenSet() const { return m_namespaceHasBeenSet; } /** *

The namespace for the CloudWatch metric. The default is * AWS/ElasticMapReduce.

*/ inline void SetNamespace(const Aws::String& value) { m_namespaceHasBeenSet = true; m_namespace = value; } /** *

The namespace for the CloudWatch metric. The default is * AWS/ElasticMapReduce.

*/ inline void SetNamespace(Aws::String&& value) { m_namespaceHasBeenSet = true; m_namespace = std::move(value); } /** *

The namespace for the CloudWatch metric. The default is * AWS/ElasticMapReduce.

*/ inline void SetNamespace(const char* value) { m_namespaceHasBeenSet = true; m_namespace.assign(value); } /** *

The namespace for the CloudWatch metric. The default is * AWS/ElasticMapReduce.

*/ inline CloudWatchAlarmDefinition& WithNamespace(const Aws::String& value) { SetNamespace(value); return *this;} /** *

The namespace for the CloudWatch metric. The default is * AWS/ElasticMapReduce.

*/ inline CloudWatchAlarmDefinition& WithNamespace(Aws::String&& value) { SetNamespace(std::move(value)); return *this;} /** *

The namespace for the CloudWatch metric. The default is * AWS/ElasticMapReduce.

*/ inline CloudWatchAlarmDefinition& WithNamespace(const char* value) { SetNamespace(value); return *this;} /** *

The period, in seconds, over which the statistic is applied. CloudWatch * metrics for Amazon EMR are emitted every five minutes (300 seconds), so if you * specify a CloudWatch metric, specify 300.

*/ inline int GetPeriod() const{ return m_period; } /** *

The period, in seconds, over which the statistic is applied. CloudWatch * metrics for Amazon EMR are emitted every five minutes (300 seconds), so if you * specify a CloudWatch metric, specify 300.

*/ inline bool PeriodHasBeenSet() const { return m_periodHasBeenSet; } /** *

The period, in seconds, over which the statistic is applied. CloudWatch * metrics for Amazon EMR are emitted every five minutes (300 seconds), so if you * specify a CloudWatch metric, specify 300.

*/ inline void SetPeriod(int value) { m_periodHasBeenSet = true; m_period = value; } /** *

The period, in seconds, over which the statistic is applied. CloudWatch * metrics for Amazon EMR are emitted every five minutes (300 seconds), so if you * specify a CloudWatch metric, specify 300.

*/ inline CloudWatchAlarmDefinition& WithPeriod(int value) { SetPeriod(value); return *this;} /** *

The statistic to apply to the metric associated with the alarm. The default * is AVERAGE.

*/ inline const Statistic& GetStatistic() const{ return m_statistic; } /** *

The statistic to apply to the metric associated with the alarm. The default * is AVERAGE.

*/ inline bool StatisticHasBeenSet() const { return m_statisticHasBeenSet; } /** *

The statistic to apply to the metric associated with the alarm. The default * is AVERAGE.

*/ inline void SetStatistic(const Statistic& value) { m_statisticHasBeenSet = true; m_statistic = value; } /** *

The statistic to apply to the metric associated with the alarm. The default * is AVERAGE.

*/ inline void SetStatistic(Statistic&& value) { m_statisticHasBeenSet = true; m_statistic = std::move(value); } /** *

The statistic to apply to the metric associated with the alarm. The default * is AVERAGE.

*/ inline CloudWatchAlarmDefinition& WithStatistic(const Statistic& value) { SetStatistic(value); return *this;} /** *

The statistic to apply to the metric associated with the alarm. The default * is AVERAGE.

*/ inline CloudWatchAlarmDefinition& WithStatistic(Statistic&& value) { SetStatistic(std::move(value)); return *this;} /** *

The value against which the specified statistic is compared.

*/ inline double GetThreshold() const{ return m_threshold; } /** *

The value against which the specified statistic is compared.

*/ inline bool ThresholdHasBeenSet() const { return m_thresholdHasBeenSet; } /** *

The value against which the specified statistic is compared.

*/ inline void SetThreshold(double value) { m_thresholdHasBeenSet = true; m_threshold = value; } /** *

The value against which the specified statistic is compared.

*/ inline CloudWatchAlarmDefinition& WithThreshold(double value) { SetThreshold(value); return *this;} /** *

The unit of measure associated with the CloudWatch metric being watched. The * value specified for Unit must correspond to the units specified in * the CloudWatch metric.

*/ inline const Unit& GetUnit() const{ return m_unit; } /** *

The unit of measure associated with the CloudWatch metric being watched. The * value specified for Unit must correspond to the units specified in * the CloudWatch metric.

*/ inline bool UnitHasBeenSet() const { return m_unitHasBeenSet; } /** *

The unit of measure associated with the CloudWatch metric being watched. The * value specified for Unit must correspond to the units specified in * the CloudWatch metric.

*/ inline void SetUnit(const Unit& value) { m_unitHasBeenSet = true; m_unit = value; } /** *

The unit of measure associated with the CloudWatch metric being watched. The * value specified for Unit must correspond to the units specified in * the CloudWatch metric.

*/ inline void SetUnit(Unit&& value) { m_unitHasBeenSet = true; m_unit = std::move(value); } /** *

The unit of measure associated with the CloudWatch metric being watched. The * value specified for Unit must correspond to the units specified in * the CloudWatch metric.

*/ inline CloudWatchAlarmDefinition& WithUnit(const Unit& value) { SetUnit(value); return *this;} /** *

The unit of measure associated with the CloudWatch metric being watched. The * value specified for Unit must correspond to the units specified in * the CloudWatch metric.

*/ inline CloudWatchAlarmDefinition& WithUnit(Unit&& value) { SetUnit(std::move(value)); return *this;} /** *

A CloudWatch metric dimension.

*/ inline const Aws::Vector& GetDimensions() const{ return m_dimensions; } /** *

A CloudWatch metric dimension.

*/ inline bool DimensionsHasBeenSet() const { return m_dimensionsHasBeenSet; } /** *

A CloudWatch metric dimension.

*/ inline void SetDimensions(const Aws::Vector& value) { m_dimensionsHasBeenSet = true; m_dimensions = value; } /** *

A CloudWatch metric dimension.

*/ inline void SetDimensions(Aws::Vector&& value) { m_dimensionsHasBeenSet = true; m_dimensions = std::move(value); } /** *

A CloudWatch metric dimension.

*/ inline CloudWatchAlarmDefinition& WithDimensions(const Aws::Vector& value) { SetDimensions(value); return *this;} /** *

A CloudWatch metric dimension.

*/ inline CloudWatchAlarmDefinition& WithDimensions(Aws::Vector&& value) { SetDimensions(std::move(value)); return *this;} /** *

A CloudWatch metric dimension.

*/ inline CloudWatchAlarmDefinition& AddDimensions(const MetricDimension& value) { m_dimensionsHasBeenSet = true; m_dimensions.push_back(value); return *this; } /** *

A CloudWatch metric dimension.

*/ inline CloudWatchAlarmDefinition& AddDimensions(MetricDimension&& value) { m_dimensionsHasBeenSet = true; m_dimensions.push_back(std::move(value)); return *this; } private: ComparisonOperator m_comparisonOperator; bool m_comparisonOperatorHasBeenSet = false; int m_evaluationPeriods; bool m_evaluationPeriodsHasBeenSet = false; Aws::String m_metricName; bool m_metricNameHasBeenSet = false; Aws::String m_namespace; bool m_namespaceHasBeenSet = false; int m_period; bool m_periodHasBeenSet = false; Statistic m_statistic; bool m_statisticHasBeenSet = false; double m_threshold; bool m_thresholdHasBeenSet = false; Unit m_unit; bool m_unitHasBeenSet = false; Aws::Vector m_dimensions; bool m_dimensionsHasBeenSet = false; }; } // namespace Model } // namespace EMR } // namespace Aws