This function retrieves a list of bandwidth records for the domains on a cPanel account.
Note:
This function also returns the bandwidth use of a distributed cPanel account.
Warning:
This function requires the Bandwidth Stats feature. To enable this feature, use WHM's Feature Manager interface (WHM >> Home >> Packages >> Feature Manager).
timezone | string The timezone in which to report the data, in Olson tz format. Note: This parameter defaults to the server's timezone. Example: timezone=America/Chicago |
uapi --output=jsonpretty \ --user=username \ Stats \ get_bandwidth
{- "apiversion": 3,
- "func": "get_bandwidth",
- "module": "Stats",
- "result": {
- "data": [
- {
- "bytes": 74845,
- "domain": "example.com",
- "month_start": 1561957200,
- "protocol": "imap"
}
], - "errors": null,
- "messages": null,
- "metadata": {
- "transformed": 1
}, - "status": 1,
- "warnings": null
}
}