Description

This function displays the Analog statistics for the domains on a cPanel account.


Examples




https://hostname.example.com:2083/cpsess##########/execute/Stats/list_sites?engine=webalizer&traffic=http



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Get account statistics for all sites on the cPanel account.
$list_sites = $cpanel->uapi(
    'Stats', 'list_sites',
    array(
        'engine'    => 'webalizer',
        'traffic'   => 'http',
  )
);



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Get account statistics for all sites on the cPanel account.
my $list_sites = $cpliveapi->uapi(
    'Stats', 'list_sites',
    {
        'engine'   => 'webalizer',
        'traffic'  => 'http',
    }
);

 



uapi --user=username Stats list_sites engine=webalizer traffic=http



{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
      
  },
  "data": [
	{
    	"path" : "/tmp/user/webalizer/index.html",
    	"ssl" : 1,
    	"domain" : "example.com"
		"all_domains" : "1"
	}
]	



Parameters

ParameterTypeDescriptionPossible valuesExample
enginestring

Required

The statistics engine.

  • webalizer 
  • analog 
webalizer
trafficinteger

The web traffic type.

This parameter defaults to http.

  • http 
  • ftp 
http

Returns

ReturnTypeDescriptionPossible valuesExample
pathstring

The filepath to the statistics file.

A valid filepath.

/tmp/user/webalizer/index.html
sslBoolean

Whether the function generates statistics from SSL requests. 


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


1
domainstringThe domain for which to display statistics.A domain on the cPanel account.example.com
all_domains BooleanWhether the statistics file's filepath is for all the domains on a cPanel account.
  • 1 — All domains.
  • 0 — An individual domain.


1