All URIs are relative to https://cpanel-server.tld:2083/execute
| Method | HTTP request | Description |
|---|---|---|
| get_session_information | GET /Variables/get_session_information | Return web server's hostname |
| variables_get_server_information | GET /Variables/get_server_information | Return server's configuration settings |
| variables_get_user_information | GET /Variables/get_user_information | Return cPanel account's configuration settings |
InlineResponse200540 get_session_information(name=name)
Return web server's hostname
This function retrieves a web server's hostname.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200540 import InlineResponse200540
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.VariablesApi(api_client)
name = host # str | The web server environment variable to retrieve. You can **only** retrieve the web server's hostname. * `host` is the only possible value. (optional) (default to host)
try:
# Return web server's hostname
api_response = api_instance.get_session_information(name=name)
print("The response of VariablesApi->get_session_information:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VariablesApi->get_session_information: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | The web server environment variable to retrieve. You can only retrieve the web server's hostname. * `host` is the only possible value. | [optional] [default to host] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200539 variables_get_server_information(name=name)
Return server's configuration settings
This function retrieves the configuration settings for the cPanel & WHM server on which an account exists. This is useful, for example, to verify which applications and functionality are available on the account.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200539 import InlineResponse200539
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.VariablesApi(api_client)
name = 'name=allow_park_subdomain_on_hostname&name=allow_remote_domains&name=allow_reset_password' # str | The server configuration settings to return. <details> <summary>Click to view information about the available server configuration settings.</summary> * `default_theme` - The cPanel interface's default theme. * `email_filter_storage_directory` - The location of the Exim email filter storage directory. * `allow_park_subdomain_on_hostname` - Whether the system allows users to park subdomains of the server's hostname. * `allow_remote_domains` - Whether the system allows users to create addon domains or aliases that resolve to other servers. * `allow_unregistered_domains` - Whether the system allows users to add domains they didn't register with a domain name registrar. * `apache_port` - The IP address or IP address with a firewall port number that Apache® uses to listen for requests and serve web pages over an unsecured connection. * `apache_ssl_port` - The port or IP address that Apache uses to listen for requests and serve web pages over a secure connection. * `api_shell` - Whether the user can access cPanel's [*API Shell*](https://go.cpanel.net/cpaneldocsAPIShell) interface (*cPanel >> Home >> Advanced >> API Shell*). * `awstats_browser_update` - Whether the user can update their [AWStats](http://awstats.sourceforge.net/) software. * `awstats_reverse_dns` - Whether the AWStats statistical analysis software interprets visitors' domain names as IP addresses. * `cpanel_root_directory` - The cPanel `root` directory. * `database_prefix_required` - Whether the account requires database prefixing. * `display_cpanel_doclinks` - Whether the system displays links to cPanel feature documentation in the cPanel interface. * `dnsadmin_app` - The application that processes DNS management requests. * `empty_trash_days` - The minimum age of files that the system will automatically purge from `.trash` folders in user home directories. * `enable_file_protect` - Whether [EasyApache 4's *FileProtect* option](https://go.cpanel.net/EasyApache4FileprotectOption) is enabled. * `file_upload_maximum_bytes` - The maximum file size, in megabytes (MB), that a user can upload to a server. * `file_upload_must_leave_bytes` - The minimum filesystem quota that the system requires after a file uploads to a server. * `file_usage` - Whether file usage information displays in the cPanel *Home* interface's statistics bar. * `ftp_server` - The FTP server. * `htaccess_check_recurse` - The maximum number of directories deep to look for `.htaccess` files when you change the PHP handler. * `invite_sub` - Whether cPanel account users can send invitations to new Subaccount users via cPanel's [*User Manager*](https://go.cpanel.net/cpaneldocsUserManager) interface (*cPanel >> Home >> Preferences >> User Manager*). * `ipv6_listen` - Whether the `cpsrvd` daemon and other cPanel & WHM services listen on IPv6. * `local_nameserver_type` - The DNS nameserver's type. * `logout_redirect_url` - The logout redirection URL. * `mailbox_storage_format` - The mailbox storage format for new accounts. * `mail_server` - The mailserver type. * `minimum_password_strength` - The minimum strength for cPanel account passwords. * `minimum_password_strength_mysql` - The minimum strength for MySQL® or MariaDB® passwords. * `mysql_host` - The MySQL or MariaDB hostname or IP address. * `mysql_version` - The MySQL or MariaDB version. * `php_maximum_execution_time` - The number of seconds that a PHP script can run before the system terminates it. * `php_post_maximum_size` - The maximum size, in megabytes (MB), of a POST request. * `php_system_default_version` - The system's default version of PHP. * `php_upload_maximum_filesize` - The maximum file size, in megabytes (MB), that a PHP script may upload. * `php_loader` - The PHP loaders through which the system executes internal PHP scripts. * `php_open_basedir_home` - Whether PHP `open_basedir` protection is enabled on the server. * `phpmyadmin_disable_search_info_schema` - Whether the user can search for the phpMyAdmin information schema. * `docroots_in_public_html_only` - Whether the system restricts users from creating addon domains and subdomains outside of their `public_html` directory. * `require_ssl` - Whether the system requires passwords and other sensitive information use SSL encryption. * `allow_reset_password` - Whether cPanel's [*Reset Password*](https://go.cpanel.net/resetsubaccountpass) feature is enabled for the account. * `allow_reset_password_for_subaccounts` - Whether cPanel's [*Reset Password*](https://go.cpanel.net/resetsubaccountpass) feature is enabled for subaccounts on the account. * `disable_analog` - Whether users can access the [*Analog Stats*](https://go.cpanel.net/cpaneldocsAnalogStats) interface (*cPanel >> Home >> Metrics >> Analog Stats*). * `skip_apache_clients_optimizer` - Whether the Apache Client Optimizer is enabled. * `disable_awstats` - Whether the [AWStats](http://awstats.sourceforge.net/) software is enabled. * `skip_mailbox_warnings_check` - Whether mailbox usage warnings are enabled. * `disable_boxtrapper` - Whether [*BoxTrapper*](https://go.cpanel.net/cpaneldocsBoxTrapper) is enabled. * `skip_bandwidth_limit_check` - Whether the system automatically suspends HTTP service for accounts that exceed their bandwidth limit. * `disable_mailman` - Whether Mailman mailing lists are enabled. * `disable_roundcube` - Whether [Roundcube webmail](https://roundcube.net/) is enabled. * `disable_spamassassin` - Whether the Apache SpamAssassin™ spam filter is enabled. * `disable_spambox` - Whether Apache SpamAssassin's spam box feature is enabled. * `disable_webalizer` - Whether the [Webalizer](https://docs.cpanel.net/cpanel/metrics/webalizer/) statistics program is enabled. * `ssl_default_key_type` - The default SSL/TLS encryption algorithm used by the system. * `use_information_schema` - Whether the system uses the MySQL® `INFORMATION_SCHEMA` view. This view includes disk usage by all MySQL tables in the disk usage totals. * `use_mail_for_mailman_url` - Whether the system prefixes Mailman URLs with the `mail` prefix. For example, `http://mail.domain.com/mailman`. * `is_mod_userdir_enabled` - Whether the [Apache `mod_userdir` Tweak](https://go.cpanel.net/whmdocsApachemod_userdirTweak) is enabled. * `version` - The system's Linux® kernel version. </details> **Note:** * If you don't use this parameter, this function returns **all** of the server's configuration settings. * To retrieve multiple variables, increment this parameter. For example, `name-1=variable`, `name-2=variable`, `name-3=variable`. (optional)
try:
# Return server's configuration settings
api_response = api_instance.variables_get_server_information(name=name)
print("The response of VariablesApi->variables_get_server_information:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VariablesApi->variables_get_server_information: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | The server configuration settings to return. <details> <summary>Click to view information about the available server configuration settings.</summary> * `default_theme` - The cPanel interface's default theme. * `email_filter_storage_directory` - The location of the Exim email filter storage directory. * `allow_park_subdomain_on_hostname` - Whether the system allows users to park subdomains of the server's hostname. * `allow_remote_domains` - Whether the system allows users to create addon domains or aliases that resolve to other servers. * `allow_unregistered_domains` - Whether the system allows users to add domains they didn't register with a domain name registrar. * `apache_port` - The IP address or IP address with a firewall port number that Apache® uses to listen for requests and serve web pages over an unsecured connection. * `apache_ssl_port` - The port or IP address that Apache uses to listen for requests and serve web pages over a secure connection. * `api_shell` - Whether the user can access cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell). * `awstats_browser_update` - Whether the user can update their AWStats software. * `awstats_reverse_dns` - Whether the AWStats statistical analysis software interprets visitors' domain names as IP addresses. * `cpanel_root_directory` - The cPanel `root` directory. * `database_prefix_required` - Whether the account requires database prefixing. * `display_cpanel_doclinks` - Whether the system displays links to cPanel feature documentation in the cPanel interface. * `dnsadmin_app` - The application that processes DNS management requests. * `empty_trash_days` - The minimum age of files that the system will automatically purge from `.trash` folders in user home directories. * `enable_file_protect` - Whether EasyApache 4's FileProtect option is enabled. * `file_upload_maximum_bytes` - The maximum file size, in megabytes (MB), that a user can upload to a server. * `file_upload_must_leave_bytes` - The minimum filesystem quota that the system requires after a file uploads to a server. * `file_usage` - Whether file usage information displays in the cPanel Home interface's statistics bar. * `ftp_server` - The FTP server. * `htaccess_check_recurse` - The maximum number of directories deep to look for `.htaccess` files when you change the PHP handler. * `invite_sub` - Whether cPanel account users can send invitations to new Subaccount users via cPanel's User Manager interface (cPanel >> Home >> Preferences >> User Manager). * `ipv6_listen` - Whether the `cpsrvd` daemon and other cPanel & WHM services listen on IPv6. * `local_nameserver_type` - The DNS nameserver's type. * `logout_redirect_url` - The logout redirection URL. * `mailbox_storage_format` - The mailbox storage format for new accounts. * `mail_server` - The mailserver type. * `minimum_password_strength` - The minimum strength for cPanel account passwords. * `minimum_password_strength_mysql` - The minimum strength for MySQL® or MariaDB® passwords. * `mysql_host` - The MySQL or MariaDB hostname or IP address. * `mysql_version` - The MySQL or MariaDB version. * `php_maximum_execution_time` - The number of seconds that a PHP script can run before the system terminates it. * `php_post_maximum_size` - The maximum size, in megabytes (MB), of a POST request. * `php_system_default_version` - The system's default version of PHP. * `php_upload_maximum_filesize` - The maximum file size, in megabytes (MB), that a PHP script may upload. * `php_loader` - The PHP loaders through which the system executes internal PHP scripts. * `php_open_basedir_home` - Whether PHP `open_basedir` protection is enabled on the server. * `phpmyadmin_disable_search_info_schema` - Whether the user can search for the phpMyAdmin information schema. * `docroots_in_public_html_only` - Whether the system restricts users from creating addon domains and subdomains outside of their `public_html` directory. * `require_ssl` - Whether the system requires passwords and other sensitive information use SSL encryption. * `allow_reset_password` - Whether cPanel's Reset Password feature is enabled for the account. * `allow_reset_password_for_subaccounts` - Whether cPanel's Reset Password feature is enabled for subaccounts on the account. * `disable_analog` - Whether users can access the Analog Stats interface (cPanel >> Home >> Metrics >> Analog Stats). * `skip_apache_clients_optimizer` - Whether the Apache Client Optimizer is enabled. * `disable_awstats` - Whether the AWStats software is enabled. * `skip_mailbox_warnings_check` - Whether mailbox usage warnings are enabled. * `disable_boxtrapper` - Whether BoxTrapper is enabled. * `skip_bandwidth_limit_check` - Whether the system automatically suspends HTTP service for accounts that exceed their bandwidth limit. * `disable_mailman` - Whether Mailman mailing lists are enabled. * `disable_roundcube` - Whether Roundcube webmail is enabled. * `disable_spamassassin` - Whether the Apache SpamAssassin™ spam filter is enabled. * `disable_spambox` - Whether Apache SpamAssassin's spam box feature is enabled. * `disable_webalizer` - Whether the Webalizer statistics program is enabled. * `ssl_default_key_type` - The default SSL/TLS encryption algorithm used by the system. * `use_information_schema` - Whether the system uses the MySQL® `INFORMATION_SCHEMA` view. This view includes disk usage by all MySQL tables in the disk usage totals. * `use_mail_for_mailman_url` - Whether the system prefixes Mailman URLs with the `mail` prefix. For example, `http://mail.domain.com/mailman`. * `is_mod_userdir_enabled` - Whether the Apache `mod_userdir` Tweak is enabled. * `version` - The system's Linux® kernel version. </details> Note: * If you don't use this parameter, this function returns all of the server's configuration settings. * To retrieve multiple variables, increment this parameter. For example, `name-1=variable`, `name-2=variable`, `name-3=variable`. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
InlineResponse200541 variables_get_user_information(name=name)
Return cPanel account's configuration settings
This function retrieves the user's account configuration settings.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200541 import InlineResponse200541
from clientapi_cpanel.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://cpanel-server.tld:2083/execute
# See configuration.py for a list of all supported configuration parameters.
configuration = clientapi_cpanel.Configuration(
host = "https://cpanel-server.tld:2083/execute"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure HTTP basic authorization: BasicAuth
configuration = clientapi_cpanel.Configuration(
username = os.environ["USERNAME"],
password = os.environ["PASSWORD"]
)
# Enter a context with an instance of the API client
with clientapi_cpanel.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = clientapi_cpanel.VariablesApi(api_client)
name = 'name-1=mailbox_format&name-2=home&name-3=shell' # str | The user configuration variables to retrieve. If you don't use this parameter, this function returns **all** of the user's configuration data. **Note:** To retrieve multiple account configuration settings for a user, increment the parameter name. For example: `name-0`, `name-1`, and `name-2`. (optional)
try:
# Return cPanel account's configuration settings
api_response = api_instance.variables_get_user_information(name=name)
print("The response of VariablesApi->variables_get_user_information:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling VariablesApi->variables_get_user_information: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| name | str | The user configuration variables to retrieve. If you don't use this parameter, this function returns all of the user's configuration data. Note: To retrieve multiple account configuration settings for a user, increment the parameter name. For example: `name-0`, `name-1`, and `name-2`. | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | HTTP Request was successful. | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]