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:
commit
96d63790f7
2 changed files with 9 additions and 6 deletions
|
@ -8,8 +8,11 @@ module Fog
|
||||||
class Volumes < Fog::Collection
|
class Volumes < Fog::Collection
|
||||||
model Fog::Volume::OpenStack::Volume
|
model Fog::Volume::OpenStack::Volume
|
||||||
|
|
||||||
def all(detailed=true)
|
def all(options = {:detailed => true})
|
||||||
load(service.list_volumes(detailed).body['volumes'])
|
# 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
|
end
|
||||||
|
|
||||||
def get(volume_id)
|
def get(volume_id)
|
||||||
|
|
|
@ -3,13 +3,13 @@ module Fog
|
||||||
class OpenStack
|
class OpenStack
|
||||||
class Real
|
class Real
|
||||||
|
|
||||||
def list_volumes(detailed=true)
|
def list_volumes(detailed=true, options={})
|
||||||
|
|
||||||
path = detailed ? 'volumes/detail' : 'volumes'
|
path = detailed ? 'volumes/detail' : 'volumes'
|
||||||
request(
|
request(
|
||||||
:expects => 200,
|
:expects => 200,
|
||||||
:method => 'GET',
|
:method => 'GET',
|
||||||
:path => path
|
:path => path,
|
||||||
|
:query => options
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ module Fog
|
||||||
|
|
||||||
class Mock
|
class Mock
|
||||||
|
|
||||||
def list_volumes(detailed=true)
|
def list_volumes(detailed=true, options={})
|
||||||
response = Excon::Response.new
|
response = Excon::Response.new
|
||||||
response.status = 200
|
response.status = 200
|
||||||
self.data[:volumes] ||= [
|
self.data[:volumes] ||= [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue