2011-01-24 20:30:57 -05:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/dns/models/bluebox/record'
|
|
|
|
|
|
|
|
module Fog
|
2011-06-15 20:25:01 -04:00
|
|
|
module DNS
|
|
|
|
class Bluebox
|
2011-01-24 20:30:57 -05:00
|
|
|
|
|
|
|
class Records < Fog::Collection
|
|
|
|
|
|
|
|
attribute :zone
|
|
|
|
|
2011-06-15 20:25:01 -04:00
|
|
|
model Fog::DNS::Bluebox::Record
|
2011-01-24 20:30:57 -05:00
|
|
|
|
|
|
|
def all
|
|
|
|
requires :zone
|
|
|
|
data = connection.get_records(zone.identity).body['records']
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(record_id)
|
|
|
|
data = connection.get_record(zone.identity, record_id).body
|
|
|
|
new(data)
|
|
|
|
rescue Fog::Service::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
def new(attributes = {})
|
|
|
|
requires :zone
|
|
|
|
super({ :zone => zone }.merge!(attributes))
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|