Class: Lumberg::Cpanel::Net

Inherits:
Base show all
Defined in:
lib/lumberg/cpanel/net.rb

Overview

Public: Allows users to access networking functions

Instance Attribute Summary

Attributes inherited from Base

#api_username

Attributes inherited from Whm::Base

#server

Instance Method Summary collapse

Methods inherited from Base

api_module, #initialize, #perform_request

Methods inherited from Whm::Base

#initialize, #setup_server

Constructor Details

This class inherits a constructor from Lumberg::Cpanel::Base

Instance Method Details

#query_hostname(options = {}) ⇒ Object

Public: Performs an A record DNS query for the hostname presented via the 'host' variable, with a 60 second timeout. If more than one A record exists for a given FQDN, all will be returned.

options - Hash options for API call params (default: {})

:host - String fully qualified domain name, either host.domain.com or
        domain.com

Returns Hash API response



22
23
24
# File 'lib/lumberg/cpanel/net.rb', line 22

def query_hostname(options = {})
  perform_request({ api_function: 'dnszone' }.merge(options))
end

#tracerouteObject

Public: Perform a traceroute back to your local IP address while displaying packet speed at each hop in milliseconds.

Returns Hash API response



9
10
11
# File 'lib/lumberg/cpanel/net.rb', line 9

def traceroute
  perform_request({ api_function: 'traceroute' })
end