This topic describes how to view tenant recovery through the API.
Call parameters
Constraints
If you set a password, you must authenticate. For more information, see API hybrid encryption.
Request path
GET /api/v1/tenant/:name/restore/overview
Return result
| Parameter | Type | Description |
|---|---|---|
| successful | bool | Specifies whether the request is successful. |
| timestamp | time.Time | The timestamp when the server processed the request. |
| duration | int | The time (in milliseconds) that the server took to process the request. |
| status | int | The HTTP status code. |
| traceId | string | The Trace ID of the request. |
| data | RestoreOverview | The details of the recovery task. For more information, see Data structure of RestoreOverview. |
| error | ApiError | The error generated by the request. It contains the following information:
|
The data structure of RestoreOverview is as follows:
| Parameter | Type | Description |
|---|---|---|
| tenant_id | int | The ID of the tenant that executes the recovery task. |
| job_id | int | The job ID of the recovery task. |
| restore_tenant_name | string | The name of the tenant to be restored. |
| restore_tenant_id | int | The ID of the tenant to be restored. |
| backup_tenant_name | string | The name of the source tenant for backup. |
| backup_tenant_id | int | The ID of the source tenant for backup. |
| backup_cluster_name | string | The name of the source cluster for backup. |
| backup_dest | string | The path for storing data backups and log archives, which is specified by the user. |
| restore_option | string | The recovery option. |
| restore_scn | int | The SCN specified by the user for recovery. |
| restore_scn_display | string | The timestamp of the specified SCN for recovery. |
| status | string | The recovery status. |
| start_timestamp | time.time | The timestamp when the recovery task started. |
| backup_set_list | string | The list of data backup set paths on which the recovery task depends. |
| backup_piece_list | string | The list of log archive piece paths on which the recovery task depends. |
| tablet_count | int | The total number of tablets to be restored. |
| total_bytes | int | The total number of bytes to be restored. |
| description | string | The description. |
| finish_tablet_count | int | The total number of completed tablets. |
| finish_bytes | int | The total number of completed bytes. |
| finish_bytes_display | string | The completed number of bytes, in storage capacity units. |
| total_bytes_display | string | The total number of bytes to be restored, in storage capacity units. |
| recover_scn | int | The log recovery SCN. |
| recover_scn_display | time.time | The timestamp of the log recovery SCN. |
| recover_progress | DECIMAL(6, 2) | The log recovery progress. |
| restore_progress | DECIMAL(6, 2) | The data recovery progress. |
| backup_cluster_version | int | The version number of the source cluster for backup. |
| ls_count | int | The total number of log streams to be restored. |
| finish_ls_count | int | The total number of completed log streams. |
| comment | string | The failure information when the recovery fails. |
| finish_timestamp | time.time | The timestamp when the recovery task ended. |
Examples
Request example
GET 10.10.10.1:2886/api/v1/tenant/rt2/restore/overview
Return example
{
"successful": true,
"timestamp": "2024-10-14T15:36:51.770834417+08:00",
"duration": 36,
"status": 200,
"traceId": "764a05909590ef9e",
"data": {
"tenant_id": 1,
"job_id": 1,
"restore_tenant_name": "rt2",
"restore_tenant_id": 1006,
"backup_tenant_name": "tenant1",
"backup_tenant_id": 1002,
"backup_cluster_name": "ob-test",
"restore_option": "pool_list=rt2_zone1_1728890715815&locality=FULL@zone1&primary_zone=RANDOM",
"restore_scn": 1728890608464651300,
"restore_scn_display": "2024-10-14T15:23:28.464651+08:00",
"status": "SUCCESS",
"start_timestamp": "2024-10-14T15:25:18.092782+08:00",
"backup_set_list": "oss://oss-328067-1014-obshell/backup/archive/test/1/1002/data/backup_set_2_full?host=oss-cn-hangzhou.aliyuncs.com",
"backup_piece_list": "oss://oss-328067-1014-obshell/backup/archive/test/1/1002/clog/piece_d1001r2p2?host=oss-cn-hangzhou.aliyuncs.com",
"tablet_count": 590,
"finish_tablet_count": 590,
"total_bytes": 18622071,
"total_bytes_display": "17.76MB",
"finish_bytes": 0,
"finish_bytes_display": "0.00MB",
"description": "",
"recover_scn": 0,
"recover_scn_display": "",
"recover_progress": "",
"restore_progress": "",
"backup_cluster_version": 17180000519,
"ls_count": 2,
"finish_ls_count": 0,
"comment": "",
"finish_timestamp": "2024-10-14T15:28:34.519092+08:00"
}
}
References
You can also call API methods through SDKs.
For more information about how to call API methods through the obshell-sdk-python, see View tenant recovery.
For more information about how to call API methods through the obshell-sdk-go, see View tenant recovery.