Query iSCSI Server

GET/zstack/v1/storage-devices/iscsi/servers
GET/zstack/v1/storage-devices/iscsi
GET/zstack/v1/storage-devices/iscsi/servers/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/servers
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/storage-devices/iscsi/servers/cf91d809261735be9f20429880c1d19c

Queryable Fields

Run the CLI command-line tool, enter QueryIscsiServer and press Tab to see all queryable fields and resource names that can be queried across tables.

API Response

Response Example

{
  "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.cloud: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.cloud:tsn.00001-lun-0",
              "size": 30003188203520.0,
              "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"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. When the operation is successful, this field is null. For details, see error3.0.0
inventoriesListFor details, see inventories3.0.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, e.g. SYS.1000, HOST.10013.0.0
descriptionStringBrief description of the error3.0.0
detailsStringDetailed error information3.0.0
elaborationStringReserved field, defaults to null3.0.0
opaqueLinkedHashMapReserved field, defaults to null3.0.0
causeErrorCodeRoot cause: the error that triggered the current error. If there is no original error, this field is null3.0.0

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource3.0.0
nameStringResource Name3.0.0
ipStringIP Address3.0.0
portIntegerPort3.0.0
chapUserNameStringCHAP Username3.0.0
chapUserPasswordStringCHAP Password3.0.0
stateStringEnabled State3.0.0
createDateTimestampCreation Time3.0.0
lastOpDateTimestampLast Modification Time3.0.0
iscsiTargetsListFor details, see iscsiTargets3.0.0
iscsiClusterRefsListFor details, see iscsiClusterRefs3.0.0

iscsiTargets

NameTypeDescriptionStarting Version
iscsiServerUuidStringiSCSI Server UUID3.0.0
uuidStringResource UUID, uniquely identifies the resource3.0.0
iqnStringiSCSI IQN3.0.0
createDateTimestampCreation Time3.0.0
lastOpDateTimestampLast Modification Time3.0.0
iscsiLunsListFor details, see iscsiLuns3.0.0

iscsiLuns

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource3.0.0
iscsiTargetUuidStringiSCSI Target UUID3.0.0
wwidStringUnique Identifier ID3.0.0
vendorStringDevice Vendor3.0.0
modelStringDevice Model3.0.0
wwnStringDevice WWN3.0.0
serialStringDevice Serial Number3.0.0
hctlStringSCSI Device HCTL3.0.0
typeStringDevice Type3.0.0
pathStringDevice Path3.0.0
sizeLongDevice Size3.0.0
createDateTimestampCreation Time3.0.0
lastOpDateTimestampLast Modification Time3.0.0

iscsiClusterRefs

NameTypeDescriptionStarting Version
iscsiServerUuidString 3.0.0
clusterUuidStringCluster UUID3.0.0
createDateTimestampCreation Time3.0.0
lastOpDateTimestampLast Modification Time3.0.0

SDK Examples

Java SDK

QueryIscsiServerAction action = new QueryIscsiServerAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryIscsiServerAction.Result res = action.call();

Python SDK

QueryIscsiServerAction action = QueryIscsiServerAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryIscsiServerAction.Result res = action.call()