GetImageCandidatesForVmToChange
API Request
URLs
GET zstack/v1/vm-instances/{vmInstanceUuid}/image-candidatesHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-instances/54f0aebe7a2536978aafb9eb7a95003e/image-candidatesRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| vmInstanceUuid | String | url | Optional. The VM instance UUID. | 2.2 | |
| systemTags | List | query | Optional. The system tags. | 2.2 | |
| userTags | List | query | Optional. The user tags. | 2.2 |
API Response
Sample
Response
{
"inventories": [
{
"uuid": "2354990ad5ee343eba48bb07851a1423",
"name": "TinyLinux",
"url": "http://192.168.1.20/share/images/tinylinux.qcow2",
"mediaType": "RootVolumeTemplate",
"platform": "Linux",
"format": "qcow2",
"backupStorageRefs": [
{
"id": 0.0,
"imageUuid": "2354990ad5ee343eba48bb07851a1423",
"backupStorageUuid": "a03a78dbdab23444bb109d67a5059389",
"installPath": "ceph://zs-images/f0b149e053b34c7eb7fe694b182ebffd",
"status": "Ready"
}
]
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.2 |
| inventories | List | See inventories. | 2.2 |
#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. | 2.2 |
| description | String | The brief description of the error. | 2.2 |
| details | String | The details about the error. | 2.2 |
| elaboration | String | The reserved field. Default value: null. | 2.2 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 2.2 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 2.2 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.2 |
| name | String | The resource name. | 2.2 |
| description | String | The detailed description of the resource. | 2.2 |
| state | String | 2.2 | |
| status | String | 2.2 | |
| size | Long | 2.2 | |
| actualSize | Long | 2.2 | |
| md5Sum | String | 2.2 | |
| url | String | 2.2 | |
| mediaType | String | 2.2 | |
| guestOsType | String | 2.2 | |
| type | String | 2.2 | |
| platform | String | 2.2 | |
| format | String | 2.2 | |
| system | Boolean | 2.2 | |
| createDate | Timestamp | The creation date. | 2.2 |
| lastOpDate | Timestamp | The last operation date. | 2.2 |
| backupStorageRefs | List | See backupStorageRefs. | 2.2 |
#backupStorageRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| imageUuid | String | The image UUID. | 2.2 |
| backupStorageUuid | String | The backup storage UUID. | 2.2 |
| installPath | String | 2.2 | |
| exportUrl | String | 2.2 | |
| exportMd5Sum | String | 2.2 | |
| status | String | 2.2 | |
| createDate | Timestamp | The creation date. | 2.2 |
| lastOpDate | Timestamp | The last operation date. | 2.2 |
SDK Sample
Java
SDK
GetImageCandidatesForVmToChangeAction action = new GetImageCandidatesForVmToChangeAction();
action.vmInstanceUuid = "54f0aebe7a2536978aafb9eb7a95003e";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetImageCandidatesForVmToChangeAction.Result res = action.call();Python
SDK
GetImageCandidatesForVmToChangeAction action = GetImageCandidatesForVmToChangeAction()
action.vmInstanceUuid = "54f0aebe7a2536978aafb9eb7a95003e"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetImageCandidatesForVmToChangeAction.Result res = action.call()