ExportVmOvaPackage
API Request
URLs
POST zstack/v1/ovf/ova-packagesHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, the userTags field is optional. This field can be
included in the body structure.
{
"params": {
"name": "ova",
"description": "description",
"vmUuid": "af3c221d1dc4351999e0834c00b33118",
"backupStorageUuid": "4205d410ede03e759277c9987c660a16"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, the userTags field is optional. This field can be
included in the body structure.Curl Sample
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-packagesParameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| name | String | body(contained in the paramsstructure) | Optional. The resource name. | 4.4.6 | |
| description | String | body(contained in the paramsstructure) | Optional. The resource description. | 4.4.6 | |
| vmUuid | String | body(contained in the paramsstructure) | The VM UUID. | 4.4.6 | |
| backupStorageUuid | String | body(contained in the paramsstructure) | The backup storage UUID. | 4.4.6 | |
| resourceUuid | String | body(contained in the paramsstructure) | Optional. The resource UUID. | 4.4.6 | |
| tagUuids | List | body(contained in the paramsstructure) | Optional. The tag UUIDs. | 4.4.6 | |
| systemTags | List | body | Optional. The system tags. | 4.4.6 | |
| userTags | List | body | Optional. The user tags. | 4.4.6 |
API Response
Sample Response
{
"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": 1.073741824E10,
"createDate": "May 10, 2022 5:24:03 AM",
"lastOpDate": "May 10, 2022 5:24:03 AM"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.4.6 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.4.6 |
| inventory | VmInstanceInventory | See inventory. | 4.4.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. | 4.4.6 |
| description | String | The brief description of the error. | 4.4.6 |
| details | String | The details about the error. | 4.4.6 |
| elaboration | String | The reserved field. Default value: null. | 4.4.6 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.4.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. | 4.4.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.4.6 |
| name | String | The resource name. | 4.4.6 |
| description | String | The resource description. | 4.4.6 |
| vmUuid | String | The source VM UUID. | 4.4.6 |
| backupStorageUuid | String | The backup storage UUID. | 4.4.6 |
| exportUrl | String | The download address. | 4.4.6 |
| md5Sum | String | The MD5 sum of the image package. | 4.4.6 |
| format | String | The image package format. | 4.4.6 |
| size | Long | The image package size. | 4.4.6 |
| createDate | Timestamp | The creation time. | 4.4.6 |
| lastOpDate | Timestamp | The last operation time. | 4.4.6 |
| state | ImagePackageState | See state. | 4.4.6 |
#state
| Name | Type | Description | Starting Version |
|---|---|---|---|
| Exporting | ImagePackageState | The image package is exporting. | 4.4.6 |
| Exported | ImagePackageState | The image package is exported. | 4.4.6 |
SDK Sample
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()