Child pages
  • WHM API 0 Functions - setsiteip
Skip to end of metadata
Go to start of metadata

 

Description

This function changes a site's or user's IP address.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/setsiteip?user=username&ip=192.168.0.20
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/setsiteip?user=username&ip=192.168.0.20
 Command Line
whmapi0 setsiteip user=username ip=192.168.0.20


Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 0 documentation or run the whmapi0 --help command.
  • If you run CloudLinux™, you must use the full path of the whmapi0 command:

    /usr/local/cpanel/bin/api/whmapi0

 Output (JSON)
{
   "result":[
      {
         "status":1,
         "statusmsg":null
      }
   ]
}
 Output (XML)
<setsiteip>
     <result>
          <status>1</status>
          <statusmsg/>
     </result>
</setsiteip>

 Parameters

Note:

You must enter the user or domain parameter.


Parameter Type

Description

Possible valuesExample

ip

string

Required

The IPv4 address.

A valid IPv4 address.192.168.0.20
userstringThe user's username.A valid username.username
domainstringThe domain name.A valid domain name.example.com

Returns

ReturnTypeDescriptionPossible valuesExample
setsiteiphash

A hash of the function's results.

This hash includes the result hash. 

result

array of hashes

An array of hashes of the function's results.

This function returns this value in the setsiteip hash.

This hash includes the status and statusmsg returns. 

status

Boolean

Whether the function succeeded.

This function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.
1

statusmsg

string

A message of success or a reason for failure.

This function returns this value in the result hash.

 A valid string.null