1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Merge pull request #1845 from cloudbau/volume_filters

Pass on filters to volume endpoint
This commit is contained in:
Dan Prince 2013-10-01 03:48:52 -07:00
commit 96d63790f7
2 changed files with 9 additions and 6 deletions

View file

@ -8,8 +8,11 @@ module Fog
class Volumes < Fog::Collection
model Fog::Volume::OpenStack::Volume
def all(detailed=true)
load(service.list_volumes(detailed).body['volumes'])
def all(options = {:detailed => true})
# the parameter has been "detailed = true" before. Make sure we are
# backwards compatible
detailed = options.is_a?(Hash) ? options.delete(:detailed) : options
load(service.list_volumes(detailed, options).body['volumes'])
end
def get(volume_id)

View file

@ -3,13 +3,13 @@ module Fog
class OpenStack
class Real
def list_volumes(detailed=true)
def list_volumes(detailed=true, options={})
path = detailed ? 'volumes/detail' : 'volumes'
request(
:expects => 200,
:method => 'GET',
:path => path
:path => path,
:query => options
)
end
@ -17,7 +17,7 @@ module Fog
class Mock
def list_volumes(detailed=true)
def list_volumes(detailed=true, options={})
response = Excon::Response.new
response.status = 200
self.data[:volumes] ||= [