Recover VM Backup

PUT/zstack/v1/vm-backups/{groupUuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "recoverVmBackupFromImageStoreBackupStorage": {
    "srcBackupStorageUuid": "c63b10a638f6302caeabb7a806d087ad",
    "dstBackupStorageUuid": "7c7d653af1c531dfa04dabea3a085de5"
  },
  "systemTags": [],
  "userTags": []
}

The systemTags and userTags fields in the above example are optional. 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 PUT -d '{"recoverVmBackupFromImageStoreBackupStorage":{"srcBackupStorageUuid":"c63b10a638f6302caeabb7a806d087ad","dstBackupStorageUuid":"7c7d653af1c531dfa04dabea3a085de5"}}' http://localhost:8080/zstack/v1/vm-backups/7913ce9f37973f4e8339aea4ff61584c/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
groupUuidStringurlVM backup group UUID 3.0.0
srcBackupStorageUuidStringbody (Contained in the recoverVmBackupFromImageStoreBackupStorage structure)Local Image Storage 3.0.0
dstBackupStorageUuidStringbody (Contained in the recoverVmBackupFromImageStoreBackupStorage structure)Backup Image Storage 3.0.0
systemTags (Optional)Listbody  3.0.0
userTags (Optional)Listbody  3.0.0

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "5e28a0c27a8e352bbeedff94a0326f9e",
      "volumeUuid": "aa5fbdba3ffa352bbefaf913f56949f3",
      "name": "Root-Volume-Backup-1",
      "description": "volume backup",
      "size": 1073741824.0,
      "groupUuid": "0150a8120f9334db8e9abc9d3f5eea08",
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    },
    {
      "uuid": "5924c90ddbcb3784ae6e78b70ede90ce",
      "volumeUuid": "12d583f519f03a0593dff7514af65be4",
      "name": "Data-Volume-Backup-1",
      "description": "volume backup",
      "size": 2147483648.0,
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeThe error code. If not null, the operation failed. This field is null on success. For details, see error3.0.0
inventoriesListFor details, see inventories3.0.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.10013.0.0
descriptionStringA brief description of the error3.0.0
detailsStringThe detailed error information3.0.0
elaborationStringReserved field. Default is null3.0.0
opaqueLinkedHashMapReserved field. Default is null3.0.0
causeErrorCodeThe root error. The source error that caused the current error. This field is null if there is no root error3.0.0

inventories

NameTypeDescriptionStarting Version
uuidStringThe UUID of the disk backup. Uniquely identifies the resource3.0.0
volumeUuidStringDisk UUID3.0.0
nameStringBackup name3.0.0
descriptionStringDetailed description of the backup3.0.0
typeStringDisk type3.0.0
stateStringThe enabled state of the disk backup3.0.0
statusStringThe status of the disk backup3.0.0
sizeLongThe size of the current disk backup3.0.0
metadataStringMetadata related to the disk backup3.0.0
createDateTimestampCreation time3.0.0
lastOpDateTimestampLast modification time3.0.0
backupStorageRefsListFor details, see backupStorageRefs3.0.0

backupStorageRefs

NameTypeDescriptionStarting Version
volumeBackupUuidStringThe UUID of the disk backup3.0.0
backupStorageUuidStringImage Storage UUID3.0.0
installPathStringThe data path of the disk backup3.0.0
statusStringThe status of the disk backup on the Image Storage3.0.0
createDateTimestampCreation time3.0.0
lastOpDateTimestampLast modification time3.0.0

SDK Examples

Java SDK

RecoverVmBackupFromImageStoreBackupStorageAction action = new RecoverVmBackupFromImageStoreBackupStorageAction();
action.groupUuid = "7913ce9f37973f4e8339aea4ff61584c";
action.srcBackupStorageUuid = "c63b10a638f6302caeabb7a806d087ad";
action.dstBackupStorageUuid = "7c7d653af1c531dfa04dabea3a085de5";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RecoverVmBackupFromImageStoreBackupStorageAction.Result res = action.call();

Python SDK

RecoverVmBackupFromImageStoreBackupStorageAction action = RecoverVmBackupFromImageStoreBackupStorageAction()
action.groupUuid = "7913ce9f37973f4e8339aea4ff61584c"
action.srcBackupStorageUuid = "c63b10a638f6302caeabb7a806d087ad"
action.dstBackupStorageUuid = "7c7d653af1c531dfa04dabea3a085de5"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RecoverVmBackupFromImageStoreBackupStorageAction.Result res = action.call()