Overview
You can call this API to create a physical backup or a logical backup task at the database or table level.
Considerations
- Table-level backup (backupObjectType=table)
- You can select only one database.
- You must specify the tables to be backed up, with a maximum of 200 tables.
- Database-level backup (backupObjectType=database)
- You can select multiple databases.
- All tables under the selected databases are automatically backed up, with a total of no more than 200 tables across all databases.
- The tables field is not required in the databaseTables parameter.
API details
Constraints
The caller must have an AccessKey for accessing the multi-cloud API. For information about how to obtain the AccessKey ID and AccessKey secret, see Manage AccessKeys.
Request path
POST /api/v2/instances/{instanceId}/backup/data/start
Physical backup
Logical backup
Request parameters
Path
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the OceanBase cluster. | obcluster-***** |
Query
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| requestId | String | Yes | The request ID, used for tracking. | dc302d76-66b5-48d8-ab53-a035******** |
Body
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| needPreCheck | Boolean | No | Specifies whether to perform a precheck. | true |
| backupObjectType | String | Yes | The type of the backup object. | tenant |
| backupPolicy | String | Yes | The backup policy. | manual |
| tenantId | String | No | The ID of the tenant. | txxx |
| uid | String | No | The ID of the user. | - |
| callerUid | String | No | The ID of the caller. | - |
| projectId | String | No | The ID of the project. | - |
Response parameters
| Parameter | Type | Description | Example value |
|---|---|---|---|
| backupTaskId | String | The ID of the backup task. | bak-******** |
Examples
Request example
curl --digest -u '<Your ak:sk>' \
-X POST \
'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/backup/data/start?requestId={requestId}' \
-H "Content-Type: application/json" \
--data '{
"needPreCheck": true,
"backupObjectType": "tenant",
"backupPolicy": "manual",
"tenantId": "txxx"
}'
Response example
JSON format
{
"data":{"backupTaskId":"bak-********"},
"requestId":"7f6dba83-871a-4ff2-966d-c69f885ae559",
"success":true
}
Request parameters
Path
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| instanceId | String | Yes | The ID of the OceanBase cluster. | obcluster-***** |
Query
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| requestId | String | Yes | The request ID, used for tracking. | dc302d76-66b5-48d8-ab53-a035******** |
Body
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| backupObjectType | String | Yes | The type of the backup object. Valid values:
|
database |
| tenantId | String | Yes | The ID of the tenant. | txxx |
| databaseTables | String | Yes | The array of database and table information, in JSON string format. | - |
| uid | String | No | The ID of the user. | - |
| callerUid | String | No | The ID of the caller. | - |
| projectId | String | No | The ID of the project. | - |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| success | Boolean | Indicates whether the request was successful. |
| data | Object | The returned data. |
| requestId | String | The request ID. |
Examples
Request example
Example 1: Table-level backup
curl --location 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/backup/data/start?requestId={requestId}' \
--digest -u '<Your ak:sk>' \
--header 'Content-Type: application/json' \
--data '{
"backupObjectType": "table",
"tenantId": "txxx",
"databaseTables": "[{\"database\": \"database1\", \"tables\": [\"test1\", \"test2\", \"test3\"]}]"
}'
Example 2: Database-level backup (multiple databases)
curl --location 'https://api-cloud.oceanbase.com/api/v2/instances/{instanceId}/backup/data/start?requestId={requestId}' \
--digest -u '<Your ak:sk>' \
--header 'Content-Type: application/json' \
--data '{
"backupObjectType": "database",
"tenantId": "txxx",
"databaseTables": "[{\"database\": \"database1\"}, {\"database\": \"database2\"}]"
}'
Response example
JSON format
{
"success": true,
"data": {},
"requestId": "req-20260113-123456"
}
