mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Merge pull request #3823 from rroa/bugfix/do_regions_filters
[DigitalOcean] Added filtering capabilities to regions request.
This commit is contained in:
commit
740245d6cc
3 changed files with 6 additions and 5 deletions
|
@ -894,3 +894,4 @@
|
|||
* Ørjan Blom <blom@blom.tv>
|
||||
* Обоев Рулон ибн Хаттаб <me@nomadrain.com>
|
||||
* 应俊 <yj2317916@gmail.com>
|
||||
* Raul Roa <raulroa@playfulcorp.com>
|
||||
|
|
|
@ -12,7 +12,7 @@ module Fog
|
|||
# @raise [Fog::Compute::DigitalOceanV2::ServiceError]
|
||||
# @see https://developers.digitalocean.com/documentation/v2/#list-all-regions
|
||||
def all(filters = {})
|
||||
data = service.list_regions.body["regions"]
|
||||
data = service.list_regions(filters).body["regions"]
|
||||
load(data)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,18 +2,18 @@ module Fog
|
|||
module Compute
|
||||
class DigitalOceanV2
|
||||
class Real
|
||||
def list_regions
|
||||
def list_regions(filters = {})
|
||||
request(
|
||||
:expects => [200],
|
||||
:method => 'GET',
|
||||
:path => '/v2/regions'
|
||||
:path => "/v2/regions?#{filters.to_a.map { |x| "#{x[0]}=#{x[1]}" }.join("&")}"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
# noinspection RubyStringKeysInHashInspection
|
||||
class Mock
|
||||
def list_regions
|
||||
def list_regions(filters = {})
|
||||
response = Excon::Response.new
|
||||
response.status = 200
|
||||
response.body = {
|
||||
|
|
Loading…
Add table
Reference in a new issue