Query SCSI LUN
Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/scsi-lun/lunscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/scsi-lun/luns/c4006c2a536f3617944e2b00aff74af6Queryable Fields
Run the CLI command-line tool, enter QueryScsiLun and press Tab to view all queryable fields and resource names that support cross-table queries.
API Response
Response Example
{
"inventories": [
{
"scsiLunHostRefs": [
{
"id": 1,
"scsiLunUuid": "6f2428969262315488684c85e14eded2",
"hostUuid": "0b756ca2d3843412860b7ec1b9315dd4",
"createDate": "Nov 14, 2017 2:20:57 PM"
}
],
"scsiLunVmInstanceRefs": [],
"name": "fc-lun-36b083fe000daf018000022905ba35d8f",
"uuid": "6f2428969262315488684c85e14eded2",
"wwid": "36b083fe000daf018000022905ba35d8f",
"vendor": "DELL",
"model": "MD32xx",
"wwn": "0x6f01faf000d5c3e7",
"serial": "6b083fe000daf018000015505abbe00a",
"type": "mpath",
"path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-11",
"size": 5497558138880,
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
},
{
"scsiLunHostRefs": [],
"scsiLunVmInstanceRefs": [],
"name": "iscsi-lun-scsi-14f504e46494c45524d5342436a6c2d4a4443672d30593032",
"uuid": "7bfde6b8e5503606849a4f3781bc02d7",
"wwid": "scsi-14f504e46494c45524d5342436a6c2d4a4443672d30593032",
"vendor": "OPNFILER",
"model": "VIRTUAL-DISK",
"serial": "4f504e46494c45524d5342436a6c2d4a4443672d30593032",
"type": "disk",
"path": "ip-10.0.104.213:3260-iscsi-iqn.2018-09.io.zstack:tsn.0000003-lun-0",
"size": 5497558138880,
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, the operation failed. If null, the operation succeeded. See error for details | 3.2.0 |
| inventories | List | See inventories for details | 3.2.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. Globally unique identifier of the error, for example SYS.1000, HOST.1001. | 0.6 |
| description | String | Brief error description | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause error. The error that caused the current error. If there is no original error, this field is null. | 0.6 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | Resource name | 3.1.0 |
| uuid | String | UUID of the resource. Uniquely identifies the resource. | 3.1.0 |
| wwid | String | Disk globally unique identifier | 3.1.0 |
| vendor | String | Disk vendor | 3.1.0 |
| model | String | Disk model | 3.1.0 |
| wwn | String | Disk WWN | 3.1.0 |
| serial | String | Disk serial number | 3.1.0 |
| type | String | Disk type | 3.1.0 |
| path | String | Disk path | 3.1.0 |
| state | String | Disk status | 3.1.0 |
| size | Long | Disk size | 3.1.0 |
| createDate | Timestamp | Create time | 3.1.0 |
| lastOpDate | Timestamp | Last update time | 3.1.0 |
| scsiLunHostRefs | List | See scsiLunHostRefs for details | 3.1.0 |
| scsiLunVmInstanceRefs | List | See scsiLunVmInstanceRefs for details | 3.1.0 |
scsiLunHostRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | SCSI Lun UUID | 3.1.0 |
| hostUuid | String | Host UUID | 3.1.0 |
| createDate | Timestamp | Create time | 3.1.0 |
| lastOpDate | Timestamp | Last update time | 3.1.0 |
scsiLunVmInstanceRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | SCSI Lun UUID | 3.1.0 |
| vmInstanceUuid | String | Virtual Machine UUID | 3.1.0 |
| createDate | Timestamp | Create time | 3.1.0 |
| lastOpDate | Timestamp | Last update time | 3.1.0 |
SDK Examples
Java SDK
QueryScsiLunAction action = new QueryScsiLunAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryScsiLunAction.Result res = action.call();Python SDK
QueryScsiLunAction action = QueryScsiLunAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryScsiLunAction.Result res = action.call()