WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function retrieves available database optimizations.
Warning:
On some servers, this function may return a large amount of output. We strongly suggest that you filter and sort the output.
Important:
The system disables this function when you have not configured remote MySQL, and you've disabled the MySQL/MariaDB and PostgreSQL roles.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/get_database_optimizations
- A server running WHM.
https://whm-server.tld:2087/json-api/get_database_optimizations
- 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_database_optimizations{ "data": { "payload": [ … ] }, "metadata": { "command": "get_database_optimizations", "reason": "OK", "result": 1, "version": 1 } }
Request
This function lists the server's database users.
Warning:
On most servers, this function returns a large amount of output. We strongly suggest that you filter and sort the output.
Important:
When you disable the MySQL/MariaDB and PostgreSQL roles and remote MySQL is not already configured, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_database_users
- A server running WHM.
https://whm-server.tld:2087/json-api/list_database_users
- 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/list_database_users{ "data": { "payload": [ … ] }, "metadata": { "command": "list_database_users", "reason": "OK", "result": 1, "version": 1 } }
Request
This function lists the server's databases.
Warning:
On most servers, this function returns a large amount of output. We strongly suggest that you filter and sort the output.
Important:
When you disable the MySQL/MariaDB and PostgreSQL roles and remote MySQL is not already configured, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/list_databases
- A server running WHM.
https://whm-server.tld:2087/json-api/list_databases
- 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/list_databases{ "data": { "payload": [ … ] }, "metadata": { "command": "list_databases", "reason": "OK", "result": 1, "version": 1 } }