We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

Child pages
  • UAPI Functions - StatsManager::save_configuration
Skip to end of metadata
Go to start of metadata

Description

This function saves the cPanel user's selected weblog analyzers for each domain on their cPanel account. If a reseller or root user controls the log analyzers selection, the cPanel user cannot manage which log analyzers are enabled or disabled.

Important:

In cPanel & WHM version 76 and later, when you disable the Web Server role, the system disables this function.


Examples 


 Raw HTTP Request
POST /cpsess##########/execute/StatsManager/save_configuration HTTP/1.1
Host: example.com:2083
Cookie: ###################################
Content-Type: application/json
Content-Length: 171
   
{ "changes": [{ "domain": "example.com", "analyzers": [{ "name": "awstats", "enabled": 0 }, { "name": "webalizer", "enabled": 1 }, { "name": "analog", "enabled": 1 }] }] }
 LiveAPI PHP Class

Note:

This method is not supported at this time. We plan to add support for this method in a future release of cPanel & WHM.

 LiveAPI Perl Module

Note:

This method is not supported at this time. We plan to add support for this method in a future release of cPanel & WHM.

 Command Line
 echo '{ "changes": [{ "domain": "example.com", "analyzers": [{ "name": "awstats", "enabled": 0 }, { "name": "webalizer", "enabled": 1 }, { "name": "analog", "enabled": 1 }] }] }' | bin/uapi --user=example --input=json --output=jsonpretty StatsManager save_configuration


Notes:

  • The format for this command line example differs from our standard format because the function only accepts a single JSON structure.
  • username represents your cPanel account username.
  • For more information and additional output options, read our Guide to UAPI documentation or run the uapi --help command. 

 Output (JSON)
{
	"apiversion": 3,
	"result": {
		"errors": null,
		"warnings": null,
		"data": [{
			"domain": "example.com",
			"analyzers": [{
					"enabled_by_user": 1,
					"name": "analog",
					"enabled": 1
				},
				{
					"enabled_by_user": 0,
					"name": "awstats",
					"enabled": 0
				},
				{
					"enabled_by_user": 1,
					"name": "webalizer",
					"enabled": 1
				}
			]
		}],
		"metadata": {
			"transformed": 1,
			"analyzers": [{
					"enabled_by_default": 1,
					"name": "analog",
					"available_for_user": 1
				},
				{
					"available_for_user": 1,
					"name": "awstats",
					"enabled_by_default": 1
				},
				{
					"available_for_user": 1,
					"name": "webalizer",
					"enabled_by_default": 1
				}
			],
			"locked": 0
		},
		"status": 1,
		"messages": null
	},
	"module": "StatsManager",
	"func": "save_configuration"
}

Note:

cPanel's  API Shell interface (WHM >> Home >> Development >> API Shell) does not support this function.

Parameters

ParameterTypeDescriptionPossible valuesExample
changes array of hashes

Required

The array that contains the keys and values to update.

This array contains the domain and analyzers array of hashes parameters.

domain

string

Required

The domain to update the weblog analyzer configuration.

A domain on the cPanel account. example.com

analyzers

array of hashes

Required

The weblog analyzer's configuration on the cPanel account.

This array contains the enabled and name parameters.

enabled

 
Boolean

Required

Whether the weblog analyzer is enabled.

  • 1 — Enabled.
  • 0 — Disabled.
1

name

 
string

Required

The name of the weblog analyzer.

  • awstats
  • analog
  • webalizer

awstats

Returns

ReturnTypeDescriptionPossible valuesExample
domain string

The domain to report the weblog analyzer configuration.

A domain on the cPanel account. example.com

analyzers

array of hashes

The weblog analyzer's configuration on the cPanel account.

This array contains the enabledenabled_by_user, and name returns.

enabled

 
Boolean

Whether the weblog analyzer is enabled.

This function returns this value in the analyzers array.

  • 1 — Enabled.
  • 0 — Disabled.
1

enabled_by_user

 
Boolean

Whether the cPanel user can enabled weblog analyzer.

This function returns this value in the analyzers array.

  • 1 — Enabled.
  • 0 — Disabled.
1

name

 
string

The name of the weblog analyzer.

This function returns this value in the analyzers array.

  • awstats
  • analog
  • webalizer

awstats

Non-Standard Metadata

Note:

The following information returns in the function's metadata section. The data is system-level information about whether the reseller or root user allows the weblog analyzers.


ReturnTypeDescriptionPossible valuesExample

analyzers

array of hashesThe system-level weblog analyzer's configuration for the cPanel account.This array contains the available_for_user, enabled_by_default, and name returns.

available_for_user

 
Boolean

Whether the reseller or root user enabled the weblog analyzer for the cPanel account.

This function returns this value in the analyzers array.

  • 1 — Enabled.
  • 0 — Disabled.

1

enabled_by_default

 
Boolean

Whether the reseller or root user enabled the weblog analyzer by default.

This function returns this value in the analyzers array.

  • 1 — Enabled.
  • 0 — Disabled.
1

name

 
string

The name of the weblog analyzer.

This function returns this value in the analyzers array.

  • awstats
  • analog
  • webalizer

awstats

locked

 
BooleanWhether the cPanel user can manage weblog analyzer.
  • 1 — No.
  • 0 — Yes.

1