Class: Lumberg::Whm::Reseller
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#account_counts(options = {}) ⇒ Object
Lists the total number of accounts owned by a reseller, as well as how many suspended accounts the reseller owns, and what the reseller’s account creation limit is, if any.
-
#add_ips(options = {}) ⇒ Object
Adds IP addresses to a reseller account.
-
#create(options = {}) ⇒ Object
Gives reseller status to an account.
-
#list ⇒ Object
Lists the usernames of all resellers on the server.
-
#list_acls ⇒ Object
Lists the saved reseller ACL lists on the server.
-
#save_acl_list(options = {}) ⇒ Object
Creates a new reseller ACL list.
-
#set_acls(options = {}) ⇒ Object
Sets the ACL for a reseller, or modifies specific ACL items for a reseller.
-
#set_limits(options = {}) ⇒ Object
Specifies the amount of bandwidth and disk space a reseller is able to use.
-
#set_main_ip(options = {}) ⇒ Object
Assigns a main, shared IP address to a reseller.
-
#set_nameservers(options = {}) ⇒ Object
Defines a reseller’s nameservers.
-
#set_package_limit(options = {}) ⇒ Object
Sets which packages resellers are able to use.
-
#stats(options = {}) ⇒ Object
Shows account statistics for a specific reseller’s accounts.
-
#suspend(options = {}) ⇒ Object
Suspends a reseller’s account.
-
#terminate(options = {}) ⇒ Object
Terminates a reseller’s main account, as well as all accounts owned by the reseller.
-
#unsetup(options = {}) ⇒ Object
Removes reseller status from an account.
-
#unsuspend(options = {}) ⇒ Object
Unsuspends a reseller’s account.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Lumberg::Whm::Base
Instance Method Details
#account_counts(options = {}) ⇒ Object
Lists the total number of accounts owned by a reseller, as well as how many suspended accounts the reseller owns, and what the reseller’s account creation limit is, if any. If no reseller is specified, counts will be provided for the reseller who is currently logged in.
Note: Counts for other users will only be provided if the user issuing the function call has root-level permissions or owns the provided account.
Required
* <tt>:username</tt> - PENDING
116 117 118 119 |
# File 'lib/lumberg/whm/reseller.rb', line 116 def account_counts( = {}) [:user] = .delete(:username) server.perform_request('acctcounts', .merge(response_key: 'reseller')) end |
#add_ips(options = {}) ⇒ Object
Adds IP addresses to a reseller account
Required
* <tt>:username</tt> - PENDING
Optional
* <tt>:ips</tt> - PENDING
31 32 33 34 |
# File 'lib/lumberg/whm/reseller.rb', line 31 def add_ips( = {}) [:user] = .delete(:username) server.perform_request('setresellerips', ) end |
#create(options = {}) ⇒ Object
Gives reseller status to an account.
Note: The user must already exist to be made a reseller. This function will not create an account. If the account does not yet exist, you can use the createacct function to set it up before conferring reseller privileges.
Required
* <tt>:username</tt> - PENDING
10 11 12 13 |
# File 'lib/lumberg/whm/reseller.rb', line 10 def create( = {}) [:user] = .delete(:username) server.perform_request('setupreseller', ) end |
#list ⇒ Object
Lists the usernames of all resellers on the server
16 17 18 19 20 21 22 |
# File 'lib/lumberg/whm/reseller.rb', line 16 def list # This method is funky. That is all result = server.perform_request('listresellers', response_key: 'reseller') result[:success] = true result[:params] = {resellers: result.delete(:params)} result end |
#list_acls ⇒ Object
Lists the saved reseller ACL lists on the server
142 143 144 |
# File 'lib/lumberg/whm/reseller.rb', line 142 def list_acls server.perform_request('listacls', {response_key: 'acls'}) end |
#save_acl_list(options = {}) ⇒ Object
Creates a new reseller ACL list
Required
* <tt>:acllist</tt> - PENDING
150 151 152 |
# File 'lib/lumberg/whm/reseller.rb', line 150 def save_acl_list( = {}) server.perform_request('saveacllist', .merge(response_key: 'results')) end |
#set_acls(options = {}) ⇒ Object
Sets the ACL for a reseller, or modifies specific ACL items for a reseller
Required
* <tt>:reseller</tt> - PENDING
Optional
* <tt>:acllist</tt> - PENDING
* <tt>:*optional_args</tt> - PENDING
162 163 164 |
# File 'lib/lumberg/whm/reseller.rb', line 162 def set_acls( = {}) server.perform_request('setacls', ) end |
#set_limits(options = {}) ⇒ Object
Specifies the amount of bandwidth and disk space a reseller is able to use
Required
* <tt>:username</tt> - PENDING
Optional
* <tt>:account_limit</tt> - PENDING
* <tt>:bandwidth_limit</tt> - PENDING
* <tt>:diskspace_limit</tt> - PENDING
45 46 47 48 |
# File 'lib/lumberg/whm/reseller.rb', line 45 def set_limits( = {}) [:user] = .delete(:username) server.perform_request('setresellerlimits', ) end |
#set_main_ip(options = {}) ⇒ Object
Assigns a main, shared IP address to a reseller
Required
* <tt>:username</tt> - PENDING
* <tt>:ip</tt> - PENDING
68 69 70 71 |
# File 'lib/lumberg/whm/reseller.rb', line 68 def set_main_ip( = {}) [:user] = .delete(:username) server.perform_request('setresellermainip', ) end |
#set_nameservers(options = {}) ⇒ Object
Defines a reseller’s nameservers. Additionally, you may use it to reset a reseller’s nameservers to the default settings
Required
* <tt>:username</tt> - PENDING
Optional
* <tt>:nameservers</tt> - PENDING
128 129 130 131 |
# File 'lib/lumberg/whm/reseller.rb', line 128 def set_nameservers( = {}) [:user] = .delete(:username) server.perform_request('setresellernameservers', ) end |
#set_package_limit(options = {}) ⇒ Object
Sets which packages resellers are able to use. It also allows you to define the number of times a package can be used by a reseller
Required
* <tt>:username</tt> - PENDING
* <tt>:no_limit</tt> - PENDING
* <tt>:package</tt> - PENDING
Optional
* <tt>:allowed</tt> - PENDING
* <tt>:number</tt> - PENDING
83 84 85 86 |
# File 'lib/lumberg/whm/reseller.rb', line 83 def set_package_limit( = {}) [:user] = .delete(:username) server.perform_request('setresellerpackagelimit', ) end |
#stats(options = {}) ⇒ Object
Shows account statistics for a specific reseller’s accounts
Required
* <tt>:reseller</tt> - PENDING
137 138 139 |
# File 'lib/lumberg/whm/reseller.rb', line 137 def stats( = {}) server.perform_request('resellerstats', ) end |
#suspend(options = {}) ⇒ Object
Suspends a reseller’s account. The suspension will prevent the reseller from accessing his or her account
Required
* <tt>:username</tt> - PENDING
Optional
* <tt>:reason</tt> - PENDING
95 96 97 98 |
# File 'lib/lumberg/whm/reseller.rb', line 95 def suspend( = {}) [:user] = .delete(:username) server.perform_request('suspendreseller', ) end |
#terminate(options = {}) ⇒ Object
Terminates a reseller’s main account, as well as all accounts owned by the reseller
Required
* <tt>:reseller</tt> - PENDING
54 55 56 57 58 59 60 61 |
# File 'lib/lumberg/whm/reseller.rb', line 54 def terminate( = {}) # WTF, seriously? wtf = "I understand this will irrevocably remove all the " wtf << "accounts owned by the reseller #{[:reseller]}" [:verify] = wtf server.perform_request('terminatereseller', ) end |
#unsetup(options = {}) ⇒ Object
Removes reseller status from an account
*Note:* This function will not delete the account; it will only remove its reseller status
169 170 171 172 |
# File 'lib/lumberg/whm/reseller.rb', line 169 def unsetup( = {}) [:user] = .delete(:username) server.perform_request('unsetupreseller', ) end |
#unsuspend(options = {}) ⇒ Object
Unsuspends a reseller’s account
Required
* <tt>:username</tt> - PENDING
104 105 106 107 |
# File 'lib/lumberg/whm/reseller.rb', line 104 def unsuspend( = {}) [:user] = .delete(:username) server.perform_request('unsuspendreseller', ) end |