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

 

Description

This function lists statistics for a reseller's accounts.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/resellerstats?reseller=user
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/resellerstats?reseller=user
 Command Line
whmapi0 resellerstatus reseller=user 

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 0 documentation or run the whmapi0 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{  
   "result":{  
      "totalbwalloc":0,
      "diskquota":0,
      "totalbwused":0,
      "statusmsg":"Fetched Reseller Data OK",
      "bandwidthlimit":0,
      "accts":[  
         {  
            "diskquota":5,
            "bandwidthlimit":0,
            "diskused":0.28,
            "deleted":0,
            "bandwidthused":"0",
            "package":"hosting_plan",
            "domain":"example.com",
            "suspended":0,
            "user":"owned_user"
         }
      ],
      "status":1,
      "diskused":0.28,
      "bwoverselling":0,
      "totaldiskalloc":5,
      "diskoverselling":0,
      "reseller":"user"
   }
}
 Output (XML)
<resellerstats>
    <result>
        <accts>
            <bandwidthlimit>0</bandwidthlimit>
            <bandwidthused>0</bandwidthused>
            <deleted>0</deleted>
            <diskquota>5</diskquota>
            <diskused>0.28</diskused>
            <domain>example.com</domain>
            <package>hosting_plan</package>
            <suspended>0</suspended>
            <user>owned_user</user>
        </accts>
        <bandwidthlimit>0</bandwidthlimit>
        <bwoverselling>0</bwoverselling>
        <diskoverselling>0</diskoverselling>
        <diskquota>0</diskquota>
        <diskused>0.28</diskused>
        <reseller>user</reseller>
        <status>1</status>
        <statusmsg>Fetched Reseller Data OK</statusmsg>
        <totalbwalloc>0</totalbwalloc>
        <totalbwused>0</totalbwused>
        <totaldiskalloc>5</totaldiskalloc>
    </result>
</resellerstats>

Parameters

ParameterTypeDescriptionPossible valuesExample
resellerstring

Required

The reseller's username.

A valid reseller username.user

Returns

ReturnTypeDescriptionPossible valuesExample

accts

hash

A hash of an account's data.

This hash includes the bandwidthlimit, bandwidthused, deleted, diskquota, diskused, domain, package, suspended, and user returns. 

bandwidthlimit

integer

The account's bandwidth limit.

The function returns this value in the accts hash.

  • A positive integer that represents the account's bandwidth limit, in Megabytes (MB).
  • 0 — The account has unlimited bandwidth.

 

0

bandwidthused

integer

The account's current bandwidth use.

The function returns this value in the accts hash.

A positive integer that represents the account's bandwidth use, in Megabytes (MB).5

deleted

Boolean

Whether the account has been deleted.

The function returns this value in the accts hash.

  • 1 — Deleted.
  • 0 — Not deleted.
0

diskquota

integer

The account's disk space quota.

The function returns this value in the accts hash.

  • A positive integer that represents the account's disk space limit, in Megabytes (MB).
  • 0 — The account has unlimited disk space.
0

diskused

integer

The account's current disk space use.

The function returns this value in the accts hash.

A positive integer that represents the account's current disk space use, in Megabytes (MB).250

domain

string

The account's main domain.

The function returns this value in the accts hash.

A valid domain on the server.example.com

package

string

The account's hosting plan (package).

The function returns this value in the accts hash.

A valid hosting plan (package) name on the server.hosting_plan

suspended

Boolean

Whether the account is currently suspended.

The function returns this value in the accts hash.

  • 1 — Suspended.
  • 0 — Not suspended.
0

user

string

The account's username.

The function returns this value in the accts hash.

A valid username on the server.user
bandwidthlimitintegerThe reseller's total bandwidth limit.
  • A positive integer that represents the reseller's bandwidth limit, in Megabytes (MB).
  • 0 — The reseller has unlimited bandwidth.
0
bwoversellingBooleanWhether the reseller can oversell bandwidth.
  • 1 — The reseller can oversell bandwidth.
  • 0 — The reseller cannot oversell bandwidth.
0
diskoversellingBooleanWhether the reseller can oversell disk space.
  • 1 — The reseller can oversell disk space.
  • 0 — The reseller cannot oversell disk space.
0
diskquotaintegerThe reseller's total disk space usage limit.
  • A positive integer that represents the reseller's disk space limit, in Megabytes (MB).
  • 0 — The reseller possesses unlimited disk space.
0
diskusedinteger

The total amount of disk space that the reseller's accounts use.

Note:

If the root account owns the reseller account, this value does not include the disk space that the reseller account itself uses. 

An integer that represents the reseller's accounts' total current disk space use, in Megabytes (MB).500
resultarray of hashesAn array of hashes of function output.This hash includes the reseller, status, statusmsg, totalbwalloc, totalbwused, and totaldiskalloc returns 

reseller

stringThe reseller's username.A valid username on the server.user

status

Boolean

Whether the function succeeded.

The function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.
1

statusmsg

string

A message of success or a reason for failure.

The function returns this value in the result hash.

  • Fetched Reseller Data OK
  • An error message.

Fetched Reseller Data OK

totalbwalloc

integer

The total amount of bandwidth that the reseller has allocated to accounts.

The function returns this value in the result hash.

An integer that represents an amount of bandwidth, in Megabytes (MB).450

totalbwused

integer

The total amount of bandwidth that the reseller's accounts have used.

The function returns this value in the result hash

An integer that represents an amount of bandwidth, in Megabytes (MB).325

totaldiskalloc

integer

The total amount of disk space that the reseller has allocated to accounts.

The function returns this value in the result hash.

An integer that represents an amount of disk space, in Megabytes (MB).750