Child pages
  • cPanel API 1 Functions - Bandwidth::displayday
Skip to end of metadata
Go to start of metadata

 

Description

This function generates bandwidth graphs 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 (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.
$daily_bandwidth_graph = $cpanel->api1('Bandwidth', 'displayday', array('example.com', '1', '2014', '25') ); // Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $daily_bandwidth_graph = $cpliveapi->api1('Bandwidth', 'displayday', ['example.com', '1', '2014', '25'] ); # Call the function.


Note:

For more information, read our Guide to the LiveAPI System.

 

 cPanel Tag System (deprecated)


Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="Bandwidth::displaybw( $FORM('domain','tmonth','tyear','tday') )">
 Command Line
cpapi1 --user=username Bandwidth displayday example.com 1 2014 25 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. 

 Output (images)

This function opens multiple bandwidth graph images in the web browser.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
domainstring

Required

The domain name.

Any valid domain.example.com
targetstring

The system does not use this parameter, and will ignore the value.

A placeholder value.''
tmonthinteger

The month for which to generate bandwidth graphs.

This parameter defaults to the current month.

An integer between 1 and 12 that corresponds to a month of the year.1
tyearinteger

The year for which to generate bandwidth graphs.

This parameter defaults to the current year.

The four digits for the desired year.2014
tdateinteger

The day of the month for which to generate bandwidth graphs.

This parameter defaults to the current day.

An integer between 1 and 31 that corresponds to a day of the month.25
subdBoolean

The type of bandwidth graphs.

This parameter defaults to 0.

  • 1 — Displays graphs for all traffic and for HTTP traffic.
  • 0 — Displays graphs for all traffic, HTTP, SMTP, FTP, POP3, and IMAP.
0

Returns

This function opens multiple bandwidth graph images in the web browser.