Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function assigns a main IP address to a reseller's account.

Note:

To assign additional IP addresses to a reseller's account, use WHM API 0's setresellerips function.

Examples 


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/setresellermainip?user=username&ip=192.168.0.20
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/setresellermainip?user=username&ip=192.168.0.20
 Command Line
whmapi0 setresellermainip 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. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
   "result":[
      {
         "status":1,
         "statusmsg":"Successfully set main IP address of the reseller."
      }
   ]
}
 Output (XML)
<setresellermainip>
     <result>
            <status>1</status>
            <statusmsg>Successfully set main IP address of the reseller.</statusmsg>
      </result>
</setresellermainip>

Parameters

ParameterTypeDescriptionPossible valuesExample
userstring

Required

The reseller's username.

A valid reseller username on the server.username
ipstring

Required

The IP address to assign to the reseller's account as the main shared IP address.

A valid IP address.192.168.0.20

Returns

ReturnTypeDescriptionPossible valuesExample

result

array of hashes

An array of hashes of function output.

This hash includes the status and statusmsg returns.

 

status

Boolean

Whether the function succeeded.

The function returns this value in the result hash.

  • 1 — Success.
  • 0 — Failure.
1

statusmsg

string

A message of success or a reason for failure.

The function returns this parameter in the  result hash.

  • Successfully set main IP address of the reseller.
  • An error message.

Successfully set main IP address of the reseller.