UAPI Functions - Email::get_disk_usage

Description

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

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Email/get_disk_usage?user=user&domain=example.com

 LiveAPI PHP Class

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

 LiveAPI Perl Module

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

 cPanel Template Toolkit

<!-- 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 %]

 Command Line

uapi --user=username Email get_disk_usage user=user

 

Notes:

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

 Output (JSON)

   "messages":null,
   "errors":null,
   "status":1,
   "metadata":{ 
 
   },
   "data":{ 
      "domain":"example.com",
      "diskused":0,
      "user":"user",
      "login":"user"
   }
}

 

Note:

Use cPanel's API Shell interface (Home >> Advanced >> API Shell) to directly test cPanel API calls.

 

Parameters

 Parameter 

Type

Description

Possible values

Example

user

 string 

The email account username.

 If you do not specify a value, the function returns information for the cPanel account's default address. 

A valid email account username on the cPanel account.

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

user

domain

string

The email account's domain.

This parameter defaults to the cPanel account's main domain.

A valid domain on the cPanel account.

 example.com 

 

  Returns

Return

Type

Description

Possible values

Example

 diskused 

 numeric 

The disk space that the email account uses.

  • A positive floating-point value that represents the disk space used, in Megabytes (MB). 
  • 0 — The account has 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

string

The email account's domain.

The email account's domain.

For example, example.com if the email address isuser@example.com.

example.com

user

string

The email account username.

The email account's username.

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

user

 

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