class Fog::DNS::Rackspace::Zone

Public Instance Methods

destroy() click to toggle source
# File lib/fog/rackspace/models/dns/zone.rb, line 22
def destroy
  response = connection.remove_domain(identity)
  wait_for_job response.body['jobId'], Fog.timeout
  true
end
records() click to toggle source
# File lib/fog/rackspace/models/dns/zone.rb, line 28
def records
  @records ||= begin
    Fog::DNS::Rackspace::Records.new(
      :zone       => self,
      :connection => connection
    )
  end
end
save() click to toggle source
# File lib/fog/rackspace/models/dns/zone.rb, line 37
def save
  if identity
    update
  else
    create
  end
  true
end

Private Instance Methods

create() click to toggle source
# File lib/fog/rackspace/models/dns/zone.rb, line 48
def create
  requires :domain, :email

  data = { :name => domain, :email => email }
  response = connection.create_domains([data])

  response = wait_for_job response.body['jobId']
  merge_attributes(response.body['response']['domains'].select {|domain| domain['name'] == self.domain}.first)
end
update() click to toggle source
# File lib/fog/rackspace/models/dns/zone.rb, line 58
def update
  requires :ttl, :email

  response = connection.modify_domain(identity, { :ttl => ttl, :comment => comment, :email => email})
  wait_for_job response.body['jobId']
end