Class: CfnGuardian::Models::MetricFilter
- Inherits:
-
Object
- Object
- CfnGuardian::Models::MetricFilter
- Defined in:
- lib/cfnguardian/models/metric_filter.rb
Instance Attribute Summary collapse
-
#log_group ⇒ Object
Returns the value of attribute log_group.
-
#metric_name ⇒ Object
Returns the value of attribute metric_name.
-
#metric_namespace ⇒ Object
readonly
Returns the value of attribute metric_namespace.
-
#metric_value ⇒ Object
Returns the value of attribute metric_value.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pattern ⇒ Object
Returns the value of attribute pattern.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(log_group, filter) ⇒ MetricFilter
constructor
A new instance of MetricFilter.
Constructor Details
#initialize(log_group, filter) ⇒ MetricFilter
Returns a new instance of MetricFilter.
16 17 18 19 20 21 22 23 24 |
# File 'lib/cfnguardian/models/metric_filter.rb', line 16 def initialize(log_group,filter) @type = 'MetricFilter' @name = Digest::MD5.hexdigest(log_group + filter['MetricName']) @log_group = log_group @pattern = filter['Pattern'] @metric_value = filter.fetch('MetricValue', '1').to_s @metric_name = filter['MetricName'] @metric_namespace = "MetricFilters" end |
Instance Attribute Details
#log_group ⇒ Object
Returns the value of attribute log_group.
11 12 13 |
# File 'lib/cfnguardian/models/metric_filter.rb', line 11 def log_group @log_group end |
#metric_name ⇒ Object
Returns the value of attribute metric_name.
11 12 13 |
# File 'lib/cfnguardian/models/metric_filter.rb', line 11 def metric_name @metric_name end |
#metric_namespace ⇒ Object (readonly)
Returns the value of attribute metric_namespace.
8 9 10 |
# File 'lib/cfnguardian/models/metric_filter.rb', line 8 def metric_namespace @metric_namespace end |
#metric_value ⇒ Object
Returns the value of attribute metric_value.
11 12 13 |
# File 'lib/cfnguardian/models/metric_filter.rb', line 11 def metric_value @metric_value end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/cfnguardian/models/metric_filter.rb', line 8 def name @name end |
#pattern ⇒ Object
Returns the value of attribute pattern.
11 12 13 |
# File 'lib/cfnguardian/models/metric_filter.rb', line 11 def pattern @pattern end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/cfnguardian/models/metric_filter.rb', line 8 def type @type end |