Class: Fog::AWS::CloudWatch::Alarm
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::CloudWatch::Alarm
- Defined in:
- lib/fog/aws/models/cloud_watch/alarm.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ Alarm
constructor
A new instance of Alarm.
- #save ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Alarm
Returns a new instance of Alarm.
28 29 30 31 32 |
# File 'lib/fog/aws/models/cloud_watch/alarm.rb', line 28 def initialize(attributes) self.namespace ||= "AWS/EC2" self.evaluation_periods ||= 1 super end |
Instance Method Details
#destroy ⇒ Object
52 53 54 55 |
# File 'lib/fog/aws/models/cloud_watch/alarm.rb', line 52 def destroy requires :id service.delete_alarms(id) end |
#save ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/fog/aws/models/cloud_watch/alarm.rb', line 34 def save requires :id requires :comparison_operator requires :metric_name requires :period requires :statistic requires :threshold requires :namespace requires :evaluation_periods = Hash[self.class.aliases.map { |key, value| [key, send(value)] }] .delete_if { |key, value| value.nil? } service.put_metric_alarm() reload end |