Class: AwsAlertMonitor::Events::CloudWatchAlarm

Inherits:
AwsAlertMonitor::Event show all
Defined in:
lib/aws-alert-monitor/events/cloud_watch_alarm.rb

Instance Attribute Summary

Attributes inherited from AwsAlertMonitor::Event

#message_data, #raw_data

Instance Method Summary collapse

Methods inherited from AwsAlertMonitor::Event

#initialize

Constructor Details

This class inherits a constructor from AwsAlertMonitor::Event

Instance Method Details

#bodyObject



6
7
8
9
10
# File 'lib/aws-alert-monitor/events/cloud_watch_alarm.rb', line 6

def body
  message = "received an alert: \n\n #{alarm_description} \n\n"
  message << " #{alarm_new_state_reason} \n\n"
  message << " At #{alarm_state_change_time}"
end

#subjectObject



12
13
14
# File 'lib/aws-alert-monitor/events/cloud_watch_alarm.rb', line 12

def subject
  "Alert: #{alarm_name}"
end

#typeObject



16
17
18
# File 'lib/aws-alert-monitor/events/cloud_watch_alarm.rb', line 16

def type
  "cloudwatch:#{metric_namespace}-#{metric_name}"
end