Test ZCE-X Connection
Headers
Authorization: OAuth the-session-uuidBody
{
"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-connectionParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| managementIp (Optional) | String | body (included in zceXTestConnection structure) | ZCE-X management node IP | 4.10.7 | |
| port (Optional) | Integer | body (included in zceXTestConnection structure) | ZCE-X API service port | 4.10.7 | |
| uuid (Optional) | String | body (included in zceXTestConnection structure) | ZCE-X VO UUID | 4.10.16 | |
| url (Optional) | String | body (included in zceXTestConnection structure) | ZCE-X test connection URL | 4.10.7 | |
| adminToken (Optional) | String | body (included in zceXTestConnection structure) | ZCE-X access-token. Can be filled in to check if access-token is available | 4.10.16 | |
| systemTags (Optional) | List | body | System Tag | 4.10.7 | |
| userTags (Optional) | List | body | User 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()