cPanel API 2 Functions - Fileman::getdiskinfo

Description

This function returns an account's disk usage statistics.

Warning:

We strongly recommend that you use UAPI instead of cPanel API 2. However, no equivalent UAPI function exists.

 

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

 LiveAPI PHP Class

$cpanel new CPANEL(); // Connect to cPanel - only do this once.
  
// Return disk usage data.
$getdiskinfo $cpanel->api2(
    'Fileman''getdiskinfo'
);

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

 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.

 

 Command Line

cpapi2 --user=username Fileman getdiskinfo

 

Notes:

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

 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"
  }
}

 

Note:

Use cPanel's API Shell interface (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.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞ — The account has unlimited disk space.

 10 MB

 file_upload_remain

 string

 The account's available file upload space.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 5 MB

 filesused_humansize

 string

 The disk space that the files on the account use.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 1.11 KB

  

  

 filesremain

 string

 The disk space that remains on the account.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

                ∞

                 

             

 spaceremain_humansize

 string

 The disk space that still remains on the account.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 ∞

 filesused

 integer

 The number of files on the account.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 1138 

 

 fileslimit_humansize

 string

 The account's disk space quota that is reserved for files.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 

 0 bytes

 spaceremain

 string

 The disk space that still remains on the account.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 ∞

 spaceused_humansize

 string

 The disk space that still remains on the account.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 42.9 MB

 file_upload_remain_humansize

 string

 The file upload space that still remains on the account.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 ∞

 spaceused

 string

 The amount of disk space used.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 44985851

 file_upload_max_bytes_humansize  

 string

 The amount of disk space that must be available to avoid quota issues due to file uploads. 

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 90.95 TB

 file_upload_max_bytes

 string

 The maximum file size that you can upload through theFile Manager.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞ — The account has unlimited disk space.

 99999999999999

 file_upload_must_leave_bytes

 string

 The amount of disk space that must be available to avoid quota issues due to file uploads.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞ — The account has unlimited disk space.

 5242880

 spacelimit_humansize

 string

 The account's disk space quota.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 ∞

  filesremain_humansize

 string

 The upload file space that still remains on the account.

  • A positive integer, in Kilobytes (KB), Megabytes (MB), or Gigabytes (GB).
  • ∞  — The account has unlimited disk space.

 ∞  

 file_upload_must_leave_bytes_humansize 

 string

 The amount of disk space that must be available to avoid issues due to file uploads.  

  • A positive integer that represents an amount of disk space in bytes.

 5 MB

 fileslimit

 string

 The account's disk space quota that is reserved for files.

  • A positive integer that represents an amount of disk space in bytes.

 

 0

 reason

 string

 A reason for failure

 Note:

 This function only returns a reasonvalue if there was an error.

 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

   

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