GetVmMigrationCandidateHosts
API Request
URLs
GET zstack/v1/vm-instances/{vmInstanceUuid}/migration-target-hostsHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth cf673ad3be454b49b24c4405f67531f0" \
-X GET http://localhost:8080/zstack/v1/vm-instances/98995eddf4854acc8b80da119fee81d5/migration-target-hostsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| vmInstanceUuid | String | url | The VM instance UUID. | 0.6 | |
| systemTags | List | query | Optional. The system tags. | 0.6 | |
| userTags | List | query | Optional. The user tags. | 0.6 |
API Response
Sample
Response
{
"inventories": [
{
"zoneUuid": "09ba44cadab94a1a95ab0b5216ace46a",
"name": "example",
"uuid": "25a4d0f25f5649ae847e81869384f155",
"clusterUuid": "d96488a7d4524609a66983de7eb1bc6c",
"description": "example",
"managementIp": "192.168.0.1",
"hypervisorType": "KVM",
"state": "Enabled",
"status": "Connected",
"totalCpuCapacity": 4.0,
"availableCpuCapacity": 2.0,
"totalMemoryCapacity": 4.0,
"availableMemoryCapacity": 4.0,
"createDate": "May 11, 2017 1:22:56 PM",
"lastOpDate": "May 11, 2017 1:22:56 PM"
}
]
}
| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
| inventories | List | See inventories. | 0.6 |
#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. | 0.6 |
| description | String | The brief description of the error. | 0.6 |
| details | String | The details about the error. | 0.6 |
| elaboration | String | The reserved field. Default value: null. | 0.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| zoneUuid | String | The zone UUID. | 0.6 |
| name | String | The resource name. | 0.6 |
| uuid | String | The resource UUID. | 0.6 |
| clusterUuid | String | The cluster UUID. | 0.6 |
| description | String | The detailed description of the resource. | 0.6 |
| managementIp | String | 0.6 | |
| hypervisorType | String | 0.6 | |
| state | String | 0.6 | |
| status | String | 0.6 | |
| totalCpuCapacity | Long | 0.6 | |
| availableCpuCapacity | Long | 0.6 | |
| cpuSockets | Integer | 0.6 | |
| totalMemoryCapacity | Long | 0.6 | |
| availableMemoryCapacity | Long | 0.6 | |
| cpuNum | Integer | 0.6 | |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
SDK Sample
Java
SDK
GetVmMigrationCandidateHostsAction action = new GetVmMigrationCandidateHostsAction();
action.vmInstanceUuid = "9949593f81604daeb21159f1e0525c4a";
action.sessionId = "fb98227d4c434087861e9157db2eb5f7";
GetVmMigrationCandidateHostsAction.Result res = action.call();Python
SDK
GetVmMigrationCandidateHostsAction action = GetVmMigrationCandidateHostsAction()
action.vmInstanceUuid = "8b530774005349c8b57b122b89d262d2"
action.sessionId = "a15e9d90559c4ed6b12e0ef05f77c493"
GetVmMigrationCandidateHostsAction.Result res = action.call()