查询HBlock服务状态
更新时间 2026-03-24 17:16:08
最近更新时间: 2026-03-24 17:16:08
本节主要介绍如何使用API查询HBlock服务状态。
此操作用来查询HBlock状态,包括系统、存储池(集群版)、服务器、数据目录(单机版)、卷的状态。
请求语法
GET /rest/v2/system/status HTTP/1.1
Date: date
Host: ip:port
Authorization: authorization响应结果
| 名称 | 类型 | 描述 |
|---|---|---|
| system.status | String | HBlock服务状态:
|
| system.licenseStatus | String | 软件许可证状态:
|
| server.status | Object | 服务器的状态,详见“表1 响应参数server.status说明”。 |
| disk.status | Object | 磁盘的状态(仅单机版支持),详见“表2 响应参数disk.status说明(仅单机版支持)”。 |
| disk.usage | Object | HBlock数据目录使用情况,详见“表3 响应参数disk.usage说明(仅单机版支持)”。 |
| lun.status | Object | 卷状态,详见“表4 响应参数lun.status说明”。 |
| lun.data | Object | 卷数据信息,详见“表5 响应参数lun.data说明”。 |
| storagePool.number | Integer | 存储池个数(仅集群版支持)。 |
| storagePool.basePool | Sring | 基础存储池名称(仅集群版支持)。 |
| storagePool.basePoolDetail | Object | 基础存储池详情(仅集群版支持),详见“表6 响应参数storagePool.basePoolDetail说明(仅集群版支持)”。 |
表1 响应参数server.status说明
| 名称 | 类型 | 描述 |
|---|---|---|
| connected | Integer | 状态为连接的服务器个数。 |
| disconnected | Integer | 状态为断开连接的服务器个数。 |
| removing | Integer | 状态为正在移除的服务器个数。 |
表2 响应参数disk.status说明(仅单机版支持)
| 名称 | 类型 | 描述 |
|---|---|---|
| healthy | Integer | 状态为健康的磁盘个数。 |
| warning | Integer | 状态为告警的磁盘个数。 |
| error | Integer | 状态为错误的磁盘个数。 |
表3 响应参数disk.usage说明(仅单机版支持)
| 名称 | 类型 | 描述 |
|---|---|---|
| used | Long | HBlock数据目录对应分区的已用容量,单位是bytes。 |
| total | Long | HBlock数据目录对应分区的总容量,单位是bytes。 |
表4 响应参数lun.status说明
| 名称 | 类型 | 描述 |
|---|---|---|
| number | Integer | 卷的总个数。 |
| cacheNumber | Integer | 缓存模式卷的个数。 |
| storageNumber | Integer | 存储模式卷的个数。 |
| localNumber | Integer | 本地模式卷的个数。 |
| cacheCapacity | Long | 缓存模式卷的容量,单位是bytes。 |
| storageCapacity | Long | 存储模式卷的容量,单位是bytes。 |
| localCapacity | Long | 本地模式卷的容量,单位是bytes。 |
表5 响应参数lun.data说明
| 名称 | 类型 | 描述 |
|---|---|---|
| normal | Double | 卷数据中,正常状态的量百分比。 |
| lowRedundancy | Double | 卷数据中,降级状态的百分比。 |
| error | Double | 卷数据中,错误状态的百分比。 |
| reconstructionProgress | Double | 如果存在降级状态的数据,数据重建进度的百分比。 |
| ETR | Long | 如果存在降级数据,预计剩余的数据重建时间。单位为秒。如果返回值为负数,说明数据无法重建,需用户尽快修复。 |
表6响应参数storagePool.basePoolDetail说明(仅集群版支持)
| 名称 | 类型 | 描述 |
|---|---|---|
| faultDomain.level | String | 基础存储池的故障域级别。 |
| faultDomain.status.healthy | Integer | 状态为健康的故障域个数。 |
| faultDomain.status.warning | Integer | 状态为告警的故障域个数。 |
| faultDomain.status.error | Integer | 状态为错误的故障域个数。 |
| disk.status.healthy | Integer | 状态为健康的磁盘个数。 |
| disk.status.warning | Integer | 状态为告警的磁盘个数。 |
| disk.status.error | Integer | 状态为错误的磁盘个数。 |
| disk.usage.used | Long | HBlock数据目录对应分区的已用容量,单位是bytes。 |
| disk.usage.total | Long | HBlock数据目录对应分区的总容量,单位是bytes。 |
| dataHealth.normal | Double | 该存储池所有正常数据的百分比 |
| dataHealth.lowRedundancy | Double | 该存储池所有降级数据的百分比。 |
| dataHealth.error | Double | 该存储池所有错误数据的百分比。 |
| dataHealth.reconstructionProgress | Double | 如果该存储池存在降级状态的数据,数据重建进度的百分比。 |
| dataHealth.ETR | Long | 如果该存储池卷存在降级数据,预计剩余的数据重建时间。单位为秒。如果返回值为负数,说明数据无法重建,需用户尽快修复。 |
请求示例1
单机版:查询HBlock状态。
GET /rest/v2/system/status HTTP/1.1
Date: Tue, 09 Dec 2025 06:11:13 GMT
Authorization: HBlock userName:signature
Host:192.168.0.66:1443响应示例1
HTTP/1.1 200 OK
x-hblock-request-id: b9a47583b571487697f327cfd70723fe
Connection: keep-alive
Content-Length: 440
Date: Tue, 09 Dec 2025 06:11:13 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"system": {
"status": "Working",
"licenseStatus": "None"
},
"server": {
"status": {
"connected": 1,
"disconnected": 0,
"removing": 0
}
},
"disk": {
"status": {
"healthy": 1,
"warning": 0,
"error": 0
},
"usage": {
"used": 1431740416,
"total": 100169342976
}
},
"lun": {
"status": {
"number": 2,
"cacheNumber": 1,
"storageNumber": 0,
"localNumber": 1,
"cacheCapacity": 236223201280,
"storageCapacity": 0,
"localCapacity": 107374182400
},
"data": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
}
}
}
}请求示例2
集群版:查询HBlock状态。
GET /rest/v2/system/status HTTP/1.1
Date: Tue, 09 Dec 2025 02:42:02 GMT
Authorization: HBlock userName:signature
Host:192.168.0.64:1443响应示例2
HTTP/1.1 200 OK
x-hblock-request-id: 34e45fb7348647a6afbfb1dcb5b602cf
Connection: keep-alive
Content-Length: 660
Date: Tue, 09 Dec 2025 02:42:02 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"system": {
"status": "Working",
"licenseStatus": "Effective"
},
"server": {
"status": {
"connected": 3,
"disconnected": 0,
"removing": 0
}
},
"storagePool": {
"number": 2,
"basePool": "default",
"basePoolDetail": {
"faultDomain": {
"level": "server",
"status": {
"healthy": 3,
"warning": 0,
"error": 0
}
},
"disk": {
"status": {
"healthy": 4,
"warning": 0,
"error": 0
},
"usage": {
"used": 18785857536,
"total": 342038982656
}
},
"dataHealth": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
}
}
},
"lun": {
"status": {
"number": 15,
"cacheNumber": 1,
"storageNumber": 2,
"localNumber": 12,
"cacheCapacity": 225485783040,
"storageCapacity": 323196289024,
"localCapacity": 928786677760
},
"data": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
}
}
}
}