WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function deploys the staged changes for all of the ModSecurity™ configuration files into the live configuration files. After the function deploys the configuration files, it restarts Apache. If the new configuration is invalid, the system restores the original configuration and preserves the 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_deploy_all_rule_changes
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_deploy_all_rule_changes
- 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/modsec_deploy_all_rule_changes{ "data": { "failed": [ … ], "outcomes": [ … ] }, "metadata": { "command": "modsec_deploy_all_rule_changes", "reason": "OK", "result": 1, "version": 1 } }
Request
This function deploys staged changes to the ModSecurity™ configuration file and restarts Apache.
Note:
If the new configuration is invalid, the system will restore the original configuration and maintain the 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_deploy_rule_changes
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_deploy_rule_changes
- 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/modsec_deploy_rule_changes?config=modsec_vendor_configs%2Fexample.conf'{ "data": {}, "metadata": { "command": "modsec_deploy_rule_changes", "reason": "OK", "result": 1, "version": 1 } }
Request
This function disables a ModSecurity™ rule.
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_disable_rule
- A server running WHM.
https://whm-server.tld:2087/json-api/modsec_disable_rule
- 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/modsec_disable_rule?config=modsec_vendor_configs%2Fexample.conf&id=1234567890'{ "metadata": { "command": "modsec_disable_rule", "reason": "OK", "result": 1, "version": 1 } }