Child pages
  • UAPI Functions - Stats::list_stats_by_domain
Skip to end of metadata
Go to start of metadata

Description

This function returns a domain's Analog statistics.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Stats/list_stats_by_domain?engine=analog&domain=example.com


Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Get account statistics for example.com.
$list_stats_by_domain = $cpanel->uapi(
    'Stats', 'list_stats_by_domain',
    array(
        'engine'   => 'analog',
        'domain'   => 'example.com',
  )
);


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.
 
# Get account statistics for example.com.
my $list_stats_by_domain = $cpliveapi->uapi(
    'Stats', 'list_stats_by_domain',
    {
        'engine'   => 'analog',
        'domain'   => 'example.com',
    }
);


Note:

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

 

 Command Line
uapi --user=username Stats list_stats_by_domain engine=analog domain=example.com


Notes:

  • You must URI-encode values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
      
  },
  "data": [
     {
        "date" : 1565795929,
        "url"  : "tmp/cptest/analog/8.html"
     },
]	


Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
enginestring

Required

The statistics engine.

analog is the only possible value.

analog
domainstring

Required

The domain from which to retrieve statistics.

A domain on the cPanel account.example.com 
ssl Boolean

Whether to return statistics from SSL requests.

This parameter defaults to 1.

  • 1 — Return statistics for SSL requests.
  • 0 — Return statistics for non-SSL requests.
1 

Returns

ReturnTypeDescriptionPossible valuesExample
datestring

The current date and time.

A time, in Unix time format.

1565795929

urlstringThe URL of the file from which the system generates statistics reports.A valid URL.tmp/cptest/analog/8.html.com