WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function enables or disables a service and its monitoring.
Note:
If the user only possesses the clustering Access Control List (ACL), then this function can only act on the named service.
The service to configure. For more information about each service, read our Service Manager documentation.
Whether to enable the service.
1— Enable.0— Disable.
If you do not use this parameter, the function will not change the enabled status of the service.
Warning:
Do not use this function to disable the cpsrvd service.
A port or list of comma-separated ports on which Exim will listen for inbound connections.
Note:
The function only uses this parameter if you set exim-altport as the service parameter's value.
Whether to monitor the service in WHM's Service Status interface (WHM >> Home >> Server Status >> Service Status).
1— Monitor.0— Do not monitor.
If you do not use this parameter, the function will not change the monitoring status of the service.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/configureservice
- A server running WHM.
https://whm-server.tld:2087/json-api/configureservice
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/configureservice?service=mysql&enabled=1&exim-altportnum=26%2C+5000%2C+6000&monitored=1'{ "metadata": { "command": "configureservice", "reason": "Enabled monitoring for mysql.", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/enable_monitor_all_enabled_services
- A server running WHM.
https://whm-server.tld:2087/json-api/enable_monitor_all_enabled_services
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/enable_monitor_all_enabled_services{ "data": { "services": [ … ] }, "metadata": { "command": "enable_monitor_all_enabled_services", "reason": "OK", "result": 1, "version": 1 } }
The service's name.
dovecot— The Dovecot service.
Note:
For a fresh install, the data returned for the Dovecot service will only contain the list of protocols. It will not be until the mailserver configuration is saved that the return data for Dovecot will look like what is shown in the example.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_service_config
- A server running WHM.
https://whm-server.tld:2087/json-api/get_service_config
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_service_config?service=dovecot'HTTP Request was successful.
A list of the configuration key's settings.
{ "data": { "auth_cache_negative_ttl": 3600, "auth_cache_size": "1M", "auth_cache_ttl": 3600, "auth_policy_hash_nonce": 91057590, "compress_messages": 0, "config_vsz_limit": 2048, "auth_allow_cleartext": "yes", "expire_trash": 0, "expire_spam": 0, "hulk_auth_passwd": "FAMONex4Bn9Hv1BO", "include_trash_in_quota": 0, "incoming_reached_quota": "bounce", "ipv6": "on", "lmtp_process_limit": 500, "lmtp_process_min_avail": 0, "lmtp_user_concurrency_limit": 4, "login_max_processes_count": 50, "login_process_per_connection": "no", "login_process_size": 128, "login_processes_count": 2, "mail_process_size": 512, "mdbox_rotate_interval": 0, "mdbox_rotate_size": "10M", "protocol_imap": { … }, "protocol_pop3": { … }, "protocols": "imap pop3", "ssl_cipher_list": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384", "ssl_min_protocol": "TLSv1.2" }, "metadata": { "command": "get_service_config", "reason": "OK", "result": 1, "version": 1 } }