Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function adds a new record or records to cPHulk's whitelist or blacklist.

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone
Expand
titleJSON API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/json-api/create_cphulk_record?api.version=1&list_name=white&ip=192.168.0.1&comment=George%20Wendt%20flying%20through%20the%20air.
Expand
titleXML API
Code Block
languagexml
https://hostname.example.com:2087/cpsess##########/xml-api/create_cphulk_record?api.version=1&list_name=white&ip=192.168.0.1&comment=George%20Wendt%20flying%20through%20the%20air.
Expand
titleCommand Line
Code Block
languagebash
whmapi1 create_cphulk_record list_name=white ip=192.168.0.1 comment=George%20Wendt%20flying%20through%20the%20air.

Include Page
_WHMAPI1CLINote
_WHMAPI1CLINote

Expand
titleOutput (JSON)
Code Block
languagetext
linenumberstrue
{  
   "data":{  
      "comment":"George Wendt flying through the air.",
      "ips_failed":{  

      },
      "requester_ip":"10.1.1.1",
      "list_name":"white",
      "ips_added":[  
         "192.168.0.1"
      ]
   },
   "metadata":{  
      "version":1,
      "reason":"OK",
      "result":1,
      "command":"create_cphulk_record"
   }
}
Expand
titleOutput (XML)
Code Block
languagetext
linenumberstrue
<result>
    <data>
        <comment>George Wendt flying through the air</comment>
        <ips_failed/>
        <list_name>white</list_name>
        <requester_ip>10.1.4.228</requester_ip>
        <ips_added>192.168.0.1</ips_added>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>create_cphulk_record</command>
    </metadata>
</result>

Include Page
LIB:_WHMAPIShellNote
LIB:_WHMAPIShellNote

Parameters

ParameterTypeDescriptionPossible valuesExample
list_namestring

Required

The cPHulk list's name.

  • black
  • white
white
ipstring

Required

The record's IP address, if there is only one IP address to add.

Note
titleNote:

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

A valid IP address.192.168.0.1
commentstringA comment to include.A valid string with a maximum length of 255 characters.George Wendt flying through the air.

Returns

ReturnTypeDescriptionPossible valuesExample
commentstringThe comment that you included when you called the function.The comment input parameter's value.George Wendt flying through the air.

list_name

stringThe cPHulk list's name.
  • black
  • white
white
requester_ipstringThe IP address of the user or system that requested the addition.A valid IP address.
10.1.4.228
              
ips_addedarray of stringsAn array of the IP addresses that the function removed from the list.An array of IP addresses.192.168.0.1
ips_failedhashA hash of the IP addresses that the system failed to add to the list.This hash contains one or more IP address returns. 

IP address

string

The reason why the system failed to add an IP address to the list.

Note
titleNote:

The IP address is the return's name.

The function returns this value in the ips_failed hash.

A valid string.Invalid IP address or range: "192.68.0.1"