此操作用来查询指定卷。
请求语法
GET /rest/v2/block/lun/lunName HTTP/1.1
Date: date
Host: ip:port
Authorization: authorization请求参数
| 参数 | 类型 | 描述 | 是否必须 |
|---|---|---|---|
| lunName | String | 卷名称。 说明 如果不填写此项,会返回所有卷信息。 取值:长度范围是1~16,只能由字母、数字和短横线(-)组成,字母区分大小写,且仅支持以字母或数字开头。 | 否 |
响应结果
| 名称 | 类型 | 描述 |
|---|---|---|
| lunName | String | 卷名称。 |
| targetName | String | target名称。 |
| status | String | 卷的状态:
|
| progress | Double | 卷还原进度百分比。 仅卷状态为Recovering时显示。 |
| recoverFailedReason | String | 卷还原失败的原因。 仅卷状态为RecoverFailed时显示。 |
| deleteFailedReason | String | 卷云上数据删除失败的原因。 仅卷状态为DeleteFailed时显示。 |
| wipeFailedReason | String | 卷清空失败的原因。 仅卷状态为WipeFailed时显示。 |
| waitUploadBytes | String | 待上传数据量,单位是bytes。 仅卷状态为Suspending时显示。 |
| SuspendFailedReason | String | 卷挂起失败的原因。 仅卷状态为SuspendFailed时显示。 |
| capacity | Integer | 卷容量,单位是GiB。 |
| storageMode | String | 卷的存储类型:
|
| createTime | Long | 卷创建时间。unix时间戳(UTC),精确到毫秒。 |
| iSCSITargets | Array of iSCSITarget | iSCSI target属性集合,详见“表1 响应参数iSCSITarget说明”。 |
| cloud | Object of cloud | 卷的上云信息,详见“表5 响应参数cloud说明”。 |
| config | Object of config | 卷的配置信息,详见“表6 响应参数config说明”。 |
| dataHealth | Object of dataHealth | 卷数据的健康状况信息,详见“表11 响应参数dataHealth说明”。 |
| number | Long | 卷编号。LUN在target下的编号,由存储系统分配,对应客户端挂载存储设备时设备地址中的LUN ID。如果target下只有一个LUN,LUN的编号一般为0。 |
| uuid | String | 卷的唯一识别码。 |
| isClone | Boolean | 是否是克隆卷:
|
| sourceSnapshotName | String | 对应的快照名称(仅克隆卷支持)。 |
| sourceLunName | String | 克隆卷的源卷名称(仅克隆卷支持)。 |
| snapshots | Object of snapshot | 卷的快照信息,详见“表12 响应参数snapshot说明”。 |
| WWID | String | 卷的唯一标识符。 |
表1 响应参数iSCSITarget说明
| 名称 | 类型 | 描述 |
|---|---|---|
| iqn | String | iSCSI target IQN。 |
| status | String | 卷对应的target的状态:
|
| ips | Array of ip | iSCSI target的IP属性集合,详见“表2 响应参数ip说明”。 |
| targetPortalIP | Array of targetPortalIP | iSCSI目标门户,详见“表3 响应参数targetPortalIP说明”。 |
| serverId | String | IQN所在的服务器ID。 |
表2 响应参数ip说明
| 名称 | 类型 | 描述 |
|---|---|---|
| ip | String | iSCSI target的IP。 |
| port | Integer | iSCSI target的端口号。 |
表3 响应参数targetPortalIP说明
| 名称 | 类型 | 描述 |
|---|---|---|
| ips | Array of ip | iSCSI目标门户的IP属性集合,详见“表4 响应参数ip(iSCSI目标门户的IP)说明”。 |
| status | String | iSCSI目标门户的状态:
|
表4 响应参数ip(iSCSI目标门户的IP)说明
| 名称 | 类型 | 描述 |
|---|---|---|
| ip | String | iSCSI目标门户的IP地址。 |
| port | Integer | iSCSI目标门户的端口号。 |
表5 响应参数cloud说明
| 名称 | 类型 | 描述 |
|---|---|---|
| bucketName | String | OOS存储桶的名称(仅上云卷支持)。 |
| prefix | String | 对象存储中的前缀名称(仅上云卷支持)。 如果未设置,则不返回此项。 |
| accessKey | String | 对象存储服务的Access Key(仅上云卷支持)。 |
| endpoint | String | OOS Endpoint(仅上云卷支持)。 |
| objectSize | Integer | 数据存储在云端的大小(仅上云卷支持)。 |
| storageClass | String | 数据在云端的存储类型(仅上云卷支持):
|
| compression | String | 是否压缩数据上传至云端(仅上云卷支持):
|
| signVersion | String | 上云签名认证的类型(仅上云卷支持):
|
| region | String | Endpoint资源池所在区域(仅上云卷支持)。 |
| provider | String | 对象存储服务名称:
|
表6 响应参数config说明
| 名称 | 类型 | 描述 |
|---|---|---|
| localStorageClass | String | 卷冗余模式(仅集群版支持):
|
| minReplica | Integer | 卷的最小副本数(仅集群版支持)。 |
| ECfragmentSize | Integer | 分片大小(仅集群版支持)。如果冗余模式为EC N+M,则会返回此项。 |
| sectorSize | Integer | 扇区大小:
|
| highAvailability | String | 高可用模式类型(仅集群版支持):
|
| writePolicy | String | 卷的写策略:
|
| cachePool | String | 缓存存储池(仅集群版支持)。 |
| pool | String | 存储池(仅集群版支持),表示最终存储池,卷数据最终落在该存储池内。 |
| redundancyOverlap | Integer | 卷的折叠副本数(仅集群版支持)。 |
| reclaimPolicy | String | 卷回收策略:
|
| serverAffinity | Object | 卷主备分布优先级设置,详见“表7 响应参数serverAffinity说明”。 |
| compress | Object | 卷本地数据的压缩策略,详见“表8 响应参数compress说明”。 |
| qosPolicy | Object | 卷关联的QoS策略信息,详见“表9 响应参数qosPolicy说明”。 |
| qosPolicyforLUN | Object | 卷所在存储池中卷的默认QoS策略信息(仅集群版支持),详见“表10 响应参数qosPolicyforLUN说明”。 说明
|
| path | String | 数据目录(仅单机版支持)。 |
表7 响应参数serverAffinity说明
| 名称 | 类型 | 描述 |
|---|---|---|
| autoFailback | String | 针对卷主备状态,当高优先级的服务器恢复正常后,是否自动进行主备状态切换(仅集群版支持):
|
| priority | Array of string | 卷主备分布优先级的服务器ID(仅集群版支持),系统根据指定的服务器ID顺序来选择卷的主备IQN。 |
表8 响应参数compress说明
| 名称 | 类型 | 描述 |
|---|---|---|
| algorithm | String | 卷的本地数据压缩策略:
|
| zstdLevel | Integer | 使用Zstandard压缩算法对卷本地数据进行压缩时,数据的压缩级别。 说明 压缩级别是一个在压缩速度与压缩比之间进行权衡的参数:级别值越低,压缩速度越快,但压缩率越低;级别值越高,压缩比越好,但压缩速度越慢,消耗的CPU和内存资源也更多。 |
表9 响应参数qosPolicy说明
| 名称 | 类型 | 描述 |
|---|---|---|
| qosName | String | QoS策略名称。 |
表10 响应参数qosPolicyforLUN
| 名称 | 类型 | 描述 |
|---|---|---|
| qosName | String | QoS策略名称。 |
| poolName | String | 存储池名称。 |
表11 响应参数dataHealth说明
| 名称 | 类型 | 描述 |
|---|---|---|
| normal | Double | 卷正常数据的百分比。 |
| lowRedundancy | Double | 卷降级数据的百分比。 |
| error | Double | 卷错误数据的百分比。 |
| reconstructionProgress | Double | 当卷存在降级状态的数据时,数据重建进度的百分比。 |
| ETR | Long | 当卷存在降级数据时,预计剩余的数据重建时间。单位为秒。如果返回值为负数,说明数据无法重建,需用户尽快修复。 |
表12 响应参数snapshot说明
| 名称 | 类型 | 描述 |
|---|---|---|
| snapshotNumbers | Integer | 卷的快照个数(仅本地卷支持)。 |
| basisofCurData | Boolean | 当前的读写是否是基于卷的初始状态:
|
| lunSnapshots | Array of lunSnapshot | 卷的快照信息集合(仅本地卷支持),详见“表13 响应参数lunSnapshot/Children说明”。 |
| snapshotSize | Long | 卷关联的快照大小的总和(仅本地卷支持),即快照记录的数据量。单位是bytes。 注意 卷或上游快照删除可能导致大小波动。 |
表13 响应参数lunSnapshot/Children说明
| 名称 | 类型 | 描述 |
|---|---|---|
| snapshotName | String | 快照名称。 |
| description | Integer | 快照描述信息。 |
| lunCapacity | String | 创建快照时刻,源卷的容量。 |
| consistencySnapshotName | String | 所属的一致性快照名称。 说明 仅一致性快照的卷快照显示。 |
| status | String | 快照的状态:
|
| reclaimPolicy | String | 快照回收策略:
|
| createTime | Long | 快照的创建时间。 |
| basisofCurData | Boolean | 卷当前数据是否基于该快照:
|
| snapshotSize | Long | 快照大小,具体快照记录的数据量。单位是bytes。 注意 卷或上游快照删除可能导致大小波动。 |
| children | Array of children | 基于该快照创建的快照信息集合,参数解释详见本表。 |
请求示例1
单机版本地卷(非克隆卷):查询卷luna1。
GET /rest/v2/block/lun/luna1 HTTP/1.1
Date: Wed, 17 Jun 2026 02:38:54 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.66:1443响应示例1
HTTP/1.1 200 OK
x-hblock-request-id: b77211e50311413d95a074a6b2204b5a
Connection: keep-alive
Content-Length: 1080
Date: Wed, 17 Jun 2026 02:38:54 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "luna1",
"targetName": "targeta",
"status": "Normal",
"capacity": 100,
"storageMode": "Local",
"createTime": 1779774272040,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:targeta.1",
"status": "Active",
"ips": [
{
"ip": "192.168.0.66",
"port": 3260
}
],
"serverId": "hblock_1"
}
],
"config": {
"sectorSize": 4096,
"writePolicy": "WriteBack",
"path": "/mnt/stor01",
"reclaimPolicy": "Retain",
"qosPolicy": {
"qosName": "Qos1"
},
"compress": {
"algorithm": "None"
}
},
"dataHealth": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
},
"number": 0,
"uuid": "lun-uuid-79c65a23-6957-4dbf-a9e2-113341a1c92f",
"isClone": false,
"snapshots": {
"snapshotNumbers": 2,
"basisofCurData": false,
"lunSnapshots": [
{
"snapshotName": "luna1-snapshot",
"lunCapacity": 100,
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1781576119608,
"basisofCurData": false,
"children": [
{
"snapshotName": "luna1-snap20260617101123",
"lunCapacity": 100,
"consistencySnapshotName": "cons1",
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1781662283927,
"basisofCurData": true,
"snapshotSize": 0
}
],
"snapshotSize": 0
}
],
"snapshotSize": 0
},
"WWID": "33fffffffcdfaf62d"
}
}请求示例2
单机版本地卷(克隆卷):查询卷luna1-C1。
GET /rest/v2/block/lun/luna1-C1 HTTP/1.1
Date: Wed, 17 Jun 2026 02:41:00 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.66:1443响应示例2
HTTP/1.1 200 OK
x-hblock-request-id: ab565463220140dcb9a3ebd80223ebe6
Connection: keep-alive
Content-Length: 974
Date: Wed, 17 Jun 2026 02:41:01 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "luna1-C1",
"targetName": "targeta1",
"status": "Normal",
"capacity": 200,
"storageMode": "Local",
"createTime": 1781576166817,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:targeta1.3",
"status": "Active",
"ips": [
{
"ip": "192.168.0.66",
"port": 3260
}
],
"serverId": "hblock_1"
}
],
"config": {
"sectorSize": 4096,
"writePolicy": "WriteBack",
"path": "/mnt/stor01",
"reclaimPolicy": "Retain",
"qosPolicy": {
"qosName": "Qos1"
},
"compress": {
"algorithm": "None"
}
},
"dataHealth": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
},
"number": 0,
"uuid": "lun-uuid-a878b283-b274-40dd-a967-71aa861b5f2d",
"isClone": true,
"sourceSnapshotName": "luna1-snapshot",
"sourceLunName": "luna1",
"snapshots": {
"snapshotNumbers": 1,
"basisofCurData": false,
"lunSnapshots": [
{
"snapshotName": "luna1-C1-snap20260617101123",
"lunCapacity": 200,
"consistencySnapshotName": "cons1",
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1781662283948,
"basisofCurData": true,
"snapshotSize": 0
}
],
"snapshotSize": 0
},
"WWID": "33fffffff922a5a0f"
}
}请求示例3
单机版上云卷:查询卷lunb2。
GET /rest/v2/block/lun/lunb2 HTTP/1.1
Date: Wed, 17 Jun 2026 02:42:26 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.66:1443响应示例3
HTTP/1.1 200 OK
x-hblock-request-id: 57dc44751bf34e33bd9c3d89bed54739
Connection: keep-alive
Content-Length: 823
Date: Wed, 17 Jun 2026 02:42:26 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lunb2",
"targetName": "targetb",
"status": "Normal",
"capacity": 220,
"storageMode": "Cache",
"createTime": 1781579618100,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:targetb.2",
"status": "Active",
"ips": [
{
"ip": "192.168.0.66",
"port": 3260
}
],
"serverId": "hblock_1"
}
],
"cloud": {
"bucketName": "hblocktest3",
"accessKey": "8f129a5529f202811fd0",
"endpoint": "https://oos-cn.ctyunapi.cn",
"objectSize": 1024,
"storageClass": "STANDARD",
"compression": "Enabled",
"signVersion": "v2",
"provider": "OOS"
},
"config": {
"sectorSize": 4096,
"writePolicy": "WriteBack",
"path": "/mnt/stor01",
"reclaimPolicy": "Retain",
"qosPolicy": {
"qosName": "Qos1"
},
"compress": {
"algorithm": "Zstd",
"zstdLevel": 4
}
},
"dataHealth": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
},
"number": 1,
"uuid": "lun-uuid-b92216f1-ee46-4589-80cc-93a2e7e35280",
"WWID": "3300000004338de99"
}
}请求示例4
集群版本地卷(非克隆卷):查询卷lun01a。
GET /rest/v2/block/lun/lun01a HTTP/1.1
Date: Wed, 17 Jun 2026 03:10:11 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.64:1443响应示例4
HTTP/1.1 200 OK
x-hblock-request-id: 178cdaff08a14c9090fae0c58674b6ad
Connection: keep-alive
Content-Length: 1736
Date: Wed, 17 Jun 2026 03:10:12 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lun01a",
"targetName": "target01",
"status": "Normal",
"capacity": 110,
"storageMode": "Local",
"createTime": 1780364892668,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target01.2",
"status": "Active",
"ips": [
{
"ip": "192.168.0.65",
"port": 3260
}
],
"targetPortalIP": {
"ips": [
{
"ip": "10.1.0.3",
"port": 105
}
],
"status": "Disabled"
},
"serverId": "hblock_1"
},
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target01.1",
"status": "Standby",
"ips": [
{
"ip": "192.168.0.67",
"port": 3260
}
],
"targetPortalIP": {
"ips": [
{
"ip": "10.1.0.3",
"port": 105
}
],
"status": "Disabled"
},
"serverId": "hblock_3"
}
],
"config": {
"localStorageClass": "EC 2+1",
"minReplica": 2,
"sectorSize": 4096,
"highAvailability": "ActiveStandby",
"writePolicy": "WriteThrough",
"pool": "default-pool",
"redundancyOverlap": 1,
"reclaimPolicy": "Retain",
"serverAffinity": {
"autoFailback": "Enabled"
},
"qosPolicy": {
"qosName": "Qos1"
},
"compress": {
"algorithm": "Zstd",
"zstdLevel": 5
},
"ECfragmentSize": 16
},
"dataHealth": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
},
"number": 0,
"uuid": "lun-uuid-c5b71193-5092-4edd-8363-13840caafaee",
"isClone": false,
"snapshots": {
"snapshotNumbers": 3,
"basisofCurData": false,
"lunSnapshots": [
{
"snapshotName": "snap1",
"lunCapacity": 110,
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1781518907620,
"basisofCurData": false,
"children": [
{
"snapshotName": "lun01a-s1",
"lunCapacity": 110,
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1781576326729,
"basisofCurData": false,
"children": [
{
"snapshotName": "lun01a-snap20260616144525",
"lunCapacity": 110,
"consistencySnapshotName": "conss1",
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1781592325936,
"basisofCurData": true,
"snapshotSize": 200589312
}
],
"snapshotSize": 0
}
],
"snapshotSize": 93356032
}
],
"snapshotSize": 293945344
},
"WWID": "33fffffffeb57e1dc"
}
}请求示例5
集群版本地卷(克隆卷):查询卷lun01a-C2。
GET /rest/v2/block/lun/lun01a-C2 HTTP/1.1
Date: Wed, 17 Jun 2026 03:12:56 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.64:1443响应示例5
HTTP/1.1 200 OK
x-hblock-request-id: e4532f3a4a5d4986ba8466315f57d913
Connection: keep-alive
Content-Length: 1446
Date: Wed, 17 Jun 2026 03:12:56 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lun01a-C2",
"targetName": "target01",
"status": "Normal",
"capacity": 110,
"storageMode": "Local",
"createTime": 1781576349404,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target01.1",
"status": "Active",
"ips": [
{
"ip": "192.168.0.67",
"port": 3260
}
],
"targetPortalIP": {
"ips": [
{
"ip": "10.1.0.3",
"port": 105
}
],
"status": "Disabled"
},
"serverId": "hblock_3"
},
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target01.2",
"status": "Standby",
"ips": [
{
"ip": "192.168.0.65",
"port": 3260
}
],
"targetPortalIP": {
"ips": [
{
"ip": "10.1.0.3",
"port": 105
}
],
"status": "Disabled"
},
"serverId": "hblock_1"
}
],
"config": {
"localStorageClass": "EC 2+1",
"minReplica": 2,
"sectorSize": 4096,
"highAvailability": "ActiveStandby",
"writePolicy": "WriteThrough",
"pool": "default-pool",
"redundancyOverlap": 1,
"reclaimPolicy": "Retain",
"serverAffinity": {
"autoFailback": "Enabled"
},
"qosPolicy": {
"qosName": "Qos1"
},
"compress": {
"algorithm": "Zstd",
"zstdLevel": 5
},
"ECfragmentSize": 16
},
"dataHealth": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
},
"number": 6,
"uuid": "lun-uuid-a3fbee10-af1c-463c-837f-c2055e11d7c4",
"isClone": true,
"sourceSnapshotName": "lun01a-s1",
"sourceLunName": "lun01a",
"snapshots": {
"snapshotNumbers": 1,
"basisofCurData": false,
"lunSnapshots": [
{
"snapshotName": "lun01a-C2-snap20260616144525",
"lunCapacity": 110,
"consistencySnapshotName": "conss1",
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1781592325952,
"basisofCurData": true,
"snapshotSize": 4096
}
],
"snapshotSize": 4096
},
"WWID": "33fffffffecefeed0"
}
}请求示例6
集群版上云卷:查询卷lun04c。
GET /rest/v2/block/lun/lun04c HTTP/1.1
Date: Wed, 17 Jun 2026 03:14:45 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.64:1443响应示例6
HTTP/1.1 200 OK
x-hblock-request-id: 6073f619b0764983a82a3d8b6d53b54d
Connection: keep-alive
Content-Length: 1262
Date: Wed, 17 Jun 2026 03:14:46 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lun02b",
"targetName": "target02",
"status": "Normal",
"capacity": 210,
"storageMode": "Cache",
"createTime": 1781576842029,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target02.4",
"status": "Active",
"ips": [
{
"ip": "192.168.0.64",
"port": 3260
}
],
"targetPortalIP": {
"ips": [
{
"ip": "10.1.0.3",
"port": 105
}
],
"status": "Disabled"
},
"serverId": "hblock_2"
},
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target02.3",
"status": "Standby",
"ips": [
{
"ip": "192.168.0.68",
"port": 3260
}
],
"targetPortalIP": {
"ips": [
{
"ip": "10.1.0.3",
"port": 105
}
],
"status": "Disabled"
},
"serverId": "hblock_4"
}
],
"cloud": {
"bucketName": "hblocktest3",
"accessKey": "8f129a5529f202811fd0",
"endpoint": "https://oos-cn.ctyunapi.cn",
"objectSize": 1024,
"storageClass": "STANDARD",
"compression": "Enabled",
"signVersion": "v2",
"provider": "OOS"
},
"config": {
"localStorageClass": "EC 2+1",
"minReplica": 2,
"sectorSize": 4096,
"highAvailability": "ActiveStandby",
"writePolicy": "WriteBack",
"pool": "default-pool",
"redundancyOverlap": 1,
"reclaimPolicy": "Retain",
"serverAffinity": {
"autoFailback": "Enabled"
},
"qosPolicy": {
"qosName": "Qos1"
},
"compress": {
"algorithm": "None"
},
"ECfragmentSize": 16
},
"dataHealth": {
"normal": 100,
"lowRedundancy": 0,
"error": 0
},
"number": 1,
"uuid": "lun-uuid-1f2f124d-902a-4ac3-9bd6-592505e2bae4",
"WWID": "3300000001892b447"
}
}