Class: Lumberg::Cpanel::Ftp
- Defined in:
- lib/lumberg/cpanel/ftp.rb
Instance Attribute Summary
Attributes inherited from Base
Attributes inherited from Whm::Base
Class Method Summary collapse
Instance Method Summary collapse
-
#add_ftp(options = {}) ⇒ Object
Public: Add a new FTP account.
-
#del_ftp(options = {}) ⇒ Object
Public: Delete an FTP account.
-
#list_ftp(options = {}) ⇒ Object
Public: List FTP accounts associated with the authenticated user’s account.
-
#list_ftp_sessions(options = {}) ⇒ Object
Public: Retrieve a list of FTP sessions associated with the account.
-
#list_ftp_with_disk(options = {}) ⇒ Object
Public: Generate a list of FTP accounts associated with a cPanel account The list will contain each account’s disk information.
-
#passwd(options = {}) ⇒ Object
Public: Change an FTP account’s password.
-
#set_quota(options = {}) ⇒ Object
Public: Change an FTP account’s quota.
Methods inherited from Base
Methods inherited from Whm::Base
Constructor Details
This class inherits a constructor from Lumberg::Cpanel::Base
Class Method Details
.api_module ⇒ Object
4 |
# File 'lib/lumberg/cpanel/ftp.rb', line 4 def self.api_module; "Ftp"; end |
Instance Method Details
#add_ftp(options = {}) ⇒ Object
Public: Add a new FTP account
options - Hash options for API call params (default: {}):
:user - The username portion of the new FTP account, without the domain
:pass - The password for the new FTP account
:quota - The new FTP account's quota. The default, 0, indicates that
the account will not use a quota.
:homedir - The path to the FTP account's root directory. This value
should be relative to the account's home directory
Returns Hash API response.
67 68 69 70 71 |
# File 'lib/lumberg/cpanel/ftp.rb', line 67 def add_ftp( = {}) perform_request({ api_function: "addftp" }.merge()) end |
#del_ftp(options = {}) ⇒ Object
Public: Delete an FTP account
options - Hash options for API call params (default: {}):
:user - The name of the account to be removed
:destroy - A boolean value that indicates whether or not the FTP account's
home directory should also be deleted
Returns Hash API response.
94 95 96 97 98 |
# File 'lib/lumberg/cpanel/ftp.rb', line 94 def del_ftp( = {}) perform_request({ api_function: "delftp" }.merge()) end |
#list_ftp(options = {}) ⇒ Object
Public: List FTP accounts associated with the authenticated user’s account
options - Hash options for API call params (default: {}):
:include_acct_types - specify which FTP account types to include
:skip_acct_types - specify which FTP account types to exclude
Returns Hash API response.
13 14 15 16 17 |
# File 'lib/lumberg/cpanel/ftp.rb', line 13 def list_ftp( = {}) perform_request({ api_function: "listftp" }.merge()) end |
#list_ftp_sessions(options = {}) ⇒ Object
Public: Retrieve a list of FTP sessions associated with the account
Returns Hash API response.
22 23 24 25 26 |
# File 'lib/lumberg/cpanel/ftp.rb', line 22 def list_ftp_sessions( = {}) perform_request({ api_function: "listftpsessions" }.merge()) end |
#list_ftp_with_disk(options = {}) ⇒ Object
Public: Generate a list of FTP accounts associated with a cPanel account
The list will contain each account's disk information
options - Hash options for API call params (default: {}):
:dirhtml - prepend the 'dir' return variable with a URL
:include_acct_types - specify which FTP account types to include
:skip_acct_types - specify which FTP account types to exclude
Returns Hash API response.
37 38 39 40 41 |
# File 'lib/lumberg/cpanel/ftp.rb', line 37 def list_ftp_with_disk( = {}) perform_request({ api_function: "listftpwithdisk" }.merge()) end |
#passwd(options = {}) ⇒ Object
Public: Change an FTP account’s password
options - Hash options for API call params (default: {}):
:user - The username portion of the FTP account
:pass - The new password for the FTP account
Returns Hash API response.
50 51 52 53 54 |
# File 'lib/lumberg/cpanel/ftp.rb', line 50 def passwd( = {}) perform_request({ api_function: "passwd" }.merge()) end |
#set_quota(options = {}) ⇒ Object
Public: Change an FTP account’s quota
options - Hash options for API call params (default: {}):
:user - The username portion of the FTP account
:quota - The new quota (in megabytes) for the FTP account
Returns Hash API response.
80 81 82 83 84 |
# File 'lib/lumberg/cpanel/ftp.rb', line 80 def set_quota( = {}) perform_request({ api_function: "setquota" }.merge()) end |