查询iSCSI磁盘
Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/lunscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/luns/da96929549c63b66b8afc63be70a373f可查询字段
运行CLI命令行工具,输入QueryIscsiLun并按Tab键查看所有可查询字段以及可跨表查询的资源名。
API返回
返回示例
{
"inventories": [
{
"uuid": "d833304319da3b32bc92f21c763a8e5b",
"wwid": "36b083fe000daf018000015505abbe00a",
"vendor": "DELL",
"model": "MD32xx",
"wwn": "0x6b083fe000daf018",
"serial": "6b083fe000daf018000015505abbe00a",
"hctl": "6:0:1:1",
"type": "mpath",
"path": "ip-0.0.0.201:3260-iscsi-iqn.2018-01.io.cloud:tsn.00001-lun-0",
"size": 30003188203520.0,
"multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
},
{
"uuid": "a21ee1e2e3f63a61ac983c53c29552d2",
"wwid": "36b083fe000daf018000015505abbe00a",
"vendor": "DELL",
"model": "MD32xx",
"wwn": "0x6b083fe000daf018",
"serial": "6b083fe000daf018000015505abbe00a",
"hctl": "6:0:3:1",
"type": "mpath",
"path": "ip-0.0.0.201:3260-iscsi-iqn.2018-01.io.cloud:tsn.00002-lun-0",
"size": 30003188203520.0,
"multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
}
]
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 3.0.0 |
| inventories | List | 详情参考inventories | 3.0.0 |
error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 3.0.0 |
| description | String | 错误的概要描述 | 3.0.0 |
| details | String | 错误的详细信息 | 3.0.0 |
| elaboration | String | 保留字段,默认为null | 3.0.0 |
| opaque | LinkedHashMap | 保留字段,默认为null | 3.0.0 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 3.0.0 |
inventories
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| uuid | String | 资源的UUID,唯一标示该资源 | 3.0.0 |
| iscsiTargetUuid | String | iSCSI目标UUID | 3.0.0 |
| wwid | String | 唯一识别ID | 3.0.0 |
| vendor | String | 设备供应商 | 3.0.0 |
| model | String | 设备型号 | 3.0.0 |
| wwn | String | 设备WWN | 3.0.0 |
| serial | String | 设备序列号 | 3.0.0 |
| hctl | String | SCSI设备HCTL | 3.0.0 |
| type | String | 设备类型 | 3.0.0 |
| path | String | 设备路径 | 3.0.0 |
| size | Long | 设备大小 | 3.0.0 |
| createDate | Timestamp | 创建时间 | 3.0.0 |
| lastOpDate | Timestamp | 最后一次修改时间 | 3.0.0 |
SDK示例
Java SDK
QueryIscsiLunAction action = new QueryIscsiLunAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIscsiLunAction.Result res = action.call();Python SDK
QueryIscsiLunAction action = QueryIscsiLunAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIscsiLunAction.Result res = action.call()