Class: Fog::Volume::OpenStack::Volumes
- Inherits:
-
OpenStack::Collection
- Object
- Collection
- OpenStack::Collection
- Fog::Volume::OpenStack::Volumes
- Defined in:
- lib/fog/openstack/models/volume/volumes.rb
Instance Attribute Summary
Attributes inherited from OpenStack::Collection
Instance Method Summary collapse
Methods inherited from OpenStack::Collection
Instance Method Details
#all(options = {}) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fog/openstack/models/volume/volumes.rb', line 10 def all( = {}) # the parameter has been "detailed = true" before. Make sure we are # backwards compatible detailed = .is_a?(Hash) ? .delete(:detailed) : if detailed.nil? || detailed # This method gives details by default, unless false or {:detailed => false} is passed load_response(service.list_volumes_detailed(), 'volumes') else Fog::Logger.deprecation('Calling OpenStack[:volume].volumes.all(false) or volumes.all(:detailed => false) '\ ' is deprecated, call .volumes.summary instead') load_response(service.list_volumes(), 'volumes') end end |
#get(volume_id) ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/fog/openstack/models/volume/volumes.rb', line 28 def get(volume_id) if volume = service.get_volume_details(volume_id).body['volume'] new(volume) end rescue Fog::Volume::OpenStack::NotFound nil end |
#summary(options = {}) ⇒ Object
24 25 26 |
# File 'lib/fog/openstack/models/volume/volumes.rb', line 24 def summary( = {}) load_response(service.list_volumes(), 'volumes') end |