class CfnGuardian::Models::BaseAlarm
Attributes
actions_enabled[RW]
additional_notifiers[RW]
alarm_action[RW]
comparison_operator[RW]
datapoints_to_alarm[RW]
dimensions[RW]
enabled[RW]
evaluate_low_sample_count_percentile[RW]
evaluation_periods[RW]
extended_statistic[RW]
group[RW]
maintenance_groups[RW]
metric_name[RW]
name[RW]
namespace[RW]
period[RW]
resource_hash[R]
resource_id[RW]
resource_name[RW]
statistic[RW]
threshold[RW]
treat_missing_data[RW]
type[R]
unit[RW]
Public Class Methods
new(resource)
click to toggle source
# File lib/cfnguardian/models/alarm.rb, line 34 def initialize(resource) @type = 'Alarm' @group = nil @name = '' @metric_name = nil @namespace = nil @dimensions = nil @threshold = 0 @period = 60 @evaluation_periods = 1 @comparison_operator = 'GreaterThanThreshold' @statistic = 'Maximum' @actions_enabled = true @datapoints_to_alarm = nil @extended_statistic = nil @evaluate_low_sample_count_percentile = nil @unit = nil @enabled = true @resource_hash = Digest::MD5.hexdigest resource['Id'] @resource_id = resource['Id'] @resource_name = resource.fetch('Name', nil) @alarm_action = 'Critical' @treat_missing_data = nil @maintenance_groups = [] @additional_notifiers = [] end
Public Instance Methods
metric_name=(metric_name)
click to toggle source
# File lib/cfnguardian/models/alarm.rb, line 61 def metric_name=(metric_name) raise ArgumentError.new("metric_name '#{metric_name}' must be of type String, provided type '#{metric_name.class}'") unless metric_name.is_a?(String) @metric_name=metric_name end