2010-12-23 16:47:47 -08:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 19:50:12 -05:00
|
|
|
require 'fog/linode/models/dns/zone'
|
2010-12-23 16:47:47 -08:00
|
|
|
|
|
|
|
module Fog
|
2011-06-15 17:25:01 -07:00
|
|
|
module DNS
|
|
|
|
class Linode
|
2010-12-23 16:47:47 -08:00
|
|
|
|
|
|
|
class Zones < Fog::Collection
|
|
|
|
|
2011-06-15 17:25:01 -07:00
|
|
|
model Fog::DNS::Linode::Zone
|
2010-12-23 16:47:47 -08:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = connection.domain_list.body['DATA']
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(zone_id)
|
2011-01-03 15:39:38 -08:00
|
|
|
if data = connection.domain_list(zone_id).body['DATA'].first
|
|
|
|
new(data)
|
|
|
|
else
|
|
|
|
nil
|
|
|
|
end
|
2010-12-23 16:47:47 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|