Child pages
  • WHM API 1 Functions - read_cphulk_records
Skip to end of metadata
Go to start of metadata

Description

This function displays a cPHulk list's records.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/read_cphulk_records?api.version=1&list_name=white
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/read_cphulk_records?api.version=1&list_name=white
 Command Line
whmapi1 read_cphulk_records list_name=white 


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi1 command:

    /usr/local/cpanel/bin/whmapi1

 Output (JSON)
{
  "data": {
    "list_name": "white",
    "requester_ip": "10.1.4.228",
    "requester_ip_is_whitelisted": 0,
    "ips_in_list": {
      "10.10.0.0": null,
      "10.10.10.11": null
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "read_cphulk_records"
  }
}
 Output (XML)
<result>
    <data>
        <list_name>white</list_name>
        <requester_ip>10.1.4.228</requester_ip>
        <requester_ip_is_whitelisted>0</requester_ip_is_whitelisted>
        <ips_in_list><10.10.11.11></10.10.11.11><10.10.0.0></10.10.0.0><10.10.10.11></10.10.10.11></ips_in_list>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>read_cphulk_records</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

Parameters

ParameterTypeDescriptionPossible valuesExample
list_namestring

Required

The cPHulk list's name.

  • black
  • white
white

Returns

ReturnTypeDescriptionPossible valuesExample

list_name

stringThe cPHulk list's name.
  • black
  • white
white
requester_ipstringThe requester's IP address.A valid IP address.
10.1.4.228
requester_ip_is_whitelistedBooleanWhether the requester's IP address exists on cPHulk's whitelist.
  • 1 — The IP address exists on the whitelist.
  • 0 — The IP address does not exist on the white list.
1
warning_ipstringA localized warning message, if the requester's IP address does not exist on the whitelist.A valid localized string.The IP address is not on the white list.
ips_in_listhash

A hash of IP address information.

A hash of the IP address returns.

 

IP address

string

The IP address' comment.

Note:

The IP address is the return's name.

The function returns this value in the ips_in_list hash.

A valid string.A helpful comment about the IP address.
restart_sshBoolean

Whether you must restart the sshd daemon in order to implement changes.

Note:

This return only appears if the UseDNS setting is yes in the /etc/ssh/sshd_config file.

Because UseDNS and cPHulk are incompatible, the system sets the UseDNS setting to no when you enable cPHulk.

  • 1 — You must restart the sshd daemon.
  • 0 — The system will implement changes without a restart.
1
warning_sshstring

A message that explains why you must restart SSH.

Note:

This return only appears if the restart_ssh return's value is 1.

A valid string.The system disabled the UseDNS setting for SSHD in order to add IP addresses to the whitelist. You must restart SSH to implement the change.