Description

This function removes an IP address from the list of trusted IP addresses.

Examples


https://hostname.example.com:2087/cpsess###########/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=SourceIPCheck&cpanel_jsonapi_func=delip&ip=192.168.0.20

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Remove IP address from list of trusted IPs for example.com.
$delete_ip = $cpanel->api2(
    'SourceIPCheck', 'delip',
		array(        
			'ip'      => '192.168.0.20'
    ) 
 );

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Remove IP address from list of trusted IPs for example.com.
my $delete_ip = $cpliveapi->api2(
    'SourceIPCheck', 'delip',
    { 
        'ip'      => '192.168.0.20'

	}
 );

 

cpapi2 --user=username SourceIPCheck delip ip=192.168.0.20

{
  "cpanelresult": {
    "apiversion": 2,
    "func": "delip",
    "data": [
      {
        "status": 1,
        "ip": "192.168.0.20",
        "error": "null."
      }
    ],
    "event": {
      "result": 1
    },
    "module": "SourceIPCheck"
  }
}

Parameters

InputTypeDescriptionPossible valuesExample
ipstring

Required

The IP address.

A valid IP address.192.168.0.20

Returns

ReturnTypeDescriptionPossible valuesExample
statusstring

Whether the function deleted the IP address.

  • 1 — Deleted.
  • 0 — Not deleted.
1
ipstring

The IP address.

A valid IP address.192.168.0.20
errorstring

Whether the function succeeded.

  • null — The function succeeded.
  • An error message.
null
reasonstring

A reason for failure.

This function only returns a reason value if there was an error.

A string that describes the error. This is an error message.
resultBoolean

Whether the function succeeded.

  • 1 — The function succeeded.
  • 0 — The function failed.
1