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

Pass on filters to volume endpoint, mainly to allow admin to get volumes from all tenants.

This commit is contained in:
Thomas Kadauke 2013-05-30 17:16:13 +02:00
parent c716044ed3
commit b45e0508c7
2 changed files with 7 additions and 6 deletions

View file

@ -8,8 +8,9 @@ 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 = true)
detailed = options.is_a?(Hash) ? options.delete(:detailed) : options
load(service.list_volumes(detailed, options).body['volumes'])
end
def find_by_id(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] ||= [