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

 

Description

This function deletes an IP address from the Greylisting Trusted Hosts list.

Examples 


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


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": {
    "ips_removed": [
      "10.10.10.1"
    ],
    "ips_failed": {
      "5.5": "Invalid IP address or range: \u201c5.5\u201d"
    }
  },
  "metadata": {
    "version": 1,
    "reason": "OK",
    "result": 1,
    "command": "delete_cpgreylist_trusted_host"
  }
}
 Output (XML)
<result>
    <data>
        <ips_removed>10.10.10.1</ips_removed>
        <ips_failed>5.5</ips_failed>
            <ip-1>"Invalid IP address or range: \u201c5.5\u201d"</ip-1> 
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>delete_cpgreylist_trusted_host</command>
    </metadata>
</result>


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
ipstring

Required

The record's IP address, or a range of IP addresses.

Note:

To add multiple IP addresses, increment the parameter name (for example, ip-1, ip-2, ip-3).

A valid IP address or range of IP addresses.192.168.0.1

Returns

Return

TypeDescriptionPossible valuesExample
ips_failedhashA hash of the IP addresses that the function failed to add to the Trusted Hosts list.This hash includes the host_ip and comment returns. 

host_ip

string

The failed IP address.

The function returns this value in the ips_failed hash.

A valid string.5.5

comment

sting

A description of why the function failed to delete the record.

The function returns this value in the ips_failed hash.

A valid string.
Invalid IP address or range: \u201c5.5\u201d
ips_removedarray of hashes

An array of hashes of the IP addresses that the function removed from the Trusted Hosts list.

Each hash includes the host_ip return.

 

host_ip

string

The removed host's IP address.

The function returns this value in the ips_removed array.

A valid IP address.192.168.0.1