Class: ProxyAPI::DNS

Inherits:
Resource show all
Defined in:
lib/proxy_api/dns.rb

Instance Attribute Summary

Attributes inherited from Resource

#url

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ DNS


3
4
5
6
# File 'lib/proxy_api/dns.rb', line 3

def initialize args
  @url  = args[:url] + "/dns"
  super args
end

Instance Method Details

#delete(key) ⇒ Object

Deletes a DNS entry

key

: String containing either a FQDN or a dotted quad plus .in-addr.arpa.

Returns : Boolean status


19
20
21
22
23
24
# File 'lib/proxy_api/dns.rb', line 19

def delete key
  parse(super("#{key}"))
rescue RestClient::ResourceNotFound
  # entry doesn't exists anyway
  return true
end

#set(args) ⇒ Object

Sets a DNS entry

fqdn

: String containing the FQDN of the host

args

: Hash containing :value and :type: The :fqdn key is taken from the fqdn parameter

Returns : Boolean status


12
13
14
# File 'lib/proxy_api/dns.rb', line 12

def set args
  parse post(args, "")
end