1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/rackspace/models/monitoring/notifications.rb
2013-09-10 10:03:33 -05:00

30 lines
671 B
Ruby

require 'fog/core/collection'
require 'fog/rackspace/models/monitoring/notification'
module Fog
module Rackspace
class Monitoring
class Notifications < Fog::Collection
model Fog::Rackspace::Monitoring::Notification
attribute :marker
def all(options={})
data = service.list_notifications(options).body
marker = data['metadata']['next_marker']
load(data['values'])
end
def get(notification_id)
data = service.get_notification(notification_id).body
new(data)
rescue Fog::Rackspace::Monitoring::NotFound
nil
end
end
end
end
end