Description
You can call this operation to initiate a data backup for a tenant.
Call description
Prerequisites
You have passed the authentication for the OceanBase Cloud Platform (OCP) application service.
Request path
POST /api/v2/ob/clusters/{id}/tenants/{tenantId}/backup/backupNow
Request parameters
Path parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Integer | Yes | 1002 | The ID of the cluster. |
| tenantId | Integer | Yes | 108 | The ID of the tenant. |
Body parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| obBackupObject | Obbackupobject | No | NA | The backup object, which will be automatically populated. |
| backupMode | String | Yes | LOGICAL_BACKUP | The backup mode. Valid values: LOGICAL_BACKUP: indicates logical backup.PHYSICAL_BACKUP: indicates physical backup. |
| dataBackupMode | String | Yes | FULL_BACKUP | The data backup mode. Valid values: FULL_BACKUP: indicates full backup.INCREMENTAL_BACKUP: indicates incremental backup. |
| obBackupServiceStorageConfig | Obbackupservicestorageconfig | Yes | NA | The backup storage configuration. For more information, see Data structure of obBackupServiceStorageConfig. |
Data structure of obBackupServiceStorageConfig
| Parameter | Type | Required | Description |
|---|---|---|---|
| configName | String | Yes | The name of the storage configuration. |
| obBackupStorageBaseInfo | Object | Yes | The basic parameters of the storage configuration. |
| |--backupStorageType | String | Yes | The storage type. Valid values: BACKUP_STORAGE_FILE, BACKUP_STORAGE_OSS, BACKUP_STORAGE_COS, and BACKUP_STORAGE_S3. |
| |--storageUrl | String | Yes | The storage directory. Specify a directory without any protocol name, for example, /obbackup/ or osstest/backup. |
| |--ossAccessKey | Object | No | The information about Alibaba Cloud Object Storage Service (OSS). This parameter is valid only when backupStorageType is set to BACKUP_STORAGE_OSS. |
| |--endpoint | String | Yes | The domain name for access. |
| |--accessKeyId | String | Yes | The AccessKey ID. |
| |--accessKeySecret | String | Yes | The AccessKey secret. |
| |--cosAccessKey | Object | No | The information about Tencent Cloud Object Storage (COS). This parameter is valid only when backupStorageType is set to BACKUP_STORAGE_COS. |
| |--endpoint | String | Yes | The domain name for access. |
| |--accessKeyId | String | Yes | The AccessKey ID. |
| |--accessKeySecret | String | Yes | The AccessKey secret. |
| |--appId | String | Yes | The application ID. |
| |--s3AccessKey | Object | No | The information about Amazon Simple Storage Service (S3). This parameter is valid only when backupStorageType is set to BACKUP_STORAGE_S3. |
| |--endpoint | String | Yes | The domain name for access. |
| |--accessKeyId | String | Yes | The AccessKey ID. |
| |--accessKeySecret | String | Yes | The AccessKey secret. |
| |--region | String | Yes | The region. |
| |--alarmStoragePercentageThreshold | Long | Yes | The threshold for backup storage capacity alerts. Set this parameter to a percentage value. |
| storageId | Long | No | The ID of the storage configuration. |
| serviceType | String | No | The service type. Valid values: BACKUP_RESTORE_SERVICE: indicates the backup and restore service (logical backup and restore).OB_CLUSTER: indicates physical backup and restore for OceanBase clusters.OTHERS: indicates other services. |
| serviceId | Long | No | The service ID. |
| serviceName | String | No | The service name. |
| hostIdList | Array | No | The list of host IDs for host resolution in global restore. |
Response parameters
Basic data structure
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information of BackupCommonResponse. For more information, see Data structure of BackupCommonResponse. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The amount of time taken by the server to process the request, in milliseconds. |
| status | Integer | The HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Data structure of BackupCommonResponse
| Parameter | Type | Description |
|---|---|---|
| obBackupTaskType | String | The type of the backup operation, for example, "CREATE_BACKUP_STRATEGY". |
| backupObjectOpsResultList | Array | The operation result set of the backup object. |
| |--obBackupObjectList | Array | The list of backup objects. |
| |--clusterId | Long | The cluster ID. |
| |--tenantId | Long | The tenant ID. |
| |--backupDimension | String | The backup dimension. For example, CLUSTER indicates cluster backup and TENANT indicates tenant backup. |
| |--beSuccessful | Boolean | Indicates whether the operation was successful. |
| |--taskIdList | Array | The list of task IDs, which is returned only for asynchronous tasks. |
| |--errorCode | Object | The error code. |
| |--hint | String | The prompt information. |
Examples
Sample request
POST /api/v2/ob/clusters/1000005/tenants/1000012/backup/backupNow
{
"obBackupObject": {
"clusterId": 1000005,
"tenantId": 1000012,
"backupDimension": "TENANT"
},
"dataBackupMode": "FULL_BACKUP",
"backupMode": "PHYSICAL_BACKUP",
"obBackupServiceStorageConfig": {
"alarmStoragePercentageThreshold": 95,
"configName": "ycnfs223_0915",
"obBackupStorageBaseInfo": {
"backupStorageType": "BACKUP_STORAGE_FILE",
"storageUrl": "/obbackup/"
},
"serviceName": "ycfor223",
"storageId": 26
}
}
Sample response
{
"data": {
"backupObjectOpsResultList": [
{
"beSuccessful": true,
"obBackupObjectList": [
{
"backupDimension": "TENANT",
"clusterId": 1000005,
"tenantId": 1000012
}
],
"taskIdList": [
3000041
]
}
],
"obBackupTaskType": "DATA_BACKUP_NOW"
},
"duration": 51,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2024-08-07T14:51:41.135+08:00",
"traceId": "5962f337662d4043"
}