This function adds a new record or records to cPHulk's whitelist or blacklist.
ip required | string <ipv4> The record's IP address, if there is only one IP address to add. Note: To add multiple IP addresses, increment the parameter name. For example, Add multiple IP addresses. ip=ip-1=192.168.0.1&ip-2=192.168.0.2&ip-3=192.168.0.3Add a single IP address. ip=192.168.0.1 |
list_name required | string The cPHulk list's name.
Example: list_name=white |
comment | string <= 255 A comment to include. Example: comment=George Wendt flying through the air. |
skip_enabled_check | integer Default: 0 Whether to skip checking if cPHulk runs on the server.
Note: If cPHulk is disabled and you check its status, the function returns the following message: Example: skip_enabled_check=1 |
object | |
object |
whmapi1 --output=jsonpretty \ create_cphulk_record \ list_name='white' \ ip='192.168.0.1'
{- "data": {
- "comment": "George Wendt flying through the air.",
- "ip_blocks_removed": 1,
- "ips_added": [
- "192.168.0.1"
], - "ips_failed": {
- "192.168.0.1": "Invalid IP address or range: \"192.68.0.1\""
}, - "iptable_bans_removed": 0,
- "list_name": "white",
- "requester_ip": "10.1.4.228",
- "requester_ip_is_whitelisted": 0
}, - "metadata": {
- "command": "create_cphulk_record",
- "reason": "OK",
- "result": 1,
- "version": 1
}
}