Child pages
  • cPanel API 1 Functions - Bandwidth::displaymainbwheader

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Description

Excerpt

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

Warning
titleWarning:

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
    Excerpt Include
    UAPI Functions - Bandwidth::query
    UAPI Functions - Bandwidth::query
    nopaneltrue
Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleLiveAPI PHP Class
Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$bandwidth_graphs = $cpanel->api1('Bandwidth', 'displaymainbwheader'); // Call the function.

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

Expand
titleLiveAPI Perl Module
Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $bandwidth_graphs = $cpliveapi->api1('Bandwidth', 'displaymainbwheader'); # Call the function.

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 

Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

Code Block
languagetext
<cpanel Module="Bandwidth::displaymainbwheader()">
Expand
titleCommand Line
Code Block
languagebash
cpapi1 --user=username Bandwidth displaymainbwheader

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote

Expand
titleOutput (HTML)
Code Block
languagexml
linenumberstrue
<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.