cPanel API 1 Functions - Bandwidth::displaybwheader

Description

This function generates a monthly bandwidth graph.

Warning:

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

  • UAPI (recommended) — Bandwidth::query — This function queries an account's bandwidth data and returns a report.

Examples 


 LiveAPI PHP Class

$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.

 LiveAPI Perl Module

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 Tag System (deprecated)

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. This example is present in order to help developers move from the old cPanel tag system to our LiveAPI.

We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

 

<cpanel Module="Bandwidth::displaybwheader( $FORM('domain','target','month','year','subd') )">

 Command Line

cpapi1 --user=username Bandwidth displaybwheader domain=example.com target=example.com month=jan year=2014 subd=subdomain.example.com

 

Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

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

Parameters

Parameter

Type

Description

Possible values

Example

 domain

 string

 Required

 The domain name.

 Any valid domain.

 example.com

 target

 string

 Required

 The domain name.

 The domain return's value.

 Important:

 This valuemust match the domainvalue.

 

 example.com

 tmonth

 string

 Required

 The month for which to retrieve bandwidth data.

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

 jan

 tyear

 integer

 Required

 The year for which to retrieve bandwidth data.

 The four digits for the desired year.

 2014

 subd

 string

 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 will use the .png extension.
  • The system stores the image file in the tmp directory.
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....