Test ZCE-X Connection

PUT/zstack/v1/zce-x-plugin/test-connection

Headers

Authorization: OAuth the-session-uuid

Body

{
  "zceXTestConnection": {
    "managementIp": "172.0.0.1",
    "port": 8056,
    "url": "/api/v1/cluster/time"
  },
  "systemTags": [],
  "userTags": []
}

In the above example, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"zceXTestConnection":{"managementIp":"172.0.0.1","port":8056,"url":"/api/v1/cluster/time"}}' \
http://localhost:8080/zstack/v1/zce-x-plugin/test-connection

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
managementIp (Optional)Stringbody (included in zceXTestConnection structure)ZCE-X management node IP 4.10.7
port (Optional)Integerbody (included in zceXTestConnection structure)ZCE-X API service port 4.10.7
uuid (Optional)Stringbody (included in zceXTestConnection structure)ZCE-X VO UUID 4.10.16
url (Optional)Stringbody (included in zceXTestConnection structure)ZCE-X test connection URL 4.10.7
adminToken (Optional)Stringbody (included in zceXTestConnection structure)ZCE-X access-token. Can be filled in to check if access-token is available 4.10.16
systemTags (Optional)ListbodySystem Tag 4.10.7
userTags (Optional)ListbodyUser Tag 4.10.7

API Response

This API returns an empty JSON structure {} on success, and a JSON structure containing an error field on failure, for example:

{
  "error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
  }
}

SDK Examples

Java SDK

ZceXTestConnectionAction action = new ZceXTestConnectionAction();
action.managementIp = "172.0.0.1";
action.port = 8056;
action.url = "/api/v1/cluster/time";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ZceXTestConnectionAction.Result res = action.call();

Python SDK

action = ZceXTestConnectionAction()
action.managementIp = "172.0.0.1"
action.port = 8056
action.url = "/api/v1/cluster/time"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()