Skip to content

Instantly share code, notes, and snippets.

@elight
Created December 16, 2013 22:02
Show Gist options
  • Save elight/7995258 to your computer and use it in GitHub Desktop.
Save elight/7995258 to your computer and use it in GitHub Desktop.
require 'fog/core/collection'
require 'fog/rackspace/models/monitoring/entity'
require 'fog/rackspace/models/monitoring/check'
module Fog
module Rackspace
class Monitoring
class Entities < Fog::Collection
model Fog::Rackspace::Monitoring::Entity
attribute :marker
def all(options={})
data = service.list_entities(options).body
marker = data['metadata']['next_marker']
load(data['values'])
end
def get(entity_id)
data = service.get_entity(entity_id).body
new(data)
rescue Fog::Rackspace::Monitoring::NotFound
nil
end
def overview(options={})
body = service.list_overview(options).body
marker = body['metadata']['next_marker']
load_all(body['values'])
end
@elight
Copy link
Author

elight commented Dec 16, 2013

https://gist.github.com/elight/7995258#file-entities-rb-L15-L16

Shouldn't that be: self.marker? Otherwise marker is a local var.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment