Class: AWS::Route53::HostedZone

Inherits:
Core::Resource
  • Object
show all
Defined in:
lib/aws/route_53/hosted_zone.rb

Overview

Delete existing hosted zone

hosted_zone = AWS::Route53::HostedZone.new(hosted_zone_id)
hosted_zone.delete

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#caller_referenceString (readonly)

Returns the current value of caller_reference.

Returns:

  • (String)

    the current value of caller_reference



31
32
33
# File 'lib/aws/route_53/hosted_zone.rb', line 31

def caller_reference
  @caller_reference
end

#change_infoChangeInfo (readonly)

Returns Change info for the newly created HostedZone instance.

Returns:

  • (ChangeInfo)

    Change info for the newly created HostedZone instance.



45
46
47
# File 'lib/aws/route_53/hosted_zone.rb', line 45

def change_info
  @change_info
end

#delegation_setArray<String> (readonly)

Returns the current value of delegation_set.

Returns:

  • (Array<String>)

    the current value of delegation_set



31
32
33
# File 'lib/aws/route_53/hosted_zone.rb', line 31

def delegation_set
  @delegation_set
end

#idString (readonly)

Returns The hosted zone ID.

Returns:

  • (String)

    The hosted zone ID.



41
42
43
# File 'lib/aws/route_53/hosted_zone.rb', line 41

def id
  @id
end

#nameString (readonly)

The hosted zone name.

Returns:

  • (String)

    the current value of name



31
32
33
# File 'lib/aws/route_53/hosted_zone.rb', line 31

def name
  @name
end

#resource_record_set_countInteger (readonly)

The resource record set count.

Returns:

  • (Integer)

    the current value of resource_record_set_count



31
32
33
# File 'lib/aws/route_53/hosted_zone.rb', line 31

def resource_record_set_count
  @resource_record_set_count
end

Instance Method Details

#deleteChangeInfo

Deletes the hosted zone.

Returns:



77
78
79
80
81
82
83
84
85
# File 'lib/aws/route_53/hosted_zone.rb', line 77

def delete
  resp = client.delete_hosted_zone(:id => id)
  if resp[:change_info][:id]
    ChangeInfo.new_from(:delete_hosted_zone,
                        resp[:change_info],
                        resp[:change_info][:id],
                        :config => config)
  end
end

#exists?Boolean

Returns true if this hosted zone exists.

Returns:

  • (Boolean)

    Returns true if this hosted zone exists.



88
89
90
# File 'lib/aws/route_53/hosted_zone.rb', line 88

def exists?
  get_resource.data[:hosted_zone][:id] == path
end

#pathString

The Hosted zone path.

Returns:

  • (String)


49
50
51
# File 'lib/aws/route_53/hosted_zone.rb', line 49

def path
  "/hostedzone/#{id}"
end

#resource_record_setsResourceRecordSetCollection Also known as: rrsets

Returns resource record sets.



94
95
96
# File 'lib/aws/route_53/hosted_zone.rb', line 94

def resource_record_sets
  ResourceRecordSetCollection.new(id, :config => config)
end