We have a new documentation site for cPanel & WHM! You can find our new documentation site at docs.cpanel.net.

We will continue to maintain our API documentation on this server.

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

This function unlinks a remote server node from your server.

Important:

This function does not unlink mail servers that are currently in use. You must first delete any accounts that use the linked mail server.


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/unlink_server_node?api.version=1&alias=example
 Command Line
whmapi1 unlink_server_node alias=example


Notes:

  • Unless otherwise noted, 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

 Output (JSON)
{
   "data" : {
      "worker_capabilities" : {
         "Mail" : {}
      },
      "tls_verified" : 1,
      "version" : "11.86.0.0",
      "user" : "root",
      "hostname" : "example.com",
      "last_check" : 1556576165,
      "enabled_services" : [
         "apache_php_fpm",
         "cpanellogd",
         "cpdavd",
         "cpgreylistd",
         "cpsrvd",
         "crond",
         "dnsadmin",
         "exim",
         "ftpd",
         "imap",
         "ipaliases",
         "lmtp",
         "mailman",
         "mysql",
         "named",
         "nscd",
         "pop",
         "queueprocd",
         "rsyslogd",
         "spamd",
         "sshd",
         "tailwatchd"
      ]
   },
   "metadata" : {
      "command" : "unlink_server_node",
      "result" : 1,
      "version" : 1,
      "reason" : "OK"
   }
}


Note:

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

ParameterTypeDescriptionPossible valuesExample
aliasstring

Required

The name of a linked remote server node.

A valid name.

example
ReturnTypeDescriptionPossible valuesExample
enabled_servicesarrayThe services enabled on the linked remote server node.

A comma-separated list of services.

apache_php_fpm
hostnamestringThe remote server node's hostname.A valid hostname.example.com
last_checkedintergerThe last time that the server queried the current status of the remote server.A timestamp, in Unix time format.1556576165
tls_verifiedBooleanWhether the remote server node has a valid SSL certificate.
  • 1 — The remote server node has a valid SSL certificate.
  • 0 — The remote server node does not have a valid SSL certificate.
1
usernamestringThe username required to make API calls to the linked remote server node.A valid username.root
versionstringThe version of cPanel & WHM installed on the remote server node.

A cPanel & WHM version number.

11.86.0.0
worker_capabilitieshashA group of services required for a remote server node to perform a specific task.

Each hash contains the role_name return.

Note:

The return's name is the remote server node's current role.


role_name

hash

The current role of the linked remote server node. This will return the required options for the role, if any exist.

Note:

The return's name is the remote server node's current role.

This function returns this value in the worker_capabilities hash.

A server role.

Note:

If no options exist, this function returns an empty hash.

Mail