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

 

Description

This function retrieves the entries on the Greylisting Trusted Hosts list.

Examples 


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


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": {
    "greylist_trusted_hosts": [
      {
        "comment": null,
        "create_time": "2015-02-17 13:52:23",
        "id": 7,
        "host_ip": "2.3.4.5"
      },
      {
        "comment": "Example",
        "create_time": "2015-03-24 10:22:38",
        "id": 19,
        "host_ip": "10.10.10.1"
      }
    ]
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "read_cpgreylist_trusted_hosts"
  }
}
 Output (XML)
<result>
    <data>
        <greylist_trusted_hosts>
            <comment/>
            <create_time>2015-02-17 13:52:23</create_time>
            <id>7</id>
            <host_ip>2.3.4.5</host_ip>
        </greylist_trusted_hosts>
        <greylist_trusted_hosts>
            <comment>Example</comment>
            <create_time>2015-03-24 10:22:38</create_time>
            <id>19</id>
            <host_ip>10.10.10.1</host_ip>
        </greylist_trusted_hosts>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>read_cpgreylist_trusted_hosts</command>
    </metadata>
</result>


Note:

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

Parameters

This function does not accept parameters.

Returns

Return

TypeDescriptionPossible valuesExample
greylist_trusted_hostsarray of hashesAn array of hashes that contains identification information for the trusted hosts.An array of hashes that each contain the comment, create_time, id, and host_ip returns. 

comment

string

The IP address's comment.

The function returns this value in the greylist_trusted_hosts array.

A valid string with a maximum length of 255 characters.
Example

create_time

string

The date and time when the system added the IP address to the Trusted Hosts list.

The function returns this value in the greylist_trusted_hosts array.

The date and time in YYYY-MM-DD HH:mm:SS format, where:

  • YYYY represents the year.
  • MM represents the month.
  • DD represents the date.
  • HH represents the hour.
  • mm represents the minute.
  • SS represents the second.
2015-03-24 10:22:38

id

integer

The identification number that the system assigned to the IP address.

The function returns this value in the greylist_trusted_hosts array.

A valid integer.
19

host_ip

string

The IP address of the host that the system added to the Trusted Hosts list.

The function returns this value in the greylist_trusted_hosts array.

A valid IP address.
10.10.10.1