2010-12-12 09:51:52 -05:00
|
|
|
module Fog
|
2011-06-15 20:25:01 -04:00
|
|
|
module DNS
|
|
|
|
class Zerigo
|
2010-12-12 09:51:52 -05:00
|
|
|
class Real
|
|
|
|
|
2011-08-24 15:40:47 -04:00
|
|
|
require 'fog/zerigo/parsers/dns/count_zones'
|
2010-12-12 09:51:52 -05:00
|
|
|
|
2010-12-12 18:02:02 -05:00
|
|
|
# Total number of zones hosted Zerigo for this account. It is the same value as provided
|
|
|
|
# in the X-Query-Count header in the list_zones API method
|
2010-12-12 09:51:52 -05:00
|
|
|
#
|
|
|
|
# ==== Returns
|
|
|
|
# * response<~Excon::Response>:
|
2010-12-13 07:38:06 -05:00
|
|
|
# * body<~Hash>
|
|
|
|
# * 'count'<~Integer>
|
2010-12-13 08:51:04 -05:00
|
|
|
# * 'status'<~Integer> - 200 indicates success
|
2011-10-08 20:19:32 -04:00
|
|
|
def count_zones
|
2010-12-12 09:51:52 -05:00
|
|
|
request(
|
|
|
|
:expects => 200,
|
|
|
|
:method => 'GET',
|
2011-06-15 20:25:01 -04:00
|
|
|
:parser => Fog::Parsers::DNS::Zerigo::CountZones.new,
|
2010-12-12 18:02:02 -05:00
|
|
|
:path => "/api/1.1/zones/count.xml"
|
2010-12-12 09:51:52 -05:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
2011-10-08 20:19:32 -04:00
|
|
|
|
|
|
|
class Mock # :nodoc:all
|
|
|
|
def count_zones
|
|
|
|
response = Excon::Response.new
|
|
|
|
|
|
|
|
response.status = 200
|
|
|
|
response.body = { 'count' => self.data[:zones].size }
|
|
|
|
|
|
|
|
response
|
|
|
|
end
|
|
|
|
end
|
2010-12-12 09:51:52 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|