批量查询存储池
更新时间 2025-09-29 17:49:38
最近更新时间: 2025-09-29 17:49:38
本节主要介绍如何使用API批量查询存储池。
此操作用来批量查询存储池。
请求语法
GET /rest/v1/system/storagepool?filter=filter HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Host: ip:port
Authorization: authorization请求参数
| 参数 | 类型 | 描述 | 是否必须 |
|---|---|---|---|
| filter | String | 查询的过滤条件。 支持的过滤条件类型包括:
| 否 |
响应结果
| 名称 | 类型 | 描述 |
|---|---|---|
| storagePool | Array of storagePool | 存储池信息集合,详见“表1 响应参数storagePool说明”。 |
表1 响应参数storagePool说明
| 名称 | 类型 | 描述 |
|---|---|---|
name | String | 存储池名称。 |
id | Short | 存储池序号。 |
isBasePool | Boolean | 是否是基础存储池:
|
status | String | 存储池状态:
|
faultDomain | String | 存储池故障域级别:
|
description | String | 存储池描述信息。 |
totalCapacity | Long | 存储池总容量,单位是字节。 |
usedCapacity | Long | 存储池已用容量,单位是字节。 |
| usedCapacityQuota | Long | 存储池已用容量配额,单位是字节。 |
| capacityQuota | Long | 存储池容量配额,单位是字节。 |
createTime | Long | 存储池创建时间。 |
| luns.lunNamesForCachePool | Array of lunNamesForCachePool | 缓存存储池卷列表。 |
| luns.lunNamesForPool | Array of lunNamesForPool | 存储池卷列表。 |
| luns.status | Object | 卷的状态信息,详见“表2 响应参数luns.status说明”。 |
| topology | Array of topology | 存储池拓扑信息集合,详见“表3响应参数topology/childNodes说明”。 |
表2 响应参数luns.status说明
| 名称 | 类型 | 描述 |
|---|---|---|
| number | Integer | 存储池关联卷的个数。 |
| cacheNumber | Integer | 缓存模式卷的个数。 |
| storageNumber | Integer | 存储模式卷的个数。 |
| localNumber | Integer | 本地模式卷的个数。 |
| cacheCapacity | Long | 缓存模式卷容量,单位是字节。 |
| storageCapacity | Long | 存储模式卷容量,单位是字节。 |
| localCapacity | Long | 本地模式卷容量,单位是字节。 |
表3 响应参数topology/childNodes说明
| 名称 | 类型 | 描述 | |
|---|---|---|---|
| name | String | 拓扑节点或者子节点名称。 | |
| fullname | String | 拓扑节点或者子节点的全路径名称。 | |
| type | String | 拓扑节点或者子节点的类型。 | |
| description | String | 拓扑节点或子节点的描述信息。 如果未添加描述信息,或者节点类型是path,不返回此项。 | |
| healthStatus | String | 故障域状态:
| |
| childNodes | Array of childNodes | 拓扑图中子节点,childNodes和topology基本一致,类型不同,包含的内容不同,详见本表其他字段。 | |
| 如果topology或者childNodes的类型是server | clusterAddress | String | 拓扑图集群网络IP。 |
| publicAddress | String | 拓扑图业务网络IP。 | |
| allDiskPaths.usedCapacity | Long | 拓扑图中所有数据目录的已用容量。 | |
| allDiskPaths.totalCapacity | Long | 拓扑图中所有数据目录的总容量。 | |
| serverStatus | String | 拓扑图的服务器状态:
| |
| serverId | String | 拓扑图的服务器ID。 | |
| childNodes | Array of childNodes | 拓扑图中子节点,childNodes和topology基本一致,类型不同,包含的内容不同,详见本表其他字段。 | |
| 如果topology或者childNodes的类型是path | usedCapacity | Long | HBlock数据目录对应分区的已用容量,单位是字节。 |
| totalCapacity | Long | HBlock数据目录对应分区的总容量,单位是字节。 | |
| usedCapacityQuota | Long | 数据目录已用容量配额,单位是字节。 | |
| capacityQuota | Long | 数据目录容量配额,单位是字节。 | |
| managementStatus | String | 数据目录的管理状态:
| |
| healthStatus | String | 数据目录健康状态:
| |
| healthDetail | String | 数据目录健康状态详情:
| |
| serverId | String | 数据目录所属的服务器ID。 | |
请求示例
查询存储池中包含pool的存储池。
GET /rest/v1/system/storagepool?filter=poolName:pool HTTP/1.1
Date: Thu, 21 Aug 2025 05:52:15 GMT
Content-Type: application/json; charset=utf-8
Authorization: HBlock userName:signature
Host: 192.168.0.64:1443 响应示例
HTTP/1.1 200 OK
x-hblock-request-id: d3c6f85be02448d4a96d12251a33b8dc
Connection: keep-alive
Content-Length: 3773
Date: Thu, 21 Aug 2025 05:52:15 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"storagePool": [
{
"name": "defaultpool",
"id": 0,
"isBasePool": true,
"status": "Normal",
"faultDomain": "server",
"description": "Default storage pool.",
"totalCapacity": 299111325696,
"usedCapacity": 54389911552,
"usedCapacityQuota": 23274280289,
"capacityQuota": 299111325696,
"createTime": 1753783004031,
"luns": {
"lunNamesForCachePool": [
"lun05a"
],
"lunNamesForPool": [
"lun02a",
"lun02d",
"lun01a-clone2",
"lun001-c001",
"lunc",
"lun04",
"lun12",
"lunn01a-clone1",
"lun03a",
"lun001",
"lunc03b",
"lun01a",
"Clone-2"
],
"status": {
"number": 14,
"cacheNumber": 1,
"storageNumber": 0,
"localNumber": 13,
"cacheCapacity": 357556027392,
"storageCapacity": 0,
"localCapacity": 2498597224448
}
},
"topology": [
{
"name": "hblock_1",
"fullname": "default:hblock_1",
"type": "server",
"healthStatus": "Healthy",
"clusterAddress": "192.168.0.65",
"publicAddress": "192.168.0.65",
"allDiskPaths": {
"usedCapacity": 7785398272,
"totalCapacity": 199407550464
},
"serverStatus": "Connected",
"serverId": "hblock_1",
"childNodes": [
{
"name": "/mnt/stor02",
"fullname": "default:hblock_1:/mnt/stor02",
"type": "path",
"usedCapacity": 7785185280,
"totalCapacity": 99703775232,
"usedCapacityQuota": 7783923712,
"capacityQuota": -1,
"managementStatus": "Added",
"healthStatus": "Healthy",
"healthDetail": [],
"serverId": "hblock_1"
}
]
},
{
"name": "hblock_2",
"fullname": "default:hblock_2",
"type": "server",
"description": "hblock_2",
"healthStatus": "Healthy",
"clusterAddress": "192.168.0.64",
"publicAddress": "192.168.0.64",
"allDiskPaths": {
"usedCapacity": 38822154240,
"totalCapacity": 199407550464
},
"serverStatus": "Connected",
"serverId": "hblock_2",
"childNodes": [
{
"name": "/mnt/stor01",
"fullname": "default:hblock_2:/mnt/stor01",
"type": "path",
"usedCapacity": 38820716544,
"totalCapacity": 99703775232,
"usedCapacityQuota": 7732608157,
"capacityQuota": -1,
"managementStatus": "Added",
"healthStatus": "Healthy",
"healthDetail": [],
"serverId": "hblock_2"
}
]
},
{
"name": "hblock_3",
"fullname": "default:hblock_3",
"type": "server",
"healthStatus": "Healthy",
"clusterAddress": "192.168.0.67",
"publicAddress": "192.168.0.67",
"allDiskPaths": {
"usedCapacity": 7784218624,
"totalCapacity": 199407550464
},
"serverStatus": "Connected",
"serverId": "hblock_3",
"childNodes": [
{
"name": "/mnt/stor01",
"fullname": "default:hblock_3:/mnt/stor01",
"type": "path",
"usedCapacity": 7784009728,
"totalCapacity": 99703775232,
"usedCapacityQuota": 7757748420,
"capacityQuota": -1,
"managementStatus": "Added",
"healthStatus": "Healthy",
"healthDetail": [],
"serverId": "hblock_3"
}
]
}
],
"qosPolicy": {
"qosName": "QoS6"
},
"qosPolicyforLUN": {
"qosName": "QoS-Test"
}
},
{
"name": "pool1",
"id": 1,
"isBasePool": false,
"status": "Normal",
"faultDomain": "path",
"totalCapacity": 299111325696,
"usedCapacity": 1859584,
"usedCapacityQuota": 491520,
"capacityQuota": 299111325696,
"createTime": 1755067585328,
"luns": {
"lunNamesForCachePool": [
"lun02a"
],
"lunNamesForPool": [
"lun05a"
],
"status": {
"number": 2,
"cacheNumber": 0,
"storageNumber": 0,
"localNumber": 2,
"cacheCapacity": 0,
"storageCapacity": 0,
"localCapacity": 543313362944
}
},
"topology": [
{
"name": "/mnt/stor01",
"fullname": "default:hblock_1:/mnt/stor01",
"type": "path",
"usedCapacity": 212992,
"totalCapacity": 99703775232,
"usedCapacityQuota": 163840,
"capacityQuota": -1,
"managementStatus": "Added",
"healthStatus": "Healthy",
"healthDetail": [],
"serverId": "hblock_1"
},
{
"name": "/mnt/stor02",
"fullname": "default:hblock_2:/mnt/stor02",
"type": "path",
"usedCapacity": 1437696,
"totalCapacity": 99703775232,
"usedCapacityQuota": 163840,
"capacityQuota": -1,
"managementStatus": "Added",
"healthStatus": "Healthy",
"healthDetail": [],
"serverId": "hblock_2"
},
{
"name": "/mnt/stor02",
"fullname": "default:hblock_3:/mnt/stor02",
"type": "path",
"usedCapacity": 208896,
"totalCapacity": 99703775232,
"usedCapacityQuota": 163840,
"capacityQuota": -1,
"managementStatus": "Added",
"healthStatus": "Healthy",
"healthDetail": [],
"serverId": "hblock_3"
}
],
"qosPolicy": {
"qosName": "Qostest2"
}
}
]
}