WHM API.
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/
https://{host}:{port}/json-api/
Request
This function adds an IPv4 address or addresses to the server. When you add an IP address, the system attempts to add an alias of that IP address to the main network interface. This process rebuilds the IP address pool, which resides in the /etc/ipaddrpool file. The system stores IP addresses within the /etc/ips file. The ipaliases service activates those IP addresses when the server starts.
The IPv4 address or address range in Class C CIDR format.
The IPv4 address' netmask.
Note:
If the ips parameter is in Class C CIDR format, the range mask must be a value from 24 through 30.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/addips
- A server running WHM.
https://whm-server.tld:2087/json-api/addips
- 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/addips?ips=string&netmask=255.255.255.0&excludes=string'{ "metadata": { "command": "addips", "output": { … }, "reason": "Success", "result": 1, "version": 1 } }
- Mock server
https://api.docs.cpanel.net/_mock/specifications/whm.openapi/delip
- A server running WHM.
https://whm-server.tld:2087/json-api/delip
- 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/delip?ip=10.1.1.1ðernetdev=eth0&skipifshutdown=1'{ "metadata": { "command": "delip", "reason": "eth0:cp2 is now down, 10.1.1.1 has been removed", "result": 1, "version": 1 } }