Class: Fog::Metering::OpenStack::Resources

Inherits:
OpenStack::Collection show all
Defined in:
lib/fog/openstack/models/metering/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(detailed = true) ⇒ Object



10
11
12
# File 'lib/fog/openstack/models/metering/resources.rb', line 10

def all(detailed=true)
  load_response(service.list_resources)
end

#find_by_id(resource_id) ⇒ Object



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

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