查询裸金属实例的bond网络配置(QueryBareMetal2Bonding)
API请求
URLs
GET /v1/baremetal2/bondingHeaders
Authorization: OAuth the-session-uuid可查询字段
运行CLI命令行工具,输入QueryBareMetal2Bonding并按Tab键查看所有可查询字段以及可跨表查询的资源名。
Curl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal2/bonding?q=uuid=0250c111188b3c4f92efd998c89fb32dAPI返回
返回示例
{
"inventories": [
{
"chassisUuid": "08e177d0c35648de8939515bf9d5adad",
"name": "bond0",
"slaves": "40:8d:5c:f7:8d:60,40:8d:5c:f7:8d:61",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"uuid": "7910f442d5c94e82963e17155567b6f3"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 4.4.24 |
| success | boolean | 4.4.24 | |
| inventories | List | 详情参考inventories | 4.4.24 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 4.4.24 |
| description | String | 错误的概要描述 | 4.4.24 |
| details | String | 错误的详细信息 | 4.4.24 |
| elaboration | String | 保留字段,默认为null | 4.4.24 |
| opaque | LinkedHashMap | 保留字段,默认为null | 4.4.24 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 4.4.24 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| chassisUuid | String | 4.4.24 | |
| name | String | 资源名称 | 4.4.24 |
| slaves | String | 4.4.24 | |
| opts | String | 4.4.24 | |
| mode | Integer | 4.4.24 | |
| createDate | Timestamp | 创建时间 | 4.4.24 |
| lastOpDate | Timestamp | 最后一次修改时间 | 4.4.24 |
| accountUuid | String | 账户UUID | 4.4.24 |
| uuid | String | 资源的UUID,唯一标示该资源 | 4.4.24 |
SDK示例
Java
SDK
QueryBareMetal2BondingAction action = new QueryBareMetal2BondingAction();
action.conditions = asList("uuid=7a85935a77ff378bbd349f619f647b26");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryBareMetal2BondingAction.Result res = action.call();Python
SDK
QueryBareMetal2BondingAction action = QueryBareMetal2BondingAction()
action.conditions = ["uuid=cb72ba18b6f83cec99cbf2519694ad33"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryBareMetal2BondingAction.Result res = action.call()