VM Related Interfaces
Get Candidate ISO for Attaching VM
Get the list of candidate ISOs that can be attached to a Virtual Machine.
Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth fe731654cc114cc3b0cc1cb0bd437f77" \
-X GET http://localhost:8080/zstack/v1/vm-instances/1f65bf61248341708265de7d759828b2/iso-candidatesParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| vmInstanceUuid | String | url | Virtual Machine UUID | 0.6 | |
| systemTags (optional) | List | query | System Tags | 0.6 | |
| userTags (optional) | List | query | User Tags | 0.6 |
API Response
Return Example
{
"inventories": [
{
"uuid": "cb2c34a46a753c5ab95807fabbae56af",
"name": "TinyLinux",
"url": "http://192.168.1.20/share/images/tinylinux.qcow2",
"mediaType": "RootVolumeTemplate",
"platform": "Linux",
"format": "qcow2",
"backupStorageRefs": [
{
"id": 0,
"imageUuid": "cb2c34a46a753c5ab95807fabbae56af",
"backupStorageUuid": "217396177c143e49ad21dd5679e28a61",
"installPath": "ceph://zs-images/f0b149e053b34c7eb7fe694b182ebffd",
"status": "Ready"
}
]
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | Error code. If not null, indicates operation failure. This field is null when the operation succeeds. See error | 0.6 |
| inventories | List | See inventories | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number, a globally unique identifier for the error, for example SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed error information | 0.6 |
| elaboration | String | Reserved field, defaults to null | 0.6 |
| opaque | LinkedHashMap | Reserved field, defaults to null | 0.6 |
| cause | ErrorCode | Root cause, the source error that triggered the current error. If there is no original error, this field is null | 0.6 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | Resource UUID, uniquely identifies the resource | 0.6 |
| name | String | Resource name | 0.6 |
| description | String | Detailed description of the resource | 0.6 |
| state | String | Image boot state | 0.6 |
| status | String | Image ready state | 0.6 |
| size | Long | Image size | 0.6 |
| actualSize | Long | Image actual size | 0.6 |
| md5Sum | String | Image MD5 value | 0.6 |
| url | String | Image URL address | 0.6 |
| mediaType | String | Image media type | 0.6 |
| guestOsType | String | Guest operating system type corresponding to the image | 0.6 |
| type | String | Internal use field | 0.6 |
| platform | String | Image system platform | 0.6 |
| format | String | Image format, for example: raw | 0.6 |
| system | Boolean | Indicates whether it is a system image | 0.6 |
| createDate | Timestamp | Creation Time | 0.6 |
| lastOpDate | Timestamp | Last Operation Date | 0.6 |
| backupStorageRefs | List | See backupStorageRefs | 0.6 |
backupStorageRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| imageUuid | String | Image UUID | 0.6 |
| backupStorageUuid | String | Backup Storage UUID | 0.6 |
| installPath | String | Installation path on backup storage | 0.6 |
| exportUrl | String | Export image URL | 0.6 |
| exportMd5Sum | String | Export image MD5 value | 0.6 |
| status | String | Image ready status | 0.6 |
| createDate | Timestamp | Creation Time | 0.6 |
| lastOpDate | Timestamp | Last Operation Date | 0.6 |
SDK Examples
Java SDK
GetCandidateIsoForAttachingVmAction action = new GetCandidateIsoForAttachingVmAction();
action.vmInstanceUuid = "a314c7a1ee9937ba94bd9fcc9a02e727";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateIsoForAttachingVmAction.Result res = action.call();Python SDK
GetCandidateIsoForAttachingVmAction action = GetCandidateIsoForAttachingVmAction()
action.vmInstanceUuid = "a314c7a1ee9937ba94bd9fcc9a02e727"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateIsoForAttachingVmAction.Result res = action.call()