/mgmt/servers

Documentation

Home » Documentation » Enterprise Manager Guide

/mgmt/servers

/mgmt/servers — Manage server resources

Synopsis

/mgmt/servers

/mgmt/servers/{server-id}

Methods

GET

Fetches information about the current servers defined within the Enterprise Manager. A call without a server ID returns a list of the known servers. A call with a server ID returns information about that server specifically.

POST

Adds a server to the Enterprise Manager. You specify the IP address and other information about the server as arguments in the body of the request.

PUT

Update the server specified by ID in the URL with the attributes in the body of the request.

DELETE

Deletes the specified server from the Enterprise Manager. You must specify a valid server ID in the URL. Also, the server must not be currently assigned to any databases or the DELETE action will fail.

Arguments

For the POST and PUT methods, you must provide attributes of the server in the body of the call. You specify the attributes as a JSON-encoded string. The structure of the deployment object used for input and output is as follows

Argument NameTypeDescription
nameTextThe name of the server
host*TextThe IP address or host name of the server
sshuserTextThe username for the management server to use when accessing the server via ssh
sshkeyTextThe ssh key to use when accessing the server via ssh
interfacesListThe internal and external network interfaces used by the server

*Required

Examples

This example adds a server to the management server:

curl --data '{"Server":{"host":"zeus"}}' \
http://voltdbmgr:9000/man/api/1.0/mgmt/servers/

The next example attempts to delete a server. The response will indicate whether the action succeeded or not.

curl -X DELETE  \
http://voltdbmgr:9000/man/api/1.0/mgmt/servers/67108917

Because the SSH keyfile is binary, you must upload the key as a Base64-encoded text string. The next example loads a specific username and keyfile.

KEY=$( base64 keyfile ) 
curl --data "{\"Server\":{\"host\":\"hera\",\
              \"sshuser\":\"juno\",\
              \"sshkey\":\"$KEY\"}}"  \
http://voltdbmgr:9000/man/api/1.0/mgmt/servers/