2014-01-21 14:39:48 -05:00
|
|
|
require 'fog/core/model'
|
|
|
|
require 'fog/rage4/models/dns/records'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module DNS
|
|
|
|
class Rage4
|
|
|
|
class Zone < Fog::Model
|
|
|
|
identity :id
|
|
|
|
|
|
|
|
attribute :domain, :aliases => 'name'
|
|
|
|
|
|
|
|
def destroy
|
2014-02-04 20:10:48 -05:00
|
|
|
service.delete_domain(id)
|
2014-01-21 14:39:48 -05:00
|
|
|
true
|
|
|
|
end
|
|
|
|
|
|
|
|
def records
|
|
|
|
@records ||= begin
|
|
|
|
Fog::DNS::Rage4::Records.new(
|
2014-01-23 16:27:04 -05:00
|
|
|
:zone => self,
|
2014-01-21 14:39:48 -05:00
|
|
|
:service => service
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def nameservers
|
|
|
|
[
|
|
|
|
"ns1.r4ns.com",
|
|
|
|
"ns2.r4ns.com",
|
|
|
|
]
|
|
|
|
end
|
|
|
|
|
|
|
|
def save
|
|
|
|
requires :domain
|
2014-01-23 16:27:04 -05:00
|
|
|
data = service.create_domain(domain).body["id"]
|
2014-01-21 14:39:48 -05:00
|
|
|
merge_attributes(data)
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|