This topic describes how to initiate a backup for a single tenant by using the API.
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| mode | string | No | "full" | The data backup mode. Valid values include full and incremental, indicating full backup and incremental backup, respectively. |
| plus_archive | bool | No | true | Specifies whether to back up archive logs during the data backup process. If this parameter is set to true, an archive log file will be generated in the final backup directory. The archive log file contains a complete data set that can be restored to the min_restore_scn point without relying on archive logs. |
| encryption | string | No | "pwd" | The password for the backup set. |
Request path
POST /api/v1/tenant/:name/backup
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| mode | string | No | "full" | The data backup mode. Valid values include full and incremental, indicating full backup and incremental backup, respectively. |
| plus_archive | bool | No | true | Specifies whether to back up archive logs during the data backup process. If this parameter is set to true, an archive log file will be generated in the final backup directory. The archive log file contains a complete data set that can be restored to the min_restore_scn point without relying on archive logs. |
| encryption | string | No | "pwd" | The password for the backup set. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Whether the request is successful. |
| timestamp | time.Time | The timestamp when the server received the request. |
| duration | int | The time (in milliseconds) required by the server to process the request. |
| status | int | The HTTP status code. |
| traceId | string | The trace ID of the request. |
| data | DagDetailDTO | Information about the asynchronous task. For more information, see the Data structure of DagDetailDTO section. |
| error | ApiError | The error generated by the request. It contains the following information:
|
The data structure of DagDetailDTO is as follows:
| Parameter | Type | Description |
|---|---|---|
| id | string | The general ID of the DAG. |
| dag_id | int | The ID of the DAG, which is the primary key in OceanBase Database. |
| name | string | The name of the DAG. |
| stage | int | The current execution stage of the DAG. |
| max_stage | int | The total number of stages in the execution process of the DAG. |
| state | string | The execution status of the DAG. |
| operator | string | The type of execution operation of the DAG. |
| start_time | time.Time | The start time of the DAG execution. |
| end_time | time.Time | The end time of the DAG execution. |
| additional_data | map[string]any | Other data of the DAG. |
| nodes | []NodeDetailDTO | Information about all nodes in the DAG. For more information, see Get node details. |
Examples
Sample request
POST 10.10.10.1:2886/api/v1/tenant/t1/backup
{
"mode":"full",
}
Sample response
{
"successful": true,
"timestamp": "2024-01-09T17:11:43.385889278+08:00",
"duration": 1,
"status": 200,
"traceId": "877fe32b83634153",
"data": {
"id": "22130706433028869",
"dag_id": 4,
"name": "Obcluster start full backup for t1",
"stage": 1,
"max_stage": 2,
"state": "READY",
"operator": "RUN",
"start_time": "2024-01-09T17:11:43.384630643+08:00",
"end_time": "2024-01-09T17:11:43.384630643+08:00",
"additional_data": null,
"nodes": null
}
}
References
You can also call the API by using the SDK.
For more information about how to call the API by using obshell-sdk-python, see Initiate a backup for a single tenant.
For more information about how to call the API by using obshell-sdk-go, see Initiate a backup for a single tenant.