Child pages
  • UAPI Functions - Email::get_disk_usage

Versions Compared

Key

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

Description

Excerpt
This function retrieves the disk space that an email account uses.

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledReceiveMailRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

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/Email/get_disk_usage?user=user&domain=example.com


Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List disk usage for user@example.com.
$disk_used = $cpanel->uapi(
    'Email', 'get_disk_usage',
    array(
        'user'         => 'user',
        'domain'       => 'example.com',
        )
);

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.
 
# List disk usage for user@example.com.
my $disk_used = $cpliveapi->uapi(
    'Email', 'get_disk_usage',
    {
        'user'         => 'user',
        'domain'       => 'example.com',
    }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 


Expand
titlecPanel Template Toolkit


Code Block
languagexml
<!-- Get a hash of disk use info, then display the diskused value. -->
[% data = execute('Email', 'get_disk_usage', { 'user' => 'user', 'domain' => 'example.com', } ) %]
[% FOREACH q = data.diskused %]
     <p>
         [% q %]
     </p>
[% END %]
    
<!-- Get only the disk use. -->
[% execute('Email', 'get_disk_usage', { 'user' => 'user', 'domain' => 'example.com', } ).data.diskused %]

Include Page
LIB:_TTLink
LIB:_TTLink

 


Expand
titleCommand Line


Code Block
languagebash
uapi --user=username Email get_disk_usage user=user domain=example.com

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{  
   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{  

   },
   "data":{  
      "domain":"example.com",
      "diskused":0,
      "user":"user",
      "login":"user"
   }
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The email account username.

A valid email account username on the cPanel account.

For example, user if the email address is user@example.com.

user
domainstring

Required

The email account's domain.

A valid domain on the cPanel account.

example.com

Returns

ReturnTypeDescriptionPossible valuesExample

diskused

numericThe disk space that the email account uses.
  • A positive floating-point value that represents the disk space, used in Megabytes (MB).
  • 0 — The account posesses an unlimited disk quota.
399.6

login

string

The email address or the main account username.

  • A valid email address.
  • The main account's username.

user@example.com

domain

stringThe email account's domain.

The email account's domain.

For example, example.com if the email address is user@example.com.

example.com

user

stringThe email account username.

The email account's username.

For example, user if the email address is user@example.com.

user