Child pages
  • UAPI Functions - Quota::get_quota_info

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt
This function retrieves the cPanel user's quota.

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone
Expand
titlecPanel or Webmail Session URL
Code Block
languagetext
https://hostname.example.com:2083/cpsess##########/execute/Quota/get_quota_info

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink

Expand
titleLiveAPI PHP Class
Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Retrieve the cPanel user's quota.
$quota_info = $cpanel->uapi(
    'Quota', 'get_quota_info'
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 

Expand
titleLiveAPI Perl Module
Code Block
languageperl
linenumberstrue
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',
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 

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

Include Page
LIB:_TTLink
LIB:_TTLink

 

Expand
titleCommand Line
Code Block
languagebash
uapi --user=username Quota get_quota_info

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{
	"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": {}
}

Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote

Parameters

This function does not accept parameters.

Returns

ReturnTypeDescriptionPossible ValuesExample
inode_limit integer

The account's inode quota limit.


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

0
inodes_remain integer

The account's available inode quota.


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

0
inodes_used integerThe 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_remain floatThe account's available disk space in, Megabytes (MB).
  • A decimal number.
  • 0.00 Unlimited or disabled server quotas.

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

5.46
under_inode_limit BooleanWhether the account is under its inode limit.
  • 1 — Under limit.
  • 0 — Overlimit.
0
under_quota_overall BooleanWhether the account is under both its inode and disk Megabyte (MB) limit.
  • 1 — Under limit.
  • 0 — Overlimit.
1
under_megabyte_limit BooleanWhether the account is under its disk space limit, in Megabytes (MB).
  • 1 — Under limit.
  • 0 — Overlimit.

 1