Software Development Kit

cPanel & WHM's API [+] cPanel & WHM's API [-]


Modules and Plugins [+] Modules and Plugins [-]


cPanel & WHM Hooks [+] cPanel & WHM Hooks [-]


cPAddons (Site Software) [+] cPAddons (Site Software) [-]


System Administration [+] System Administration [-]


Developer Software [+] Developer Software [-]


Back to All Documentation

Delete IP address — delip

This function deletes an IP address from the server.

Calling Functions

Using the XML API

To use the XML API to perform the delip function from within your custom script:

  • Append the /xml-api/delip function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/xml-api/delip

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Using the JSON API

To use the JSON API to perform the delip function from within your custom script:

  • Append the /json-api/delip function call name, plus the required variables (see below), to a URL which includes the address of your server.

  • For example, on a server whose hostname is example.com, you would include the following string in your script: https://example.com:2087/json-api/delip

  • You need to be logged in with the proper permissions in order to call a function. See our document about Authenticating API Function Calls for more information about authenticating APIs from within a script.

  • You can also perform the function by entering the string in your web browser's address bar. This may be useful for testing the function call and viewing its output.

Variables

Input

The delip function takes the following variables as input.

The following variable is required:

  • ip (string) — IP address to remove.

The following variables are optional:

  • ethernetdev (string) — Network alias to which the IP is bound. Example: eth0:1 This variable is required if you wish to unbind the IP address from the server. Not specifying this variable will remove the IP address from cPanel data stores but the IP will remain bound to the ethernet device.
  • skipifshutdown (boolean) — Whether or not the function should remove the IP, even if the Ethernet interface is down.
    • 1 — yes.
    • 0 — no.

Output

Show Hide

  • delip — Root-level XML tag for the output of the delip function.
    • delip (XML) — Container for the results of the IP deletion.
      • status (boolean) — Result of the request.
        • 1 — success.
        • 0 — failure.
      • statusmsg (string) — Information about the result of the request.

Examples

XML API

Show Hide

Calling https://example.com:2087/xml-api/delip?ip=192.168.1.99&ethernetdev=em0&skipifshutdown=1 in WebHost Manager will produce results similar to the following:

<delip>
     <delip>
            <status>1</status>
            <statusmsg>192.168.1.99 has been removed</statusmsg>
      </delip>
</delip>

JSON API

Show Hide

Calling the URL https://example.com:2087/json-api/delip?ip=208.77.188.166&ethernetdev=em0&skipifshutdown=1 in WebHost Manager will produce output similar to:

{
   "delip":[
      {
         "status":1,
         "statusmsg":"208.77.188.166 has been removed",
         "warnings":[

         ]
      }
   ]
}

Topic revision: r8 - 09 May 2011 - 22:20:17 - Main.JustinSchaefer