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=192.168.0.20
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/delip?api.version=1&ip=192.168.0.20
 Command Line
whmapi1 delip ip=192.168.0.20


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": {
    "version": 1,
    "reason": "192.168.0.20 has been removed.",
    "output": {
      "warnings": "Skipping shutdown of ethernet device 192.168.0.20 is bound to."
    },
    "result": 1,
    "command": "delip"
  }
}
 Output (XML)
<result>
    <metadata>
        <version>1</version>
        <reason>192.168.0.20 has been removed.</reason>
        <output>
            <warnings>
                Skipping shutdown of ethernet device 192.168.0.20 is bound to.
            </warnings>
        </output>
        <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.
192.168.0.20
netmaskstring

The network alias to which the IPv4 address is bound.

 

Note:

This parameter is required to unbind the IP address from the server. If you do not specify this variable, the IP address will be removed from cPanel data stores, but the IP address will remain bound to the Ethernet device.

A valid netmask.

 

255.255.255.0
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

Note:

This function outputs these returns in the metadata.


ReturnTypeDescriptionPossible valuesExample
outputhash

A hash of output messages.

The hash includes the messages return.
 

warnings

string

The function's warning messages.

The function returns this value in the output hash.

A valid string.
 Click to view...
Skipping shutdown of ethernet device 192.168.0.20 is bound to.