Sha256: 25659ddf81b610c12fa0f8039c68c3d402d8f64e9ae19c79dae374dd15c1487a

Contents?: true

Size: 690 Bytes

Versions: 5

Compression:

Stored size: 690 Bytes

Contents

module ProxyAPI
  class DNS < Resource
    def initialize args
      @url  = args[:url] + "/dns"
      super args
    end

    # 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
    def set args
      parse post(args, "")
    end

    # Deletes a DNS entry
    # [+key+] : String containing either a FQDN or a dotted quad plus .in-addr.arpa.
    # Returns    : Boolean status
    def delete key
      parse(super("#{key}"))
    rescue RestClient::ResourceNotFound
      # entry doesn't exists anyway
      return true
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_discovery-1.0.0 test/foreman_app/lib/proxy_api/dns.rb
foreman_discovery-1.0.0.rc4 test/foreman_app/lib/proxy_api/dns.rb
foreman_discovery-1.0.0.rc3 test/foreman_app/lib/proxy_api/dns.rb
foreman_discovery-1.0.0.rc2 test/foreman_app/lib/proxy_api/dns.rb
foreman_discovery-1.0.0.rc1 test/foreman_app/lib/proxy_api/dns.rb