VM Related Interfaces

Get Candidate ISO for Attaching VM

GET/zstack/v1/vm-instances/{vmInstanceUuid}/iso-candidates

Get the list of candidate ISOs that can be attached to a Virtual Machine.

Headers

Authorization: OAuth the-session-uuid

Curl 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-candidates

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
vmInstanceUuidStringurlVirtual Machine UUID 0.6
systemTags (optional)ListquerySystem Tags 0.6
userTags (optional)ListqueryUser 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"
        }
      ]
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, indicates operation failure. This field is null when the operation succeeds. See error0.6
inventoriesListSee inventories0.6

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause, the source error that triggered the current error. If there is no original error, this field is null0.6

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource0.6
nameStringResource name0.6
descriptionStringDetailed description of the resource0.6
stateStringImage boot state0.6
statusStringImage ready state0.6
sizeLongImage size0.6
actualSizeLongImage actual size0.6
md5SumStringImage MD5 value0.6
urlStringImage URL address0.6
mediaTypeStringImage media type0.6
guestOsTypeStringGuest operating system type corresponding to the image0.6
typeStringInternal use field0.6
platformStringImage system platform0.6
formatStringImage format, for example: raw0.6
systemBooleanIndicates whether it is a system image0.6
createDateTimestampCreation Time0.6
lastOpDateTimestampLast Operation Date0.6
backupStorageRefsListSee backupStorageRefs0.6

backupStorageRefs

NameTypeDescriptionStarting Version
imageUuidStringImage UUID0.6
backupStorageUuidStringBackup Storage UUID0.6
installPathStringInstallation path on backup storage0.6
exportUrlStringExport image URL0.6
exportMd5SumStringExport image MD5 value0.6
statusStringImage ready status0.6
createDateTimestampCreation Time0.6
lastOpDateTimestampLast Operation Date0.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()