查询iSCSI服务器

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示例

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

可查询字段

运行CLI命令行工具,输入QueryIscsiServer并按Tab键查看所有可查询字段以及可跨表查询的资源名。

API返回

返回示例

{
  "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"
    }
  ]
}
名字类型描述起始版本
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error3.0.0
inventoriesList详情参考inventories3.0.0

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10013.0.0
descriptionString错误的概要描述3.0.0
detailsString错误的详细信息3.0.0
elaborationString保留字段,默认为null3.0.0
opaqueLinkedHashMap保留字段,默认为null3.0.0
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null3.0.0

inventories

名字类型描述起始版本
uuidString资源的UUID,唯一标示该资源3.0.0
nameString资源名称3.0.0
ipStringIP地址3.0.0
portInteger端口3.0.0
chapUserNameStringCHAP用户名3.0.0
chapUserPasswordStringCHAP密码3.0.0
stateString启用状态3.0.0
createDateTimestamp创建时间3.0.0
lastOpDateTimestamp最后一次修改时间3.0.0
iscsiTargetsList详情参考iscsiTargets3.0.0
iscsiClusterRefsList详情参考iscsiClusterRefs3.0.0

iscsiTargets

名字类型描述起始版本
iscsiServerUuidStringiSCSI服务器UUID3.0.0
uuidString资源的UUID,唯一标示该资源3.0.0
iqnStringiSCSI IQN3.0.0
createDateTimestamp创建时间3.0.0
lastOpDateTimestamp最后一次修改时间3.0.0
iscsiLunsList详情参考iscsiLuns3.0.0

iscsiLuns

名字类型描述起始版本
uuidString资源的UUID,唯一标示该资源3.0.0
iscsiTargetUuidStringiSCSI目标UUID3.0.0
wwidString唯一识别ID3.0.0
vendorString设备供应商3.0.0
modelString设备型号3.0.0
wwnString设备WWN3.0.0
serialString设备序列号3.0.0
hctlStringSCSI设备HCTL3.0.0
typeString设备类型3.0.0
pathString设备路径3.0.0
sizeLong设备大小3.0.0
createDateTimestamp创建时间3.0.0
lastOpDateTimestamp最后一次修改时间3.0.0

iscsiClusterRefs

名字类型描述起始版本
iscsiServerUuidString 3.0.0
clusterUuidString集群UUID3.0.0
createDateTimestamp创建时间3.0.0
lastOpDateTimestamp最后一次修改时间3.0.0

SDK示例

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