文档目录

获取物理机多路径拓扑(GetHostMultipathTopology)

API请求

URLs
GET zstack/v1/storage-devices/multipath/topology
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/multipath/topology?hostUuid=da8052bf25c43b73ad0c9a7546d166ae&diskUuids=360014058e50754920324473a4c85c767&diskUuids=36001405a5d87d462c2c47acb683c4c37
参数列表
名字 类型 位置 描述 可选值 起始版本
hostUuid String query 物理机UUID 5.3.0
diskUuids List query 磁盘UUID 5.3.0
systemTags (可选) List query 系统标签 5.3.0
userTags (可选) List query 用户标签 5.3.0

API返回

返回示例
{
  "results": [
    {
      "diskUuid": "360014058e50754920324473a4c85c767",
      "devices": [
        {
          "disk": "sda",
          "status": "active",
          "state": "running",
          "target": "iqn.2003-01.org.linux-iscsi.172-20-14-68.x8664:sn.23019b11e653",
          "targetType": "iSCSI"
        },
        {
          "disk": "sdb",
          "status": "enabled",
          "state": "running",
          "target": "iqn.2003-01.org.linux-iscsi.172-20-14-68.x8664:sn.23019b11e653",
          "targetType": "iSCSI"
        }
      ]
    }
  ]
}
名字 类型 描述 起始版本
success boolean 5.3.0
results List 详情参考results 5.3.0
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 5.3.0
#results
名字 类型 描述 起始版本
diskUuid String 磁盘UUID 5.3.0
devices List 详情参考devices 5.3.0
#devices
名字 类型 描述 起始版本
disk String 磁盘名称 5.3.0
state String 磁盘健康状态 5.3.0
status String 磁盘启用状态 5.3.0
target String 磁盘所在目标 5.3.0
targetType String 磁盘所在目标类型 5.3.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 5.3.0
description String 错误的概要描述 5.3.0
details String 错误的详细信息 5.3.0
elaboration String 保留字段,默认为null 5.3.0
opaque LinkedHashMap 保留字段,默认为null 5.3.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 5.3.0

SDK示例

Java SDK
GetHostMultipathTopologyAction action = new GetHostMultipathTopologyAction();
action.hostUuid = "da8052bf25c43b73ad0c9a7546d166ae";
action.diskUuids = asList("360014058e50754920324473a4c85c767","36001405a5d87d462c2c47acb683c4c37");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetHostMultipathTopologyAction.Result res = action.call();
Python SDK
GetHostMultipathTopologyAction action = GetHostMultipathTopologyAction()
action.hostUuid = "da8052bf25c43b73ad0c9a7546d166ae"
action.diskUuids = [360014058e50754920324473a4c85c767, 36001405a5d87d462c2c47acb683c4c37]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetHostMultipathTopologyAction.Result res = action.call()
开发手册 | 5.4.12 | ZStack Cloud · ZCF | ZStack 资源中心