Class: DLDInternet::DOctl::API::Compute::Domain::Records::Update

Inherits:
Base
  • Object
show all
Defined in:
lib/dldinternet/doctl/api/compute/domain/records/update.rb

Instance Attribute Summary

Attributes inherited from Base

#client, #logger, #options

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from DLDInternet::DOctl::API::Base

Instance Method Details

#UpdateDomainRecord(domain, record, id) ⇒ Object

noinspection RubyUnnecessaryReturnValue



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/dldinternet/doctl/api/compute/domain/records/update.rb', line 12

def UpdateDomainRecord(domain, record, id)
  client.domain_records.create(record, for_domain: domain, id: id)
rescue ::DropletKit::Error => e
  if matches = e.message.match(%r{^([0-9]{3}):\s+(\{.*\})\s*$})
    json = JSON.parse(matches[2])
    @logger.fatal json['message']
  else
    @logger.fatal e.message
  end
  exit 1
end