Description

This function generates a monthly bandwidth graph.

We removed this function in cPanel & WHM version 11.52. We strongly recommend that you use the following UAPI function instead of this function:

Examples 


$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$monthly_bandwidth_graph = $cpanel->api1('Bandwidth', 'displaybwheader', array('example.com', 'jan', '2014','subdomain.example.com') ); // Call the function.

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $monthly_bandwidth_graph = $cpliveapi->api1('Bandwidth', 'displaybwheader', ['example.com', 'jan', '2014','subdomain.example.com'] ); # Call the function.

<cpanel Module="Bandwidth::displaybwheader( $FORM('domain','target','month','year','subd') )">
cpapi1 --user=username Bandwidth displaybwheader example.com example.com jan 2014 subdomain.example.com

<img file="example.com-01-2014-all.png" src="/tmp/user/example.com-01-2014-all.png" width="647" height="174">
<br /><br />

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain name.

Any valid domain.example.com
targetstring

Required

The domain name.

The domain return's value.

This value must match the domain value.


example.com
tmonthstring

Required

The month for which to retrieve bandwidth data.

The first three letters of a month's name, in English.jan
tyearinteger

Required

The year for which to retrieve bandwidth data.

The four digits for the desired year.2014
subdstring

The subdomain for which to retrieve bandwidth data.

If you do not use this parameter, the function returns bandwidth data for all of the specified domain's subdomains.

Any subdomain on the specified domain.subdomain.example.com

timezone

 

string

The timezone in which to report the data.

This parameter defaults to the domain's timezone.

A timezone in Olson tz format.America/Chicago

Returns

This function returns HTML to display a generated bandwidth graph image.

  • The image file uses the .png extension.
  • The system stores the image file in the tmp directory.