Bandwidth
3 functions, invoked through the cpanel_uapi tool.
cpanel_uapi(service_id, module="Bandwidth", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.get_enabled_protocols GET#
Return services monitored in bandwidth data
This function returns a list of the server's enabled protocols.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
The bandwidth protocols that the server records. ftp imap pop3 smtp * http — This value includes all web traffic for the 80 and 443 ports.
get_retention_periods GET#
Return bandwidth retention period
This function retrieves the retention periods for bandwidth data.
No parameters.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
query GET#
Return cPanel account's bandwidth usage report
This function queries an account's bandwidth data and returns a report.
Note:
This function also returns the bandwidth use of a distributed cPanel account.
Response — normalized as { ok, data, errors[], warnings[] }; data contains:
The function returns data in a hierarchy of objects that the order of values in the grouping parameter determines. For example: domain - Returns data by domain. domain|protocol - Returns data by protocol and nests it within the object for each domain. domain|year - Returns data by year and nests it within the object for each domain. year|domain - Returns data by domain and nests it within object for each year. * domain|year|protocol - Returns data by protocol and nests it within object for each year, which the result then nests in objects for each domain. The deepest child object contains the bandwidth data in bytes.