此操作用来查询指定卷。
请求语法
GET /rest/v1/block/lun/lunName HTTP/1.1
Date: date
Host: ip:port
Authorization: authorization
请求参数
参数 | 描述 | 是否必须 |
---|---|---|
lunName | 卷名称。 说明 如果不填写此项,会返回所有卷信息。 类型:字符串 取值:长度范围是1~16,只能由字母、数字和短横线(-)组成,字母区分大小写,且仅支持以字母或数字开头。 | 否 |
响应结果
名称 | 描述 |
---|---|
lunName | 卷名称。 |
targetName | Target名称。 |
status | 卷的状态:
|
recoverFailedReason | 卷还原失败的原因。 仅卷状态为RecoverFailed时显示。 |
deleteFailedReason | 卷云上数据删除失败的原因。 仅卷状态为DeleteFailed时显示。 |
capacity | 卷容量,单位是GiB。 |
storageMode | 卷的存储类型:
|
createTime | 卷创建时间。unix时间戳(UTC),精确到毫秒。 |
iSCSITargets | iSCSI Target属性集合。包含:iqn、status、ips、targetPortalIP、serverId。 类型:数组 |
iqn | Target IQN。 |
iSCSITargets.status | 卷对应的Target的状态:
|
ips | iSCSI Target的IP属性集合,包含:ip、port。 类型:数组 |
ip | iSCSI Target的IP。 |
port | iSCSI Target的端口号。 |
targetPortalIP.ips | iSCSI目标门户的属性集合,包括:ip、port。 类型:数组 |
ip | iSCSI目标门户的IP地址。 |
port | iSCSI目标门户的端口号。 |
targetPortalIP.status | iSCSI目标门户的状态:
|
serverId | IQN所在的服务器ID。 |
cloud.bucketName | 存储桶的名称(仅上云卷支持)。 |
cloud.prefix | 对象存储中的前缀名称(仅上云卷支持)。 如果未设置,则不显示此段。 |
cloud.accessKey | 对象存储服务的Access Key(仅上云卷支持)。 |
cloud.endpoint | 对象存储Endpoint(仅上云卷支持)。 |
cloud.objectSize | 数据存储在对象存储的大小(仅上云卷支持)。 |
cloud.storageClass | 数据在对象存储的存储类型(仅上云卷支持):
|
cloud.compression | 是否压缩数据上传至对象存储(仅上云卷支持):
|
cloud.signVersion | 上云签名认证的类型(仅上云卷支持):
|
cloud.region | Endpoint资源池所在区域(仅上云卷支持)。 |
cloud.provider | 对象存储服务名称:
|
config.localStorageClass | 卷冗余模式(仅集群版支持):
|
config.minReplica | 卷的最小副本数(仅集群版支持)。 |
config.ECfragmentSize | 分片大小(仅集群版支持)。如果冗余模式为EC N+M,则会返回此项。 |
config.sectorSize | 扇区大小,单位为字节。 |
config.highAvailability | 高可用模式类型(仅集群版支持):
|
config.writePolicy | 卷的写策略:
|
config.cachePool | 缓存存储池(仅集群版支持)。 |
config.pool | 存储池(仅集群版支持),表示最终存储池,卷数据最终落在该存储池内。 |
config.redundancyOverlap | 卷的折叠副本数(仅集群版支持)。 |
config.serverAffinity.autoFailback | 针对卷主备状态,当高优先级的服务器恢复正常后,是否自动进行主备状态切换(仅集群版支持):
|
config.serverAffinity.priority | 卷主备分布优先级的服务器ID(仅集群版支持),根据系统指定的服务器ID顺序来选择卷的主备IQN。 |
config.path | 数据目录(仅单机版支持)。 |
number | 卷编号。LUN在Target下的编号,由存储系统分配,对应客户端挂载存储设备时设备地址中的LUN ID。如果Target下只有一个LUN,LUN的编号一般为0。 |
uuid | 卷的唯一识别码。 |
WWID | 卷的唯一标识符。 |
请求示例1
单机版本地卷:查询卷lun02。
GET /rest/v1/block/lun/lun02 HTTP/1.1
Date: Tue, 17 Dec 2024 03:54:16 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.32:1443
响应示例1
HTTP/1.1 200 OK
x-hblock-request-id: 94da6070904c49d486ec5b6c1244543c
Connection: keep-alive
Content-Length: 449
Date: Tue, 17 Dec 2024 03:54:16 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lun02",
"targetName": "target02",
"status": "Enabled",
"capacity": 20,
"storageMode": "Local",
"createTime": 1734407307599,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target02.1",
"status": "Active",
"ips": [
{
"ip": "192.168.0.32",
"port": 3260
}
],
"serverId": "hblock_1"
}
],
"config": {
"sectorSize": 4096,
"writePolicy": "WriteBack",
"path": "/mnt/stor"
},
"number": 0,
"uuid": "lun-uuid-c7ea21b5-81bf-494c-b093-2a26076ee404",
"WWID": "3300000002b6bda37"
}
}
请求示例2
单机版上云卷:查询卷lunb1。
GET /rest/v1/block/lun/lunb1 HTTP/1.1
Date: Fri, 03 Jan 2025 06:31:20 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.32:1443
响应示例2
HTTP/1.1 200 OK
x-hblock-request-id: 9097f8ff916740b3893bbb45d063e01b
Connection: keep-alive
Content-Length: 694
Date: Fri, 03 Jan 2025 06:31:20 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lunb1",
"targetName": "targetb",
"status": "Enabled",
"capacity": 230,
"storageMode": "Cache",
"createTime": 1734407368558,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:targetb.2",
"status": "Active",
"ips": [
{
"ip": "192.168.0.32",
"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/stor"
},
"number": 0,
"uuid": "lun-uuid-27f8fa0e-86b4-4c3d-b8d9-8f3dabeadb85",
"WWID": "3300000002f3e892d"
}
}
请求示例3
集群版本地卷:查询卷lun01a。
GET /rest/v1/block/lun/lun01a HTTP/1.1
Date: Fri, 3 Jan 2025 16:32:55 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.192:1443
响应示例3
HTTP/1.1 200 OK
x-hblock-request-id: 94bfd0aed30d41209bebee5281fbafb8
Connection: keep-alive
Content-Length: 772
Date: Fri, 3 Jan 2025 16:32:55 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lun01a",
"targetName": "target01",
"status": "Enabled",
"capacity": 100,
"storageMode": "Local",
"createTime": 1735875169673,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target01.2",
"status": "Active",
"ips": [
{
"ip": "192.168.0.202",
"port": 3260
}
],
"serverId": "hblock_2"
},
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target01.1",
"status": "Standby",
"ips": [
{
"ip": "192.168.0.102",
"port": 3260
}
],
"serverId": "hblock_3"
}
],
"config": {
"localStorageClass": "EC 2+1",
"minReplica": 2,
"sectorSize": 4096,
"highAvailability": "ActiveStandby",
"writePolicy": "WriteBack",
"pool": "default",
"redundancyOverlap": 1,
"serverAffinity": {
"autoFailback": "Enabled",
"priority": [
"hblock_2"
]
},
"ECfragmentSize": 16
},
"number": 0,
"uuid": "lun-uuid-5816ffd2-c232-4e5a-8b53-2834bc9303b9",
"WWID": "3300000000aa369a3"
}
}
请求示例4
集群版上云卷:查询卷lun02a。
GET /rest/v1/block/lun/lun02a HTTP/1.1
Date: Fri, 3 Jan 2025 16:36:23 GMT
Authorization: HBlock userName:signature
Host: 192.168.0.192:1443
响应示例4
HTTP/1.1 200 OK
x-hblock-request-id: b850de90c4c945f4a639a39f6a8efd5a
Connection: keep-alive
Content-Length: 982
Date: Fri, 3 Jan 2025 16:36:23 GMT
Content-Type: application/json;charset=utf-8
Server: HBlock
{
"data": {
"lunName": "lun02a",
"targetName": "target02",
"status": "Enabled",
"capacity": 200,
"storageMode": "Cache",
"createTime": 1735875228560,
"iSCSITargets": [
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target02.3",
"status": "Active",
"ips": [
{
"ip": "192.168.0.192",
"port": 3260
}
],
"serverId": "hblock_1"
},
{
"iqn": "iqn.2012-08.cn.ctyunapi.oos:target02.4",
"status": "Standby",
"ips": [
{
"ip": "192.168.0.102",
"port": 3260
}
],
"serverId": "hblock_3"
}
],
"cloud": {
"bucketName": "hblocktest3",
"prefix": "lun02a",
"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,
"serverAffinity": {
"autoFailback": "Enabled"
},
"ECfragmentSize": 16
},
"number": 0,
"uuid": "lun-uuid-4b44d601-0f88-43e8-868e-6a7cb0fe55ee",
"WWID": "33fffffff9000b000"
}
}