查詢整個拓撲
更新時間 2025-09-29 17:49:40
最近更新時間: 2025-09-29 17:49:40
分享文章
本節主要介紹如何使用API查詢整個拓撲。
此操作用來查詢整個拓撲。
請求語法
GET /rest/v1/system/topology HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Host: ip:port
Authorization: authorization響應結果
| 名稱 | 類型 | 描述 |
|---|---|---|
| name | String | 拓撲節點名稱。 |
| fullname | String | 節點在集群中的全路徑名稱,從根節點開始,使用name:name:name格式來唯一標識該節點的名稱。 |
| id | String | 拓撲節點ID。 |
| type | String | 節點的類型:root:根節點。 |
| 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 | 數據目錄健康狀態詳情:
| |
請求示例
查詢整個拓撲。
GET /rest/v1/system/topology HTTP/1.1
Date: Fri, 2 Aug 2024 10:10:18 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: ea0f7997eeeb415087c269c61681e4bc
Connection: keep-alive
Content-Length: 4234
Date: Fri, 2 Aug 2024 10: 10: 18 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"name": "default",
"fullname": "default",
"id": "e69eb32c-9311-43fd-9b9e-01af53bf32c1",
"type": "root",
"childNodes": [
{
"name": "rack1",
"fullname": "default:rack1",
"id": "568156af-0c15-4984-ac5f-ea877db752e5",
"type": "rack",
"description": "rack1",
"childNodes": [
{
"name": "server4",
"fullname": "default:rack1:server4",
"id": "2257dc92-fafe-4e91-9000-2c127ae13f68",
"serverId": "hblock_4",
"type": "server",
"clusterAddress": "192.168.0.117",
"publicAddress": "192.168.0.117",
"allDiskPaths": {
"usedCapacity": 29337317376,
"totalCapacity": 131883315200
},
"serverStatus": "Connected",
"childNodes": [
{
"name": "/mnt/storage02",
"fullname": "default:rack1:server4:/mnt/storage02",
"id": "fddcbc2b-808f-4ed0-b9f4-1fa61914011c",
"serverId": "hblock_4",
"type": "path",
"totalCapacity": 56028450816,
"usedCapacity": 57221120,
"capacityQuota": -1,
"usedCapacityQuota": 69632,
"storagePool": "pool2",
"healthStatus": "Healthy",
"healthDetail": []
},
{
"name": "/mnt/storage03",
"fullname": "default:rack1:server4:/mnt/storage03",
"id": "cec39c97-8b67-414a-adc7-4e9275d091f7",
"serverId": "hblock_4",
"type": "path",
"totalCapacity": 3927900160,
"usedCapacity": 16855040,
"capacityQuota": -1
},
{
"name": "/mnt/storage04",
"fullname": "default:rack1:server4:/mnt/storage04",
"id": "22eb96ff-ea92-4e22-b1f0-1ed42f2409aa",
"serverId": "hblock_4",
"type": "path",
"totalCapacity": 35963482112,
"usedCapacity": 14631620608,
"capacityQuota": -1,
"usedCapacityQuota": 69632,
"storagePool": "pool2",
"healthStatus": "Healthy",
"healthDetail": []
},
{
"name": "/mnt/storage05",
"fullname": "default:rack1:server4:/mnt/storage05",
"id": "d7e3dd03-e127-4e3e-b619-73fcfd4956fd",
"serverId": "hblock_4",
"type": "path",
"totalCapacity": 35963482112,
"usedCapacity": 14631620608,
"capacityQuota": -1,
"usedCapacityQuota": 69632,
"storagePool": "pool2",
"healthStatus": "Healthy",
"healthDetail": []
}
]
}
]
},
{
"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": 18890235904,
"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": 7379460096,
"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": []
}
]
}
]
}
]
}
}