cPanel API 2 Functions - Ftp::listftpwithdisk

Description

This function lists FTP users and their home directory's disk information.

Warning:

We strongly recommend that you use the following UAPI function instead of this function:

  • Ftp::list_ftp_with_disk — This function lists FTP account and disk usage information.

Examples 


 WHM API (JSON)

https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Ftp&cpanel_jsonapi_func=listftpwithdisk&include_acct_types=main

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// List the account's FTP users.
$list_ftpdisk $cpanel->api2(
    'Ftp''listftpwithdisk',
 array(
        'include_acct_types' => 'main',
    )
);

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
  
# List the account's FTP users and disk information.
my $list_ftpdisk $cpliveapi->api2(
    'Ftp''listftpwithdisk',
{
        'host' => 'remote.example.com',
    }
);

 cPanel Tag System (deprecated)

Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We strongly recommend that youonly use the LiveAPI system to call the cPanel APIs.

cPanel API 2 calls that use cPanel tags vary widely in code syntax and in their output. For more information, read our Deprecated cPanel Tag Usage documentation. Examples are only present in order to help developers move from the old cPanel tag system to our LiveAPI.


 Output (JSON)

{
  "cpanelresult": {
    "apiversion": 2,
    "func": "listftpwithdisk",
    "data": [
      {
        "diskquota": "unlimited",
        "diskusedpercent": 0,
        "diskused": 0,
        "humandiskquota": "None",
        "accttype": "main",
        "reldir": "",
        "_diskused": 0,
        "login": "example",
        "dir": "/home/example",
        "deleteable": 1,
        "serverlogin": "example",
        "htmldir": null,
        "humandiskused": "None",
        "diskusedpercent20": 0,
        "_diskquota": 0
      },
      {
        "diskquota": "unlimited",
        "diskusedpercent": 0,
        "diskused": 0,
        "humandiskquota": "None",
        "accttype": "logaccess",
        "reldir": "usr/local/apache/domlogs/example",
        "_diskused": 0,
        "login": "example_logs",
        "dir": "/usr/local/apache/domlogs/example",
        "deleteable": 1,
        "serverlogin": "example_logs",
        "htmldir": null,
        "humandiskused": "None",
        "diskusedpercent20": 0,
        "_diskquota": 0
      },
      {
        "diskquota": "unlimited",
        "diskusedpercent": 0,
        "diskused": 0,
        "humandiskquota": "None",
        "accttype": "sub",
        "reldir": "public_html/user",
        "_diskused": 0,
        "login": "user",
        "dir": "/home/example/public_html/user",
        "deleteable": 1,
        "serverlogin": "user@example.com",
        "htmldir": null,
        "humandiskused": "None",
        "diskusedpercent20": 0,
        "_diskquota": 0
      }
    ],
    "event": {
      "result": 1
    },
    "module": "Ftp"
  }
}

Note:

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

 

Parameters

Parameters

Type

Description

Possible values

Example

 dirhtml

 string

 A string to prepend to the dir return variable. 

 A valid string.

 example.com/

 include_acct_types 

 string

 The types of account to view.

  • main — This is the main FTP account.
  • sub — This is a sub-user FTP account.
  • logaccess — This account is for logfile access.

 Note:

 Separate multiple types with the pipe (|) character.

                main 

             

 skip_acct_types

 string 

 The types of account to exclude.

  • main — This is the main FTP account.
  • sub — This is a sub-user FTP account.
  • logaccess — This account is for logfile access. 

 Note:

 Separate multiple types with the pipe (|) character.

                main

             

 

Returns

Return

Type

Description

Possible values

Example

 diskquota

 string

 The account's disk quota, in Megabytes (MB).

 A positive integer value, or unlimited.

 unlimited

 diskusedpercent

 integer

 The percentage of space that the account uses.

 A positive integer value.

 0

 diskused

 integer

 The amount of space that the account uses, in Megabytes (MB).

 A positive integer value.

 0

 humandiskquota

 string

 The amount of space that the account may use in a human-readable format, in Megabytes (MB). 

  • None — For no space used.
  • A positive integer value, followed by MB.

 None

 accttype

 string

 The type of FTP account.

  • main — This is the main FTP account.
  • sub — This is a sub-user FTP account.
  • logaccess — This account is for logfile access. 

 sub

 reldir

 string

 The relative path to the FTP user's document root.

 A valid relative path.

 public_html/user

 _diskused

 integer

 The amount of space that the account uses, in bytes.

 A positive integer value.

 0

 login

 string

 The FTP account's username.

 A valid username.

 user

 dir

 string

 The path to the FTP user's document root.

 A valid absolute path.

 /home/example/public_html/user

 deleteable

 boolean

 Whether you can delete the account.

  • 1 — You can delete this account.
  • 0 — You cannot delete this account.

 1

 serverlogin

 string

 The full FTP login name.

 A username, at symbol (@), and the domain name

 user@example.com

 htmldir

 string

  

 

 null

 humandiskused

 string

 The amount of space that the account uses in a human-readable format, in Megabytes (MB).

  • None — No space used.
  • A positive integer, followed by MB.

 None

 diskusedpercent20 

 integer

 The percentage of space that the account uses.

 A positive integer value.

 0

 _diskquota

 integer

 The amount of space that the account may use, in bytes.

 A positive integer value.

 0

 reason

 string

 A reason for failure.

 Note:

 This function only returns a reasonvalue if it failed.

 A string that describes the error.

 This is an error message.

 result

 boolean 

 Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.

 1

  

  • 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....