Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function retrieves the cPanel user's quota.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Quota/get_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 user's quota.
$quota_info = $cpanel->uapi(
    'Quota', 'get_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 user's quota.
my $quota_info = $cpliveapi->uapi(
    'Quota', 'get_quota_info',
);

Note:

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

 

 cPanel Template Toolkit
<!-- Retrieve the cPanel user's quota. -->
[% execute( 'Quota', 'get_quota_info' ); %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username Quota get_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. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (JSON)
{
	"messages": null,
	"errors": null,
	"status": 1,
	"data": {
		"under_quota_overall": "1",
		"megabytes_remain": "0.00",
		"inodes_remain": "0",
		"megabyte_limit": "0.00",
		"inode_limit": "0",
		"inodes_used": 1035,
		"megabytes_used": "5.46",
		"under_inode_limit": "1",
		"under_megabyte_limit": "1"
	},
	"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
inode_limitinteger

The account's inode quota limit.


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

0
inodes_remaininteger

The account's available inode quota.


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

0
inodes_usedintegerThe account's number of used inodes.
  • A positive integer.
  • 0 — No usage or disabled server quotas.

1035
megabyte_limit
floatThe account's disk space limit, in Megabytes (MB).
  • A decimal number.
  • 0.00 Unlimited or disabled server quotas.

 0.00
megabytes_remainfloatThe account's available disk space in, Megabytes (MB).
  • A decimal number.
  • 0.00 Unlimited or disabled server quotas.

0.00
megabytes_usedfloatThe account's used disk space, in Megabytes (MB).
  • A decimal number.
  • 0.00 — No usage or disabled server quotas.

5.46
under_inode_limitbooleanWhether the account is under its inode limit.
  • 1 — Under limit.
  • 0 — Over limit.
0
under_quota_overallbooleanWhether the account is under both its inode and disk Megabyte (MB) limit.
  • 1 — Under limit.
  • 0 — Over limit.
1
under_megabyte_limitbooleanWhether the account is under its disk space limit, in Megabytes (MB).
  • 1 — Under limit.
  • 0 — Over limit.

 1