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

Description

This function removes an IP address from the server.

Examples 


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


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)
{
   "metadata": {
      "command": "delip",
      "reason": "eth0:cp2 is now down, 10.1.1.1 has been removed",
      "result": 1,
      "version": 1
   }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>eth0:cp2 is now down, 10.1.1.1 has been removed.</reason>
        <result>1</result>
        <command>delip</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 IPv4 address.

A valid IPv4 address.
10.1.1.1
ethernetdevstring

The network alias to which the IPv4 address is bound.

This parameter defaults to an empty string.

A valid device name.

 

eth0
skipifshutdownBoolean

Whether to remove the IP address if the ethernet interface is down.

This parameter defaults to 0.

  • 1 — Do not remove the IP address.
  • 0 — Remove the IP address.
1

Returns

This function only returns metadata.