查詢指定存儲池
更新時間 2025-09-29 17:49:38
最近更新時間: 2025-09-29 17:49:38
分享文章
本節主要介紹如何使用API查詢指定存儲池。
此操作用來查詢指定存儲池。
請求語法
GET /rest/v1/system/storagepool/poolName HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Host: ip:port
Authorization: authorization請求參數
| 參數 | 類型 | 描述 | 是否必須 |
|---|---|---|---|
| poolName | String | 存儲池名稱。 取值:長度范圍是1~16,只能由字母、數字和短橫線(-)、下劃線(_)組成,字母區分大小寫,且僅支持以字母和數字開頭。 | 是 |
響應結果
| 名稱 | 類型 | 描述 |
|---|---|---|
| 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 | 卷的狀態信息,詳見“表1 響應參數luns.status說明”。 |
| topology | Array of topology | 存儲池拓撲信息集合,詳見“表2響應參數topology/childNodes說明”。 |
| qosPolicy.qosName | String | 存儲池關聯的QoS策略名稱。 |
| qosPolicyforLUN.qosName | String | 存儲池內卷的默認QoS策略名稱。 |
表1 響應參數luns.status說明
| 名稱 | 類型 | 描述 |
|---|---|---|
| number | Integer | 存儲池關聯卷的個數。 |
| cacheNumber | Integer | 緩存模式卷的個數。 |
| storageNumber | Integer | 存儲模式卷的個數。 |
| localNumber | Integer | 本地模式卷的個數。 |
| cacheCapacity | Long | 緩存模式卷容量,單位是字節。 |
| storageCapacity | Long | 存儲模式卷容量,單位是字節。 |
| localCapacity | Long | 本地模式卷容量,單位是字節。 |
表2 響應參數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 | Array of string | 數據目錄健康狀態詳情:
| |
| serverId | String | 數據目錄所屬的服務器ID。 | |
請求示例
查詢存儲池default。
GET /rest/v1/system/storagepool/defaultpool HTTP/1.1
Date: Thu, 21 Aug 2025 05:55:19 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: ec7686d210f5407690aa054698947034
Connection: keep-alive
Content-Length: 2437
Date: Thu, 21 Aug 2025 05:55:19 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"name": "defaultpool",
"id": 0,
"isBasePool": true,
"status": "Normal",
"faultDomain": "server",
"description": "Default storage pool.",
"totalCapacity": 299111325696,
"usedCapacity": 54389911552,
"usedCapacityQuota": 23300496420,
"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": 7771341232,
"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": 7783989248,
"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": 7745165940,
"capacityQuota": -1,
"managementStatus": "Added",
"healthStatus": "Healthy",
"healthDetail": [],
"serverId": "hblock_3"
}
]
}
],
"qosPolicy": {
"qosName": "QoS6"
},
"qosPolicyforLUN": {
"qosName": "QoS-Test"
}
}
}