# File lib/fog/aws/models/dns/record.rb, line 24 def initialize(attributes={}) super end
# File lib/fog/aws/models/dns/record.rb, line 28 def destroy options = attributes_to_options('DELETE') service.change_resource_record_sets(zone.id, [options]) true end
# File lib/fog/aws/models/dns/record.rb, line 48 def modify(new_attributes) options = [] # Delete the current attributes options << attributes_to_options('DELETE') # Create the new attributes merge_attributes(new_attributes) options << attributes_to_options('CREATE') data = service.change_resource_record_sets(zone.id, options).body merge_attributes(data) true end
Returns true if record is insync. May only be called for newly created or modified records that have a change_id and status set.
# File lib/fog/aws/models/dns/record.rb, line 65 def ready? requires :change_id, :status status == 'INSYNC' end
# File lib/fog/aws/models/dns/record.rb, line 70 def reload # If we have a change_id (newly created or modified), then reload performs a get_change to update status. if change_id data = service.get_change(change_id).body merge_attributes(data) self else super end end
# File lib/fog/aws/models/dns/record.rb, line 38 def save unless self.alias_target self.ttl ||= 3600 end options = attributes_to_options('CREATE') data = service.change_resource_record_sets(zone.id, [options]).body merge_attributes(data) true end
# File lib/fog/aws/models/dns/record.rb, line 34 def zone @zone end
# File lib/fog/aws/models/dns/record.rb, line 87 def attributes_to_options(action) requires :name, :type, :zone requires_one :value, :alias_target options = { :action => action, :name => name, :resource_records => [*value], :alias_target => symbolize_keys(alias_target), :ttl => ttl, :type => type, :weight => weight, :set_identifier => set_identifier, :region => region } unless self.alias_target requires :ttl options[:ttl] = ttl end options end
# File lib/fog/aws/models/dns/record.rb, line 83 def zone=(new_zone) @zone = new_zone end