UAPI Functions - Ftp::list_ftp_with_disk

Description

This function lists FTP account and disk usage information.

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Ftp/list_ftp_with_disk

 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'
);

 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',
);

 cPanel Template Toolkit

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

 Command Line

uapi --user=username Ftp list_ftp_with_disk

 

Notes:

  • You must URI-encode values.
  • username represents your account-level username.

 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 (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

Parameters

Type

Description

Possible values

Example

skip_acct_types

 string 

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_types 

string

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

Return

Type

Description

Possible values

Example

diskquota

string

The FTP account's quota.

  • unlimited
  • A positive integer that represents the disk quota, in Megabytes (MB).

unlimited

diskusedpercent

integer

The percentage of the disk space quota that the account currently uses.

A positive integer.

20

humandiskquota

string

The 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

_diskused

integer

The amount of disk space that the account currently uses.

A positive integer.

10

reldir

string

The 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/

accttype

string

The type of FTP account.

  • anonymous
  • logaccess
  • main
  • sub

main

dir

string

The absolute path to the FTP account's document root.

The absolute path to the FTP account's document root.

 /home/user/public_html/ftp/ 

login

string

The FTP account username.

The username for an FTP account on the cPanel account.

ftpaccount

deleteable

 Boolean 

Whether the function's caller can delete the account.

  • 1 — The caller can delete the account.
  • 0 — The caller cannot delete the account.

1

htmldir

string

The path to the FTP account's HTML directory.

The path to the FTP account's HTML directory, or null.

null

serverlogin

string

The full FTP login name.

The full login name for the FTP account, in user@example.com format, whereuser is the FTP account username, andexample.com is the domain.

ftpaccount@example.com

 diskusedpercent20 

integer

The percentage of disk space that the account currently uses.

A positive integer.

20

humandiskused

integer

The 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

 

  • 7 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....