批量查詢存儲池
更新時間 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"
}
}
]
}