Sync to Backup Storage
Sync backup to the backup Image Storage.
Headers
Authorization: OAuth the-session-uuidBody
{
"syncVmBackupFromImageStoreBackupStorage": {
"srcBackupStorageUuid": "3428f7d03e493f89b32c57ef80a7e5af",
"dstBackupStorageUuid": "6f8c528537a9347a86da7a96fb7418d4"
},
"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 '{"syncVmBackupFromImageStoreBackupStorage":{"srcBackupStorageUuid":"3428f7d03e493f89b32c57ef80a7e5af","dstBackupStorageUuid":"6f8c528537a9347a86da7a96fb7418d4"}}' http://localhost:8080/zstack/v1/vm-backups/14e53ad2aecd3e7ebe1f05cb4f5dd6a5/actionsParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| groupUuid | String | url | Backup group UUID | 3.0.0 | |
| srcBackupStorageUuid | String | body (Contained in the syncVmBackupFromImageStoreBackupStorage structure) | Local Image Storage | 3.0.0 | |
| dstBackupStorageUuid | String | body (Contained in the syncVmBackupFromImageStoreBackupStorage structure) | Backup Image Storage | 3.0.0 | |
| systemTags (Optional) | List | body | 3.0.0 | ||
| userTags (Optional) | List | body | 3.0.0 |
API Response
Response Example
{
"inventories": [
{
"uuid": "cf59b77253e134e483ceda7e21c6bf15",
"volumeUuid": "6be74434a84e3c939830a3987488a499",
"name": "Root-Volume-Backup-1",
"description": "volume backup",
"size": 1073741824.0,
"groupUuid": "09d5949ca5f233c2adcf4c278f537cef",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
},
{
"uuid": "c546170919a4300e9b3d3e29fc27de7f",
"volumeUuid": "39656103b9e7391e89071517f9d21b91",
"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"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation failed. This field is null on success. For details, see error | 3.0.0 |
| inventories | List | For details, see inventories | 3.0.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 3.0.0 |
| description | String | A brief description of the error | 3.0.0 |
| details | String | The detailed error information | 3.0.0 |
| elaboration | String | Reserved field. Default is null | 3.0.0 |
| opaque | LinkedHashMap | Reserved field. Default is null | 3.0.0 |
| cause | ErrorCode | The root error. The source error that caused the current error. This field is null if there is no root error | 3.0.0 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the disk backup. Uniquely identifies the resource | 3.0.0 |
| volumeUuid | String | Disk UUID | 3.0.0 |
| name | String | Backup name | 3.0.0 |
| description | String | Detailed description of the backup | 3.0.0 |
| type | String | Disk type | 3.0.0 |
| state | String | The enabled state of the disk backup | 3.0.0 |
| status | String | The status of the disk backup | 3.0.0 |
| size | Long | The size of the current disk backup | 3.0.0 |
| metadata | String | Metadata related to the disk backup | 3.0.0 |
| createDate | Timestamp | Creation time | 3.0.0 |
| lastOpDate | Timestamp | Last modification time | 3.0.0 |
| backupStorageRefs | List | For details, see backupStorageRefs | 3.0.0 |
backupStorageRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| volumeBackupUuid | String | The UUID of the disk backup | 3.0.0 |
| backupStorageUuid | String | Image Storage UUID | 3.0.0 |
| installPath | String | The data path of the disk backup | 3.0.0 |
| status | String | The status of the disk backup on the Image Storage | 3.0.0 |
| createDate | Timestamp | Creation time | 3.0.0 |
| lastOpDate | Timestamp | Last modification time | 3.0.0 |
SDK Examples
Java SDK
SyncVmBackupFromImageStoreBackupStorageAction action = new SyncVmBackupFromImageStoreBackupStorageAction();
action.groupUuid = "14e53ad2aecd3e7ebe1f05cb4f5dd6a5";
action.srcBackupStorageUuid = "3428f7d03e493f89b32c57ef80a7e5af";
action.dstBackupStorageUuid = "6f8c528537a9347a86da7a96fb7418d4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SyncVmBackupFromImageStoreBackupStorageAction.Result res = action.call();Python SDK
SyncVmBackupFromImageStoreBackupStorageAction action = SyncVmBackupFromImageStoreBackupStorageAction()
action.groupUuid = "14e53ad2aecd3e7ebe1f05cb4f5dd6a5"
action.srcBackupStorageUuid = "3428f7d03e493f89b32c57ef80a7e5af"
action.dstBackupStorageUuid = "6f8c528537a9347a86da7a96fb7418d4"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SyncVmBackupFromImageStoreBackupStorageAction.Result res = action.call()