查询管理节点
Headers
Authorization: OAuth the-session-uuidCurl示例
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/bc27558979364d7c9b34a7317965e0be可查询字段
运行CLI命令行工具,输入QueryManagementNode并按Tab键查看所有可查询字段以及可跨表查询的资源名
API返回
返回示例
{
"inventories": [
{
"uuid": "188b2c6376c34d3687c5a7a19685ffa6",
"hostName": "127.0.0.1",
"joinDate": "May 11, 2017 1:22:44 PM",
"heartBeat": "May 11, 2017 1:22:44 PM"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
| inventories | List | 详情参考inventories | 0.6 |
error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 0.6 |
| hostName | String | 宿主机名称 | 0.6 |
| joinDate | Timestamp | 加入时间 | 0.6 |
| heartBeat | Timestamp | 心跳时间 | 0.6 |
SDK示例
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()