REST API
ztC Edge systems support the Representational State Transfer (REST) application programming interface (API). With access to the REST API methods, you can collect system information, including physical machine (PM) and virtual machine (VM) properties, statistics, and alerts. You can also execute some administrative tasks including creating VMs, powering VMs on and off, putting a PM into maintenance mode, and powering the system off. You can use these HTTP methods to create your own customized Web-based applications to monitor and manage the ztC Edge system.
The system provides the REST API and interactive REST API documentation through the OpenAPI (also known as Swaggerâ„¢) Specification. You can access the documentation directly from the local ztC Edge system.
To begin exploring the REST API on ztC Edge systems, see the following sections:
- The REST API uses port 8888 for HTTPS communications. If needed, ask your network administrator to open this port in your company's firewall to allow REST API activity.
- Optionally, to secure REST API activity, you can install a custom SSL certificate into the CA bundle of the ztC Edge system. For information about using the certificate_installer script to install a custom SSL certificate, see To install a custom certificate into the CA bundle.
Accessing the REST API documentation
In a web browser, open the following URL, which includes the hostname or IP address of your ztC Edge system:
The documentation describes the API methods and syntax, and also allows you to try the methods on your own system.
Logging In for REST API Testing
-
Open the REST API documentation page.
-
Under Authentication API, click the /v2/login method to expand it, and click Try it out.
-
The system displays the syntax for the REST API /v2/login method. Under Request Body, update the text to enter the username and password for a user account on the ztC Edge system:
{
"username": "type_username_here",
"password": "type_password_here"
}Log in to an account that has the appropriate level of privileges for the REST API methods that you want to use.
-
Below the Request Body, click Execute and view the Server Response. If the method is successful, the response contains two REST API session authentication tokens (token and refreshToken). If the method is unsuccessful, the response might contain a message similar to Unauthorized - Invalid username/password.
-
Upon a successful login, copy the authorization token string to your management PC running the ztC Edge Console. Copy only the text between quotes to the clipboard to use in a subsequent step.
{
"token":
"eyJhbGciOiJIUzUxMiJ9dgkl;jageXNUaW1lTWlsbGkiOjE2OTQzMjUzNTgwODMkilegjk",
"refreshToken":
"eyJhbGciOiJIUzUxMiJ9.eyJzeXNUaW1lTWlsbGkiOjE2OTkyMzQ2NDI4MTksInN1YiI6I"
} -
At the top of the REST API documentation page, on the right side, click Authorize.
-
Under bearerAuth, in the Value field, paste the authorization token string, and then click Authorize. If your login is successful, the dialog box displays a Logout button.
-
Click Close or X to close the dialog box and return to the REST API documentation page.
-
Proceed with your REST API testing.
Extending a Login Session with the Refresh Token
After logging in as described in Logging In for REST API Testing, the login session remains active for 45 minutes. To extend the login session, use the /v2/refreshToken method to reset the session timeout to 90 minutes.
-
From the original /v2/login response of your current login session, copy the refreshToken string to your clipboard. Copy only the text between quotes.
{
"token":
"eyJhbGciOiJIUzUxMiJ9dgkl;jageXNUaW1lTWlsbGkiOjE2OTQzMjUzNTgwODMkilegjk",
"refreshToken":
"eyJhbGciOiJIUzUxMiJ9.eyJzeXNUaW1lTWlsbGkiOjE2OTkyMzQ2NDI4MTksInN1YiI6I"
} -
Under Authentication API, click the /v2/refreshToken method to expand it, and click Try it out.
-
The system displays the syntax for the REST API /v2/refreshToken method. Replace the string text between the quote marks with the refreshToken string you copied in the previous step:
{
"refreshToken": "string"
} -
Below the Request Body, click Execute and view the Server Response.
-
From the response of the /v2/refreshToken method, copy the new authorization token string to your clipboard. Copy only the text between quotes.
{
"token":
"eyJhbGciOiJIUzUxMiJ9.eyJzeXNUaW1lTWlsbGkiOjE2OTkyMzQ2NDI4MTksInN1Yi",
} -
At the top of the REST API documentation page, on the right side, click Authorize, and then click Logout.
-
Under bearerAuth, in the Value field, paste the new authorization token string, and then click Authorize. If your login is successful, the dialog box displays a Logout button.
-
Click Close or X to close the dialog box and return to the REST API documentation page.
-
Proceed with your REST API testing.
Logging Out of the REST API
At the top of the REST API documentation page, click Authorize and then click Logout.
List of REST API Methods
The following methods are available:

POST /v2/virtualmachines/vmshutdown
POST /v2/virtualmachines/vmpoweron
POST /v2/virtualmachines/vmpoweroff
POST /v2/virtualmachines/vmdelete
POST /v2/virtualmachines/vmcreate
POST /v2/virtualmachines/vmcopy
GET /v2/resource/virtualmachines
GET /v2/resource/virtualmachines/vmname

GET /v2/upgradepath

GET /v2/resource

GET /v2/summary

PUT /v2/logout

GET /v2/

GET /v2/pref

POST /v2/physicalmachines/workon
POST /v2/physicalmachines/workoff
POST /v2/physicalmachines/systemshutdown
POST /v2/physicalmachines/nodeshutdown
GET /v2/physicalmachines
GET /v2/physicalmachines/pmname

POST /v2/refreshtoken
POST /v2/login

GET /v2/pref/system
GET /v2/pref/system/swupdate
GET /v2/pref/system/quorumservers
GET /v2/pref/system/productlicense
GET /v2/pref/system/ownerinfo
GET /v2/pref/system/mailserver
GET /v2/pref/system/ipconfiguration
GET /v2/pref/system/dateandtime

GET /v2/alert
GET /v2/alert/history

GET /v2/pref/remotesupport

GET /v2/supportlogs
GET /v2/auditlogs

GET /v2/system/node
GET /v2/system/cluster

GET /v2/pref/admintools
GET /v2/pref/admintools/secureconnection

GET /v2/pref/notification