Class: Lumberg::Cpanel::SubDomain
- Defined in:
- lib/lumberg/cpanel/sub_domain.rb
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Whm::Base
Instance Method Summary collapse
-
#add(options = {}) ⇒ Object
Public: Add a subdomain.
-
#list(options = {}) ⇒ Object
Public: Get list of subdomains.
-
#modify(options = {}) ⇒ Object
Public: Modify the document root of a subdomain.
-
#remove(options = {}) ⇒ Object
Public: Remove a subdomain.
Methods inherited from Base
api_module, #initialize, #perform_request
Methods inherited from Whm::Base
Constructor Details
This class inherits a constructor from Lumberg::Cpanel::Base
Instance Method Details
#add(options = {}) ⇒ Object
Public: Add a subdomain.
options - Hash options for API call params (default: {}):
:domain - String local part of the subdomain to add.
"sub" if "sub.domain.com".
:rootdomain - String domain on which to add the subdomain.
:dir - String docroot for subdomain (optional, default:
"public_html/[:domain value]")
:disallowdot - String value (optional). Set to "1" to strip "."
chars from specified :domain value.
Returns Hash API response.
16 17 18 19 20 |
# File 'lib/lumberg/cpanel/sub_domain.rb', line 16 def add( = {}) perform_request({ api_function: "addsubdomain" }.merge()) end |
#list(options = {}) ⇒ Object
Public: Get list of subdomains.
options - Hash options for API call params (default: {}):
:regex - String regular expression to filter results (optional).
Returns Hash API response.
40 41 42 43 44 |
# File 'lib/lumberg/cpanel/sub_domain.rb', line 40 def list( = {}) perform_request({ api_function: "listsubdomains" }.merge()) end |
#modify(options = {}) ⇒ Object
Public: Modify the document root of a subdomain
options - Hash options for API call params (default: {}):
:dir - String docroot to which you want to move the subdomain
:subdomain - String subdomain whose docroot you want to modify
:rootdomain - String domain on which to modify the subdomain
Returns Hash API response
54 55 56 57 58 |
# File 'lib/lumberg/cpanel/sub_domain.rb', line 54 def modify( = {}) perform_request({ api_function: "changedocroot" }.merge()) end |
#remove(options = {}) ⇒ Object
Public: Remove a subdomain.
options - Hash options for API call params (default: {}):
:domain - String subdomain to delete.
Returns Hash API response.
28 29 30 31 32 |
# File 'lib/lumberg/cpanel/sub_domain.rb', line 28 def remove( = {}) perform_request({ api_function: "delsubdomain" }.merge()) end |