Class: Lumberg::Cpanel::AddonDomain

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

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

#add(options = {}) ⇒ Object

Public: Add an addon domain with a coresponding subdomain.

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

:dir       - String path for addon domain docroot.
:newdomain - String domain to use for addon domain.
:subdomain - String subdomain / FTP username corresponding to new
             addon domain, e.g., "user".

Returns Hash API response.



29
30
31
32
33
# File 'lib/lumberg/cpanel/addon_domain.rb', line 29

def add(options = {})
  perform_request({
    api_function: "addaddondomain"
  }.merge(options))
end

#list(options = {}) ⇒ Object

Public: Get a list of addon domains.

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

:regex - String regular expression to filter search results
         (optional).

Returns Hash API response.



42
43
44
45
46
# File 'lib/lumberg/cpanel/addon_domain.rb', line 42

def list(options={})
  perform_request({
    api_function: "listaddondomains"
  }.merge(options))
end

#remove(options = {}) ⇒ Object

Public: Delete an addon domain. This will also remove the corresponding subdomain and FTP account.

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

:domain    - String addon domain to be deleted.
:subdomain - String adddon domain's username followed by "_", then
             the addon domain's main domain, e.g.,
             "user_addon.com"

Returns Hash API response.



14
15
16
17
18
# File 'lib/lumberg/cpanel/addon_domain.rb', line 14

def remove(options = {})
  perform_request({
    api_function: "deladdondomain"
  }.merge(options))
end