cPanel API 1 Functions - Bandwidth::displaymainbwheader

Description

This function generates bandwidth graphs for the current day, week, and year.

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.
$bandwidth_graphs $cpanel->api1('Bandwidth''displaymainbwheader'); // Call the function.

 LiveAPI Perl Module

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $bandwidth_graphs $cpliveapi->api1('Bandwidth''displaymainbwheader'); # Call the function.

 cPanel Tag System (deprecated)

Warning:

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::displaybw()">


 Output (HTML)

<fieldset>
 <legend><b>Today</b></legend>
 <table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
 <tr>
 <td>
 <div align="center">
 <img file="bw-example-today.png" src="/tmp/example/bw-example-today.png" width="597" height="174">
 </div> </td></tr></table>
 </fieldset>
 <br /><br /> <fieldset>
 <legend><b>Past 7 Days</b></legend>
 <table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
 <tr>
 <td>
 <div align="center">
 <img file="bw-example-7days.png" src="/tmp/example/bw-example-7days.png" width="597" height="174">
 </div> </td></tr></table>
 </fieldset>
 <br /><br /> <fieldset>
 <legend><b>Past 12 Months</b></legend>
 <table align="center" width="100%" cellspacing="0" cellpadding="0" border="0">
 <tr>
 <td>
 <div align="center">
 <img file="bw-example-year.png" src="/tmp/example/bw-example-year.png" width="597" height="174">
 </div> </td></tr></table>
 </fieldset>
 <br /> 

Parameters

This function does not accept parameters.

Returns

This function returns HTML to display a table of generated bandwidth graph images for the current date, for the past seven days, and for the past 12 months.

  • The generated image files use the .png extension.
  • The system stores these files 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....