Description

This function adds an IPv4 address or addresses to the server.

Examples


https://hostname.example.com:2087/cpsess##########/json-api/addips?api.version=1&ips=192.168.0.20&netmask=255.255.255.0
https://hostname.example.com:2087/cpsess##########/xml-api/addips?api.version=1&ips=192.168.0.20&netmask=255.255.255.0
whmapi1 addips ips=192.168.0.20 netmask=255.255.255.0

{
  "metadata": {
    "version": 1,
    "reason": "Success",
    "output": {
      "messages": [
        "eth0:cp1 is now up. 192.168.0.20/255.255.255.0 broadcast 192.168.0.255 has been added.",
        "1"
      ]
    },
    "result": 1,
    "command": "addips"
  }
}
<result>
    <metadata>
        <version>1</version>
        <reason>Success</reason>
        <output>
            <messages>
                eth0:cp1 is now up. 192.168.0.20/255.255.255.0 broadcast 192.168.0.255 has been added.
            </messages>
            <messages>1</messages>
        </output>
        <result>1</result>
        <command>addips</command>
    </metadata>
</result>

   

Parameters

ParameterTypeDescriptionPossible valuesExample
ipsstring

Required

The IPv4 address or addresses.

A valid IPv4 address or address range in Class C CIDR format.
192.168.0.0

192.168.0.20/28

netmaskstring

Required

The IPv4 address' netmask.

 

A valid IPv4 netmask address.

If the ips parameter is in Class C CIDR format, the range mask must be a value from 24 through 30.

255.255.255.0
excludesstring

An IPv4 address or addresses to exclude.

If you do not specify a value, the function does not exclude any IPv4 addresses.

A comma-delimited list of IPv4 addresses.192.168.0.1,192.168.0.2

Returns

This function outputs these returns in the metadata.


ReturnTypeDescriptionPossible valuesExample
outputhash

A hash of output messages.

The hash includes the messages return.
 

messages

array

An array of the function call's raw output.

The function returns this array in the output hash.

An array of valid strings.
eth0:cp1 is now up. 192.168.0.20/255.255.255.0 broadcast 192.168.0.255 has been added.