- Created by Documentation, last modified on Apr 09, 2018
Use WHM API to Call cPanel API & UAPI
disable_authentication_provider
disable_failing_authentication_providers
enable_authentication_provider
get_available_authentication_providers
get_provider_client_configurations
get_provider_configuration_fields
get_provider_display_configurations
get_users_authn_linked_accounts
set_provider_client_configurations
set_provider_display_configurations
twofactorauth_generate_tfa_config
twofactorauth_get_user_configs
cpgreylist_is_server_netblock_trusted
cpgreylist_list_entries_for_common_mail_provider
cpgreylist_load_common_mail_providers_config
cpgreylist_save_common_mail_providers_config
cpgreylist_trust_entries_for_common_mail_provider
cpgreylist_untrust_entries_for_common_mail_provider
create_cpgreylist_trusted_host
delete_cpgreylist_trusted_host
Description
This function assigns a main IP address to a reseller's account.
Note:
To assign additional IP addresses to a reseller's account, call the WHM API 1 setresellerips
function.
Examples
https://hostname.example.com:2087/cpsess##########/json-api/setresellermainip?api.version=1&user=username&ip=192.168.0.20
https://hostname.example.com:2087/cpsess##########/xml-api/setresellermainip?api.version=1&user=username&ip=192.168.0.20
whmapi1 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 1 documentation or run the
whmapi1 --help
command. If you run CloudLinux™, you must use the full path of the
whmapi1
command:/usr/local/cpanel/bin/whmapi1
{ "metadata": { "version": 1, "reason": "OK", "result": 1, "command": "setresellermainip" } }
<result> <metadata> <version>1</version> <reason>OK</reason> <result>1</result> <command>setresellermainip</command> </metadata> </result>
Note:
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
user | string | Required The reseller's username. | A valid reseller username on the server. | username |
ip | string | 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
This function only returns metadata.
Function information
API Version:
Available in:
WHM 11+
Methods:
GET, POST
Required Parameters:
user
, ip
Return Formats:
About WHM API 1
WHM API 1 performs functions and accesses data in WHM.
Notes:
- Some functions and parameters may require that the caller authenticate as the
root
user. - You must use the appropriate WHM ports (
2086
or2087
) to call WHM API functions.
Find a function
Related functions
-
Page:WHM API 1 Functions - acctcounts — This function lists a reseller's total accounts, suspended accounts, and account creation limit.
-
Page:WHM API 1 Functions - getresellerips — This function lists a reseller's available IP addresses.
-
Page:WHM API 1 Functions - listresellers — This function lists the reseller accounts on the server.
-
Page:WHM API 1 Functions - setresellerips — This function adds IP addresses to a reseller's account.
-
Page:WHM API 0 Functions - setresellermainip — This function assigns a main IP address to a reseller's account.