Child pages
  • UAPI Functions - Ftp::list_ftp_with_disk

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt
This function lists FTP account and disk usage information.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledFTPRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titlecPanel or Webmail Session URL


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

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$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'
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
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',
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titlecPanel Template Toolkit


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

Include Page
LIB:_TTLink
LIB:_TTLink


Expand
titleCommand Line


Code Block
languagexml
uapi --user=username Ftp list_ftp_with_disk

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{  
   "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
      }
   ]
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


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
Note
titleNotes:
  • 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
Note
titleNotes:
  • 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