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

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



10
11
12
# File 'lib/fog/metering/openstack/models/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/metering/openstack/models/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