Child pages
  • UAPI Functions - Ftp::list_ftp_with_disk
Skip to end of metadata
Go to start of metadata

Description

This function lists FTP account and disk usage information.

Important:

In cPanel & WHM version 76 and later, when you disable the FTP role, the system disables this function. For more information, read our How to Use Server Profiles documentation.

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Ftp/list_ftp_with_disk


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List FTP account and disk usage information.
$list_ftp_accts = $cpanel->uapi(
    'Ftp', 'list_ftp_with_disk'
);


Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List FTP account and disk usage information.
my $list_ftp_accts = $cpliveapi->uapi(
    'Ftp', 'list_ftp_with_disk',
);


Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Template Toolkit
<!-- List FTP account and disk usage information. -->
[% execute( 'Ftp', 'list_ftp_with_disk' ); %]


Note:

For more information, read our Guide to Template Toolkit documentation. 

 Command Line
uapi --user=username Ftp list_ftp_with_disk


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  
      "transformed":1
   },
   "data":[  
      {  
         "diskquota":"unlimited",
         "diskusedpercent":0,
         "diskused":0,
         "humandiskquota":"None",
         "_diskused":0,
         "reldir":"public_ftp",
         "accttype":"anonymous",
         "dir":"/home/user/public_ftp",
         "login":"anonymous",
         "deleteable":0,
         "htmldir":null,
         "serverlogin":"anonymous@example.com",
         "diskusedpercent20":0,
         "humandiskused":"None",
         "_diskquota":0
      },
      {  
         "diskquota":"unlimited",
         "diskusedpercent":0,
         "diskused":0,
         "humandiskquota":"None",
         "_diskused":0,
         "reldir":"public_html/ftpaccount",
         "accttype":"sub",
         "dir":"/home/user/public_html/ftpaccount",
         "login":"ftpaccount",
         "deleteable":1,
         "htmldir":null,
         "serverlogin":"ftpaccount@example.com",
         "diskusedpercent20":0,
         "humandiskused":"None",
         "_diskquota":0
      },
      {  
         "diskquota":"unlimited",
         "diskusedpercent":0,
         "diskused":0,
         "humandiskquota":"None",
         "_diskused":0,
         "reldir":"public_html/seconddomain.com",
         "accttype":"sub",
         "dir":"/home/user/public_html/seconddomain.com",
         "login":"seconddomain",
         "deleteable":1,
         "htmldir":null,
         "serverlogin":"seconddomain@example.com",
         "diskusedpercent20":0,
         "humandiskused":"None",
         "_diskquota":0
      }
   ]
}


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParametersTypeDescriptionPossible valuesExample
skip_acct_typesstring

A list of the FTP account types to exclude from the function's results.

If you do not specify this parameter, the function does not exclude any account types.

  • anonymous
  • logaccess
  • main
  • sub

Notes:

  • Separate multiple types with the pipe character (|).
  • In browser-based calls, use %7C.
main|anonymous  
include_acct_typesstring

A list of the FTP account types to include in the function's results.

If you do not specify this parameter, the function returns all FTP account types.

  • anonymous
  • logaccess
  • main
  • sub

Notes:

  • Separate multiple types with the pipe character (|).
  • In browser-based calls, use %7C.
main|anonymous

Returns

ReturnTypeDescriptionPossible valuesExample
diskquotastringThe FTP account's quota.
  • unlimited
  • A positive integer that represents the disk quota, in Megabytes (MB).
unlimited
diskusedpercentintegerThe percentage of the disk space quota that the account currently uses.A positive integer.20
humandiskquotastringThe FTP account's quota, in human-readable format.
  • None — The function returns this value if the account has an unlimited quota.
  • A positive integer that represents the quota in Megabytes (MB), a space, and the characters MB.
250 MB
_diskusedintegerThe amount of disk space that the account currently uses.A positive integer.10
reldirstringThe path to the FTP account's document root.The path to the FTP account's document root, relative to the cPanel account's home directory. This value includes the prefix home:.home:public_html/ftp/
accttypestringThe type of FTP account.
  • anonymous
  • logaccess
  • main
  • sub
main
dirstringThe absolute path to the FTP account's document root.The absolute path to the FTP account's document root./home/user/public_html/ftp/
loginstringThe FTP account username.The username for an FTP account on the cPanel account.ftpaccount
deleteableBooleanWhether the function's caller can delete the account.
  • 1 — The caller can delete the account.
  • 0 — The caller cannot delete the account.
1
htmldirstringThe path to the FTP account's HTML directory.The path to the FTP account's HTML directory, or null.null
serverloginstringThe full FTP login name.The full login name for the FTP account, in user@example.com format, where user is the FTP account username, and example.com is the domain.ftpaccount@example.com
diskusedpercent20integerThe percentage of disk space that the account currently uses.A positive integer.20
humandiskusedintegerThe amount of disk space that the account currently uses, in human-readable format.A positive integer that represents the amount of disk space in Megabytes (MB), a space, and the characters MB.10 MB