Child pages
  • WHM API 1 Functions - resellerstats
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?api.version=1&user=user
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/resellerstats?api.version=1&user=user
 Command Line
whmapi1 resellerstats user=user


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/api/whmapi1

 Output (JSON)
{
  "data": {
    "reseller": {
      "totalbwalloc": 0,
      "diskquota": 0,
      "totalbwused": 0,
      "bandwidthlimit": 0,
      "diskused": 0.46,
      "bwoverselling": 0,
      "acct": [
        {
          "diskquota": 0,
          "bandwidthlimit": 0,
          "diskused": 0.15,
          "deleted": 0,
          "bandwidthused": "0",
          "package": "default",
          "domain": "example.com",
          "suspended": 0,
          "user": "example"
        },
        {
          "diskquota": 0,
          "bandwidthlimit": 0,
          "diskused": 0,
          "deleted": 1,
          "bandwidthused": "0",
          "package": "deleted account",
          "domain": "example2.com",
          "suspended": 1,
          "user": "example2"
        }
      ],
      "totaldiskalloc": 1100,
      "diskoverselling": 0,
      "user": "root"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "resellerstats"
  }
}
 Output (XML)
<result>
    <data>
        <reseller>
            <totalbwalloc>0</totalbwalloc>
            <diskquota>0</diskquota>
            <totalbwused>0</totalbwused>
            <bandwidthlimit>0</bandwidthlimit>
            <diskused>0.46</diskused>
            <bwoverselling>0</bwoverselling>
            <acct>
                <diskquota>0</diskquota>
                <bandwidthlimit>0</bandwidthlimit>
                <diskused>0.15</diskused>
                <deleted>0</deleted>
                <bandwidthused>0</bandwidthused>
                <package>default</package>
                <domain>example.com</domain>
                <suspended>0</suspended>
                <user>example</user>
            </acct>
            <acct>
                <diskquota>0</diskquota>
                <bandwidthlimit>0</bandwidthlimit>
                <diskused>0</diskused>
                <deleted>1</deleted>
                <bandwidthused>0</bandwidthused>
                <package>deleted account</package>
                <domain>example2.com</domain>
                <suspended>1</suspended>
                <user>example2</user>
            </acct>
            <totaldiskalloc>1100</totaldiskalloc>
            <diskoverselling>0</diskoverselling>
            <user>root</user>
        </reseller>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>resellerstats</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The reseller's username.

A valid reseller username.user

 

Returns

ReturnTypeDescriptionPossible valuesExample
resellerhashA hash of a reseller's data.This hash includes the bandwidthlimit, bandwidthused, deleted, diskquota, diskused, domain, package, suspended, totaldiskalloc, totalbwalloc, totalbwused, and user returns and the acct array of hashes. 

acct

array of hashes

An array of hashes of an account's data.

The function returns this array of hashes in the reseller hash.

This array of hashes 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 acct 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 acct 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 acct hash.

  • 1 — Deleted.
  • 0Not deleted.
0

diskquota

integer

The account's disk space quota.

The function returns this value in the acct 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 acct 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 acct hash.

A valid domain on the server.example.com

package

string

The account's hosting plan (package).

The function returns this value in the acct 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 acct hash.

  • 1 — Suspended.
  • 0Not suspended.
0

user

string

The account's username.

The function returns this value in the acct hash.

A valid username on the server.user

bandwidthlimit

integer

The reseller's total bandwidth limit.

The function returns this value in the reseller hash.

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

bwoverselling

Boolean

Whether the reseller can oversell bandwidth.

The function returns this value in the reseller hash.

  • 1 — The reseller can oversell bandwidth.
  • 0 — The reseller cannot oversell bandwidth.
0

diskoverselling

Boolean

Whether the reseller can oversell disk space.

The function returns this value in the reseller hash.

  • 1 — The reseller can oversell disk space.
  • 0 — The reseller cannot oversell disk space.
0

diskquota

integer

The reseller's total disk space usage limit.

The function returns this value in the reseller hash.

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

diskused

integer

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. 

The function returns this value in the reseller hash.

A positive integer that represents the reseller's accounts' total current disk space use, in Megabytes (MB).500

reseller

string

The reseller's username.

The function returns this value in the reseller hash.

A valid username on the server.user

totalbwalloc

integer

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

The function returns this value in the reseller hash.

A positive 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 reseller hash.

A positive 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 reseller hash.

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