Class: AWSCDK::CloudWatch::AlarmProps
- Inherits:
-
CreateAlarmOptions
- Object
- CreateAlarmOptions
- AWSCDK::CloudWatch::AlarmProps
- Defined in:
- cloud_watch/alarm_props.rb
Overview
Properties for Alarms.
Instance Attribute Summary collapse
-
#actions_enabled ⇒ Boolean?
readonly
Whether the actions for this alarm are enabled.
-
#alarm_description ⇒ String?
readonly
Description for the alarm.
-
#alarm_name ⇒ String?
readonly
Name of the alarm.
-
#comparison_operator ⇒ AWSCDK::CloudWatch::ComparisonOperator?
readonly
Comparison to use to check if metric is breaching.
-
#datapoints_to_alarm ⇒ Numeric?
readonly
The number of datapoints that must be breaching to trigger the alarm.
-
#evaluate_low_sample_count_percentile ⇒ String?
readonly
Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.
-
#evaluation_periods ⇒ Numeric
readonly
The number of periods over which data is compared to the specified threshold.
-
#metric ⇒ AWSCDK::CloudWatch::IMetric
readonly
The metric to add the alarm on.
-
#threshold ⇒ Numeric
readonly
The value against which the specified statistic is compared.
-
#treat_missing_data ⇒ AWSCDK::CloudWatch::TreatMissingData?
readonly
Sets how this alarm is to handle missing data points.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(evaluation_periods:, threshold:, actions_enabled: nil, alarm_description: nil, alarm_name: nil, comparison_operator: nil, datapoints_to_alarm: nil, evaluate_low_sample_count_percentile: nil, treat_missing_data: nil, metric:) ⇒ AlarmProps
constructor
A new instance of AlarmProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(evaluation_periods:, threshold:, actions_enabled: nil, alarm_description: nil, alarm_name: nil, comparison_operator: nil, datapoints_to_alarm: nil, evaluate_low_sample_count_percentile: nil, treat_missing_data: nil, metric:) ⇒ AlarmProps
Returns a new instance of AlarmProps.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'cloud_watch/alarm_props.rb', line 17 def initialize(evaluation_periods:, threshold:, actions_enabled: nil, alarm_description: nil, alarm_name: nil, comparison_operator: nil, datapoints_to_alarm: nil, evaluate_low_sample_count_percentile: nil, treat_missing_data: nil, metric:) @evaluation_periods = evaluation_periods Jsii::Type.check_type(@evaluation_periods, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "evaluationPeriods") @threshold = threshold Jsii::Type.check_type(@threshold, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "threshold") @actions_enabled = actions_enabled Jsii::Type.check_type(@actions_enabled, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "actionsEnabled") unless @actions_enabled.nil? @alarm_description = alarm_description Jsii::Type.check_type(@alarm_description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "alarmDescription") unless @alarm_description.nil? @alarm_name = alarm_name Jsii::Type.check_type(@alarm_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "alarmName") unless @alarm_name.nil? @comparison_operator = comparison_operator Jsii::Type.check_type(@comparison_operator, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5Db21wYXJpc29uT3BlcmF0b3IifQ==")), "comparisonOperator") unless @comparison_operator.nil? @datapoints_to_alarm = datapoints_to_alarm Jsii::Type.check_type(@datapoints_to_alarm, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "datapointsToAlarm") unless @datapoints_to_alarm.nil? @evaluate_low_sample_count_percentile = evaluate_low_sample_count_percentile Jsii::Type.check_type(@evaluate_low_sample_count_percentile, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "evaluateLowSampleCountPercentile") unless @evaluate_low_sample_count_percentile.nil? @treat_missing_data = treat_missing_data Jsii::Type.check_type(@treat_missing_data, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5UcmVhdE1pc3NpbmdEYXRhIn0=")), "treatMissingData") unless @treat_missing_data.nil? @metric = metric Jsii::Type.check_type(@metric, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY2xvdWR3YXRjaC5JTWV0cmljIn0=")), "metric") end |
Instance Attribute Details
#actions_enabled ⇒ Boolean? (readonly)
Default: true
Whether the actions for this alarm are enabled.
52 53 54 |
# File 'cloud_watch/alarm_props.rb', line 52 def actions_enabled @actions_enabled end |
#alarm_description ⇒ String? (readonly)
Default: No description
Description for the alarm.
57 58 59 |
# File 'cloud_watch/alarm_props.rb', line 57 def alarm_description @alarm_description end |
#alarm_name ⇒ String? (readonly)
Default: Automatically generated name
Name of the alarm.
62 63 64 |
# File 'cloud_watch/alarm_props.rb', line 62 def alarm_name @alarm_name end |
#comparison_operator ⇒ AWSCDK::CloudWatch::ComparisonOperator? (readonly)
Default: GreaterThanOrEqualToThreshold
Comparison to use to check if metric is breaching.
67 68 69 |
# File 'cloud_watch/alarm_props.rb', line 67 def comparison_operator @comparison_operator end |
#datapoints_to_alarm ⇒ Numeric? (readonly)
Default: evaluationPeriods
The number of datapoints that must be breaching to trigger the alarm.
This is used only if you are setting an "M out of N" alarm. In that case, this value is the M. For more information, see Evaluating an Alarm in the Amazon CloudWatch User Guide.
77 78 79 |
# File 'cloud_watch/alarm_props.rb', line 77 def datapoints_to_alarm @datapoints_to_alarm end |
#evaluate_low_sample_count_percentile ⇒ String? (readonly)
Default: - Not configured.
Specifies whether to evaluate the data and potentially change the alarm state if there are too few data points to be statistically significant.
Used only for alarms that are based on percentiles.
84 85 86 |
# File 'cloud_watch/alarm_props.rb', line 84 def evaluate_low_sample_count_percentile @evaluate_low_sample_count_percentile end |
#evaluation_periods ⇒ Numeric (readonly)
The number of periods over which data is compared to the specified threshold.
43 44 45 |
# File 'cloud_watch/alarm_props.rb', line 43 def evaluation_periods @evaluation_periods end |
#metric ⇒ AWSCDK::CloudWatch::IMetric (readonly)
The metric to add the alarm on.
Metric objects can be obtained from most resources, or you can construct custom Metric objects by instantiating one.
96 97 98 |
# File 'cloud_watch/alarm_props.rb', line 96 def metric @metric end |
#threshold ⇒ Numeric (readonly)
The value against which the specified statistic is compared.
47 48 49 |
# File 'cloud_watch/alarm_props.rb', line 47 def threshold @threshold end |
#treat_missing_data ⇒ AWSCDK::CloudWatch::TreatMissingData? (readonly)
Default: TreatMissingData.Missing
Sets how this alarm is to handle missing data points.
89 90 91 |
# File 'cloud_watch/alarm_props.rb', line 89 def treat_missing_data @treat_missing_data end |
Class Method Details
.jsii_properties ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'cloud_watch/alarm_props.rb', line 98 def self.jsii_properties { :evaluation_periods => "evaluationPeriods", :threshold => "threshold", :actions_enabled => "actionsEnabled", :alarm_description => "alarmDescription", :alarm_name => "alarmName", :comparison_operator => "comparisonOperator", :datapoints_to_alarm => "datapointsToAlarm", :evaluate_low_sample_count_percentile => "evaluateLowSampleCountPercentile", :treat_missing_data => "treatMissingData", :metric => "metric", } end |
Instance Method Details
#to_jsii ⇒ Object
113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'cloud_watch/alarm_props.rb', line 113 def to_jsii result = {} result.merge!(super) result.merge!({ "evaluationPeriods" => @evaluation_periods, "threshold" => @threshold, "actionsEnabled" => @actions_enabled, "alarmDescription" => @alarm_description, "alarmName" => @alarm_name, "comparisonOperator" => @comparison_operator, "datapointsToAlarm" => @datapoints_to_alarm, "evaluateLowSampleCountPercentile" => @evaluate_low_sample_count_percentile, "treatMissingData" => @treat_missing_data, "metric" => @metric, }) result.compact end |