此操作用来查询指定卷。
请求语法
GET /rest/v1/block/lun/lunName HTTP/1.1
Date: date
Host: ip:port
Authorization: authorization
请求参数
参数 | 类型 | 描述 | 是否必须 |
---|---|---|---|
lunName | String | 卷名称。 说明 如果不填写此项,会返回所有卷信息。 取值:长度范围是1~16,只能由字母、数字和短横线(-)组成,字母区分大小写,且仅支持以字母或数字开头。 | 否 |
响应结果
名称 | 类型 | 描述 |
---|---|---|
lunName | String | 卷名称。 |
targetName | String | Target名称。 |
status | String | 卷的状态:
|
recoverFailedReason | String | 卷还原失败的原因。 仅卷状态为RecoverFailed时显示。 |
deleteFailedReason | String | 卷云上数据删除失败的原因。 仅卷状态为DeleteFailed时显示。 |
capacity | Integer | 卷容量,单位是GiB。 |
storageMode | String | 卷的存储类型:
|
createTime | Long | 卷创建时间。unix时间戳(UTC),精确到毫秒。 |
iSCSITargets | Array of iSCSITarget | iSCSI Target属性集合,详见“表1 响应参数iSCSITarget说明”。 |
cloud.bucketName | String | 存储桶的名称(仅上云卷支持)。 |
cloud.prefix | String | 对象存储中的前缀名称(仅上云卷支持)。 如果未设置,则不显示此段。 |
cloud.accessKey | String | 对象存储服务的Access Key(仅上云卷支持)。 |
cloud.endpoint | String | 对象存储Endpoint(仅上云卷支持)。 |
cloud.objectSize | Integer | 数据存储在对象存储的大小(仅上云卷支持)。 |
cloud.storageClass | String | 数据在对象存储的存储类型(仅上云卷支持):
|
cloud.compression | String | 是否压缩数据上传至对象存储(仅上云卷支持):
|
cloud.signVersion | String | 上云签名认证的类型(仅上云卷支持):
|
cloud.region | String | Endpoint资源池所在区域(仅上云卷支持)。 |
cloud.provider | String | 对象存储服务名称:
|
config.localStorageClass | String | 卷冗余模式(仅集群版支持):
|
config.minReplica | Integer | 卷的最小副本数(仅集群版支持)。 |
config.ECfragmentSize | Integer | 分片大小(仅集群版支持)。如果冗余模式为EC N+M,则会返回此项。 |
config.sectorSize | Long | 扇区大小,单位为字节。 |
config.highAvailability | String | 高可用模式类型(仅集群版支持):
|
config.writePolicy | String | 卷的写策略:
|
config.cachePool | String | 缓存存储池(仅集群版支持)。 |
config.pool | String | 存储池(仅集群版支持),表示最终存储池,卷数据最终落在该存储池内。 |
config.redundancyOverlap | Integer | 卷的折叠副本数(仅集群版支持)。 |
config.serverAffinity | List of serverAffinity | 卷主备分布优先级设置,详见“表5 响应参数config.serverAffinity说明”。 |
config.path | String | 数据目录(仅单机版支持)。 |
number | Long | 卷编号。LUN在Target下的编号,由存储系统分配,对应客户端挂载存储设备时设备地址中的LUN ID。如果Target下只有一个LUN,LUN的编号一般为0。 |
uuid | String | 卷的唯一识别码。 |
isClone | Boolean | 是否是克隆卷:
|
sourceSnapshotName | String | 对应的快照名称(仅克隆卷支持)。 |
Snapshots.snapshotNumbers | Integer | 卷的快照个数。 |
Snapshots.lunSnapshots | Array of lunSnapshot | 卷的快照信息集合,详见“表6 响应参数lunSnapshot/Children说明”。 |
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 响应参数config.serverAffinity说明
名称 | 类型 | 描述 |
---|---|---|
autoFailback | String | 针对卷主备状态,当高优先级的服务器恢复正常后,是否自动进行主备状态切换(仅集群版支持):
|
priority | Array of string | 卷主备分布优先级的服务器ID(仅集群版支持),系统根据指定的服务器ID顺序来选择卷的主备IQN。 |
表6 响应参数lunSnapshot/Children说明
名称 | 类型 | 描述 |
---|---|---|
snapshotName | String | 快照名称。 |
description | Integer | 快照描述信息。 |
lunCapacity | String | 创建快照时刻,源卷的容量。 |
consistencySnapshotName | String | 所属的一致性快照名称。 说明 仅一致性快照的卷快照显示。 |
status | String | 快照的状态:
|
reclaimPolicy | String | 快照回收策略:
|
createTime | Long | 快照的创建时间。 |
basisofCurData | Boolean | 卷当前数据是否基于该快照:
|
children | Array of children | 基于该快照创建的快照信息集合,参数解释详见本表。 |
请求示例1
单机版本地卷(非克隆卷):查询卷luna1。
GET /rest/v1/block/lun/luna1 HTTP/1.1
Date: Fri, 14 Mar 2025 01:36:47 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.65:1443
响应示例1
HTTP/1.1 200 OK
x-hblock-request-id: 24d4772d8b1d4a4bae6726342d38bf3f
Connection: keep-alive
Content-Length: 1459
Date: Fri, 14 Mar 2025 01:36:47 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "luna1",
"targetName": "targeta",
"status": "Normal",
"capacity": 100,
"storageMode": "Local",
"createTime": 1740646111244,
"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"
},
"number": 0,
"uuid": "lun-uuid-2ffdaa5e-da3e-400f-84fd-7bd46ed34fb1",
"isClone": false,
"snapshots": {
"snapshotNumbers": 5,
"lunSnapshots": [
{
"snapshotName": "luna1-snapshot",
"description": "lunaqo snapshot",
"lunCapacity": 100,
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1741054896981,
"basisofCurData": false,
"children": [
{
"snapshotName": "luna1-snap20250310101155",
"description": "",
"lunCapacity": 100,
"consistencySnapshotName": "consnapshot2",
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1741572715753,
"basisofCurData": false,
"children": [
{
"snapshotName": "luna1-snap1",
"description": "",
"lunCapacity": 100,
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1741595526061,
"basisofCurData": false,
"children": [
{
"snapshotName": "luna1-snap2",
"description": "",
"lunCapacity": 100,
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1741595540686,
"basisofCurData": false,
"children": [
{
"snapshotName": "luna1-snap4",
"description": "",
"lunCapacity": 100,
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1741676007534,
"basisofCurData": true
}
]
}
]
}
]
}
]
}
]
},
"WWID": "33000000032b51acf"
}
}
请求示例2
单机版本地卷(克隆卷):查询卷luna1-C1。
GET /rest/v1/block/lun/luna1-C1 HTTP/1.1
Date: Fri, 14 Mar 2025 02:03:13 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.65:1443
响应示例2
HTTP/1.1 200 OK
x-hblock-request-id: f04c028ac6b24d72a4d3c0f42bebcb58
Connection: keep-alive
Content-Length: 777
Date: Fri, 14 Mar 2025 02:03:13 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "luna1-C1",
"targetName": "targeta1",
"status": "Normal",
"capacity": 200,
"storageMode": "Local",
"createTime": 1741578932451,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:targeta1.4",
"status": "Active",
"ips": [
{
"ip": "192.168.0.66",
"port": 3260
}
],
"serverId": "hblock_1"
}
],
"config": {
"sectorSize": 4096,
"writePolicy": "WriteBack",
"path": "/mnt/stor01",
"reclaimPolicy": "Retain"
},
"number": 0,
"uuid": "lun-uuid-4beffea2-05a1-4ba9-8e21-06337a1e57e5",
"isClone": true,
"sourceSnapshotName": "luna1-snapshot",
"sourceLunName": "luna1",
"snapshots": {
"snapshotNumbers": 1,
"lunSnapshots": [
{
"snapshotName": "lun",
"description": "luna1-C1's snapshot.",
"lunCapacity": 200,
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1741595506373,
"basisofCurData": true
}
]
},
"WWID": "33000000066d85e04"
}
}
请求示例3
单机版上云卷:查询卷lunb1。
GET /rest/v1/block/lun/lunb1 HTTP/1.1
Date: Wed, 12 Mar 2025 03:10:41 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.66:1443
响应示例3
HTTP/1.1 200 OK
x-hblock-request-id: eb12ed58e57b49d4b17e5de0c1d25ffc
Connection: keep-alive
Content-Length: 736
Date: Wed, 12 Mar 2025 03:10:41 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lunb1",
"targetName": "targetb",
"status": "Normal",
"capacity": 200,
"storageMode": "Cache",
"createTime": 1740650654198,
"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",
"prefix": "lunb",
"accessKey": "8f129a5529f202811fd0",
"endpoint": "https://oos-cn.ctyunapi.cn",
"objectSize": 1024,
"storageClass": "STANDARD",
"compression": "Enabled",
"signVersion": "v4",
"region": "cn",
"provider": "OOS"
},
"config": {
"sectorSize": 4096,
"writePolicy": "WriteBack",
"path": "/mnt/stor01",
"reclaimPolicy": "Retain"
},
"number": 0,
"uuid": "lun-uuid-fc9a2f2c-c8bd-462b-8684-49e6e1650b1c",
"isClone": false,
"WWID": "33fffffff9449437a"
}
}
请求示例4
集群版本地卷(非克隆卷):查询卷lun01a。
GET /rest/v1/block/lun/lun01a HTTP/1.1
Date: Fri, 14 Mar 2025 02:22:13 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.65:1443
响应示例4
HTTP/1.1 200 OK
x-hblock-request-id: 4de928edab1a49b3bd58470845d241d4
Connection: keep-alive
Content-Length: 1536
Date: Fri, 14 Mar 2025 02:22:13 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lun01a",
"targetName": "target01",
"status": "Normal",
"capacity": 100,
"storageMode": "Local",
"createTime": 1739874581872,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target01.2",
"status": "Active",
"ips": [
{
"ip": "192.168.0.64",
"port": 3260
}
],
"serverId": "hblock_2"
},
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target01.1",
"status": "Standby",
"ips": [
{
"ip": "192.168.0.67",
"port": 3260
}
],
"serverId": "hblock_3"
}
],
"config": {
"localStorageClass": "EC 2+1",
"minReplica": 2,
"sectorSize": 4096,
"highAvailability": "ActiveStandby",
"writePolicy": "WriteBack",
"pool": "default",
"redundancyOverlap": 1,
"reclaimPolicy": "Retain",
"serverAffinity": {
"autoFailback": "Enabled",
"priority": [
"hblock_2",
"hblock_3"
]
},
"ECfragmentSize": 16
},
"number": 0,
"uuid": "lun-uuid-67f10b65-4efa-4933-878d-89f3ca276839",
"isClone": false,
"snapshots": {
"snapshotNumbers": 3,
"lunSnapshots": [
{
"snapshotName": "lun01a-snap20250304161817",
"description": "",
"lunCapacity": 100,
"consistencySnapshotName": "consistencysnapshot1",
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1741076297203,
"basisofCurData": false,
"children": [
{
"snapshotName": "lun01a-snap20250304170942",
"description": "",
"lunCapacity": 100,
"consistencySnapshotName": "consistencysnapshot4",
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1741079382737,
"basisofCurData": true,
"children": [
{
"snapshotName": "snapshot-lun01a-2",
"description": "The second snapshot of lun01a.",
"lunCapacity": 100,
"status": "Normal",
"reclaimPolicy": "Delete",
"createTime": 1741155999216,
"basisofCurData": false
}
]
}
]
}
]
},
"WWID": "3300000004ef4da0e"
}
}
请求示例5
集群版本地卷(克隆卷):查询卷lun01a-clone2。
GET /rest/v1/block/lun/lun01a-clone2 HTTP/1.1
Date: Fri, 14 Mar 2025 02:33:03 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.65:1443
响应示例5
HTTP/1.1 200 OK
x-hblock-request-id: 12d31de4258c4bfbb8f35b3708737ed1
Connection: keep-alive
Content-Length: 1078
Date: Fri, 14 Mar 2025 02:33:03 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lun01a-clone2",
"targetName": "target001",
"status": "Normal",
"capacity": 100,
"storageMode": "Local",
"createTime": 1741224470703,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target001.7",
"status": "Active",
"ips": [
{
"ip": "192.168.0.65",
"port": 3260
}
],
"serverId": "hblock_1"
},
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target001.8",
"status": "Standby",
"ips": [
{
"ip": "192.168.0.67",
"port": 3260
}
],
"serverId": "hblock_3"
}
],
"config": {
"localStorageClass": "EC 2+1",
"minReplica": 2,
"sectorSize": 4096,
"highAvailability": "ActiveStandby",
"writePolicy": "WriteBack",
"pool": "default",
"redundancyOverlap": 1,
"reclaimPolicy": "Retain",
"serverAffinity": {
"autoFailback": "Enabled"
},
"ECfragmentSize": 16
},
"number": 2,
"uuid": "lun-uuid-540f485e-4ff9-40f1-9b91-732229ed34f3",
"isClone": true,
"sourceSnapshotName": "snapshot-lun01a-2",
"sourceLunName": "lun01a",
"snapshots": {
"snapshotNumbers": 1,
"lunSnapshots": [
{
"snapshotName": "lun01a-clone2-snap1",
"description": "",
"lunCapacity": 100,
"status": "Normal",
"reclaimPolicy": "Retain",
"createTime": 1741684178521,
"basisofCurData": true
}
]
},
"WWID": "3300000000429bf04"
}
}
请求示例6
集群版上云卷:查询卷lun04a。
GET /rest/v1/block/lun/lun04a HTTP/1.1
Date: Wed, 12 Mar 2025 03:19:21 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.66:1443
响应示例6
HTTP/1.1 200 OK
x-hblock-request-id: cb3ff4b6f5e84fe9a8937f41eb1b3303
Connection: keep-alive
Content-Length: 1004
Date: Wed, 12 Mar 2025 03:19:21 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lun04a",
"targetName": "target04",
"status": "Normal",
"capacity": 220,
"storageMode": "Cache",
"createTime": 1740708257052,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target04.15",
"status": "Active",
"ips": [
{
"ip": "192.168.0.65",
"port": 3260
}
],
"serverId": "hblock_1"
},
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target04.16",
"status": "Standby",
"ips": [
{
"ip": "192.168.0.64",
"port": 3260
}
],
"serverId": "hblock_2"
}
],
"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",
"redundancyOverlap": 1,
"reclaimPolicy": "Retain",
"serverAffinity": {
"autoFailback": "Enabled"
},
"ECfragmentSize": 16
},
"number": 0,
"uuid": "lun-uuid-194c91ec-1dd5-4d12-94ce-7bab1a898362",
"isClone": false,
"WWID": "33ffffffff4f9099b"
}
}