VM Related Interfaces

Export VM OVA Package

POST/zstack/v1/ovf/ova-packages

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "name": "ova",
    "description": "description",
    "vmUuid": "af3c221d1dc4351999e0834c00b33118",
    "backupStorageUuid": "4205d410ede03e759277c9987c660a16"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"ova","description":"description","vmUuid":"af3c221d1dc4351999e0834c00b33118","backupStorageUuid":"4205d410ede03e759277c9987c660a16"}}' http://localhost:8080/zstack/v1/ovf/ova-packages

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
name (optional)Stringbody (included in params structure)Resource name 4.4.6
description (optional)Stringbody (included in params structure)Resource description 4.4.6
vmUuidStringbody (included in params structure)Source VM UUID 4.4.6
backupStorageUuidStringbody (included in params structure)Destination backup storage UUID for export 4.4.6
resourceUuid (optional)Stringbody (included in params structure)Resource UUID 4.4.6
tagUuids (optional)Listbody (included in params structure)Tag UUID list 4.4.6
systemTags (optional)ListbodySystem tags 4.4.6
userTags (optional)ListbodyUser tags 4.4.6

API Response

Response Example

{
  "inventory": {
    "uuid": "9f77f8d79ee138bfac21290c02fc2cb6",
    "name": "ova",
    "description": "description",
    "vmUuid": "43d306a42cdf38c48458d061e40b810a",
    "backupStorageUuid": "22f7145dba4f3da6af7ff8f0e02af6e3",
    "state": "Exported",
    "exportUrl": "http://bs-host-name/path/to/ova.ova",
    "md5Sum": "sampleMd5Sum",
    "format": "OVA",
    "size": 10737418240.0,
    "createDate": "May 10, 2022 5:24:03 AM",
    "lastOpDate": "May 10, 2022 5:24:03 AM"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.4.6
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See error for details.4.4.6
inventoryVmInstanceInventorySee inventory for details.4.4.6

error

NameTypeDescriptionStarting Version
codeStringError code. A globally unique identifier for the error, for example SYS.1000, HOST.10014.4.6
descriptionStringBrief description of the error4.4.6
detailsStringDetailed error information4.4.6
elaborationStringReserved field, defaults to null4.4.6
opaqueLinkedHashMapReserved field, defaults to null4.4.6
causeErrorCodeRoot error. The error that caused this error. If there is no original error, this field is null4.4.6

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID. Uniquely identifies the resource4.4.6
nameStringResource name4.4.6
descriptionStringResource description4.4.6
vmUuidStringSource VM UUID4.4.6
backupStorageUuidStringBackup storage UUID where the image package file is located4.4.6
exportUrlStringDownload URL4.4.6
md5SumStringImage package file MD5 checksum4.4.6
formatStringImage package file format4.4.6
sizeLongImage package file size4.4.6
createDateTimestampCreate time4.4.6
lastOpDateTimestampLast modification time4.4.6
stateImagePackageStateSee state for details.4.4.6

state

NameTypeDescriptionStarting Version
ExportingImagePackageStateExporting4.4.6
ExportedImagePackageStateExported4.4.6

SDK Examples

Java SDK

ExportVmOvaPackageAction action = new ExportVmOvaPackageAction();
action.name = "ova";
action.description = "description";
action.vmUuid = "af3c221d1dc4351999e0834c00b33118";
action.backupStorageUuid = "4205d410ede03e759277c9987c660a16";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ExportVmOvaPackageAction.Result res = action.call();

Python SDK

ExportVmOvaPackageAction action = ExportVmOvaPackageAction()
action.name = "ova"
action.description = "description"
action.vmUuid = "af3c221d1dc4351999e0834c00b33118"
action.backupStorageUuid = "4205d410ede03e759277c9987c660a16"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ExportVmOvaPackageAction.Result res = action.call()