Class: Fog::DNS::AWS::Zone

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/aws/models/dns/zone.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



16
17
18
19
20
# File 'lib/fog/aws/models/dns/zone.rb', line 16

def destroy
  requires :identity
  service.delete_hosted_zone(identity)
  true
end

#recordsObject



22
23
24
25
26
27
28
29
# File 'lib/fog/aws/models/dns/zone.rb', line 22

def records
  @records ||= begin
    Fog::DNS::AWS::Records.new(
      :zone       => self,
      :service => service
    )
  end
end

#saveObject



31
32
33
34
35
36
37
38
39
# File 'lib/fog/aws/models/dns/zone.rb', line 31

def save
  requires :domain
  options = {}
  options[:caller_ref]  = caller_reference if caller_reference
  options[:comment]     = description if description
  data = service.create_hosted_zone(domain, options).body
  merge_attributes(data)
  true
end