Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
WHM API 0 Functions - setresellermainip - Developer Documentation - cPanel Documentation
Child pages
  • WHM API 0 Functions - setresellermainip
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.
  • If you run CloudLinux™, you must use the full path of the whmapi0 command:

    /usr/local/cpanel/bin/whmapi0

 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.