2011-01-24 20:30:57 -05:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 20:58:47 -04:00
|
|
|
require 'fog/bluebox/models/dns/zone'
|
2011-01-24 20:30:57 -05:00
|
|
|
|
|
|
|
module Fog
|
2011-06-15 20:25:01 -04:00
|
|
|
module DNS
|
|
|
|
class Bluebox
|
2011-01-24 20:30:57 -05:00
|
|
|
|
|
|
|
class Zones < Fog::Collection
|
|
|
|
|
2011-06-15 20:25:01 -04:00
|
|
|
model Fog::DNS::Bluebox::Zone
|
2011-01-24 20:30:57 -05:00
|
|
|
|
|
|
|
def all
|
2012-12-22 18:29:33 -05:00
|
|
|
data = service.get_zones.body['zones']
|
2011-01-24 20:30:57 -05:00
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(zone_id)
|
2012-12-22 18:29:33 -05:00
|
|
|
data = service.get_zone(zone_id).body
|
2011-01-24 20:30:57 -05:00
|
|
|
new(data)
|
|
|
|
rescue Fog::Service::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|