Management Node Operations
QueryManagementNode
API Request
URLs
GET zstack/v1/management-nodes
GET zstack/v1/management-nodes/{uuid}Headers
Authorization: OAuth the-session-uuidCurl
Sample
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
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryManagementNode, and pressing the Tab key.
API Response
Sample
Response
{
"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 fails, or vice versa. For more information, see error. | 0.6 |
| inventories | List | See inventories. | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| hostName | String | The hostname. | 0.6 |
| joinDate | Timestamp | The joining date. | 0.6 |
| heartBeat | Timestamp | The heartbeat time. | 0.6 |
SDK Sample
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 preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"getVersion": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"getVersion":{}}' http://localhost:8080/zstack/v1/management-nodes/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample Response
{
"version": "1.9.x"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| version | String | The current version of the management node. | 0.6 |
| success | boolean | Whether the API succeeds. | 0.6 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
SDK Sample
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 preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"getCurrentTime": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"getCurrentTime":{}}' http://localhost:8080/zstack/v1/management-nodes/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"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 | Whether the API succeeds. | 0.6 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
SDK Sample
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 Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" -X GET http://localhost:8080/zstack/v1/management-nodes/platform-timezone?Request Parameters
| Name | Type | Location | Description | Valid Value | Starting Version |
|---|---|---|---|---|---|
| systemTags | List | body | Optional. The system tags. | 4.1.0 | |
| userTags | List | body | Optional. The user tags. | 4.1.0 |
API Response
Sample Response
{
"timezone": "Asia/Shanghai",
"offset": "+8:00"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| timezone | String | The time zone. | 4.1.0 |
| offset | String | The time difference with GMT | 4.1.0 |
| success | boolean | 4.1.0 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.1.0 |
| description | String | The brief description of the error. | 4.1.0 |
| details | String | The details about the error. | 4.1.0 |
| elaboration | String | The reserved field. Default value: null. | 4.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.1.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.1.0 |
SDK Sample
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
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 61f9cb0129d749ebbd3d6052bfc759b2" \
-X GET http://localhost:8080/zstack/v1/management-nodes/ready?Request Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| managementNodeId | String | query | Optional. | 0.6 | |
| systemTags | List | query | Optional. The system tags. | 0.6 | |
| userTags | List | query | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"managementNodeId": "28ff5884cbf83d48b2e50203a5f2e636"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
SDK Sample
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 preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"getManagementNodeOS": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"getManagementNodeOS":{}}' http://localhost:8080/zstack/v1/management/actionsRequest Parameters
| Name | Type | Location | Description | Valid Value | Starting Version |
|---|---|---|---|---|---|
| systemTags | List | query | Optional. The system tags. | 4.1.0 | |
| userTags | List | query | Optional. The user tags. | 4.1.0 |
API Response
Sample Response:
{
"name": "Linux",
"version": "5.4.0-33-generic"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name. | 4.1.0 |
| version | String | 4.1.0 | |
| success | boolean | 4.1.0 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.1.0 |
| description | String | The brief description of the error. | 4.1.0 |
| details | String | The details about the error. | 4.1.0 |
| elaboration | String | The reserved field. Default value: null. | 4.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.1.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.1.0 |
SDK Sample
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 preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"getManagementNodeArch": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"getManagementNodeArch":{}}' http://localhost:8080/zstack/v1/management-nodes/actionsRequest Parameters
| Name | Type | Location | Description | Valid Value | Starting Version |
|---|---|---|---|---|---|
| systemTags | List | query | Optional. The system tags. | 4.1.0 | |
| userTags | List | query | Optional. The user tags. | 4.1.0 |
API Response
Sample Response:
{
"architecture": "x86_64"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name. | 4.1.0 |
| version | String | 4.1.0 | |
| success | boolean | 4.1.0 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error | 4.1.0 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.1.0 |
| description | String | The brief description of the error. | 4.1.0 |
| details | String | The details about the error. | 4.1.0 |
| elaboration | String | The reserved field. Default value: null. | 4.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.1.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.1.0 |
SDK Sample
Java
SDK
GetManagementNodeArchAction action = new GetManagementNodeArchAction();
GetManagementNodeArchAction.Result res = action.call();Python
SDK
GetManagementNodeArchAction action = GetManagementNodeArchAction()
GetManagementNodeArchAction.Result res = action.call()