Document navigation

GetHostCandidatesForVmMigration

API Request

URLs
GET zstack/v1/primary-storage/hosts/{vmInstanceUuid}/migration-candidates
Headers
Authorization: OAuth the-session-uuid
Curl Sample
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
Request Parameters
Name Type Location Description Valid Value Starting Version
vmInstanceUuid String url The UUID of the VM instance. 4.0.0
dstPrimaryStorageUuid String query The UUID of the destination primary storage. 4.0.0
limit Integer query Optional. The maximum number of returned hosts. 4.0.0
systemTags List query Optional. The system tags. 4.0.0
userTags List query Optional. The user tags. 4.0.0

API Response

Sample Response
{
  "inventories": [
    {
      "name": "HOST-1",
      "uuid": "b72c8853294a3e08abe838c58a61efb9"
    }
  ]
}
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.0.0
inventories List See inventories 4.0.0
#error
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.0.0
description String The detailed description of the error. 4.0.0
details String The details about the error. 4.0.0
elaboration String The reserved field. Default value: null. 4.0.0
opaque LinkedHashMap The reserved field. Default value: null. 4.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. 4.0.0
#inventories
Name Type Description Starting Version
zoneUuid String The zone UUID. 4.0.0
name String The name of the 4.0.0
uuid String The host UUID. 4.0.0
clusterUuid String The cluster UUID. 4.0.0
description String The detailed description of the host. 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 The time when the host was created. 4.0.0
lastOpDate Timestamp The time when the host was last modified. 4.0.0

SDK Sample

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()
API Reference | 5.4.12 | ZStack Cloud · ZCF | ZStack Resource Center