We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - Quota::get_local_quota_info
Skip to end of metadata
Go to start of metadata

Description

This function retrieves the cPanel account's quota for the server where you run the function. For example, a distributed cPanel account could approach its quota. The servers will balance that cPanel user's quota between the parent and the child node.

Note:

This function runs on only the local server. To retrieve the cPanel account's total quota, use the UAPI Quota::get_quota function instead.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Quota/get_local_quota_info


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve the cPanel account's local quota.
$local_quota_info = $cpanel->uapi(
    'Quota', 'get_local_quota_info'
);


Note:

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.
 
# Retrieve the cPanel account's local quota.
my $local_quota_info = $cpliveapi->uapi(
    'Quota', 'get_local_quota_info',
);


Note:

For more information, read our Guide to the LiveAPI System.


 Command Line
uapi --user=username Quota get_local_quota_info


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
	"messages": null,
	"errors": null,
	"status": 1,
	"data": {
		"byte_limit": "262144000",
		"bytes_used": "4149284",
		"inode_limit": "0",
		"inodes_used": 1035
	},
	"metadata": {}
}


Note:

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

ReturnTypeDescriptionPossible ValuesExample
byte_limit
integer

The limit for disk space the cPanel account may use on this server, in bytes.

  • A positive integer.
  • Unlimited or disabled server quotas.

    Note:

    This value does not update immediately.

262144000
bytes_used integer

The amount of disk space the cPanel account uses on this server, in bytes.

  • A positive integer.
  • 0 — No usage or disabled server quotas.

4149284
inode_limit integer

The limit for inodes that the cPanel account may use on this server.

  • A positive integer.
  • 0 — Unlimited or disabled server quotas.

0
inodes_used integer

The number of inodes that the cPanel account uses on this server.

  • A positive integer.
  • 0 — No usage or disabled server quotas.

1035