Upload a Software Package to Backup Storage

POST/zstack/v1/software-packages/backup-storage/upload

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "name": "software-package-name",
    "type": "ZMigrate",
    "backupStorageUuid": "ff081de062bd338eb907962028e64d00",
    "url": "http://192.168.1.1/disk/images/test.qcow2",
    "installPath": "/root/zmigrate.tar.gz"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding example, the 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":"software-package-name","type":"ZMigrate","backupStorageUuid":"ff081de062bd338eb907962028e64d00","url":"http://192.168.1.1/disk/images/test.qcow2","installPath":"/root/zmigrate.tar.gz"}}' \
http://localhost:8080/zstack/v1/software-packages/backup-storage/upload

Parameters

NameTypeLocationDescriptionValid ValuesSince
nameStringbody(contained in the params structure)Resource name 5.0.0
typeStringbody(contained in the params structure)Software package type 5.0.0
backupStorageUuid (optional)Stringbody(contained in the params structure)Backup storage UUID 5.0.0
urlStringbody(contained in the params structure)Software package URL 5.0.0
installPathStringbody(contained in the params structure)Installation path 5.0.0
resourceUuid (optional)Stringbody(contained in the params structure)Resource UUID 5.0.0
tagUuids (optional)Stringbody(contained in the params structure)Tag UUID list 5.0.0
systemTags (optional)ListbodySystem tags 5.0.0
userTags (optional)ListbodyUser tags 5.0.0

API Response

Response Example

{
  "inventory": {
    "size": 0
  }
}
NameTypeDescriptionSince
successboolean 5.0.0
inventorySoftwarePackageInventoryFor details, see inventory5.0.0
errorErrorCodeFor details, see error5.0.0

inventory

NameTypeDescriptionSince
uuidStringResource UUID, which uniquely identifies the resource4.10.20
nameStringResource name4.10.20
hostUuidStringhost UUID4.10.20
managementNodeUuidStringUUID of the management node to which the package is uploaded4.10.20
installPathStringInstallation path4.10.20
unzipInstallPathStringExtraction installation path4.10.20
typeStringInstallation package type4.10.20
md5sumStringMD5 checksum of the installation package4.10.20
statusStringInstallation package status4.10.20
sizelongInstallation package size4.10.20
createDateTimestampCreation time4.10.20
lastOpDateTimestampLast modification time4.10.20

error

NameTypeDescriptionSince
codeStringError code, a globally unique identifier of the error, for example, SYS.1000 or HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. The default value is null0.6
opaqueLinkedHashMapReserved field. The default value is null0.6
causeErrorCodeRoot error, which is the source error that caused the current error. If there is no source error, this field is null0.6

SDK Example

Java SDK

UploadSoftwarePackageToBackupStorageAction action = new UploadSoftwarePackageToBackupStorageAction();
action.name = "software-package-name";
action.type = "ZMigrate";
action.backupStorageUuid = "ff081de062bd338eb907962028e64d00";
action.url = "http://192.168.1.1/disk/images/test.qcow2";
action.installPath = "/root/zmigrate.tar.gz";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UploadSoftwarePackageToBackupStorageAction.Result res = action.call();

Python SDK

action = UploadSoftwarePackageToBackupStorageAction()
action.name = "software-package-name"
action.type = "ZMigrate"
action.backupStorageUuid = "ff081de062bd338eb907962028e64d00"
action.url = "http://192.168.1.1/disk/images/test.qcow2"
action.installPath = "/root/zmigrate.tar.gz"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()