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