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

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



10
11
12
# File 'lib/fog/openstack/metering/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/openstack/metering/models/resources.rb', line 14

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