首批通过分布式安全可靠测评,为关键业务系统打造
查询某一集群的恢复任务
更新时间:2023-08-10 11:45:58
功能说明
该接口用于查询某一集群的恢复任务。
调用说明
接口约束
调用者需至少具备对该集群备份恢复的只读权限。
调用者需要通过 OCP 应用服务鉴权。
请求路径
GET /api/v2/ob/clusters/{id}/backup/task/restoreTasks
请求参数
| 参数 | 类型 | 必选 | 示例值 | 描述 |
|---|---|---|---|---|
| id | Long | 是 | 1 | 集群ID |
| startTime | OffsetDateTime | 否 | 2021-09-16T15:14:51.397+08:00 | 时间范围的开始时间 |
| endTime | OffsetDateTime | 否 | 2021-09-16T15:20:51.397+08:00 | 时间范围的结束时间 |
| page | Long | 是 | 1 | 查询第几页的任务。 |
| size | Long | 是 | 10 | 每页显示任务条数。 |
返回结果
| 参数 | 类型 | 说明 |
|---|---|---|
| data | Object | 请求的数据。 |
| ├─ contents | Array | RestoreHistoryTask 的数组,详细数据结构见 RestoreHistoryTask 的数据结构 。 |
| ├─ page | Object | 分页信息。 |
| ├─ totalElements | Integer | 总记录数。 |
| ├─ totalPage | Integer | 总页数。 |
| ├─ number | Integer | 当前页码。 |
| ├─ size | Integer | 当前页大小。 |
| successful | Boolean | 请求是否成功。 |
| timestamp | Datetime | 服务端完成请求的时间戳。 |
| duration | Integer | 服务端处理请求的时间(毫秒)。 |
| status | Integer | 符合 HTTP Status 规范的编码。 |
| traceId | String | 请求的 Trace Id,用于排查问题。 |
| server | String | 响应请求的应用服务的地址。 |
RestoreHistoryTask 的数据结构
| 参数 | 类型 | 说明 |
|---|---|---|
| id | Long | 恢复任务 ID。 |
| ocpJobId | Long | 恢复任务外部编号,是由 OCP 下发的,只有抽检物理恢复任务时,此值大于 0。 |
| backupMode | String | 恢复模式,复用备份模式字段,包括逻辑恢复或物理恢复。 |
| createTime | Timestamp | 创建时间。 |
| finishTime | Timestamp | 完成时间。 |
| backupClusterId | Long | 备份集群 ID。 |
| backupClusterName | String | 备份集群名。 |
| backupObClusterId | Long | 备份集群 ID(OB 侧)。 |
| backupObTenantId | Long | 备份租户 ID(OB 侧)。 |
| backupTenantId | Long | 备份租户 ID。 |
| backupTenantName | String | 备份租户名。 |
| restoreClusterName | String | 恢复集群名。 |
| restoreObClusterId | Long | 恢复集群 ID (OB 侧)。 |
| restoreClusterId | Long | 恢复集群 ID。 |
| restoreTenantName | String | 恢复租户名。 |
| restorePoolListStr | String | 恢复资源池列表。多个资源池,以逗号隔开。 |
| restoreUri | String | 备份目录。 |
| restoreEndTime | Timestamp | 恢复时间。 |
| status | String | 恢复状态。 |
| errorMsg | String | 错误信息。 |
示例
请求示例
GET api/v2/ob/clusters/1000005/backup/task/restoreTasks?page=1&size=10
返回示例
{
"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": "失败",
"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": "已完成",
"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"
}