查询裸金属网卡绑定
Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/network/bondings?q=uuid=10d30b226f093a4c9ccd911575406e7bcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/baremetal/network/bondings/e0ea2452b6be30a6a7fbfc01dd5e70f5可查询字段
运行CLI命令行工具,输入QueryBaremetalBonding并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"uuid": "d2ab26c55a664a85ae2df0b8cee6ede7",
"chassisUuid": "6b0cde704099460b9a96a0c451186467",
"name": "bond0",
"mode": 1,
"slaves": "[\"d4:ae:52:6e:d1:0d\", \"d4:ae:52:6e:d1:0e\"]",
"opts": "miimon=100",
"createDate": "Aug 15, 2025 5:36:54 AM",
"lastOpDate": "Aug 15, 2025 5:36:54 AM"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.4.0 |
| inventories | List | 详情参考inventories | 3.4.0 |
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,唯一标示该资源 | 3.4.0 |
| chassisUuid | String | 裸金属设备UUID | 3.4.0 |
| name | String | 网卡绑定名称 | 3.4.0 |
| mode | Integer | 网卡绑定模式 | 3.4.0 |
| slaves | String | Slave MAC地址,逗号分隔 | 3.4.0 |
| opts | String | 网卡绑定选项 | 3.4.0 |
| createDate | Timestamp | 创建时间 | 3.4.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.4.0 |
SDK示例
Java SDK
QueryBaremetalBondingAction action = new QueryBaremetalBondingAction();
action.conditions = asList("uuid=eb879ea0b5b93f12aefb1a8bb21cf135");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryBaremetalBondingAction.Result res = action.call();Python SDK
action = QueryBaremetalBondingAction()
action.conditions = ["uuid=3c90a0f5fb763620ab38cc6184732ea3"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()