Revert VM from VM Backup

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "revertVmFromVmBackup": {
    "backupStorageUuid": "99afb6149155396c8ac1b6ab62badb9d",
    "strategy": "CreateStopped"
  },
  "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 '{"revertVmFromVmBackup":{"backupStorageUuid":"99afb6149155396c8ac1b6ab62badb9d","strategy":"CreateStopped"}}' \
http://localhost:8080/zstack/v1/vm-backups/39f4e3c4b7553dbc98b8c0ce0e8f82a1/actions

Parameter List

Name

Type

Location

Description

Allowed Values

Starting Version

groupUuid

String

url

Backup group UUID

 

3.0.0

backupStorageUuid (Optional)

String

body (Contained in the revertVmFromVmBackup structure)

Image Storage UUID

 

3.0.0

strategy (Optional)

String

body (Contained in the revertVmFromVmBackup structure)

 

  • InstantStart
  • JustCreate
  • CreateStopped

4.3.0

systemTags (Optional)

List

body

 

 

3.0.0

userTags (Optional)

List

body

 

 

3.0.0

API Response

On success, this API returns an empty JSON structure {}. On failure, the returned JSON structure contains an error field. For example:

{
  "error": {
    "code": "SYS.1001",
    "description": "A message or a operation timeout",
    "details": "Create VM on KVM timeout after 300s"
  }
}

SDK Examples

Java SDK

RevertVmFromVmBackupAction action = new RevertVmFromVmBackupAction();
action.groupUuid = "39f4e3c4b7553dbc98b8c0ce0e8f82a1";
action.backupStorageUuid = "99afb6149155396c8ac1b6ab62badb9d";
action.strategy = "CreateStopped";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RevertVmFromVmBackupAction.Result res = action.call();

Python SDK

RevertVmFromVmBackupAction action = RevertVmFromVmBackupAction()
action.groupUuid = "39f4e3c4b7553dbc98b8c0ce0e8f82a1"
action.backupStorageUuid = "99afb6149155396c8ac1b6ab62badb9d"
action.strategy = "CreateStopped"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RevertVmFromVmBackupAction.Result res = action.call()