class DLDInternet::DOctl::Compute::Domain::Records::Command

Public Instance Methods

create(domain) click to toggle source
# File lib/dldinternet/doctl/compute/domain/records/command.rb, line 36
def create(domain)
  records_formats
  command_pre(domain)
  command_out(DLDInternet::DOctl::API::Compute::Domain::Records::Create.new(options, @logger).CreateDomainRecord(domain, record_from_options))
  0
end
delete(domain, id) click to toggle source
# File lib/dldinternet/doctl/compute/domain/records/command.rb, line 46
def delete(domain, id)
  # @header = -> {  }
  # @format = ->(o) { o.ai }
  records_formats
  command_pre(domain)
  DLDInternet::DOctl::API::Compute::Domain::Records::Delete.new(options, @logger).DeleteDomainRecord(domain, id)
  command_out(DLDInternet::DOctl::API::Compute::Domain::Records::List.new(options, @logger).GetDomainRecordsList(domain))
  0
end
list(domain) click to toggle source
# File lib/dldinternet/doctl/compute/domain/records/command.rb, line 20
def list(domain)
  records_formats
  command_pre(domain)
  command_out(DLDInternet::DOctl::API::Compute::Domain::Records::List.new(options, @logger).GetDomainRecordsList(domain))
  0
end
update(domain) click to toggle source
# File lib/dldinternet/doctl/compute/domain/records/command.rb, line 66
def update(domain)
  records_formats
  command_pre(domain)
  res = DLDInternet::DOctl::API::Compute::Domain::Records::Update.new(options, @logger).UpdateDomainRecord(domain, record_from_options, options[:record_id])
  if res.is_a?(::DropletKit::DomainRecord)
    res = DLDInternet::DOctl::API::Compute::Domain::Records::Delete.new(options, @logger).DeleteDomainRecord(domain, options[:record_id])
    if res === true
      command_out(DLDInternet::DOctl::API::Compute::Domain::Records::List.new(options, @logger).GetDomainRecordsList(domain))
      0
    else
      command_out(res)
      1
    end
  else
    command_out(res)
    1
  end
end