This topic describes how to initiate a cluster-level backup through 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 | If set to true, the system will also back up the archived logs during the data backup. After the backup is completed, a complete dataset containing the data and archived logs will be generated in the backup directory. This dataset is restorable without relying on the archived logs, and can be used to restore the tenant data to the min_restore_scn. |
| encryption | string | No | "pwd" | The password for the backup set. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Indicates whether the request is successful. |
| timestamp | time.Time | The timestamp when the server completes 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 | The asynchronous task information. For more information, see the Data structure of the DagDetailDTO parameter section. |
| error | ApiError | The error information returned by the request, which contains the following fields:
|
The data structure of the DagDetailDTO parameter is as follows:
| Parameter | Type | Description |
|---|---|---|
| id | string | The common 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 execution stages 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 | The information of all nodes in the DAG. For more information, see Get node details. |
Examples
Request example
POST 10.10.10.1:2886/api/v1/obcluster/backup
{
"mode":"full",
}
Response example
{
"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",
"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 APIs through SDK methods in addition to using the CLI.
For more information about how to initiate a cluster-level backup through the obshell-sdk-python, see Initiate a cluster-level backup.
For more information about how to initiate a cluster-level backup through the obshell-sdk-go, see Initiate a cluster-level backup.