文档目录

获取跨存储迁移可选物理机列表(GetHostCandidatesForVmMigration)

API请求

URLs
GET zstack/v1/primary-storage/hosts/{vmInstanceUuid}/migration-candidates
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/primary-storage/hosts/73e5ee655c3d3ef7b9fc0f3a3b560270/migration-candidates?dstPrimaryStorageUuid=cc8db724e1b334568026ca38d5c27b0f
参数列表
名字 类型 位置 描述 可选值 起始版本
vmInstanceUuid String url 云主机UUID 4.0.0
dstPrimaryStorageUuid String query 目的主存储UUID 4.0.0
limit (可选) Integer query 获取物理机列表数量 4.0.0
systemTags (可选) List query 系统标签 4.0.0
userTags (可选) List query 用户标签 4.0.0

API返回

返回示例
{
  "inventories": [
    {
      "name": "HOST-1",
      "uuid": "b72c8853294a3e08abe838c58a61efb9"
    }
  ]
}
名字 类型 描述 起始版本
error ErrorCode 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error 4.0.0
inventories List 详情参考inventories 4.0.0
#error
名字 类型 描述 起始版本
code String 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 4.0.0
description String 错误的概要描述 4.0.0
details String 错误的详细信息 4.0.0
elaboration String 保留字段,默认为null 4.0.0
opaque LinkedHashMap 保留字段,默认为null 4.0.0
cause ErrorCode 根错误,引发当前错误的源错误,若无原错误,该字段为null 4.0.0
#inventory
名字 类型 描述 起始版本
zoneUuid String 区域UUID 4.0.0
name String 资源名称 4.0.0
uuid String 资源的UUID,唯一标示该资源 4.0.0
clusterUuid String 集群UUID 4.0.0
description String 资源的详细描述 4.0.0
managementIp String 4.0.0
hypervisorType String 4.0.0
state String 4.0.0
status String 4.0.0
totalCpuCapacity Long 4.0.0
availableCpuCapacity Long 4.0.0
cpuSockets Integer 4.0.0
totalMemoryCapacity Long 4.0.0
availableMemoryCapacity Long 4.0.0
cpuNum Integer 4.0.0
createDate Timestamp 创建时间 4.0.0
lastOpDate Timestamp 最后一次修改时间 4.0.0

SDK示例

Java SDK
GetHostCandidatesForVmMigrationAction action = new GetHostCandidatesForVmMigrationAction();
action.vmInstanceUuid = "73e5ee655c3d3ef7b9fc0f3a3b560270";
action.dstPrimaryStorageUuid = "cc8db724e1b334568026ca38d5c27b0f";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetHostCandidatesForVmMigrationAction.Result res = action.call();
Python SDK
GetHostCandidatesForVmMigrationAction action = GetHostCandidatesForVmMigrationAction()
action.vmInstanceUuid = "73e5ee655c3d3ef7b9fc0f3a3b560270"
action.dstPrimaryStorageUuid = "cc8db724e1b334568026ca38d5c27b0f"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetHostCandidatesForVmMigrationAction.Result res = action.call()
开发手册 | 4.8.38 | ZStack Cloud · ZCF | ZStack 资源中心