Create Database Backup

POST/zstack/v1/database-backups

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "name": "cloud-db",
    "backupStorageUuid": "676c5945223647698fcf4da2fa46d1dd"
  },
  "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 POST -d '{"params":{"name":"cloud-db","backupStorageUuid":"0c0f5fc523d8420a97a9be367f112b4a"}}' http://localhost:8080/zstack/v1/database-backups

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
nameStringbody (Contained in the params structure)Resource name 3.0.0
descriptionStringbody (Contained in the params structure)Detailed description of the resource 3.0.0
backupStorageUuidStringbody (Contained in the params structure)Image Storage UUID 3.0.0
resourceUuid (Optional)Stringbody (Contained in the params structure)  3.0.0
systemTags (Optional)Listbody  3.0.0
userTags (Optional)Listbody  3.0.0

API Response

Response Example

{
  "inventory": {
    "uuid": "7decf4a7cb7c41dabc57446df2784476",
    "name": "zsdb",
    "state": "Enabled",
    "size": 1000.0,
    "metadata": "{\"version\":\"3.0.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
inventoryDatabaseBackupInventoryFor details, see inventory3.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

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource3.0.0
nameStringResource name3.0.0
descriptionStringDetailed description of the resource3.0.0
stateString 3.0.0
statusString 3.0.0
sizeLong 3.0.0
metadataString 3.0.0
createDateTimestampCreation time3.0.0
lastOpDateTimestampLast modification time3.0.0
backupStorageRefsListFor details, see backupStorageRefs3.0.0

backupStorageRefs

NameTypeDescriptionStarting Version
databaseBackupUuidString 3.0.0
backupStorageUuidStringImage Storage UUID3.0.0
installPathString 3.0.0
exportUrlString 3.0.0
statusString 3.0.0
createDateTimestampCreation time3.0.0
lastOpDateTimestampLast modification time3.0.0

SDK Examples

Java SDK

CreateDatabaseBackupAction action = new CreateDatabaseBackupAction();
action.name = "cloud-db";
action.backupStorageUuid = "35c0d1e417d84bf498be201091f39c49";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateDatabaseBackupAction.Result res = action.call();

Python SDK

CreateDatabaseBackupAction action = CreateDatabaseBackupAction()
action.name = "cloud-db"
action.backupStorageUuid = "476870bf9c4241c8993340bd0703d0bf"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateDatabaseBackupAction.Result res = action.call()