Description
You can call this operation to query the recovery tasks of a cluster.
Call description
Prerequisites
You have the Read-only permission on cluster backup and recovery.
You have passed the authentication for the OCP application service.
Request path
GET /api/v2/ob/clusters/{id}/backup/task/restoreTasks
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| id | Long | Yes | 1 | The ID of the cluster. |
| startTime | OffsetDateTime | No | 2021-09-16T15:14:51.397+08:00 | The start time of the period. |
| endTime | OffsetDateTime | No | 2021-09-16T15:20:51.397+08:00 | The end time of the period. |
| page | Long | Yes | 1 | The page number of the content to be queried. |
| size | Long | Yes | 10 | The number of records on each page. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Object | The requested data. |
| ├─ contents | Array | The RestoreHistoryTask array. For more information about the data structure, see Data structure of RestoreHistoryTask . |
| ├─ page | Object | The page information. |
| ├─ totalElements | Integer | The total number of records. |
| ├─ totalPage | Integer | The total number of pages. |
| ├─ number | Integer | The number of the current page. |
| ├─ size | Integer | The size of the current page. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An 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 RestoreHistoryTask
| Parameter | Type | Description |
|---|---|---|
| id | Long | The ID of the recovery task. |
| ocpJobId | Long | The external ID of the recovery task generated by OCP. This ID is greater than 0 if the task is a physical recovery one. |
| backupMode | String | The recovery mode. Valid values: * LOGICAL_BACKUP * PHYSICAL_BACKUP Here, LOGICAL_BACKUP indicates logical recovery and PHYSICAL_BACKUP indicates physical recovery. |
| createTime | Timestamp | The creation time. |
| finishTime | Timestamp | The completion time. |
| backupClusterId | Long | The ID of the backed-up cluster. |
| backupClusterName | String | The name of the backed-up cluster. |
| backupObClusterId | Long | The ID of the backed-up OceanBase cluster. |
| backupObTenantId | Long | The ID of the backed-up OceanBase Database tenant. |
| backupTenantId | Long | The ID of the backed-up tenant. |
| backupTenantName | String | The name of the backed-up tenant. |
| restoreClusterName | String | The name of the recovered cluster. |
| restoreObClusterId | Long | The ID of the recovered OceanBase cluster. |
| restoreClusterId | Long | The ID of the recovered cluster. |
| restoreTenantName | String | The name of the recovered tenant. |
| restorePoolListStr | String | The list of resource pools for recovery. Separate multiple resource pools with a comma (,). |
| restoreUri | String | The backup directory. |
| restoreEndTime | Timestamp | The recovery time. |
| status | String | The recovery status. |
| errorMsg | String | The error message. |
Examples
Sample request
GET api/v2/ob/clusters/1000005/backup/task/restoreTasks?page=1&size=10
Sample response
{
"data": {
"contents": [
{
"backupClusterId": 1000005,
"backupClusterName": "yc0820_17",
"backupMode": "PHYSICAL_BACKUP",
"backupObClusterId": 5,
"backupObTenantId": 1001,
"backupTenantId": 1000012,
"backupTenantName": "yctest",
"createTime": "2021-09-09T18:32:18.833+0800",
"errorMsg": "CLOG : OB_ENTRY_NOT_EXIST(-4018) on \"xxx.xxx.xxx.xxx:2882\" with traceid YB42AC1E55AC-0005CB53B2946DFF",
"finishTime": "2021-09-09T18:32:20.066+0800",
"finished": true,
"id": 4,
"ocpJobId": -1,
"restoreClusterId": 1000005,
"restoreClusterName": "yc0820_17",
"restoreEndTime": "2021-09-09T17:19:00.000+0800",
"restoreObClusterId": 5,
"restorePoolListStr": "pool_restoretest_zone1_oqy",
"restoreTenantName": "restoretest",
"restoreUri": "file:///obbackup/backup_backup2",
"status": "RESTORE_FAIL",
"statusDesc": "Failed",
"successful": false
},
{
"backupClusterId": 1000005,
"backupClusterName": "yc0820_17",
"backupMode": "PHYSICAL_BACKUP",
"backupObClusterId": 5,
"backupObTenantId": 1001,
"backupTenantId": 1000012,
"backupTenantName": "yctest",
"createTime": "2021-08-31T14:17:23.808+0800",
"errorMsg": "",
"finishTime": "2021-08-31T14:18:42.265+0800",
"finished": true,
"id": 1,
"ocpJobId": -1,
"restoreClusterId": 1000005,
"restoreClusterName": "yc0820_17",
"restoreEndTime": "2021-08-31T10:00:00.000+0800",
"restoreObClusterId": 5,
"restorePoolListStr": "pool_ycrestore_zone1_gmb",
"restoreTenantName": "ycrestore",
"restoreUri": "file:///obbackup/",
"status": "RESTORE_SUCCESS",
"statusDesc": "Completed",
"successful": true
}
],
"page": {
"number": 1,
"size": 2,
"totalElements": 2,
"totalPages": 1
}
},
"duration": 90,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-23T14:49:34.885+08:00",
"traceId": "63620e1f4273439a"
}