All URIs are relative to https://cpanel-server.tld:2083/execute
Method | HTTP request | Description |
---|---|---|
get_stats | GET /StatsBar/get_stats | Return cPanel account statistics |
get_usages | GET /ResourceUsage/get_usages | Return resource usage and custom statistics |
InlineResponse200492 get_stats(display, infinityimg=infinityimg, infinitylang=infinitylang, rowcounter=rowcounter, warninglevel=warninglevel, warnings=warnings, warnout=warnout)
Return cPanel account statistics
This function retrieves a cPanel account's statistics.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200492 import InlineResponse200492
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.ResourceUsageAndStatisticsApi(api_client)
display = 'bandwidthusage|diskusage' # str | A pipe-delimited list of the account's statistics. <details> <summary>Click for a list of available display parameters.</summary> * `addondomains` — Information about the account's addon domains. * `apacheversion` — The server's Apache version. * `autoresponders` — Information about the account's auto-responders. * `bandwidthusage` — Information about the account's bandwidth usage. * `cachedlistdiskusage` — The amount of cached mailing list disk space the account currently uses. * `cachedmysqldiskusage` — The amount of cached disk space that the account's MySQL® databases currently use. * `cachedpostgresdiskusage` — The amount of cached disk space that the account's PostgreSQL databases use. * `cpanelversion` — The server's cPanel version. * `dedicatedip` — Account websites that use dedicated IP addresses. * `diskusage` — Information the account's disk space usage. * `emailaccounts` — Information about the account's email accounts. * `emailfilters` — Information the account's email filters. * `emailforwarders` — Information about the account's forwarders. * `fileusage` — Information about the account's file usage. * `ftpaccounts` — Information about the account's FTP accounts. * `hostingpackage` — The account's hosting package. * `hostname` — The server's hostname. * `kernelversion` — The operating system's kernel version. * `localip` — Account websites that use local IP addresses. * `machinetype` — The type of operating system that the server uses. * `mailinglists` — Information the account's mailing lists. * `mysqldatabases` — The number of MySQL databases the account possesses. * `mysqldiskusage` — The amount of disk space that the account's MySQL databases use. * `mysqlversion` — The server's MySQL version. * `operatingsystem` — The server's operating system. * `parkeddomains` — Information about the account's parked domains (aliases). * `perlpath` — The Perl binary's absolute path. * `perlversion` — The server's Perl version. * `phpversion` — The server's PHP version. * `postgresqldatabases` — The number of PostgreSQL databases the cPanel account possesses. * `postgresdiskusage` — The amount of disk space that the cPanel account's PostgreSQL databases use. * `sendmailpath` — The path to the system's sendmail binary. * `sharedip` — Any of the account's websites that use a shared IP address. * `shorthostname` — The short version of your server's hostname. * `sqldatabases` — Information about the all of the account's SQL databases. * `subdomains` — Information about the account's subdomains. * `theme` — The account's current theme. </details> **Note:** * This function may require URI-encode format (`%7C`) or quotes (`\"`) in some contexts, such as the command line tool. * Some display parameters may be unavailable based on the server's configuration.
infinityimg = '/home/example/infinity.png' # str | The absolute file path to an alternative infinity symbol image. (optional)
infinitylang = 'infinity' # str | A phrase to represent infinity that the locales system can use. (optional)
rowcounter = 'even' # str | The type of row. * `odd` * `even` (optional)
warninglevel = 87 # int | The minimum level at which to return warnings. (optional)
warnings = 0 # int | Whether to return all results with a warning. * `1` — Return only warnings that **exceed** the `warninglevel` parameter's value. * `0` — Return all results. (optional)
warnout = 0 # int | Whether to display results with a value of `100%`. * `1` — Display results with a value of `100%`. * `0` — Hide results with a value of `100%`. (optional)
try:
# Return cPanel account statistics
api_response = api_instance.get_stats(display, infinityimg=infinityimg, infinitylang=infinitylang, rowcounter=rowcounter, warninglevel=warninglevel, warnings=warnings, warnout=warnout)
print("The response of ResourceUsageAndStatisticsApi->get_stats:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ResourceUsageAndStatisticsApi->get_stats: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
display | str | A pipe-delimited list of the account's statistics. <details> <summary>Click for a list of available display parameters.</summary> * `addondomains` — Information about the account's addon domains. * `apacheversion` — The server's Apache version. * `autoresponders` — Information about the account's auto-responders. * `bandwidthusage` — Information about the account's bandwidth usage. * `cachedlistdiskusage` — The amount of cached mailing list disk space the account currently uses. * `cachedmysqldiskusage` — The amount of cached disk space that the account's MySQL® databases currently use. * `cachedpostgresdiskusage` — The amount of cached disk space that the account's PostgreSQL databases use. * `cpanelversion` — The server's cPanel version. * `dedicatedip` — Account websites that use dedicated IP addresses. * `diskusage` — Information the account's disk space usage. * `emailaccounts` — Information about the account's email accounts. * `emailfilters` — Information the account's email filters. * `emailforwarders` — Information about the account's forwarders. * `fileusage` — Information about the account's file usage. * `ftpaccounts` — Information about the account's FTP accounts. * `hostingpackage` — The account's hosting package. * `hostname` — The server's hostname. * `kernelversion` — The operating system's kernel version. * `localip` — Account websites that use local IP addresses. * `machinetype` — The type of operating system that the server uses. * `mailinglists` — Information the account's mailing lists. * `mysqldatabases` — The number of MySQL databases the account possesses. * `mysqldiskusage` — The amount of disk space that the account's MySQL databases use. * `mysqlversion` — The server's MySQL version. * `operatingsystem` — The server's operating system. * `parkeddomains` — Information about the account's parked domains (aliases). * `perlpath` — The Perl binary's absolute path. * `perlversion` — The server's Perl version. * `phpversion` — The server's PHP version. * `postgresqldatabases` — The number of PostgreSQL databases the cPanel account possesses. * `postgresdiskusage` — The amount of disk space that the cPanel account's PostgreSQL databases use. * `sendmailpath` — The path to the system's sendmail binary. * `sharedip` — Any of the account's websites that use a shared IP address. * `shorthostname` — The short version of your server's hostname. * `sqldatabases` — Information about the all of the account's SQL databases. * `subdomains` — Information about the account's subdomains. * `theme` — The account's current theme. </details> Note: * This function may require URI-encode format (`%7C`) or quotes (`"`) in some contexts, such as the command line tool. * Some display parameters may be unavailable based on the server's configuration. | |
infinityimg | str | The absolute file path to an alternative infinity symbol image. | [optional] |
infinitylang | str | A phrase to represent infinity that the locales system can use. | [optional] |
rowcounter | str | The type of row. * `odd` * `even` | [optional] |
warninglevel | int | The minimum level at which to return warnings. | [optional] |
warnings | int | Whether to return all results with a warning. * `1` — Return only warnings that exceed the `warninglevel` parameter's value. * `0` — Return all results. | [optional] |
warnout | int | Whether to display results with a value of `100%`. * `1` — Display results with a value of `100%`. * `0` — Hide results with a value of `100%`. | [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]
InlineResponse200396 get_usages()
Return resource usage and custom statistics
This function retrieves resource usage and custom statistics for a cPanel user account.
- Basic Authentication (BasicAuth):
import clientapi_cpanel
from clientapi_cpanel.models.inline_response200396 import InlineResponse200396
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.ResourceUsageAndStatisticsApi(api_client)
try:
# Return resource usage and custom statistics
api_response = api_instance.get_usages()
print("The response of ResourceUsageAndStatisticsApi->get_usages:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ResourceUsageAndStatisticsApi->get_usages: %s\n" % e)
This endpoint does not need any parameter.
- 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]