Class: Fog::OpenStack::Monitoring::Alarms
- Inherits:
-
Collection
- Object
- Collection
- Collection
- Fog::OpenStack::Monitoring::Alarms
show all
- Defined in:
- lib/fog/openstack/monitoring/models/alarms.rb
Instance Attribute Summary
Attributes inherited from Collection
#response
Instance Method Summary
collapse
Methods inherited from Collection
#get, #load_response, #summary
Instance Method Details
#all(options = {}) ⇒ Object
10
11
12
|
# File 'lib/fog/openstack/monitoring/models/alarms.rb', line 10
def all(options = {})
load_response(service.list_alarms(options), 'elements')
end
|
#destroy(id) ⇒ Object
23
24
25
26
|
# File 'lib/fog/openstack/monitoring/models/alarms.rb', line 23
def destroy(id)
alarm = find_by_id(id)
alarm.destroy
end
|
#find_by_id(id) ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/fog/openstack/monitoring/models/alarms.rb', line 14
def find_by_id(id)
cached_alarm = detect { |alarm| alarm.id == id }
return cached_alarm if cached_alarm
alarm_hash = service.get_alarm(id).body
Fog::OpenStack::Monitoring::Alarm.new(
alarm_hash.merge(:service => service)
)
end
|