Module: Fog::Volume::OpenStack::Volumes
- Defined in:
- lib/fog/openstack/models/volume/volumes.rb
Instance Method Summary collapse
Instance Method Details
#all(options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/fog/openstack/models/volume/volumes.rb', line 7 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
25 26 27 28 29 30 31 |
# File 'lib/fog/openstack/models/volume/volumes.rb', line 25 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
21 22 23 |
# File 'lib/fog/openstack/models/volume/volumes.rb', line 21 def summary( = {}) load_response(service.list_volumes(), 'volumes') end |