查询控制台代理

GET/zstack/v1/consoles/agents
GET/zstack/v1/consoles/agents/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 350b72c2d3f24641a767acbcec744b19" \
-X GET http://localhost:8080/zstack/v1/consoles/agents?q=uuid=745b7c17cd224025b3adfef4ae61b3d2
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth bb08e240616b482984c397e4517a021c" \
-X GET http://localhost:8080/zstack/v1/consoles/agents/8a3cc2be7e20420db29925e381c598bc

可查询字段

运行CLI命令行工具,输入QueryConsoleProxyAgent并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例

{
  "inventories": [
    {
      "uuid": "c77bbc7d3364449e9543d0776a6087de",
      "managementIp": "127.0.0.1",
      "type": "ManagementServerConsoleProxy",
      "state": "Connected"
    }
  ]
}
名字类型描述起始版本
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error0.6
inventoriesList详情参考inventories0.6

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10010.6
descriptionString错误的概要描述0.6
detailsString错误的详细信息0.6
elaborationString保留字段,默认为null0.6
opaqueLinkedHashMap保留字段,默认为null0.6
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null0.6

inventories

名字类型描述起始版本
uuidString资源的UUID,唯一标示该资源0.6
descriptionString资源的详细描述0.6
managementIpString管理节点IP0.6
typeString类型0.6
statusString状态(连接,断开)0.6
stateString状态(启用,禁用)0.6
createDateTimestamp创建时间0.6
lastOpDateTimestamp最后一次修改时间0.6

SDK示例

Java SDK

QueryConsoleProxyAgentAction action = new QueryConsoleProxyAgentAction();
action.conditions = asList("uuid=dfbe49d87cb94d93b69354fa1270012b");
action.sessionId = "e2300cd4f74a457e87f13842aeb8fdef";
QueryConsoleProxyAgentAction.Result res = action.call();

Python SDK

QueryConsoleProxyAgentAction action = QueryConsoleProxyAgentAction()
action.conditions = ["uuid=1e47046946f849ee871de20a2b045750"]
action.sessionId = "1655d7f2e56d4710824cd1082bd5cc94"
QueryConsoleProxyAgentAction.Result res = action.call()