You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.
Class: AWS::Route53::ResourceRecordSet
- Inherits:
-
Core::Resource
- Object
- Core::Resource
- AWS::Route53::ResourceRecordSet
- Defined in:
- lib/aws/route_53/resource_record_set.rb
Overview
Modify resource record set
rrsets = AWS::Route53::HostedZone.new(hosted_zone_id).rrsets
rrset = rrsets['foo.example.com.', 'A']
rrset.ttl = 3600
rrset.update
Delete existing resource record set
rrsets = AWS::Route53::HostedZone.new(hosted_zone_id).rrsets
rrset = rrsets['foo.example.com.', 'A']
rrset.delete
Instance Attribute Summary collapse
-
#alias_target ⇒ Hash
The current value of alias_target.
-
#change_info ⇒ ChangeInfo
readonly
-
#hosted_zone_id ⇒ String
readonly
The hosted zone ID.
-
#name ⇒ String
Name.
-
#region ⇒ String
The current value of region.
-
#resource_records ⇒ Array<Hash>
The current value of resource_records.
-
#set_identifier ⇒ String
(also: #identifier)
-
#ttl ⇒ Integer
The current value of ttl.
-
#type ⇒ String
-
#weight ⇒ Integer
The current value of weight.
Instance Method Summary collapse
-
#delete(options = {}) ⇒ ChangeInfo
Delete resource record set.
-
#exists? ⇒ Boolean
Returns
true
if this rrset exists. -
#failover=(new_failover) ⇒ Object
-
#geo_location=(new_geo_location) ⇒ Object
-
#health_check_id=(new_health_check_id) ⇒ Object
-
#new_change_batch(options = {}) ⇒ ChangeBatch
Return a new change batch for this hosted zone.
-
#new_create_request ⇒ CreateRequest
Return the create request that #update would include in its change batch.
-
#new_delete_request ⇒ DeleteRequest
Return a delete request that would delete this resource record set.
-
#update(options = {}) ⇒ ResourceRecordSet
Update values of resource record set.
Instance Attribute Details
#alias_target ⇒ Hash
Returns the current value of alias_target
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def alias_target @alias_target end |
#change_info ⇒ ChangeInfo (readonly)
57 58 59 |
# File 'lib/aws/route_53/resource_record_set.rb', line 57 def change_info @change_info end |
#hosted_zone_id ⇒ String (readonly)
Returns The hosted zone ID.
54 55 56 |
# File 'lib/aws/route_53/resource_record_set.rb', line 54 def hosted_zone_id @hosted_zone_id end |
#name ⇒ String
Returns name
60 61 62 |
# File 'lib/aws/route_53/resource_record_set.rb', line 60 def name @name end |
#region ⇒ String
Returns the current value of region
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def region @region end |
#resource_records ⇒ Array<Hash>
Returns the current value of resource_records
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def resource_records @resource_records end |
#set_identifier ⇒ String Also known as: identifier
78 79 80 |
# File 'lib/aws/route_53/resource_record_set.rb', line 78 def set_identifier @set_identifier end |
#ttl ⇒ Integer
Returns the current value of ttl
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def ttl @ttl end |
#type ⇒ String
69 70 71 |
# File 'lib/aws/route_53/resource_record_set.rb', line 69 def type @type end |
#weight ⇒ Integer
Returns the current value of weight
40 41 42 |
# File 'lib/aws/route_53/resource_record_set.rb', line 40 def weight @weight end |
Instance Method Details
#delete(options = {}) ⇒ ChangeInfo
Delete resource record set.
190 191 192 193 194 195 |
# File 'lib/aws/route_53/resource_record_set.rb', line 190 def delete = {} batch = new_change_batch() batch << new_delete_request change_info = batch.call() end |
#exists? ⇒ Boolean
Returns true
if this rrset exists.
159 160 161 162 163 164 165 166 167 |
# File 'lib/aws/route_53/resource_record_set.rb', line 159 def exists? !get_resource.data[:resource_record_sets].find { |details| if set_identifier details[:name] == name and details[:type] == type and details[:set_identifier] == set_identifier else details[:name] == name and details[:type] == type end }.nil? end |
#failover=(new_failover) ⇒ Object
130 131 132 |
# File 'lib/aws/route_53/resource_record_set.rb', line 130 def failover= new_failover @create_options[:failover] = new_failover end |
#geo_location=(new_geo_location) ⇒ Object
124 125 126 |
# File 'lib/aws/route_53/resource_record_set.rb', line 124 def geo_location= new_geo_location @create_options[:geo_location] = new_geo_location end |
#health_check_id=(new_health_check_id) ⇒ Object
136 137 138 |
# File 'lib/aws/route_53/resource_record_set.rb', line 136 def health_check_id= new_health_check_id @create_options[:health_check_id] = new_health_check_id end |
#new_change_batch(options = {}) ⇒ ChangeBatch
Return a new change batch for this hosted zone.
200 201 202 |
# File 'lib/aws/route_53/resource_record_set.rb', line 200 def new_change_batch = {} ChangeBatch.new(hosted_zone_id, .merge(:config => config)) end |
#new_create_request ⇒ CreateRequest
Return the create request that #update would include in its change batch. Note that #update also includes a delete request.
207 208 209 210 211 |
# File 'lib/aws/route_53/resource_record_set.rb', line 207 def new_create_request = .merge(@create_options) CreateRequest.new([:name], [:type], ) end |
#new_delete_request ⇒ DeleteRequest
Return a delete request that would delete this resource record set.
215 216 217 218 |
# File 'lib/aws/route_53/resource_record_set.rb', line 215 def new_delete_request = DeleteRequest.new([:name], [:type], ) end |
#update(options = {}) ⇒ ResourceRecordSet
Update values of resource record set.
172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/aws/route_53/resource_record_set.rb', line 172 def update = {} batch = new_change_batch() AWS.memoize do batch << new_delete_request batch << new_create_request end @change_info = batch.call() @name = @create_options[:name] || @name @type = @create_options[:type] || @type @set_identifier = @create_options[:set_identifier] || @set_identifier @create_options = {} self end |