MN Monitoring APIs
QueryManagementNode
API Request
URLs
GET zstack/v1/management-nodes
GET zstack/v1/management-nodes/{uuid}Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth f5db0d0f90104a79b02c8f1c34dfc13b" \
-X GET http://localhost:8080/zstack/v1/management-nodes?q=uuid=2c0761c3720f4d2c93435f1b8edb1297curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 5ffa91907f3c4d0392d7daa73b1a0627" \
-X GET http://localhost:8080/zstack/v1/management-nodes/bc27558979364d7c9b34a7317965e0beQueryable Fields
Run the CLI command-line tool, type QueryManagementNode and press the Tab key to view all queryable fields and cross-table queryable resource names.
API Response
Response Example
{
"inventories": [
{
"uuid": "188b2c6376c34d3687c5a7a19685ffa6",
"hostName": "127.0.0.1",
"joinDate": "May 11, 2017 1:22:44 PM",
"heartBeat": "May 11, 2017 1:22:44 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventories | List | For details, see inventories | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error. | 0.6 |
| details | String | The detailed error information. | 0.6 |
| elaboration | String | A reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource. Uniquely identifies the resource. | 0.6 |
| hostName | String | The host name | 0.6 |
| joinDate | Timestamp | The join time | 0.6 |
| heartBeat | Timestamp | The heartbeat time | 0.6 |
SDK Examples
Java
SDK
ueryManagementNodeAction action = new QueryManagementNodeAction();
action.conditions = asList("uuid=7c2075262bb44872b6ceaef5ee94b089");
action.sessionId = "293267e661d8400ca3808ff5f445a6e8";
QueryManagementNodeAction.Result res = action.call();Python
SDK
QueryManagementNodeAction action = QueryManagementNodeAction()
action.conditions = ["uuid=3bcbd030e10746eeba9f8ea938f2647a"]
action.sessionId = "21526cb97ac541b6b27192b4c671ec08"
QueryManagementNodeAction.Result res = action.call()GetVersion
API Request
URLs
PUT zstack/v1/management-nodes/actionsBody
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.
{
"getVersion": {},
"systemTags": [],
"userTags": []
}
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"getVersion":{}}' http://localhost:8080/zstack/v1/management-nodes/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | body | System tags | 0.6 | |
| userTags (Optional) | List | body | User tags | 0.6 |
API Response
Response Example
{
"version": "1.9.x"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| version | String | The current version of the Management Node | 0.6 |
| success | boolean | The success flag | 0.6 |
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error. | 0.6 |
| details | String | The detailed error information. | 0.6 |
| elaboration | String | A reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
SDK Examples
Java
SDK
GetVersionAction action = new GetVersionAction();
GetVersionAction.Result res = action.call();Python
SDK
GetVersionAction action = GetVersionAction()
GetVersionAction.Result res = action.call()GetCurrentTime
API Request
URLs
PUT zstack/v1/management-nodes/actionsBody
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.
{
"getCurrentTime": {},
"systemTags": [],
"userTags": []
}
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"getCurrentTime":{}}' http://localhost:8080/zstack/v1/management-nodes/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | body | System tags | 0.6 | |
| userTags (Optional) | List | body | User tags | 0.6 |
API Response
Response Example
{
"currentTime": {
"MillionSeconds": 1.494480176967E12,
"Seconds": 1.494480176E9
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| currentTime | Map | The current time of the Management Node | 0.6 |
| success | boolean | The success flag | 0.6 |
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error. | 0.6 |
| details | String | The detailed error information. | 0.6 |
| elaboration | String | A reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
SDK Examples
Java
SDK
GetCurrentTimeAction action = new GetCurrentTimeAction();
GetCurrentTimeAction.Result res = action.call();Python
SDK
GetCurrentTimeAction action = GetCurrentTimeAction()
GetCurrentTimeAction.Result res = action.call()GetPlatformTimeZone
API Request
URLs
GET zstack/v1/management-nodes/platform-timezoneHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/management-nodes/platform-timezone?Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | body | System tags | 4.1.0 | |
| userTags (Optional) | List | body | User tags | 4.1.0 |
API Response
Response Example
{
"timezone": "Asia/Shanghai",
"offset": "+8:00"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| timezone | String | The time zone name | 4.1.0 |
| offset | String | The time offset from GMT | 4.1.0 |
| success | boolean | Whether the operation succeeded. | 4.1.0 |
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 4.1.0 |
| description | String | A brief description of the error. | 4.1.0 |
| details | String | The detailed error information. | 4.1.0 |
| elaboration | String | A reserved field. Default is null. | 4.1.0 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 4.1.0 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 4.1.0 |
SDK Examples
Java
SDK
GetPlatformTimeZoneAction action = new GetPlatformTimeZoneAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetPlatformTimeZoneAction.Result res = action.call();Python
SDK
GetPlatformTimeZoneAction action = GetPlatformTimeZoneAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetPlatformTimeZoneAction.Result res = action.call()IsReadyToGo
API Request
URLs
GET zstack/v1/management-nodes/readyHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 61f9cb0129d749ebbd3d6052bfc759b2" \
-X GET http://localhost:8080/zstack/v1/management-nodes/ready?Parameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| managementNodeId (Optional) | String | query | Optional. The management node ID. | 0.6 | |
| systemTags (Optional) | List | query | System tags | 0.6 | |
| userTags (Optional) | List | query | User tags | 0.6 |
API Response
Response Example:
{
"managementNodeId": "28ff5884cbf83d48b2e50203a5f2e636"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error. | 0.6 |
| details | String | The detailed error information. | 0.6 |
| elaboration | String | A reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
SDK Examples
Java
SDK
IsReadyToGoAction action = new IsReadyToGoAction();
action.sessionId = "4feaf1772217415a876735801e468fac";
IsReadyToGoAction.Result res = action.call();Python
SDK
IsReadyToGoAction action = IsReadyToGoAction()
action.sessionId = "432b9a5c589c4c09b33b79d8272528be"
IsReadyToGoAction.Result res = action.call()GetManagementNodeOS
API Request
URLs
PUT zstack/v1/management/actionsBody
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.
{
"getManagementNodeOS": {},
"systemTags": [],
"userTags": []
}
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"getManagementNodeOS":{}}' http://localhost:8080/zstack/v1/management/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 4.1.0 | |
| userTags (Optional) | List | query | User tags | 4.1.0 |
API Response
Response Example:
{
"name": "Linux",
"version": "5.4.0-33-generic"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name | 4.1.0 |
| version | String | The version. | 4.1.0 |
| success | boolean | Whether the operation succeeded. | 4.1.0 |
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 4.1.0 |
| description | String | A brief description of the error. | 4.1.0 |
| details | String | The detailed error information. | 4.1.0 |
| elaboration | String | A reserved field. Default is null. | 4.1.0 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 4.1.0 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 4.1.0 |
SDK Examples
Java
SDK
GetManagementNodeOSAction action = new GetManagementNodeOSAction();
GetManagementNodeOSAction.Result res = action.call();Python
SDK
GetManagementNodeOSAction action = GetManagementNodeOSAction()
GetManagementNodeOSAction.Result res = action.call()GetManagementNodeArch
API Request
URLs
PUT zstack/v1/management-nodes/actionsBody
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.
{
"getManagementNodeArch": {},
"systemTags": [],
"userTags": []
}
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"getManagementNodeArch":{}}' http://localhost:8080/zstack/v1/management-nodes/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 4.1.0 | |
| userTags (Optional) | List | query | User tags | 4.1.0 |
API Response
Response Example:
{
"architecture": "x86_64"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name | 4.1.0 |
| version | String | The version. | 4.1.0 |
| success | boolean | Whether the operation succeeded. | 4.1.0 |
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 4.1.0 |
| description | String | A brief description of the error. | 4.1.0 |
| details | String | The detailed error information. | 4.1.0 |
| elaboration | String | A reserved field. Default is null. | 4.1.0 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 4.1.0 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 4.1.0 |
SDK Examples
Java
SDK
GetManagementNodeArchAction action = new GetManagementNodeArchAction();
GetManagementNodeArchAction.Result res = action.call();Python
SDK
GetManagementNodeArchAction action = GetManagementNodeArchAction()
GetManagementNodeArchAction.Result res = action.call()GetSupportAPIs
API Request
URLs
PUT zstack/v1/management-nodes/actionsBody
Note: In the above example, the
{
"getSupportAPIs": {},
"systemTags": [],
"userTags": []
}
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"getSupportAPIs":{}}' \
http://localhost:8080/zstack/v1/management-nodes/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | body | System tags | 0.6 | |
| userTags (Optional) | List | body | User tags | 0.6 |
API Response
Response Example
{
"supportApis": []
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| supportApis | List | Whether apis is supported. | 4.5.0 |
| success | boolean | Whether the operation succeeded. | 0.6 |
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error. | 0.6 |
| details | String | The detailed error information. | 0.6 |
| elaboration | String | A reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
SDK Examples
Java
SDK
GetSupportAPIsAction action = new GetSupportAPIsAction();
GetSupportAPIsAction.Result res = action.call();Python
SDK
GetSupportAPIsAction action = GetSupportAPIsAction()
GetSupportAPIsAction.Result res = action.call()GetFactoryModeState
API Request
URLs
GET zstack/v1/management-nodes/factory-mode-stateHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/management-nodes/factory-mode-stateParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 3.8 | |
| userTags (Optional) | List | query | User tags | 3.8 |
API Response
Response Example
{
"factoryModeState": true
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| factoryModeState | Boolean | The factory mode state. | 3.8 |
| success | boolean | Whether the operation succeeded. | 3.8 |
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 3.8 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error. | 0.6 |
| details | String | The detailed error information. | 0.6 |
| elaboration | String | A reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
SDK Examples
Java
SDK
GetFactoryModeStateAction action = new GetFactoryModeStateAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetFactoryModeStateAction.Result res = action.call();Python
SDK
GetFactoryModeStateAction action = GetFactoryModeStateAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetFactoryModeStateAction.Result res = action.call()UpdateFactoryModeState
API Request
URLs
PUT zstack/v1/management-nodes/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: In the above example, the
{
"updateFactoryModeState": {
"factoryModeState": true
},
"systemTags": [],
"userTags": []
}
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateFactoryModeState":{"factoryModeState":true}}' \
http://localhost:8080/zstack/v1/management-nodes/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| factoryModeState | Boolean | body(included in the updateFactoryModeState structure) |
The factory mode enabled state | 3.8 | |
| systemTags (Optional) | List | body | Optional. The system tags. | 3.8 | |
| userTags (Optional) | List | body | Optional. The user tags. | 3.8 |
API Response
On success, this API returns an empty JSON structure
{}. On failure, the returned JSON structure contains an error field, 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
UpdateFactoryModeStateAction action = new UpdateFactoryModeStateAction();
action.factoryModeState = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateFactoryModeStateAction.Result res = action.call();Python
SDK
UpdateFactoryModeStateAction action = UpdateFactoryModeStateAction()
action.factoryModeState = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateFactoryModeStateAction.Result res = action.call()GetNodeRoles
API Request
URLs
GET zstack/v1/zsv/nodes/rolesHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zsv/nodes/rolesParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 4.10.7 | |
| userTags (Optional) | List | query | User tags | 4.10.7 |
API Response
Response Example
{
"inventories": [
{
"uuid": "ff000842a4673ab39dad7a3990df5300",
"resourceType": "ManagementNodeVO",
"roles": [
{
"uuid": "ff000842a4673ab39dad7a3990df5300",
"resourceType": "ManagementNodeVO",
"role": "management"
},
{
"uuid": "ff0192fa70113da886101145c084bd00",
"resourceType": "HostVO",
"role": "compute"
}
]
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the request succeeded | 4.10.7 |
| inventories | List | For details, see inventories | 4.10.7 |
| error | ErrorCode | The error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 4.10.7 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the Management Node. Uniquely identifies the resource. | 4.10.7 |
| compute | boolean | Whether the node is a Compute Node | 4.10.7 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error. | 0.6 |
| details | String | The detailed error information. | 0.6 |
| elaboration | String | A reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
SDK Examples
Java
SDK
GetNodeRolesAction action = new GetNodeRolesAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetNodeRolesAction.Result res = action.call();Python
SDK
GetNodeRolesAction action = GetNodeRolesAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetNodeRolesAction.Result res = action.call()GetManagementNodesStatus
API Request
URLs
GET zstack/v1/management-nodes/statusHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/management-nodes/statusParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 4.10.20 | |
| userTags (Optional) | List | query | User tags | 4.10.20 |
API Response
Response Example
{
"inventory": {
"vip": "172.26.30.7",
"uiHttpPath": "https://172.26.30.7:443",
"nodes": [
{
"ip": "172.26.21.212",
"gatewayIp": "172.26.0.1",
"ownsVip": true,
"peerReachable": true,
"gatewayReachable": true,
"vipReachable": true,
"keepalivedStatus": "active",
"haMonitorStatus": "active",
"databaseStatus": "mysqld is alive",
"uiStatus": "running",
"managementsNodeStatus": "running",
"slaveIoRunning": true,
"slaveSqlRunning": true
},
{
"ip": "172.26.30.106",
"gatewayIp": "172.26.0.1",
"ownsVip": false,
"peerReachable": true,
"gatewayReachable": true,
"vipReachable": true,
"keepalivedStatus": "active",
"haMonitorStatus": "active",
"databaseStatus": "mysqld is alive",
"uiStatus": "running",
"managementsNodeStatus": "running",
"slaveIoRunning": true,
"slaveSqlRunning": true
}
]
}
}#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| vip | String | The VIP address | 4.10.20 |
| uiHttpPath | String | The UI HTTP path | 4.10.20 |
| nodes | List | For details, see nodes | 4.10.20 |
#nodes
| Name | Type | Description | Starting Version |
|---|---|---|---|
| ip | String | The Management Node IP | 4.10.20 |
| gatewayIp | String | The gateway IP | 4.10.20 |
| ownsVip | boolean | Whether the node owns the VIP | 4.10.20 |
| peerReachable | boolean | Whether the peer Management Node is reachable | 4.10.20 |
| gatewayReachable | boolean | Whether the gateway is reachable | 4.10.20 |
| vipReachable | boolean | Whether the VIP is reachable | 4.10.20 |
| keepalivedStatus | String | The keepalived service status, typically 'alive' | 4.10.20 |
| haMonitorStatus | String | The HA monitor service status, typically 'alive' | 4.10.20 |
| databaseStatus | String | The database status, typically 'mysqld is alive' | 4.10.20 |
| uiStatus | String | The UI status, typically 'running' | 4.10.20 |
| managementsNodeStatus | String | The Management Node status, typically 'running' | 4.10.20 |
| slaveIoRunning | boolean | Whether the Slave IO is running | 4.10.20 |
| slaveSqlRunning | boolean | Whether the Slave SQL is running | 4.10.20 |
| error | ErrorCode | The error information from the last operation | 4.10.20 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error. | 0.6 |
| details | String | The detailed error information. | 0.6 |
| elaboration | String | A reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
SDK Examples
Java SDK
GetManagementNodesStatusAction action = new GetManagementNodesStatusAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetManagementNodesStatusAction.Result res = action.call();Python SDK
action = GetManagementNodesStatusAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()GetZSha2Status
API Request
URLs
GET zstack/v1/management-nodes/zsha2/statusHeaders
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/management-nodes/zsha2/statusParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 4.10.20 | |
| userTags (Optional) | List | query | User tags | 4.10.20 |
API Response
Response Example
{
"inventory": {
"vip": "172.26.30.7",
"uiHttpPath": "https://172.26.30.7:443",
"nodes": [
{
"ip": "172.26.21.212",
"gatewayIp": "172.26.0.1",
"ownsVip": true,
"peerReachable": true,
"gatewayReachable": true,
"vipReachable": true,
"keepalivedStatus": "active",
"haMonitorStatus": "active",
"databaseStatus": "mysqld is alive",
"uiStatus": "running",
"managementsNodeStatus": "running",
"slaveIoRunning": true,
"slaveSqlRunning": true
},
{
"ip": "172.26.30.106",
"gatewayIp": "172.26.0.1",
"ownsVip": false,
"peerReachable": true,
"gatewayReachable": true,
"vipReachable": true,
"keepalivedStatus": "active",
"haMonitorStatus": "active",
"databaseStatus": "mysqld is alive",
"uiStatus": "running",
"managementsNodeStatus": "running",
"slaveIoRunning": true,
"slaveSqlRunning": true
}
]
}
}#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| vip | String | The VIP address | 4.10.20 |
| uiHttpPath | String | The UI HTTP path | 4.10.20 |
| nodes | List | For details, see nodes | 4.10.20 |
#nodes
| Name | Type | Description | Starting Version |
|---|---|---|---|
| ip | String | The Management Node IP | 4.10.20 |
| gatewayIp | String | The gateway IP | 4.10.20 |
| ownsVip | boolean | Whether the node owns the VIP | 4.10.20 |
| peerReachable | boolean | Whether the peer Management Node is reachable | 4.10.20 |
| gatewayReachable | boolean | Whether the gateway is reachable | 4.10.20 |
| vipReachable | boolean | Whether the VIP is reachable | 4.10.20 |
| keepalivedStatus | String | The keepalived service status, typically 'alive' | 4.10.20 |
| haMonitorStatus | String | The HA monitor service status, typically 'alive' | 4.10.20 |
| databaseStatus | String | The database status, typically 'mysqld is alive' | 4.10.20 |
| uiStatus | String | The UI status, typically 'running' | 4.10.20 |
| managementsNodeStatus | String | The Management Node status, typically 'running' | 4.10.20 |
| slaveIoRunning | boolean | Whether the Slave IO is running | 4.10.20 |
| slaveSqlRunning | boolean | Whether the Slave SQL is running | 4.10.20 |
| error | ErrorCode | The error information from the last operation | 4.10.20 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001. | 0.6 |
| description | String | A brief description of the error. | 0.6 |
| details | String | The detailed error information. | 0.6 |
| elaboration | String | A reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | A reserved field. Default is null. | 0.6 |
| cause | ErrorCode | The root error. The source error that caused the current error. If there is no root error, this field is null. | 0.6 |
SDK Examples
Java SDK
GetZSha2StatusAction action = new GetZSha2StatusAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetZSha2StatusAction.Result res = action.call();Python SDK
action = GetZSha2StatusAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()ZSha2Demote
API Request
URLs
PUT zstack/v1/management-nodes/zsha2/demoteHeaders
Authorization: OAuth the-session-uuidBody
Note: In the above example, the
{
"zSha2Demote": {},
"systemTags": [],
"userTags": []
}
Note: In the above example, the systemTags and userTags fields can be omitted. They are listed to indicate that these two fields can be included in the body.Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"zSha2Demote":{}}' \
http://localhost:8080/zstack/v1/management-nodes/zsha2/demoteParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| systemTags (Optional) | List | query | System tags | 4.10.20 | |
| userTags (Optional) | List | query | User tags | 4.10.20 |
API Response
On success, this API returns an empty JSON structure
{}. On failure, the returned JSON structure contains an error field, 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
ZSha2DemoteAction action = new ZSha2DemoteAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ZSha2DemoteAction.Result res = action.call();Python SDK
action = ZSha2DemoteAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()