Class: Lumberg::Cpanel::Ftp

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

Instance Attribute Summary

Attributes inherited from Base

#api_username

Attributes inherited from Whm::Base

#server

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, #perform_request

Methods inherited from Whm::Base

#initialize, #setup_server

Constructor Details

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

Class Method Details

.api_moduleObject


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(options = {})
  perform_request({
    api_function: "addftp"
  }.merge(options))
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(options = {})
  perform_request({
    api_function: "delftp"
  }.merge(options))
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(options = {})
  perform_request({
    api_function: "listftp"
  }.merge(options))
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(options = {})
  perform_request({
    api_function: "listftpsessions"
  }.merge(options))
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(options = {})
  perform_request({
    api_function: "listftpwithdisk"
  }.merge(options))
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(options = {})
  perform_request({
    api_function: "passwd"
  }.merge(options))
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(options = {})
  perform_request({
    api_function: "setquota"
  }.merge(options))
end