查询expon类型块存储卷(QueryExponBlockVolume)
API请求
URLs
GET zstack/v1/expon/block-volumes
GET zstack/v1/expon/block-volumes/{uuid}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/expon/block-volumes?q=uuid=xxx&q=name=xxxcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/expon/block-volumes/57dcd9124665304191c221331ee95e6b可查询字段
运行CLI命令行工具,输入QuerExponBlockVolume并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"actualSize": 1406140416,
"createDate": "Apr 22, 2024 5:01:23 PM",
"deviceId": 1,
"exponStatus": "normal",
"format": "raw",
"installPath": "expon://pool/55e7b5f5a19e42d6996108a09c0ce22e",
"isShareable": true,
"iscsiPath": "iscsi://3260/",
"lastAttachDate": "Apr 24, 2024 5:49:11 PM",
"lastDetachDate": "Apr 22, 2024 5:04:15 PM",
"lastOpDate": "Apr 24, 2024 5:49:11 PM",
"lastVmInstanceUuid": "ce585c3170c646779c4827e06895d3e2",
"name": "aaa444dd",
"primaryStorageUuid": "173d49a118384c00a7d7ebf9815e54e2",
"protocol": "iSCSI",
"size": 4294967296,
"state": "Enabled",
"status": "Ready",
"type": "Data",
"uuid": "150c1b4cce834d0485df7f686a18b34f",
"vendor": "expon"
},
{
"actualSize": 0,
"createDate": "Apr 15, 2024 10:04:55 AM",
"exponStatus": "normal",
"format": "raw",
"installPath": "expon://pool/1af65a9e30ef45489a0c545f1aa48c8e",
"isShareable": true,
"iscsiPath": "iscsi://3260/",
"lastAttachDate": "Apr 17, 2024 1:06:07 PM",
"lastDetachDate": "Apr 17, 2024 1:14:24 PM",
"lastOpDate": "Apr 17, 2024 1:54:21 PM",
"lastVmInstanceUuid": "c1d98d17677248dd958ece943401b603",
"name": "sfa",
"primaryStorageUuid": "173d49a118384c00a7d7ebf9815e54e2",
"protocol": "iSCSI",
"size": 4294967296,
"state": "Enabled",
"status": "Ready",
"type": "Data",
"uuid": "1c29001448e64a98a5c8efd264a62f2b",
"vendor": "expon"
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 5.1.0 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 5.1.0 |
| inventories | List | 详情参考inventories | 5.1.0 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 5.1.0 |
| description | String | 错误的概要描述 | 5.1.0 |
| details | String | 错误的详细信息 | 5.1.0 |
| elaboration | String | 保留字段,默认为null | 5.1.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 5.1.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 5.1.0 |
#inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| actualSize | Long | 真实容量 | 5.1.0 |
| createDate | String | 创建时间 | 5.1.0 |
| deviceId | integer | 设备ID | 5.1.0 |
| exponStatus | String | expon状态 | 5.1.0 |
| format | String | 格式 | 5.1.0 |
| InstallPath | String | 安装路径 | 5.1.0 |
| isShareable | Boolean | 是否共享 | 5.1.0 |
| iscsiPath | String | ISCSI路径 | 5.1.0 |
| lastAttachDate | Timestamp | 最后加载时间 | 5.1.0 |
| lastDetachDate | Timestamp | 最后卸载时间 | 5.1.0 |
| lastVmInstanceUuid | String | 上次加载实例UUID | 5.1.0 |
| name | String | 资源名称 | 5.1.0 |
| primaryStorageUuid | String | 主存储UUID | 5.1.0 |
| protocol | String | 协议 | 5.1.0 |
| size | Long | 容量 | 5.1.0 |
| state | String | 启用状态 | 5.1.0 |
| status | String | 就绪状态 | 5.1.0 |
| type | String | 类型 | 5.1.0 |
| uuid | String | 资源UUID | 5.1.0 |
| vendor | String | 厂商 | 5.1.0 |
SDK示例
Java
SDK
QueryXskyBlockVolumeAction action = new QueryXskyBlockVolumeAction();
action.conditions = asList("uuid=xxx","name=xxx");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryXskyBlockVolumeAction.Result res = action.call();Python
SDK
QueryXskyBlockVolumeAction action = QueryXskyBlockVolumeAction()
action.conditions = ["uuid=xxx","name=xxx"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryXskyBlockVolumeAction.Result res = action.call()