此操作用来查询整个拓扑。
请求语法
GET /rest/v1/system/topology HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Host: ip:port
Authorization: authorization
响应结果
名称 描述 name 拓扑节点名称。 fullname 节点在集群中的全路径名称,从根节点开始,使用name:name:name格式来唯一标识该节点的名称。 id 拓扑节点ID。 type 节点的类型:root:根节点。
description 节点描述。
childNodes 子节点信息集合,根据子节点类型不同,展示的信息不同。 子节点类型为room name 子节点名称。 fullname 节点在集群中的全路径名称,从根节点开始,使用name:name格式来唯一标识该节点的名称。 id 节点ID。 type 节点类型。 description 节点描述。
子节点类型为rack name 子节点名称。 fullname 节点在集群中的全路径名称,从根节点开始,使用name:name:name格式来唯一标识该节点的名称。 id 节点ID。 type 节点类型。 description 节点描述。
子节点类型为server name 子节点名称。 fullname 节点在集群中的全路径名称,从根节点开始,使用name:name:name格式来唯一标识该节点的名称。 id 节点ID。 serverId 服务器ID。 type 节点类型。 description 节点描述。
clusterAddress 拓扑图集群网络IP。 publicAddress 拓扑图业务网络IP。 allDiskPaths.usedCapacity 服务器上HBlock数据目录对应分区的已用容量,单位是字节。 allDiskPaths.totalCapacity 服务器上HBlock数据目录对应分区的总容量,单位是字节。 serverStatus 服务器状态:
Connected:已连接。
Disconnected:未连接。
Removing:移除中。
子节点类型为path name 子节点名称。 fullname 节点在集群中的全路径名称,从根节点开始,使用name:name:name格式来唯一标识该节点的名称。 id 节点ID。 serverId 服务器ID。 type 节点类型。 totalCapacity HBlock数据目录对应分区的总容量,单位是字节。 usedCapacity HBlock数据目录对应分区的已用容量,单位是字节。 capacityQuota 数据目录容量配额。
负整数表示无限制写入。
usedCapacityQuota 数据目录已用容量配额。 storagePool 所属存储池。 healthStatus 数据目录健康状态:
Healthy:数据目录处于健康状态,可正常读写,且数据目录所在磁盘使用率未超过90%。
Warning:数据目录处于警告状态,可读,但存在以下情况的任意一种:慢盘;数据目录所在磁盘使用率超过90%;磁盘剩余空间不足1GiB;或者HBlock对这个目录停写。
Error:数据目录错误状态,无法访问,原因可能是:所在磁盘出现I/O错误导致无法读写,数据目录未正确挂载等。
healthDetail 数据目录健康状态详情:
如果健康状态为Healthy,此字段为空。
如果健康状态为Warning或Error,显示警告或错误的详细信息。
请求示例
查询整个拓扑。
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": []
}
]
}
]
}
]
}
}