class Fog::DNS::Google::Record
Resource Record Sets resource
Public Instance Methods
destroy(async = true)
click to toggle source
Deletes a previously created Resource Record Sets resource
@param [Boolean] async If the operation must be asyncronous (true by default) @return [Boolean] If the Resource Record Set has been deleted
# File lib/fog/google/models/dns/record.rb, line 23 def destroy(async = true) requires :name, :type, :ttl, :rrdatas data = service.create_change(self.zone.id, [], [resource_record_set_format]) change = Fog::DNS::Google::Changes.new(:service => service, :zone => zone).get(data.body['id']) unless async change.wait_for { ready? } end true end
modify(new_attributes)
click to toggle source
Modifies a previously created Resource Record Sets resource
@param [Hash] new_attributes Resource Record Set new attributes @return [Fog::DNS::Google::Record] Resource Record Sets resource
# File lib/fog/google/models/dns/record.rb, line 39 def modify(new_attributes) requires :name, :type, :ttl, :rrdatas deletions = resource_record_set_format merge_attributes(new_attributes) data = service.create_change(self.zone.id, [resource_record_set_format], [deletions]) change = Fog::DNS::Google::Changes.new(:service => service, :zone => zone).get(data.body['id']) async = new_attributes.has_key?(:async) ? new_attributes[:async] : true unless async change.wait_for { ready? } end self end
reload()
click to toggle source
save()
click to toggle source
Creates a new Resource Record Sets resource
@return [Fog::DNS::Google::Record] Resource Record Sets resource
# File lib/fog/google/models/dns/record.rb, line 70 def save requires :name, :type, :ttl, :rrdatas data = service.create_change(self.zone.id, [resource_record_set_format], []) change = Fog::DNS::Google::Changes.new(:service => service, :zone => zone).get(data.body['id']) change.wait_for { !pending? } self end
Private Instance Methods
resource_record_set_format()
click to toggle source
Resource Record Sets resource representation
# File lib/fog/google/models/dns/record.rb, line 100 def resource_record_set_format { 'kind' => 'dns#resourceRecordSet', 'name' => self.name, 'type' => self.type, 'ttl' => self.ttl, 'rrdatas' => self.rrdatas, } end