Class: Fog::OpenStack::Metric::Resources

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/openstack/metric/models/resources.rb

Instance Attribute Summary

Attributes inherited from Collection

#response

Instance Method Summary collapse

Methods inherited from Collection

#destroy, #get, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object



11
12
13
# File 'lib/fog/openstack/metric/models/resources.rb', line 11

def all(options = {})
  load_response(service.list_resources(options))
end

#find_by_id(resource_id) ⇒ Object



15
16
17
18
19
20
# File 'lib/fog/openstack/metric/models/resources.rb', line 15

def find_by_id(resource_id)
  resource = service.get_resource(resource_id).body
  new(resource)
rescue Fog::OpenStack::Metric::NotFound
  nil
end