Child pages
  • WHM API 1 Functions - ticket_grant
Skip to end of metadata
Go to start of metadata

Description


This function installs an SSH key from the cPanel Customer Portal.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/ticket_grant?api.version=1&ticket_id=999999999&server_num=1&ssh_username=root
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/ticket_grant?api.version=1&ticket_id=999999999&server_num=1&ssh_username=root
 Command Line
whmapi1 ticket_grant ticket_id=999999999 server_num=1 ssh_username=root


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. 

 Output (JSON)
{
	"data": {
		"chain_status": "ACTIVE",
		"auth_time": 1477338450,
		"host_access_wl_status": "ACTIVE",
		"ssh_username": "root",
		"hulk_wl_status": "ACTIVE",
		"non_fatals": [],
		"auth_status": "AUTHED",
		"ticket_status": "OPEN",
		"server_name": "example",
		"ticket_id": "999999999",
		"server_num": "1"
	},
	"metadata": {
		"version": 1,
		"result": 1,
		"reason": "OK",
		"command": "ticket_grant"
	}
}
 Output (XML)
<result>
	<data>
		<chain_status>ACTIVE</chain_status>
		<auth_time>1477338450</auth_time>
		<host_access_wl_status>ACTIVE</host_access_wl_status>
		<ssh_username>root</ssh_username>
		<hulk_wl_status>ACTIVE</hulk_wl_status>
		<auth_status>AUTHED</auth_status>
		<ticket_status>OPEN</ticket_status>
		<server_name>example</server_name>
		<ticket_id>999999999</ticket_id>
		<server_num>1</server_num>
	</data>
	<metadata>
		<version>1</version>
		<result>1</result>
		<reason>OK</reason>
		<command>ticket_grant</command>
	</metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
ticket_idinteger

Required

The support ticket's ID number.

A valid positive integer.999999999

server_num

integer

Required

The server's support ticket ID number.

A valid positive integer.

1
ssh_usernamestring

The username for incoming SSH connections before they escalate to the root user.

If you do not specify a value, the function will retrieve the user from the support ticket. 

A valid system username.

root

Returns

ReturnTypeDescriptionPossible valuesExample
ssh_usernamestringThe username for incoming SSH connections before they escalate the root user.

A valid system username.

root
auth_statusstringThe installation status.A string value.AUTHED
auth_timeintegerWhen the system authorized access.A time, in Unix time format.
1477338450
ticket_statusstringThe support ticket's status.
  • OPEN
  • CLOSED
  • UNKNOWN
OPEN
ticket_idintegerThe support ticket's ID number.A positive integer.999999999
server_numintegerThe server's ID number.A positive integer.1
server_namestringThe server's human-readable description.A string from the cPanel Customer Portal .
example

non_fatals

array

Any non-fatal errors.

  • ticket_system_log_entry The function could not record the grant operation in the ticket.

  • audit_log The function could not record the grant operation in the local audit log.

Note:

The system stores the local audit log in the /var/cpanel/logs/supportauth/audit.log  file.

2
chain_statusstring

The status of the iptables whitelist entries.

Note:

We added this return in cPanel & WHM version 62.

  • ACTIVEThe system added the appropriate whitelist entries or they already existed.
  • INACTIVE The whitelist entries were successfully removed or were already deleted.
  • ERR_SETUP — The system failed to add the whitelist entries.
  • ERR_UNSETUP — The system failed to remove the whitelist entries.
  • ERR_UNKNOWN An unknown error occurred.
ACTIVE
csf_wl_statusstring

The status of the CSF whitelist entries.

Note:

If CSF does not exist on your server, the function will not display this return.


Note:

We added this return in cPanel & WHM version 62.


  • ACTIVEThe system added the appropriate whitelist entries or they already existed.
  • INACTIVE — The whitelist entries were successfully removed or were already deleted.
  • ERR_SETUP — The system failed to add the whitelist entries.
  • ERR_UNSETUP — The system failed to remove the whitelist entries.
  • ERR_UNKNOWN — An unknown error occurred.
ACTIVE
hulk_wl_statusstring

The status of the cPHulk whitelist entries.

Note:

We added this return in cPanel & WHM version 62.


  • ACTIVE — The system added the appropriate whitelist entries or they already existed.
  • INACTIVE — The whitelist entries were successfully removed or were already deleted.
  • ERR_SETUP — The system failed to add the whitelist entries.
  • ERR_UNSETUP — The system failed to remove the whitelist entries.
  • ERR_UNKNOWN — An unknown error occurred.
ACTIVE
host_access_wl_statusstring

The status of the /etc/hosts.allow file's whitelist entries.

Note:

We added this return in cPanel & WHM version 62.


  • ACTIVEThe system added the appropriate whitelist entries or they already existed.
  • INACTIVE — The whitelist entries were successfully removed or were already deleted.
  • ERR_SETUP — The system failed to add the whitelist entries.
  • ERR_UNSETUP — The system failed to remove the whitelist entries.
  • ERR_UNKNOWN — An unknown error occurred.
ACTIVE