查詢HBlock服務狀態
更新時間 2025-09-29 17:49:42
最近更新時間: 2025-09-29 17:49:42
分享文章
本節主要介紹如何使用API查詢HBlock服務狀態。
此操作用來查詢HBlock狀態,包括系統、存儲池(集群版)、服務器、數據目錄(單機版)、卷的狀態。
請求語法
GET /rest/v1/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數據目錄對應分區的已用容量,單位是字節。 |
| total | Long | HBlock數據目錄對應分區的總容量,單位是字節。 |
表4 響應參數lun.status說明
| 名稱 | 類型 | 描述 |
|---|---|---|
| number | Integer | 卷的總個數。 |
| cacheNumber | Integer | 緩存模式卷的個數。 |
| storageNumber | Integer | 存儲模式卷的個數。 |
| localNumber | Integer | 本地模式卷的個數。 |
| cacheCapacity | Long | 緩存模式卷的容量,單位是字節。 |
| storageCapacity | Long | 存儲模式卷的容量,單位是字節。 |
| localCapacity | Long | 本地模式卷的容量,單位是字節。 |
表5 響應參數lun.data說明
| 名稱 | 類型 | 描述 |
|---|---|---|
| normal | Integer | 正常狀態的卷數量百分比。 |
| lowRedundancy | Integer | 低冗余狀態的卷數據量百分比。 |
| error | Integer | 錯誤狀態的卷數據量百分比。 |
表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數據目錄對應分區的已用容量,單位是字節。 |
| disk.usage.total | Long | HBlock數據目錄對應分區的總容量,單位是字節。 |
請求示例1
單機版:查詢HBlock狀態。
GET /rest/v1/system/status HTTP/1.1
Date: Mon, 13 May 2024 11:06:55 GMT
Authorization: HBlock userName:signature
Host:192.168.0.32:1443響應示例1
HTTP/1.1 200 OK
x-hblock-request-id: b9a47583b571487697f327cfd70723fe
Connection: keep-alive
Content-Length: 443
Date: Mon, 13 May 2024 11:06:55 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"system": {
"status": "Working",
"licenseStatus": "Effective"
},
"server": {
"status": {
"connected": 1,
"disconnected": 0,
"removing": 0
}
},
"disk": {
"status": {
"healthy": 1,
"warning": 0,
"error": 0
},
"usage": {
"used": 63168512,
"total": 100167352320
}
},
"lun": {
"status": {
"number": 5,
"cacheNumber": 0,
"storageNumber": 2,
"localNumber": 3,
"cacheCapacity": 0,
"storageCapacity": 654982512640,
"localCapacity": 665719930880
},
"data": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
}
}
}
}請求示例2
集群版:查詢HBlock狀態。
GET /rest/v1/system/status HTTP/1.1
Date: Wed, 7 Aug 2024 06:20:45 GMT
Authorization: HBlock userName:signature
Host:192.168.0.32:1443響應示例2
HTTP/1.1 200 OK
x-hblock-request-id: 34e45fb7348647a6afbfb1dcb5b602cf
Connection: keep-alive
Content-Length: 597
Date: Wed, 7 Aug 2024 06:20:45 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"system": {
"status": "Working",
"licenseStatus": "None"
},
"server": {
"status": {
"connected": 4,
"disconnected": 0,
"removing": 0
}
},
"storagePool": {
"number": 4,
"basePool": "default",
"basePoolDetail": {
"faultDomain": {
"level": "server",
"status": {
"healthy": 3,
"warning": 0,
"error": 0
}
},
"disk": {
"status": {
"healthy": 4,
"warning": 0,
"error": 0
},
"usage": {
"used": 40795934720,
"total": 336471511040
}
}
}
},
"lun": {
"status": {
"number": 5,
"cacheNumber": 1,
"storageNumber": 1,
"localNumber": 3,
"cacheCapacity": 214748364800,
"storageCapacity": 322122547200,
"localCapacity": 429496729600
},
"data": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
}
}
}
}