Image Storage Related InterfacesImage Related Interfaces

Query Image Package

GET/zstack/v1/image-packages
GET zstack/v1/image-packages/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/image-packages?q=uuid=7cd2f1b456ce3045b78d3c1eb58cc03d
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/image-packages/1c57c91becf431f3b098800fc900c708

Queryable Fields

Run the CLI command tool, enter QueryImagePackage and press Tab to view all queryable fields and resource names that support cross-table queries.

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "e97e03503a5d3bf19a23f91c9a79e009",
      "name": "ova",
      "description": "description",
      "vmUuid": "b3da643979eb3452abbeb978208cb672",
      "backupStorageUuid": "6185f4e18a993ece84a06ec8c469b530",
      "state": "Exported",
      "exportUrl": "http://bs-host-name/path/to/ova.ova",
      "md5Sum": "sampleMd5Sum",
      "format": "OVA",
      "size": 10737418240.0,
      "createDate": "May 10, 2022 5:26:20 AM",
      "lastOpDate": "May 10, 2022 5:26:20 AM"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.4.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error4.4.6
inventoriesListSee inventories4.4.6

error

NameTypeDescriptionStarting Version
codeStringError code number, 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 cause. The source error that triggered the current error. This field is null if there is no original error4.4.6

inventory

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource4.4.6
nameStringResource name4.4.6
descriptionStringDetailed description of the resource4.4.6
vmUuidStringSource VM UUID4.4.6
backupStorageUuidStringImage 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
createDateTimestampCreation time4.4.6
lastOpDateTimestampLast modification time4.4.6
stateImagePackageStateSee state4.4.6

state

NameTypeDescriptionStarting Version
ExportingImagePackageStateExporting4.4.6
ExportedImagePackageStateExported4.4.6

SDK Examples

Java SDK

QueryImagePackageAction action = new QueryImagePackageAction();
action.conditions = asList("uuid=5319396fe8f0393d998ac6c0939e780e");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryImagePackageAction.Result res = action.call();

Python SDK

QueryImagePackageAction action = QueryImagePackageAction()
action.conditions = ["uuid=99435bfd7903372289db27c8a2b1038c"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryImagePackageAction.Result res = action.call()