WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function lists ModSecurity™ configuration files. The system stores the configuration files in the /usr/local/apache/conf/modsec_vendor_configs directory.
Important:
When you disable the Web Server role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_get_configs
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_get_configs
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
modsec_get_configs{ "data": { "configs": [ … ] }, "metadata": { "command": "modsec_get_configs", "reason": "OK", "result": 1, "version": 1 } }
Request
This function lists the ModSecurity™ configuration files that have staged changes.
Important:
When you disable the Web Server role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_get_configs_with_changes_pending
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_get_configs_with_changes_pending
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
modsec_get_configs_with_changes_pending{ "data": { "configs": [ … ] }, "metadata": { "command": "modsec_get_configs_with_changes_pending", "reason": "OK", "result": 1, "version": 1 } }
Request
This function retrieves ModSecurity™ log entries from the modsec MySQL® database.
Important:
When you disable the Web Server role, the system disables this function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/modsec_get_log
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_get_log
- CLI
- URL
- curl
- JavaScript
- Node.js
- Python
- Java
- Java8+Apache
- C#
- C#+Newtonsoft
- PHP
- Go
- Ruby
- R
whmapi1 --output=jsonpretty \
modsec_get_log{ "data": [ { … } ], "metadata": { "command": "modsec_get_log", "reason": "OK", "result": 1, "version": 1 } }