cPanel API 2 Functions - Fileman::getdiskinfo
The cPanel API 2 system is deprecated. We strongly recommend that you use UAPI instead of cPanel API 2.
Description
This function returns an account's disk usage statistics.
We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.
When you disable the File Storage role, the system disables this function.
Examples
WHM API (JSON)
https://hostname.example.com:2087/cpsess##########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Fileman&cpanel_jsonapi_func=getdiskinfo
For more information, read our Calls from the WHM API documentation.
LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
// Return disk usage data.
$getdiskinfo = $cpanel->api2(
'Fileman', 'getdiskinfo'
);
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.
# Return disk usage data.
my $getdiskinfo = $cpliveapi->api2(
'Fileman', 'getdiskinfo',
);
For more information, read our Guide to the LiveAPI System.
cPanel Tag System (deprecated)
- cPanel tags are deprecated . We strongly recommend that you only use the LiveAPI system to call the cPanel APIs. Examples are only present in order to help developers move from the old cPanel tag system to our LiveAPI .
- cPanel API 2 calls that use cPanel tags vary in code syntax and in their output.
- For more information, read our Deprecated cPanel Tag Usage documentation.
Command Line
cpapi2 --user=username Fileman getdiskinfo
- You must URI-encode values.
-
username
represents your account-level username. -
You
must
include the
--user=username
option. -
For more information and additional output options, read our
Guide to cPanel API 2
documentation or run the
cpapi2 --help
command. -
If you run CloudLinux™, you
must
use the full path of the
cpapi2
command:/usr/local/cpanel/bin/cpapi2
Output (JSON)
{
"cpanelresult": {
"apiversion": 2,
"func": "getdiskinfo",
"data": [
{
"spacelimit": "500",
"file_upload_remain": "500",
"filesused_humansize": "1.11 KB",
"filesremain": "500",
"spaceremain_humansize": "500",
"filesused": 1138,
"fileslimit_humansize": "500",
"spaceremain": "500",
"spaceused_humansize": "42.9 MB",
"file_upload_remain_humansize": "500",
"spaceused": 44985851,
"file_upload_max_bytes_humansize": "90.95 TB",
"file_upload_max_bytes": 99999999999999,
"file_upload_must_leave_bytes": 5242880,
"spacelimit_humansize": "500",
"filesremain_humansize": "500",
"file_upload_must_leave_bytes_humansize": "5 MB",
"fileslimit": 0
}
],
"event": {
"result": 1
},
"module": "Fileman"
}
}
Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.
Parameters
This function does not accept parameters.
Returns
Return | Type | Description | Possible values | Example |
---|---|---|---|---|
spacelimit |
string | The account's disk space quota. |
|
10 MB |
file_upload_remain |
string | The account's available file upload space. |
|
5 MB |
filesused_humansize |
string | The disk space that the files on the account use. |
|
1.11 KB |
filesremain |
string | The disk space that remains on the account. |
|
∞ |
spaceremain_humansize |
string | The disk space that still remains on the account. |
|
∞ |
filesused |
integer | The number of files on the account. |
|
1138 |
fileslimit_humansize |
string | The account's disk space quota that is reserved for files. |
|
0 bytes |
spaceremain |
string | The disk space that still remains on the account. |
|
∞ |
spaceused_humansize |
string | The disk space that still remains on the account. |
|
42.9 MB |
file_upload_remain_humansize |
string | The file upload space that still remains on the account. |
|
∞ |
spaceused |
string | The amount of disk space used. |
|
44985851 |
file_upload_max_bytes_humansize |
string | The amount of disk space that must be available to avoid quota issues due to file uploads. |
|
90.95 TB |
file_upload_max_bytes |
string | The maximum file size that you can upload through the File Manager. |
|
99999999999999 |
file_upload_must_leave_bytes |
string | The amount of disk space that must be available to avoid quota issues due to file uploads. |
|
5242880 |
spacelimit_humansize |
string | The account's disk space quota. |
|
∞ |
filesremain_humansize |
string | The upload file space that still remains on the account. |
|
∞ |
file_upload_must_leave_bytes_humansize |
string | The amount of disk space that must be available to avoid issues due to file uploads. |
|
5 MB |
fileslimit |
string | The account's disk space quota that is reserved for files. |
|
0 |
reason |
string |
A reason for failure This function only returns a |
A string that describes the error. | This is an error message. |
result |
Boolean | Whether the function succeeded. |
|
1 |