QueryScsiLun

API Request

URLs
GET zstack/v1/storage-devices/scsi-lun/luns GET zstack/v1/storage-devices/scsi-lun/luns/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X GET http://localhost:8080/zstack/v1/storage-devices/scsi-lun/luns
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X GET http://localhost:8080/zstack/v1/storage-devices/scsi-lun/luns/c4006c2a536f3617944e2b00aff74af6

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryScsiLun, and pressing the Tab key.

API Response

Sample Response
{   "inventories": [     {       "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": 5.49755813888E12,       "scsiLunHostRefs": [         {           "id": 1.0,           "scsiLunUuid": "6f2428969262315488684c85e14eded2",           "hostUuid": "0b756ca2d3843412860b7ec1b9315dd4",           "createDate": "Nov 14, 2017 10:20:57 PM"         }       ],       "scsiLunVmInstanceRefs": [],       "createDate": "Nov 14, 2017 10:20:57 PM",       "lastOpDate": "Nov 14, 2017 10:20:57 PM"     },     {       "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": 5.49755813888E12,       "scsiLunHostRefs": [],       "scsiLunVmInstanceRefs": [],       "createDate": "Nov 14, 2017 10:20:57 PM",       "lastOpDate": "Nov 14, 2017 10:20:57 PM"     }   ] }
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.2.0
inventories List See inventories. 3.2.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.2.0
description String The brief description of the error. 3.2.0
details String The details about the error. 3.2.0
elaboration String The reserved field. Default value: null. 3.2.0
opaque LinkedHashMap The reserved field. Default value: null. 3.2.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.2.0
#inventories
Name Type Description Starting Version
name String The resource name. 3.2.0
uuid String The resource UUID. 3.2.0
wwid String The disk WWID. 3.2.0
vendor String The disk vendor. 3.2.0
model String The disk model. 3.2.0
wwn String The disk WWN. 3.2.0
serial String The disk serial No. 3.2.0
type String The disk type. 3.2.0
path String The disk path. 3.2.0
state String The disk state. 3.2.0
size Long The disk size. 3.2.0
createDate Timestamp The creation date. 3.2.0
lastOpDate Timestamp The last operation date. 3.2.0
scsiLunHostRefs List See scsiLunHostRefs. 3.2.0
scsiLunVmInstanceRefs List See scsiLunVmInstanceRefs. 3.2.0
#scsiLunHostRefs
Name Type Description Starting Version
scsiLunUuid String The SCSI LUN UUID. 3.2.0
hostUuid String The host UUID. 3.2.0
createDate Timestamp The creation date. 3.2.0
lastOpDate Timestamp The last operation date. 3.2.0
#scsiLunVmInstanceRefs
Name Type Description Starting Version
scsiLunUuid String The SCSI LUN UUID. 3.2.0
vmInstanceUuid String The VM instance UUID. 3.2.0
createDate Timestamp The creation date. 3.2.0
lastOpDate Timestamp The last operation date. 3.2.0

SDK Sample

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()

AddIscsiServer

API Request

URLs
POST zstack/v1/storage-devices/iscsi/servers
Headers
Authorization: OAuth the-session-uuid
Body
{   "params": {     "ip": "10.0.0.201",     "port": 3260.0   },   "systemTags": [],   "userTags": [] }
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"ip":"10.0.0.201","port":3260.0}}' http://localhost:8080/zstack/v1/storage-devices/iscsi/servers
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) Optional. The resource name. 3.0.0
ip String body (contained in the params structure) The IP address. 3.0.0
port Integer body (contained in the params structure) Optional. The port. Default port: 3260. 3.0.0
chapUserName String body (contained in the params structure) Optional. The CHAP user name. Default value: null. 3.0.0
chapUserPassword String body (contained in the params structure) Optional. The CHAP password. Default value: null. 3.0.0
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 3.0.0
systemTags List body Optional. The system tags. 3.0.0
userTags List body Optional. The user tags. 3.0.0

API Response

Sample Response
{   "inventory": {     "uuid": "0b77c2e947ca3b40b79f6342728ec8fc",     "name": "iscsi-server-10.0.0.201",     "ip": "10.0.0.201",     "port": 3260.0,     "chapUserName": "username",     "chapUserPassword": "password",     "state": "Enabled",     "createDate": "Nov 14, 2017 10:20:57 PM",     "lastOpDate": "Nov 14, 2017 10:20:57 PM"   } }
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.0.0
inventory IscsiServerInventory See inventory. 3.0.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 3.0.0
description String The brief description of the error. 3.0.0
details String The details about the error. 3.0.0
elaboration String The reserved field. Default value: null. 3.0.0
opaque LinkedHashMap The reserved field. Default value: null. 3.0.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 3.0.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.0.0
name String The resource name. 3.0.0
ip String The IP address. 3.0.0
port Integer The port. 3.0.0
chapUserName String The CHAP user name. 3.0.0
chapUserPassword String The CHAP password. 3.0.0
state String The state. 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
iscsiTargets List See iscsiTargets. 3.0.0
iscsiClusterRefs List See iscsiClusterRefs. 3.0.0
#iscsiTargets
Name Type Description Starting Version
iscsiServerUuid String The iSCSI server UUID. 3.0.0
uuid String The resource UUID. 3.0.0
iqn String The iSCSI IQN. 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
iscsiLuns List See iscsiLuns. 3.0.0
#iscsiLuns
Name Type Description Starting Version
uuid String The resource UUID. 3.0.0
iscsiTargetUuid String The iSCSI target UUID. 3.0.0
wwid String The device WWID. 3.0.0
vendor String The device vendor. 3.0.0
model String The device model. 3.0.0
wwn String The device WWN. 3.0.0
serial String The device serial No. 3.0.0
hctl String The SCSI device HCTL. 3.0.0
type String The device type. 3.0.0
path String The device path. 3.0.0
size Long The device size. 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0
#iscsiClusterRefs
Name Type Description Starting Version
iscsiServerUuid String 3.0.0
clusterUuid String The cluster UUID. 3.0.0
createDate Timestamp The creation date. 3.0.0
lastOpDate Timestamp The last operation date. 3.0.0

SDK Sample

Java SDK
AddIscsiServerAction action = new AddIscsiServerAction(); action.ip = "10.0.0.201"; action.port = 3260.0; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; AddIscsiServerAction.Result res = action.call();
Python SDK
AddIscsiServerAction action = AddIscsiServerAction() action.ip = "10.0.0.201" action.port = 3260.0 action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" AddIscsiServerAction.Result res = action.call()















Back to Top

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.