Description


This function lists the account's 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=listips&account=example



$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// List IP addresses for example.com.
$list_ips = $cpanel->api2(
    'SourceIPCheck', 'listips',
		array(        
			'account'      => 'example'
    ) 
 );

 



my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# List IP addresses for example.com.
my $list_ips = $cpliveapi->api2(
    'SourceIPCheck', 'listips',
    { 
        'account'      => 'example'

	}
 );

 




cpapi2 --user=username SourceIPCheck listips account=example



{
  "cpanelresult": {
    "apiversion": 2,
    "func": "listips",
    "data": [
      {
        "ip": "192.168.0.20"
      }
    ],
    "event": {
      "result": 1
    },
    "module": "SourceIPCheck"
  }
}



Parameters

InputTypeDescriptionPossible valuesExample
accountstring

The cPanel account.

If you do not use this parameter, the value defaults to the currently authenticated account.

Any valid cPanel account.example

Returns

ReturnTypeDescriptionPossible valuesExample
ipstring

The account's IP address or addresses.

A comma-separated list of IP addresses.192.168.0.20
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