cPanel API 1 Functions - Bandwidth::displaybw

Description

This function generates bandwidth data for the specified day.

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 — 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_data $cpanel->api1('Bandwidth''displaybw'array('example.com''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 $bandwidth_data $cpliveapi->api1('Bandwidth''displaybw', ['example.com''example.com''jan''2014''subdomain.example.com'] ); # 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( $FORM('domain','target','month','year','subd') )">

 Command Line
 
h displaybw 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.
 Output (HTML)

<td align="center" class="bwtdh1">
<b>1</b>
</td>
<td class="bwtd1">91</td>
<td class="bwtd1">1.65</td>
<td class="bwtd1">0.00</td>
<td class="bwtd1">0.00</td>
<td class="bwtd1">0.00</td>
<td class="bwtd1">6.26</td>
</tr>

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 value must 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 table row of bandwidth data for the specified account. The table row includes one column of bandwidth data for each day of the specified month.

  • 11 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....