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

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

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

#destroy, #get, #load_response, #summary

Instance Method Details

#all(options = {}) ⇒ Object



11
12
13
# File 'lib/fog/metric/openstack/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/metric/openstack/models/resources.rb', line 15

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