SAN Storage Operations
QueryScsiLun
API Request
GET zstack/v1/storage-devices/scsi-lun/luns
GET zstack/v1/storage-devices/scsi-lun/luns/{uuid}Authorization: OAuth the-session-uuidcurl -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
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 |
| 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 |
| 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 |
| 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 |
| 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
QueryScsiLunAction action = new QueryScsiLunAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryScsiLunAction.Result res = action.call();QueryScsiLunAction action = QueryScsiLunAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryScsiLunAction.Result res = action.call()DetachScsiLunFromHost
API Request
PUT zstack/v1/storage-devices/scsi-lun/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"detachScsiLunFromHost": {
"hostUuid": "dce542427a3a3d1fa13324c9f67352cb"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"detachScsiLunFromHost":{"hostUuid":"dce542427a3a3d1fa13324c9f67352cb"}}' http://localhost:8080/zstack/v1/storage-devices/scsi-lun/fb5d3f596f683bd7a3b1bf1c396d5f4d/actions| Name | Type | Location | Description | Valid Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The SCSI LUN UUID. | 4.2.0 | |
| hostUuid | String | body (contained in the detachScsiLunFromHost structure) | Optional. The host UUID. | 4.2.0 | |
| systemTags | List | body | Optional. The system tags. | 4.2.0 | |
| userTags | List | body | Optional. The user tags. | 4.2.0 |
API Response
Sample Response{
"inventory": {
"name": "test-scsi-lun",
"uuid": "e09fbca6d27332a1946326f3ae114fc3",
"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": [],
"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. | 4.2.0 |
| inventories | List | See inventory. | 4.2.0 |
| 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. | 4.2.0 |
| description | String | The brief description of the error. | 4.2.0 |
| details | String | The details about the error. | 4.2.0 |
| elaboration | String | The reserved field. Default value: null. | 4.2.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.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. | 4.2.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name. | 4.2.0 |
| uuid | String | The resource UUID. | 4.2.0 |
| wwid | String | The disk WWID. | 4.2.0 |
| vendor | String | The disk vendor. | 4.2.0 |
| model | String | The disk model. | 4.2.0 |
| wwn | String | The disk WWN. | 4.2.0 |
| serial | String | The disk serial No. | 4.2.0 |
| type | String | The disk type. | 4.2.0 |
| path | String | The disk path. | 4.2.0 |
| state | String | The disk state. | 4.2.0 |
| size | Long | The disk size. | 4.2.0 |
| createDate | Timestamp | The creation time. | 4.2.0 |
| lastOpDate | Timestamp | The last operation time. | 4.2.0 |
| scsiLunHostRefs | List | See scsiLunHostRefs. | 4.2.0 |
| scsiLunVmInstanceRefs | List | See scsiLunVmInstanceRefs. | 4.2.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 4.2.0 |
| hostUuid | String | The host UUID. | 4.2.0 |
| createDate | Timestamp | The creation time. | 4.2.0 |
| lastOpDate | Timestamp | The last operation time. | 4.2.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 4.2.0 |
| vmInstanceUuid | String | The VM instance UUID. | 4.2.0 |
| createDate | Timestamp | The creation time. | 4.2.0 |
| lastOpDate | Timestamp | The last operation time. | 4.2.0 |
SDK Sample
DetachScsiLunFromHostAction action = new DetachScsiLunFromHostAction();
action.uuid = "fb5d3f596f683bd7a3b1bf1c396d5f4d";
action.hostUuid = "dce542427a3a3d1fa13324c9f67352cb";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachScsiLunFromHostAction.Result res = action.call();DetachScsiLunFromHostAction action = DetachScsiLunFromHostAction()
action.uuid = "fb5d3f596f683bd7a3b1bf1c396d5f4d"
action.hostUuid = "dce542427a3a3d1fa13324c9f67352cb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachScsiLunFromHostAction.Result res = action.call()iSCSI Server Operations
AddIscsiServer
API Request
POST zstack/v1/storage-devices/iscsi/serversAuthorization: OAuth the-session-uuid{
"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 -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| 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
{
"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 |
|---|---|---|---|
| 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 |
| 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 |
| 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 |
| 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 |
| 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
AddIscsiServerAction action = new AddIscsiServerAction();
action.ip = "10.0.0.201";
action.port = 3260.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddIscsiServerAction.Result res = action.call();AddIscsiServerAction action = AddIscsiServerAction()
action.ip = "10.0.0.201"
action.port = 3260.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddIscsiServerAction.Result res = action.call()DeleteIscsiServer
API Request
DELETE zstack/v1/storage-devices/iscsi/servers/{uuid}?deleteMode={deleteMode}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/storage-devices/iscsi/servers/7a3f7749fd393899b4b74d2b470e15eb?deleteMode=Permissive| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The iSCSI server UUID. | 3.0.0 | |
| deleteMode | String | url | Optional. The delete mode. | 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
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}SDK Sample
DeleteIscsiServerAction action = new DeleteIscsiServerAction();
action.uuid = "7a3f7749fd393899b4b74d2b470e15eb";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteIscsiServerAction.Result res = action.call();DeleteIscsiServerAction action = DeleteIscsiServerAction()
action.uuid = "7a3f7749fd393899b4b74d2b470e15eb"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteIscsiServerAction.Result res = action.call()QueryIscsiServer
API Request
GET zstack/v1/storage-devices/iscsi/servers
GET zstack/v1/storage-devices/iscsi
GET zstack/v1/storage-devices/iscsi/servers/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/serverscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsicurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/servers/cf91d809261735be9f20429880c1d19cQueryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryIscsiServer, and pressing the Tab key.
API Response
{
"inventories": [
{
"uuid": "fd97e8b6d61c399abed358ea6b2fc206",
"name": "iscsi-server-10.0.0.201",
"ip": "10.0.0.201",
"port": 3260.0,
"chapUserName": "username",
"chapUserPassword": "password",
"state": "Enabled",
"iscsiTargets": [
{
"iscsiServerUuid": "fd97e8b6d61c399abed358ea6b2fc206",
"uuid": "d156429110f13c2ca07bbc04e4031231",
"iqn": "iqn.2018-01.io.zstack:tsn.00001",
"state": "Enabled",
"iscsiLuns": [
{
"uuid": "500f63c8f44939bbab102222927f9290",
"iscsiTargetUuid": "d156429110f13c2ca07bbc04e4031231",
"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.zstack:tsn.00001-lun-0",
"size": 3.000318820352E13,
"multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"iscsiClusterRefs": [
{
"id": 1.0,
"iscsiServerUuid": "fd97e8b6d61c399abed358ea6b2fc206",
"clusterUuid": "02db8eb4e3043f55b7f1cf02df735611",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"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 |
| inventories | List | See inventories | 3.0.0 |
| 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 |
| 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 |
| 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 |
| 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 |
| 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
QueryIscsiServerAction action = new QueryIscsiServerAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIscsiServerAction.Result res = action.call();QueryIscsiServerAction action = QueryIscsiServerAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIscsiServerAction.Result res = action.call()RefreshIscsiServer
API Request
POST zstack/v1/storage-devices/iscsi/servers/{uuid}Authorization: OAuth the-session-uuid{
"params": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/storage-devices/iscsi/servers/0243c5d7322a36718ad76d865682ba44| Name | Type | Locaiton | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | 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
{
"inventory": {
"uuid": "a4a3ef3c3ed537e6b1040ee4b7d77686",
"name": "iscsi-server-10.0.0.201",
"ip": "10.0.0.201",
"port": 3260.0,
"chapUserName": "username",
"chapUserPassword": "password",
"state": "Enabled",
"iscsiTargets": [
{
"iscsiServerUuid": "a4a3ef3c3ed537e6b1040ee4b7d77686",
"uuid": "3da0cdedd9763edfab39a897f87454e9",
"iqn": "iqn.2018-01.io.zstack:tsn.00001",
"iscsiLuns": [
{
"uuid": "f569b3e3baf838e59d8a115458d72a9b",
"iscsiTargetUuid": "3da0cdedd9763edfab39a897f87454e9",
"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.zstack:tsn.00001-lun-0",
"size": 3.000318820352E13,
"multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"iscsiClusterRefs": [
{
"id": 1.0,
"iscsiServerUuid": "a4a3ef3c3ed537e6b1040ee4b7d77686",
"clusterUuid": "da1ddc379fc137789b12bcac0ed90148",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}| 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 |
| 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 |
| 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 |
| 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 |
| 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
RefreshIscsiServerAction action = new RefreshIscsiServerAction();
action.uuid = "0243c5d7322a36718ad76d865682ba44";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RefreshIscsiServerAction.Result res = action.call();RefreshIscsiServerAction action = RefreshIscsiServerAction()
action.uuid = "0243c5d7322a36718ad76d865682ba44"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RefreshIscsiServerAction.Result res = action.call()UpdateIscsiServer
API Request
POST zstack/v1/storage-devices/iscsi/serversAuthorization: OAuth the-session-uuid{
"updateIscsiServer": {
"name": "test-iscsi-server"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateIscsiServer":{"name":"test-iscsi-server"}}' http://localhost:8080/zstack/v1/storage-devices/iscsi/servers/98d2177199ca301d9fd842eace2dbc67/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | body (contained in the params structure) | Optional. The resource UUID. | 3.0.0 | |
| name | String | body (contained in the params structure) | Optional. The resource name. | 3.0.0 | |
| chapUserName | String | body (contained in the params structure) | Optional. The CHAP user name. | 3.0.0 | |
| chapUserPassword | String | body (contained in the params structure) | Optional. The CHAP password. | 3.0.0 | |
| state | String | body (contained in the params structure) | Optional. The state. |
|
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
{
"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 |
|---|---|---|---|
| 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 |
| 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 |
| 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 |
| 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 |
| 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
UpdateIscsiServerAction action = new UpdateIscsiServerAction();
action.uuid = "98d2177199ca301d9fd842eace2dbc67";
action.name = "test-iscsi-server";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateIscsiServerAction.Result res = action.call();UpdateIscsiServerAction action = UpdateIscsiServerAction()
action.uuid = "98d2177199ca301d9fd842eace2dbc67"
action.name = "test-iscsi-server"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateIscsiServerAction.Result res = action.call()AttachIscsiServerToCluster
API Request
POST zstack/v1/clusters/{clusterUuid}/storage-devices/iscsi/servers/{uuid}Authorization: OAuth the-session-uuid{
"params": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{}}' http://localhost:8080/zstack/v1/clusters/ee5a78dfa67b34598e9fe734111592a7/storage-devices/iscsi/servers/3ae1ec6d33d53ab7b8cea6e33e517e28| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The iSCSI server UUID. | 3.0.0 | |
| clusterUuid | String | url | The cluster 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
{
"inventory": {
"uuid": "a3d69cbb4ccc35f49354f34b9a52833d",
"name": "iscsi-server-10.0.0.201",
"ip": "10.0.0.201",
"port": 3260.0,
"chapUserName": "username",
"chapUserPassword": "password",
"state": "Enabled",
"iscsiTargets": [
{
"iscsiServerUuid": "a3d69cbb4ccc35f49354f34b9a52833d",
"uuid": "0a0f4da9f2ba3fddac178737e11cef73",
"iqn": "iqn.2018-01.io.zstack:tsn.00001",
"state": "Enabled",
"iscsiLuns": [
{
"uuid": "f63e921f951435ee9d18901b8eccf986",
"iscsiTargetUuid": "0a0f4da9f2ba3fddac178737e11cef73",
"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.zstack:tsn.00001-lun-0",
"size": 3.000318820352E13,
"multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"iscsiClusterRefs": [
{
"id": 1.0,
"iscsiServerUuid": "a3d69cbb4ccc35f49354f34b9a52833d",
"clusterUuid": "962af991872e3ac98a2c4a7385f92541",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}| 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 |
| 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 |
| 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 |
| 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 |
| 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
AttachIscsiServerToClusterAction action = new AttachIscsiServerToClusterAction();
action.uuid = "3ae1ec6d33d53ab7b8cea6e33e517e28";
action.clusterUuid = "ee5a78dfa67b34598e9fe734111592a7";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachIscsiServerToClusterAction.Result res = action.call();AttachIscsiServerToClusterAction action = AttachIscsiServerToClusterAction()
action.uuid = "3ae1ec6d33d53ab7b8cea6e33e517e28"
action.clusterUuid = "ee5a78dfa67b34598e9fe734111592a7"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachIscsiServerToClusterAction.Result res = action.call()DetachIscsiServerFromCluster
API Request
DELETE zstack/v1/clusters/{clusterUuid}/storage-devices/iscsi/servers/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/clusters/81ecbd4ae7c9346aa3225592441c36df/storage-devices/iscsi/servers/132d1caceecd3847b30bd901485ccc44| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The iSCSI server UUID. | 3.0.0 | |
| clusterUuid | String | url | The cluster 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
{
"inventory": {
"uuid": "2c42d5e271e93a91a4467bf936a21018",
"ip": "10.0.0.201",
"port": 3260.0,
"chapUserName": "username",
"chapUserPassword": "password",
"state": "Enabled",
"iscsiTargets": [
{
"iscsiServerUuid": "2c42d5e271e93a91a4467bf936a21018",
"uuid": "84fb04ce8ac03803b99cab5cccd831d1",
"iqn": "iqn.2018-01.io.zstack:tsn.00001",
"state": "Enabled",
"iscsiLuns": [
{
"uuid": "44d2c6a338123031a55ce32f102432af",
"iscsiTargetUuid": "84fb04ce8ac03803b99cab5cccd831d1",
"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.zstack:tsn.00001-lun-0",
"size": 3.000318820352E13,
"multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"iscsiClusterRefs": [
{
"id": 1.0,
"iscsiServerUuid": "2c42d5e271e93a91a4467bf936a21018",
"clusterUuid": "ced139d5eded3049bbfe8364804fa8c0",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}| 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 |
| 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 |
| 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 |
| 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 |
| 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
DetachIscsiServerFromClusterAction action = new DetachIscsiServerFromClusterAction();
action.uuid = "132d1caceecd3847b30bd901485ccc44";
action.clusterUuid = "81ecbd4ae7c9346aa3225592441c36df";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachIscsiServerFromClusterAction.Result res = action.call();DetachIscsiServerFromClusterAction action = DetachIscsiServerFromClusterAction()
action.uuid = "132d1caceecd3847b30bd901485ccc44"
action.clusterUuid = "81ecbd4ae7c9346aa3225592441c36df"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachIscsiServerFromClusterAction.Result res = action.call()QueryIscsiLun
API Request
GET zstack/v1/storage-devices/iscsi/luns
GET zstack/v1/storage-devices/iscsi/luns/{uuid}Authorization: OAuth the-session-uuidcurl -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/da96929549c63b66b8afc63be70a373fQueryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryIscsiLun, and pressing the Tab key.
API Response
{
"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.zstack:tsn.00001-lun-0",
"size": 3.000318820352E13,
"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.zstack:tsn.00002-lun-0",
"size": 3.000318820352E13,
"multipathDeviceUuid": "36b083fe000daf018000015505abbe00a"
}
]
}| 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 |
| inventories | List | See inventories. | 3.0.0 |
| 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 |
| 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 |
SDK Sample
QueryIscsiLunAction action = new QueryIscsiLunAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIscsiLunAction.Result res = action.call();QueryIscsiLunAction action = QueryIscsiLunAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIscsiLunAction.Result res = action.call()FC Storage Operations
QueryFiberChannelStorage
API Request
GET zstack/v1/storage-devices/fiber-channel/controllers
GET zstack/v1/storage-devices/fiber-channel
GET zstack/v1/storage-devices/fiber-channel/controllers/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/fiber-channel/controllers?curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/fiber-channel?curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/fiber-channel/controllers/6ca3d260093e3c06840309e9e756b1bfQueryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QueryFiberChannelStorage, and pressing the Tab key.
API Response
{
"inventories": [
{
"uuid": "afedd6ab89d338fbaab258f981ca2295",
"state": "Enabled",
"fiberChannelLuns": [
{
"fiberChannelStorageUuid": "afedd6ab89d338fbaab258f981ca2295",
"name": "fc-lun-36b083fe000daf018000022905ba35d8f",
"uuid": "2e69f8443fbc3ec3a25a92ab8632f80f",
"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": 3.0,
"scsiLunUuid": "5a89fbd0d7793673acfa2e69acc56ce4",
"hostUuid": "bc3f69d449aa3410bd7267a1050de980",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"scsiLunVmInstanceRefs": []
},
{
"fiberChannelStorageUuid": "afedd6ab89d338fbaab258f981ca2295",
"name": "fc-lun-36f01faf000d5c3e7000023ef5ba362f2",
"uuid": "52039a86c9173ff7a86ce214fc3d47cf",
"wwid": "36f01faf000d5c3e7000023ef5ba362f2",
"vendor": "DELL",
"model": "MD32xx",
"wwn": "0x6b083fe000daf018",
"serial": "6b083fe000daf018000015505abbe00a",
"type": "mpath",
"path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-12",
"size": 5.49755813888E12,
"scsiLunHostRefs": [
{
"id": 3.0,
"scsiLunUuid": "5a89fbd0d7793673acfa2e69acc56ce4",
"hostUuid": "bc3f69d449aa3410bd7267a1050de980",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"scsiLunVmInstanceRefs": []
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
},
{
"uuid": "4e902db710403f68a7703e45d00e551d",
"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.1.0 |
| inventories | List | See inventories. | 3.1.0 |
| 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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.1.0 |
| name | String | The resource name. | 3.1.0 |
| wwnn | String | The FC SAN storage WWNN. | 3.1.0 |
| state | String | The state. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| fiberChannelLuns | List | See fiberChannelLuns. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.1.0 |
| fiberChannelStorageUuid | String | The FC SAN storage UUID. | 3.1.0 |
| wwid | String | The disk WWID. | 3.1.0 |
| vendor | String | The disk vendor. | 3.1.0 |
| model | String | The disk model. | 3.1.0 |
| wwn | String | The disk WWN. | 3.1.0 |
| serial | String | The disk serial No. | 3.1.0 |
| type | String | The disk type. | 3.1.0 |
| path | String | The disk path. | 3.1.0 |
| size | Long | The disk size. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| name | String | The resource name. | 3.1.0 |
| state | String | The disk state. | 3.1.0 |
| scsiLunHostRefs | List | See scsiLunHostRefs. | 3.1.0 |
| scsiLunVmInstanceRefs | List | See scsiLunVmInstanceRefs. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| hostUuid | String | The host UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| vmInstanceUuid | String | The VM instance UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
SDK Sample
QueryFiberChannelStorageAction action = new QueryFiberChannelStorageAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryFiberChannelStorageAction.Result res = action.call();QueryFiberChannelStorageAction action = QueryFiberChannelStorageAction() action.conditions = [] action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" QueryFiberChannelStorageAction.Result res = action.call()
RefreshFiberChannelStorage
API Request
POST zstack/v1/storage-devices/fiber-channel/controllers
POST zstack/v1/storage-devices/fiber-channel/controllers/{uuid}Authorization: OAuth the-session-uuid{
"params": {
"uuid": "52049ca66e8135f5aac2835aecab62a0"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"uuid":"52049ca66e8135f5aac2835aecab62a0"}}' http://localhost:8080/zstack/v1/storage-devices/fiber-channel/controllerscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"uuid":"52049ca66e8135f5aac2835aecab62a0"}}' http://localhost:8080/zstack/v1/storage-devices/fiber-channel/controllers/52049ca66e8135f5aac2835aecab62a0| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | body (contained in the params structure) | Optional. The FC SAN storage UUID. | 3.1.0 | |
| zoneUuid | String | body (contained in the params structure) | The zone UUID. | 3.1.0 | |
| systemTags | List | body | Optional. The system tags. | 3.1.0 | |
| userTags | List | body | Optional. The user tags. | 3.1.0 |
API Response
{
"inventories": [
{
"uuid": "971fa2e9e689304183d4eef676ad0241",
"state": "Enabled",
"fiberChannelLuns": [
{
"fiberChannelStorageUuid": "971fa2e9e689304183d4eef676ad0241",
"name": "fc-lun-36b083fe000daf018000022905ba35d8f",
"uuid": "2fb634b5c6ae3e1390360e982cdaf9d2",
"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": 3.0,
"scsiLunUuid": "fd0a53d0234e303c9ba7c316f5484a59",
"hostUuid": "ef288e9807853188b76d3d445a35b345",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"scsiLunVmInstanceRefs": []
},
{
"fiberChannelStorageUuid": "971fa2e9e689304183d4eef676ad0241",
"name": "fc-lun-36f01faf000d5c3e7000023ef5ba362f2",
"uuid": "fb37b3bb268c38c3803b93ee60f25ef6",
"wwid": "36f01faf000d5c3e7000023ef5ba362f2",
"vendor": "DELL",
"model": "MD32xx",
"wwn": "0x6b083fe000daf018",
"serial": "6b083fe000daf018000015505abbe00a",
"type": "mpath",
"path": "pci-0000:05:00.0-fc-0x2012b083fedaf018-lun-12",
"size": 5.49755813888E12,
"scsiLunHostRefs": [
{
"id": 3.0,
"scsiLunUuid": "fd0a53d0234e303c9ba7c316f5484a59",
"hostUuid": "ef288e9807853188b76d3d445a35b345",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"scsiLunVmInstanceRefs": []
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
},
{
"uuid": "ddc6eb334da838b08224ed6c43e67d0e",
"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.1.0 |
| inventories | List | See inventories. | 3.1.0 |
| 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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.1.0 |
| name | String | The resource UUID. | 3.1.0 |
| wwnn | String | The FC SAN storage WWNN. | 3.1.0 |
| state | String | The state. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| fiberChannelLuns | List | See fiberChannelLuns. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 3.1.0 |
| fiberChannelStorageUuid | String | The FC SAN storage UUID. | 3.1.0 |
| wwid | String | The disk WWID. | 3.1.0 |
| vendor | String | The disk vendor. | 3.1.0 |
| model | String | The disk model. | 3.1.0 |
| wwn | String | The disk WWN. | 3.1.0 |
| serial | String | The disk serial No. | 3.1.0 |
| type | String | The disk type. | 3.1.0 |
| path | String | The disk path. | 3.1.0 |
| size | Long | The disk size. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| name | String | The resource name. | 3.1.0 |
| state | String | The disk state. | 3.1.0 |
| scsiLunHostRefs | List | See scsiLunHostRefs. | 3.1.0 |
| scsiLunVmInstanceRefs | List | See scsiLunVmInstanceRefs. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| hostUuid | String | The host UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| vmInstanceUuid | String | The VM instance UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
SDK Sample
RefreshFiberChannelStorageAction action = new RefreshFiberChannelStorageAction();
action.uuid = "52049ca66e8135f5aac2835aecab62a0";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RefreshFiberChannelStorageAction.Result res = action.call();RefreshFiberChannelStorageAction action = RefreshFiberChannelStorageAction()
action.uuid = "52049ca66e8135f5aac2835aecab62a0"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RefreshFiberChannelStorageAction.Result res = action.call()UpdateScsiLun
API Request
PUT zstack/v1/storage-devices/scsi-lun/{uuid}/actionsAuthorization: OAuth the-session-uuid{
"updateScsiLun": {
"name": "test-scsi-lun"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateScsiLun":{"name":"test-scsi-lun"}}' http://localhost:8080/zstack/v1/storage-devices/scsi-lun/e2e9d7f44ee23960bc6e4e31b0a010d9/actions| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 3.1.0 | |
| name | String | body (contained in the updateScsiLun structure) | Optional. The resource name. | 3.1.0 | |
| state | String | body (contained in the updateScsiLun structure) | Optional. The state. |
|
3.1.0 |
| systemTags | List | body | Optional. The system tags. | 3.1.0 | |
| userTags | List | body | Optional. The user tags. | 3.1.0 |
API Response
{
"inventory": {
"name": "test-scsi-lun",
"uuid": "57cefcdc1746340ba1649c446059aea0",
"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": "57cefcdc1746340ba1649c446059aea0",
"hostUuid": "6e76dfbcc3b338c482ff51de1f0d76da",
"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 | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.1.0 |
| inventory | ScsiLunInventory | See inventory. | 3.1.0 |
| 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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource UUID. | 3.1.0 |
| uuid | String | The FC SAN storage UUID. | 3.1.0 |
| wwid | String | The disk WWID. | 3.1.0 |
| vendor | String | The disk vendor. | 3.1.0 |
| model | String | The disk model. | 3.1.0 |
| wwn | String | The disk WWN. | 3.1.0 |
| serial | String | The disk serial No. | 3.1.0 |
| type | String | The disk type. | 3.1.0 |
| path | String | The disk path. | 3.1.0 |
| state | String | The disk state. | 3.1.0 |
| size | Long | The disk size. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| scsiLunHostRefs | List | See scsiLunHostRefs. | 3.1.0 |
| scsiLunVmInstanceRefs | List | See scsiLunVmInstanceRefs. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| hostUuid | String | The host UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| vmInstanceUuid | String | The VM instance UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
SDK Sample
UpdateScsiLunAction action = new UpdateScsiLunAction();
action.uuid = "e2e9d7f44ee23960bc6e4e31b0a010d9";
action.name = "test-scsi-lun";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateScsiLunAction.Result res = action.call();UpdateScsiLunAction action = UpdateScsiLunAction()
action.uuid = "e2e9d7f44ee23960bc6e4e31b0a010d9"
action.name = "test-scsi-lun"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateScsiLunAction.Result res = action.call()AttachScsiLunToVmInstance
API Request
POST zstack/v1/vm-instances/{vmInstanceUuid}/scsi-lun/{uuid}Authorization: OAuth the-session-uuid{
"params": {
"disableMultiPathAttach": false
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"disableMultiPathAttach":false}}' http://localhost:8080/zstack/v1/vm-instances/e5bc51b4fdd13d35b4abe7be408435d4/scsi-lun/e4ea0f73829b3206a497c88b896613d6| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The SCSI LUN UUID. | 3.1.0 | |
| vmInstanceUuid | String | url | The VM instance UUID. | 3.1.0 | |
| disableMultiPathAttach | String | url | Optional. Whether to turn off the switch for automatically attaching multi-path devices. | 3.1.0 | |
| systemTags | List | body | Optional. The system tags. | 3.1.0 | |
| userTags | List | body | Optional. The user tags. | 3.1.0 |
API Response
{
"inventory": {
"name": "fc-lun-36b083fe000daf018000022905ba35d8f",
"uuid": "d20114f179003943904fee1127d16eba",
"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": "d20114f179003943904fee1127d16eba",
"hostUuid": "e62d261d3f293e0182f85779e105eb13",
"createDate": "Nov 14, 2017 10:20:57 PM"
}
],
"scsiLunVmInstanceRefs": [
{
"id": 1.0,
"scsiLunUuid": "d20114f179003943904fee1127d16eba",
"vmInstanceUuid": "84af387a5ef034818cc8488eaddbf5f3",
"createDate": "Nov 14, 2017 10:20:57 PM",
"attachMultipath": false
}
],
"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.1.0 |
| inventory | ScsiLunInventory | See inventory. | 3.1.0 |
| 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.1.0 |
| description | String | The brief description of the error. | 3.1.0 |
| details | String | The details about the error. | 3.1.0 |
| elaboration | String | The reserved field. Default value: null. | 3.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.1.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.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource UUID. | 3.1.0 |
| uuid | String | The iSCSI target UUID. | 3.1.0 |
| wwid | String | The device WWID. | 3.1.0 |
| vendor | String | The device vendor. | 3.1.0 |
| model | String | The device model. | 3.1.0 |
| wwn | String | The device WWN. | 3.1.0 |
| serial | String | The device serial No. | 3.1.0 |
| type | String | The device type. | 3.1.0 |
| path | String | The device path. | 3.1.0 |
| state | String | The device state. | 3.1.0 |
| size | Long | The device size. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| scsiLunHostRefs | List | See scsiLunHostRefs. | 3.1.0 |
| scsiLunVmInstanceRefs | List | See scsiLunVmInstanceRefs. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| hostUuid | String | The host UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| vmInstanceUuid | String | The VM instance UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
SDK Sample
AttachScsiLunToVmInstanceAction action = new AttachScsiLunToVmInstanceAction();
action.uuid = "e4ea0f73829b3206a497c88b896613d6";
action.vmInstanceUuid = "e5bc51b4fdd13d35b4abe7be408435d4";
action.disableMultiPathAttach = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachScsiLunToVmInstanceAction.Result res = action.call();AttachScsiLunToVmInstanceAction action = AttachScsiLunToVmInstanceAction()
action.uuid = "e4ea0f73829b3206a497c88b896613d6"
action.vmInstanceUuid = "e5bc51b4fdd13d35b4abe7be408435d4"
action.disableMultiPathAttach = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachScsiLunToVmInstanceAction.Result res = action.call()DetachScsiLunFromVmInstance
API Request
DELETE zstack/v1/vm-instances/{vmInstanceUuid}/scsi-lun/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/vm-instances/68b34252ae3a386e92b74ce3a2bd7e4a/scsi-lun/4af9531a118a3b7aba404d794a4cfa51Request Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 3.1.0 | |
| vmInstanceUuid | String | url | The VM instance UUID. | 3.1.0 | |
| systemTags | List | body | Optional. The system tags. | 3.1.0 | |
| userTags | List | body | Optional. The user tags. | 3.1.0 |
API Response
Sample Response
{
"inventory": {
"name": "fc-lun-36b083fe000daf018000022905ba35d8f",
"uuid": "a51554a318e333f1b96a7abe91674ede",
"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": "a51554a318e333f1b96a7abe91674ede",
"hostUuid": "5c5a4a7c480e3b5791e0915785968eb1",
"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 | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.1.0 |
| inventory | ScsiLunInventory | See inventory. | 3.1.0 |
| 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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource name. | 3.1.0 |
| uuid | String | The resource UUID. | 3.1.0 |
| wwid | String | The disk WWID. | 3.1.0 |
| vendor | String | The disk vendor. | 3.1.0 |
| model | String | The disk model. | 3.1.0 |
| wwn | String | The disk WWN. | 3.1.0 |
| serial | String | The disk serial No. | 3.1.0 |
| type | String | The disk type. | 3.1.0 |
| path | String | The disk path. | 3.1.0 |
| state | String | The disk state. | 3.1.0 |
| size | Long | The disk size. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| scsiLunHostRefs | List | See scsiLunHostRefs. | 3.1.0 |
| scsiLunVmInstanceRefs | List | See scsiLunVmInstanceRefs. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| hostUuid | String | The host UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| vmInstanceUuid | String | The VM instance UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
SDK Sample
DetachScsiLunFromVmInstanceAction action = new DetachScsiLunFromVmInstanceAction();
action.uuid = "4af9531a118a3b7aba404d794a4cfa51";
action.vmInstanceUuid = "68b34252ae3a386e92b74ce3a2bd7e4a";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachScsiLunFromVmInstanceAction.Result res = action.call();DetachScsiLunFromVmInstanceAction action = DetachScsiLunFromVmInstanceAction()
action.uuid = "4af9531a118a3b7aba404d794a4cfa51"
action.vmInstanceUuid = "68b34252ae3a386e92b74ce3a2bd7e4a"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachScsiLunFromVmInstanceAction.Result res = action.call()CheckScsiLunClusterStatus
API Request
PUT zstack/v1/storage-devices/scsi-lun/{uuid}/cluster/{clusterUuid}Authorization: OAuth the-session-uuid{
"checkScsiLunClusterStatus": {},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"checkScsiLunClusterStatus":{}}' http://localhost:8080/zstack/v1/storage-devices/scsi-lun/abe6bf1e763739f88f97055c14246245/cluster/5415c2beb8a93447a27f69c109cdfb23| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 3.1.0 | |
| clusterUuid | String | url | The cluster UUID. | 3.1.0 | |
| systemTags | List | body | Optional. The system tags. | 3.1.0 | |
| userTags | List | body | Optional. The user tags. | 3.1.0 |
API Response
{
"inventory": {
"attachedHosts": [
{
"zoneUuid": "5899ac6fab7d3951acae1d43c4fd7f97",
"name": "example",
"uuid": "161616a23a4834cfbe3dd7000a75ef51",
"clusterUuid": "b886a9367ff9362d8955443cc5065fab",
"description": "example",
"managementIp": "192.168.0.1",
"hypervisorType": "KVM",
"state": "Enabled",
"status": "Connected",
"totalCpuCapacity": 4.0,
"availableCpuCapacity": 2.0,
"totalMemoryCapacity": 4.0,
"availableMemoryCapacity": 4.0
}
],
"unattachedHosts": [
{
"zoneUuid": "ee802d3432203cc99a9711b3d26e047d",
"name": "example",
"uuid": "0d28db87cedc3c729300bcc7f426f9b6",
"clusterUuid": "5d5325e38b4331c28efe5367dc583110",
"description": "example",
"managementIp": "192.168.0.2",
"hypervisorType": "KVM",
"state": "Enabled",
"status": "Connected",
"totalCpuCapacity": 4.0,
"availableCpuCapacity": 2.0,
"totalMemoryCapacity": 4.0,
"availableMemoryCapacity": 4.0
}
],
"isAllHostsAttached": false
}
}| 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.1.0 |
| description | String | The brief description of the error. | 3.1.0 |
| details | String | The details about the error. | 3.1.0 |
| elaboration | String | The reserved field. Default value: null. | 3.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.1.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.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| isAllHostsAttached | Boolean | Whether the SCSI LUN is connected to all the hosts that are attached to the cluster. | 3.1.0 |
| attachedHosts | List | See attachedHosts. | 3.1.0 |
| unattachedHosts | List | See unattachedHosts. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| zoneUuid | String | The zone UUID. | 3.1.0 |
| name | String | The resource name. | 3.1.0 |
| uuid | String | The resource UUID. | 3.1.0 |
| clusterUuid | String | The cluster UUID. | 3.1.0 |
| description | String | The detailed description of the resource. | 3.1.0 |
| managementIp | String | 3.1.0 | |
| hypervisorType | String | 3.1.0 | |
| state | String | 3.1.0 | |
| status | String | 3.1.0 | |
| totalCpuCapacity | Long | 3.1.0 | |
| availableCpuCapacity | Long | 3.1.0 | |
| totalMemoryCapacity | Long | 3.1.0 | |
| availableMemoryCapacity | Long | 3.1.0 | |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| zoneUuid | String | The zone UUID. | 3.1.0 |
| name | String | The resource name. | 3.1.0 |
| uuid | String | The resource UUID. | 3.1.0 |
| clusterUuid | String | The cluster UUID. | 3.1.0 |
| description | String | The detailed description of the resource. | 3.1.0 |
| managementIp | String | 3.1.0 | |
| hypervisorType | String | 3.1.0 | |
| state | String | 3.1.0 | |
| status | String | 3.1.0 | |
| totalCpuCapacity | Long | 3.1.0 | |
| availableCpuCapacity | Long | 3.1.0 | |
| totalMemoryCapacity | Long | 3.1.0 | |
| availableMemoryCapacity | Long | 3.1.0 | |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
SDK Sample
CheckScsiLunClusterStatusAction action = new CheckScsiLunClusterStatusAction();
action.uuid = "abe6bf1e763739f88f97055c14246245";
action.clusterUuid = "5415c2beb8a93447a27f69c109cdfb23";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CheckScsiLunClusterStatusAction.Result res = action.call();CheckScsiLunClusterStatusAction action = CheckScsiLunClusterStatusAction()
action.uuid = "abe6bf1e763739f88f97055c14246245"
action.clusterUuid = "5415c2beb8a93447a27f69c109cdfb23"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CheckScsiLunClusterStatusAction.Result res = action.call()GetScsiLunCandidatesForAttachingVm
API Request
GET zstack/v1/vm-instances/{vmInstanceUuid}/candidate-storage-devicesAuthorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/ccd1f4cb76e83c3b997fc4ed16ed529f/candidate-storage-devices?| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| vmInstanceUuid | String | url | The VM instance UUID. | 3.1.0 | |
| systemTags | List | query | Optional. The system tags. | 3.1.0 | |
| userTags | List | query | Optional. The user tags. | 3.1.0 |
API Response
{
"inventories": [
{
"name": "fc-lun-36b083fe000daf018000022905ba35d8f",
"uuid": "d4714249ba273a5c9d1c1cb3a1a16f24",
"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": "d4714249ba273a5c9d1c1cb3a1a16f24",
"hostUuid": "c922c37f885e35aeb1ae87db3446fc7e",
"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 | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 3.1.0 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.1.0 |
| inventories | List | See inventories. | 3.1.0 |
| error | ErrorCode | See error. | 3.1.0 |
| 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.1.0 |
| description | String | The brief description of the error. | 3.1.0 |
| details | String | The details about the error. | 3.1.0 |
| elaboration | String | The reserved field. Default value: null. | 3.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.1.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.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| name | String | The resource UUID. | 3.1.0 |
| uuid | String | The resource UUID. | 3.1.0 |
| wwid | String | The disk WWID. | 3.1.0 |
| vendor | String | The disk vendor. | 3.1.0 |
| model | String | The disk model. | 3.1.0 |
| wwn | String | The disk WWN. | 3.1.0 |
| serial | String | The disk serial No. | 3.1.0 |
| type | String | The disk type. | 3.1.0 |
| path | String | The disk path. | 3.1.0 |
| state | String | The disk state. | 3.1.0 |
| size | Long | The disk size. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| scsiLunHostRefs | List | See scsiLunHostRefs. | 3.1.0 |
| scsiLunVmInstanceRefs | List | See scsiLunVmInstanceRefs. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| hostUuid | String | The host UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scsiLunUuid | String | The SCSI LUN UUID. | 3.1.0 |
| vmInstanceUuid | String | The VM instance UUID. | 3.1.0 |
| createDate | Timestamp | The creation date. | 3.1.0 |
| lastOpDate | Timestamp | The last operation date. | 3.1.0 |
| 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.1.0 |
| description | String | The brief description of the error. | 3.1.0 |
| details | String | The details about the error. | 3.1.0 |
| elaboration | String | The reserved field. Default value: null. | 3.1.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 3.1.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.1.0 |
SDK Sample
GetScsiLunCandidatesForAttachingVmAction action = new GetScsiLunCandidatesForAttachingVmAction();
action.vmInstanceUuid = "ccd1f4cb76e83c3b997fc4ed16ed529f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetScsiLunCandidatesForAttachingVmAction.Result res = action.call();GetScsiLunCandidatesForAttachingVmAction action = GetScsiLunCandidatesForAttachingVmAction()
action.vmInstanceUuid = "ccd1f4cb76e83c3b997fc4ed16ed529f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetScsiLunCandidatesForAttachingVmAction.Result res = action.call()NVMe Storage Operations
QueryNvmeLun
API Request
GET zstack/v1/storage-devices/nvme/luns
GET zstack/v1/storage-devices/nvme/luns/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/lunscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/luns/066996e131e03824a7ef6a22defed432Queryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QueryNvmeLun, and pressing the Tab key.
API Response
{
"inventories": [
{
"nvmeTargetUuid": "f04819a9445c3d068c075e753d48fc3c",
"nvmeLunHostRefs": [],
"name": "nvme-lun-36b083fe000daf018000022905ba35d8f",
"uuid": "138c10cda11c3b8e9c7d988350d5cf64",
"wwid": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
"wwn": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
"serial": "3d87eca1686c1782",
"type": "disk",
"path": "nvme-uuid.48daeab7-7f15-405e-8481-7152cb9b0aca ",
"size": 5497558138880
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.6.21 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.6.21 |
| inventories | List | See inventories. | 4.6.21 |
| 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. | 4.6.21 |
| description | String | The brief description of the error. | 4.6.21 |
| details | String | The details about the error. | 4.6.21 |
| elaboration | String | The reserved field. Default value: null. | 4.6.21 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.6.21 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.6.21 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| nvmeTargetUuid | String | The NVMe device UUID. | 4.6.21 |
| name | String | The resource name. | 4.6.21 |
| uuid | String | The resource uuid. | 4.6.21 |
| wwid | String | The unique tag of the resource. | 4.6.21 |
| vendor | String | The vendor供应商 | 4.6.21 |
| model | String | The model | 4.6.21 |
| wwn | String | 4.6.21 | |
| serial | String | The serial. | 4.6.21 |
| type | String | The type. | 4.6.21 |
| hctl | String | 4.6.21 | |
| path | String | The path. | 4.6.21 |
| state | String | The state. | 4.6.21 |
| size | Long | The size. | 4.6.21 |
| multipathDeviceUuid | String | The UUID of the multi-path device. | 4.6.21 |
| source | String | The disk source, NVME. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
| nvmeLunHostRefs | List | See nvmeLunHostRefs. | 4.6.21 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| nvmeLunUuid | List | The UUID of the NVMe disk. | 4.6.21 |
| hostUuid | String | The host UUID. | 4.6.21 |
| path | String | The disk path. | 4.6.21 |
| hctl | String | The disk HCTL. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
SDK Sample
QueryNvmeLunAction action = new QueryNvmeLunAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryNvmeLunAction.Result res = action.call();QueryNvmeLunAction action = QueryNvmeLunAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryNvmeLunAction.Result res = action.call()QueryNvmeTarget
API Request
GET zstack/v1/storage-devices/nvme/controllers
GET zstack/v1/storage-devices/nvme
GET zstack/v1/storage-devices/nvme/controllers/{uuid}Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/controllerscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvmecurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/controllers/de0f2549ed0130948f14b00916fbf9a0Queryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QueryNvmeTarget, and pressing the Tab key.
API Response
{
"inventories": [
{
"uuid": "40ab069909633d4293c62f44efb26db8",
"state": "Enabled",
"nvmeLuns": [
{
"nvmeTargetUuid": "40ab069909633d4293c62f44efb26db8",
"nvmeLunHostRefs": [
{
"id": 1,
"nvmeLunUuid": "5690b46050623763a0335e753c347fa1",
"hostUuid": "d6f8a7ff0069304080b345c077c3aeb9",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"name": "nvme-lun-36b083fe000daf018000022905ba35d8f",
"uuid": "5690b46050623763a0335e753c347fa1",
"wwid": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
"wwn": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
"serial": "3d87eca1686c1782",
"type": "disk",
"path": "nvme-uuid.48daeab7-7f15-405e-8481-7152cb9b0aca ",
"size": 5497558138880
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.6.21 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.6.21 |
| inventories | List | See inventories. | 4.6.21 |
| 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. | 4.6.21 |
| description | String | The brief description of the error. | 4.6.21 |
| details | String | The details about the error. | 4.6.21 |
| elaboration | String | The reserved field. Default value: null. | 4.6.21 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.6.21 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.6.21 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.6.21 |
| name | String | The resource name. | 4.6.21 |
| nqn | String | The unique name for the NVMe. | 4.6.21 |
| state | String | The state. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
| nvmeLuns | List | See nvmeLuns. | 4.6.21 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| nvmeTargetUuid | String | The NVMe device UUID. | 4.6.21 |
| name | String | The resource name. | 4.6.21 |
| uuid | String | The resource uuid. | 4.6.21 |
| wwid | String | The unique tag of the resource. | 4.6.21 |
| vendor | String | The vendor供应商 | 4.6.21 |
| model | String | The model | 4.6.21 |
| wwn | String | 4.6.21 | |
| serial | String | The serial. | 4.6.21 |
| type | String | The type. | 4.6.21 |
| hctl | String | 4.6.21 | |
| path | String | The path. | 4.6.21 |
| state | String | The state. | 4.6.21 |
| size | Long | The size. | 4.6.21 |
| multipathDeviceUuid | String | The UUID of the multi-path device. | 4.6.21 |
| source | String | The disk source, NVME. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
| nvmeLunHostRefs | List | See nvmeLunHostRefs. | 4.6.21 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| nvmeLunUuid | List | The UUID of the NVMe disk. | 4.6.21 |
| hostUuid | String | The host UUID. | 4.6.21 |
| path | String | The disk path. | 4.6.21 |
| hctl | String | The disk HCTL. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
SDK Sample
QueryNvmeTargetAction action = new QueryNvmeTargetAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryNvmeTargetAction.Result res = action.call();QueryNvmeLunAction action = QueryNvmeLunAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryNvmeLunAction.Result res = action.call()RefreshNvmeTarget
API Request
POST zstack/v1/storage-devices/nvme/controllersAuthorization: OAuth the-session-uuid{
"params": {
"zoneUuid": "7a7b52cf91933070af3c8273f30ef458"
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \-X POST -d '{"params":{"zoneUuid":"7a7b52cf91933070af3c8273f30ef458"}}' \
http://localhost:8080/zstack/v1/storage-devices/nvme/controllerscurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvmecurl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/nvme/controllers/de0f2549ed0130948f14b00916fbf9a0| Name | Type | Location | Description | Valid Values | Satrting Version |
|---|---|---|---|---|---|
| zoneUuid | String | body(contained in the paramsstructure) | The zone UUID. | 4.6.21 | |
| nvmeLunUuids | List | body(contained in the paramsstructure) | Optional. The NVMe disk UUID. | 4.6.21 | |
| systemTags | List | body | Optional. The system tags. | 4.6.21 | |
| userTags | List | body | Optional. The user tags. | 4.6.21 |
API Response
{
"inventories": [
{
"uuid": "88ed12f1c3d7329c9b3fd00a87ce999e",
"state": "Enabled",
"nvmeLuns": [
{
"nvmeTargetUuid": "88ed12f1c3d7329c9b3fd00a87ce999e",
"nvmeLunHostRefs": [
{
"id": 1,
"nvmeLunUuid": "3adbd21bfa483cb2bc48b91c1438c788",
"hostUuid": "8c26dfd50d963292b8a51ddc0f9957f5",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"name": "nvme-lun-36b083fe000daf018000022905ba35d8f",
"uuid": "3adbd21bfa483cb2bc48b91c1438c788",
"wwid": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
"wwn": "uuid.48daeab7-7f15-405e-8481-7152cb9b0aca",
"serial": "3d87eca1686c1782",
"type": "disk",
"path": "nvme-uuid.48daeab7-7f15-405e-8481-7152cb9b0aca ",
"size": 5497558138880
}
],
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.6.21 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.6.21 |
| inventories | List | See inventories. | 4.6.21 |
| 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. | 4.6.21 |
| description | String | The brief description of the error. | 4.6.21 |
| details | String | The details about the error. | 4.6.21 |
| elaboration | String | The reserved field. Default value: null. | 4.6.21 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.6.21 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.6.21 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.6.21 |
| name | String | The resource name. | 4.6.21 |
| nqn | String | The unique name for the NVMe. | 4.6.21 |
| state | String | The state. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
| nvmeLuns | List | See nvmeLuns. | 4.6.21 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| nvmeTargetUuid | String | The NVMe device UUID. | 4.6.21 |
| name | String | The resource name. | 4.6.21 |
| uuid | String | The resource uuid. | 4.6.21 |
| wwid | String | The unique tag of the resource. | 4.6.21 |
| vendor | String | The vendor供应商 | 4.6.21 |
| model | String | The model | 4.6.21 |
| wwn | String | 4.6.21 | |
| serial | String | The serial. | 4.6.21 |
| type | String | The type. | 4.6.21 |
| hctl | String | 4.6.21 | |
| path | String | The path. | 4.6.21 |
| state | String | The state. | 4.6.21 |
| size | Long | The size. | 4.6.21 |
| multipathDeviceUuid | String | The UUID of the multi-path device. | 4.6.21 |
| source | String | The disk source, NVME. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
| nvmeLunHostRefs | List | See nvmeLunHostRefs. | 4.6.21 |
| Name | Type | Description | Starting Version |
|---|---|---|---|
| nvmeLunUuid | List | The UUID of the NVMe disk. | 4.6.21 |
| hostUuid | String | The host UUID. | 4.6.21 |
| path | String | The disk path. | 4.6.21 |
| hctl | String | The disk HCTL. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
SDK Sample
QueryNvmeTargetAction action = new QueryNvmeTargetAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryNvmeTargetAction.Result res = action.call();QueryNvmeTargetAction action = QueryNvmeTargetAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryNvmeTargetAction.Result res = action.call()