mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[dns|rackspace] list_domains request
This commit is contained in:
parent
cc40adc46b
commit
d6d9840dd8
3 changed files with 55 additions and 0 deletions
|
@ -17,6 +17,10 @@ module Fog
|
|||
#collection :zones
|
||||
|
||||
request_path 'fog/dns/requests/rackspace'
|
||||
request :list_domains
|
||||
|
||||
class Mock
|
||||
end
|
||||
|
||||
class Real
|
||||
def initialize(options={})
|
||||
|
|
15
lib/fog/dns/requests/rackspace/list_domains.rb
Normal file
15
lib/fog/dns/requests/rackspace/list_domains.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
module Fog
|
||||
module DNS
|
||||
class Rackspace
|
||||
class Real
|
||||
def list_domains(options={})
|
||||
request(
|
||||
:expects => 200,
|
||||
:method => 'GET',
|
||||
:path => 'domains'
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
36
tests/dns/requests/rackspace/dns_tests.rb
Normal file
36
tests/dns/requests/rackspace/dns_tests.rb
Normal file
|
@ -0,0 +1,36 @@
|
|||
Shindo.tests('Fog::DNS[:rackspace] | DNS requests', ['rackspace', 'dns']) do
|
||||
|
||||
@domain = ''
|
||||
@new_zones = []
|
||||
@new_records =[]
|
||||
|
||||
@service = Fog::DNS[:rackspace]
|
||||
|
||||
LIST_DOMAIN_FORMAT = {
|
||||
'domains' => [
|
||||
{
|
||||
'name' => String,
|
||||
'id' => Integer,
|
||||
'accountId' => Integer,
|
||||
'updated' => String,
|
||||
'created' => String
|
||||
}
|
||||
],
|
||||
'totalEntries' => Integer,
|
||||
'links' => [
|
||||
{
|
||||
'rel' => String,
|
||||
'href' => String
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
tests( 'success') do
|
||||
tests('list_domains').formats(LIST_DOMAIN_FORMAT) do
|
||||
@service.list_domains.body
|
||||
end
|
||||
end
|
||||
|
||||
tests( 'failure') do
|
||||
end
|
||||
end
|
Loading…
Add table
Reference in a new issue