mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
Adding list_zones call to OpenStack
This commit is contained in:
parent
d74db05b2d
commit
da2bb5c702
2 changed files with 35 additions and 0 deletions
|
@ -189,6 +189,9 @@ module Fog
|
|||
request :list_hosts
|
||||
request :get_host_details
|
||||
|
||||
# Zones
|
||||
request :list_zones
|
||||
|
||||
class Mock
|
||||
attr_reader :auth_token
|
||||
attr_reader :auth_token_expiration
|
||||
|
|
32
lib/fog/openstack/requests/compute/list_zones.rb
Normal file
32
lib/fog/openstack/requests/compute/list_zones.rb
Normal file
|
@ -0,0 +1,32 @@
|
|||
module Fog
|
||||
module Compute
|
||||
class OpenStack
|
||||
class Real
|
||||
def list_zones(*args)
|
||||
request(
|
||||
:expects => 200,
|
||||
:method => 'GET',
|
||||
:path => 'os-availability-zone.json'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
class Mock
|
||||
def list_zones(*args)
|
||||
Excon::Response.new(
|
||||
:body => { "availabilityZoneInfo" => [
|
||||
{
|
||||
"zoneState" => {
|
||||
"available" => true
|
||||
},
|
||||
"hosts" => nil,
|
||||
"zoneName" => "nova"
|
||||
}
|
||||
] },
|
||||
:status => 200
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue