查詢拓撲節點
更新時間 2025-09-29 17:49:40
最近更新時間: 2025-09-29 17:49:40
分享文章
本節主要介紹如何使用API 查詢拓撲節點。
此操作用來查詢指定拓撲節點。
請求語法
GET /rest/v1/system/topology/nodeName HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Host: ip:port
Authorization: authorization請求參數
| 名稱 | 類型 | 描述 | 是否必須 |
|---|---|---|---|
| nodeName | String | 要查詢的拓撲節點。 不支持查詢path級別的節點信息。 | 是 |
響應結果
| 名稱 | 類型 | 描述 |
|---|---|---|
| name | String | 拓撲節點名稱。 |
| fullname | String | 節點在集群中的全路徑名稱,從根節點開始,使用name:name:name格式來唯一標識該節點的名稱。 |
| id | String | 拓撲節點ID。 |
| type | String | 節點的類型:
|
| description | String | 節點描述。 |
| childNodes | Array of childNodes | 子節點信息集合,根據子節點類型不同,展示的信息不同,詳見“表1響應參數ChildNode說明”。 |
表1 響應參數ChildNode說明
| 名稱 | 類型 | 描述 | |
|---|---|---|---|
| 子節點類型為room | name | String | 子節點名稱。 |
| fullname | String | 節點在集群中的全路徑名稱,從根節點開始,使用name:name格式來唯一標識該節點的名稱。 | |
| id | String | 節點ID。 | |
| type | String | 節點類型。 | |
| description | String | 節點描述。 | |
| 子節點類型為rack | name | String | 子節點名稱。 |
| fullname | String | 節點在集群中的全路徑名稱,從根節點開始,使用name:name:name格式來唯一標識該節點的名稱。 | |
| id | String | 節點ID。 | |
| type | String | 節點類型。 | |
| description | String | 節點描述。 | |
| 子節點類型為server | name | String | 子節點名稱。 |
| fullname | String | 節點在集群中的全路徑名稱,從根節點開始,使用name:name:name格式來唯一標識該節點的名稱。 | |
| id | String | 節點ID。 | |
| serverId | String | 服務器ID。 | |
| type | String | 節點類型。 | |
| description | String | 節點描述。 | |
| clusterAddress | String | 拓撲圖集群網絡IP。 | |
| publicAddress | String | 拓撲圖業務網絡IP。 | |
| allDiskPaths.usedCapacity | Long | 服務器上HBlock數據目錄對應分區的已用容量,單位是字節。 | |
| allDiskPaths.totalCapacity | Long | 服務器上HBlock數據目錄對應分區的總容量,單位是字節。 | |
| serverStatus | String | 服務器狀態:
| |
| 子節點類型為path | name | String | 子節點名稱。 |
| fullname | String | 節點在集群中的全路徑名稱,從根節點開始,使用name:name:name格式來唯一標識該節點的名稱。 | |
| id | String | 節點ID。 | |
| serverId | String | 服務器ID。 | |
| type | String | 節點類型。 | |
| totalCapacity | Long | HBlock數據目錄對應分區的總容量,單位是字節。 | |
| usedCapacity | Long | HBlock數據目錄對應分區的已用容量,單位是字節。 | |
| capacityQuota | Long | 數據目錄容量配額。 負整數表示無限制寫入。 | |
| usedCapacityQuota | Long | 數據目錄已用容量配額。 | |
| storagePool | String | 所屬存儲池。 | |
| healthStatus | String | 數據目錄健康狀態:
| |
| healthDetail | Array of string | 數據目錄健康狀態詳情:
| |
請求示例
查詢節點room1。
GET /rest/v1/system/topology/room1 HTTP/1.1
Date: Fri, 2 Aug 2024 10:12:05 GMT
Content-Type: application/json; charset=utf-8
Authorization: HBlock userName:signature
Host: 192.168.0.110:1443 響應示例
HTTP/1.1 200 OK
x-hblock-request-id: a04f0b22a3844518afb8ab61e5bc3757
Connection: keep-alive
Content-Length: 2480
Date: Fri, 2 Aug 2024 10:12:05 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"name": "room1",
"fullname": "default:room1",
"id": "00457811-af8e-4f39-ba6c-f856cdc173f8",
"type": "room",
"childNodes": [
{
"name": "rack2",
"fullname": "default:room1:rack2",
"id": "3f591741-a387-44d2-8ae8-36c4ba546bd2",
"type": "rack",
"childNodes": [
{
"name": "server1",
"fullname": "default:room1:rack2:server1",
"id": "36a55e61-47e5-43f0-9d73-357a86d3ff53",
"serverId": "hblock_1",
"type": "server",
"clusterAddress": "192.168.0.192",
"publicAddress": "192.168.0.192",
"allDiskPaths": {
"usedCapacity": 18887569408,
"totalCapacity": 136132825088
},
"serverStatus": "Connected",
"childNodes": [
{
"name": "/mnt/stor",
"fullname": "default:room1:rack2:server1:/mnt/stor",
"id": "d14f3938-a6de-4950-87bc-e461d743284a",
"serverId": "hblock_1",
"type": "path",
"totalCapacity": 100169342976,
"usedCapacity": 11510775808,
"capacityQuota": -1,
"usedCapacityQuota": 172032,
"storagePool": "default",
"healthStatus": "Healthy",
"healthDetail": []
},
{
"name": "/mnt/storage01",
"fullname": "default:room1:rack2:server1:/mnt/storage01",
"id": "9999d96e-1032-404c-85de-4c76f8100e12",
"serverId": "hblock_1",
"type": "path",
"totalCapacity": 35963482112,
"usedCapacity": 7376793600,
"capacityQuota": -1,
"usedCapacityQuota": 106496,
"storagePool": "default",
"healthStatus": "Healthy",
"healthDetail": []
}
]
}
]
},
{
"name": "server2",
"fullname": "default:room1:server2",
"id": "444dd9a4-88db-4df5-9959-88d7b82edad8",
"serverId": "hblock_2",
"type": "server",
"clusterAddress": "192.168.0.110",
"publicAddress": "192.168.0.110",
"allDiskPaths": {
"usedCapacity": 8582782976,
"totalCapacity": 100169342976
},
"serverStatus": "Connected",
"childNodes": [
{
"name": "/mnt/stor",
"fullname": "default:room1:server2:/mnt/stor",
"id": "1451c75b-2e6f-4cbe-82ab-962019247f35",
"serverId": "hblock_2",
"type": "path",
"totalCapacity": 100169342976,
"usedCapacity": 8582782976,
"capacityQuota": -1,
"usedCapacityQuota": 229376,
"storagePool": "default",
"healthStatus": "Healthy",
"healthDetail": []
}
]
},
{
"name": "server3",
"fullname": "default:room1:server3",
"id": "f89a94bc-2cc3-4ac9-b5dc-13d227b40cf4",
"serverId": "hblock_3",
"type": "server",
"clusterAddress": "192.168.0.102",
"publicAddress": "192.168.0.102",
"allDiskPaths": {
"usedCapacity": 11067289600,
"totalCapacity": 100169342976
},
"serverStatus": "Connected",
"childNodes": [
{
"name": "/mnt/stor",
"fullname": "default:room1:server3:/mnt/stor",
"id": "effad142-9e34-43f4-8390-ccb5c211f60f",
"serverId": "hblock_3",
"type": "path",
"totalCapacity": 100169342976,
"usedCapacity": 11067289600,
"capacityQuota": -1,
"usedCapacityQuota": 229376,
"storagePool": "default",
"healthStatus": "Healthy",
"healthDetail": []
}
]
}
]
}
}