首批通过分布式安全可靠测评,为关键业务系统打造
解析集群备份信息
更新时间:2023-08-10 11:45:58
功能说明
该接口用于解析集群的备份信息。
调用说明
接口约束
调用者需至少具备对该集群备份恢复的只读权限。
调用者需要通过 OCP 应用服务鉴权。
请求路径
GET /api/v2/ob/clusters/{id}/backup/info
请求参数
| 参数 | 类型 | 必选 | 示例值 | 描述 |
|---|---|---|---|---|
| id | Integer | 是 | 1001 | 需解析备份信息的集群 ID。 |
| startTime | OffsetDateTime | 否 | 2021-09-16T15:14:51.397+08:00 | 解析的开始时间。 |
| endTime | OffsetDateTime | 否 | 2021-09-16T15:20:51.397+08:00 | 解析的结束时间。 |
返回结果
| 参数 | 类型 | 说明 |
|---|---|---|
| data | Object | ObClusterBackupInfo ,详情请参见 ObClusterBackupInfo 的数据结构 。 |
| successful | Boolean | 请求是否成功。 |
| timestamp | Datetime | 服务端完成请求的时间戳。 |
| duration | Integer | 服务端处理请求的时间(毫秒)。 |
| status | Integer | 符合 HTTP Status 规范的编码。 |
| traceId | String | 请求的 Trace Id,用于排查问题。 |
| server | String | 响应请求的应用服务的地址。 |
ObClusterBackupInfo 的数据结构
| 参数 | 类型 | 说明 |
|---|---|---|
| clusterName | String | 集群名。 |
| obClusterId | Long | OB 集群 ID。 |
| clusterId | Long | 集群 ID。 |
| online | Boolean | 是否在线。 |
| tenantBackupInfos | Array | 租户备份信息集,集合元素详见 ObTenantBackupInfo 的数据结构 。 |
| obRecoverableInfoAggregation | Object | 可恢复时间区间,是所有租户的最大合集。同tenantBackupInfos中的obRecoverableInfoAggregation。 |
ObTenantBackupInfo 的数据结构
| 参数 | 类型 | 说明 |
|---|---|---|
| clusterName | String | 集群名。 |
| obClusterId | Long | OB 集群 ID。 |
| clusterId | Long | 集群 ID。 |
| obTenantId | Long | OB 租户 ID。 |
| tenantId | Long | 租户 ID。 |
| tenantName | String | 租户名。 |
| online | Boolean | 是否在线。 |
| obRecoverableInfoAggregation | Object | 可恢复时间区间。 |
| |----latestSevenDaysAggregation | Object | 最近一定天数的可恢复数据的聚合集合,详情请参见 LatestSevenDaysAggregation 的数据结构 。 |
LatestSevenDaysAggregation 的数据结构
| 参数 | 类型 | 说明 |
|---|---|---|
| obRecoverableSectionItems | Array | 可恢复时间区间列表。 |
| |----obRecoverableSectionItemType | String | 可恢复时间区间中的结点类型,包括: * FULL_DATA_BACKUP * INCREMENTAL_DATA_BACKUP * LOG_BACKUP * RECOVERABLE |
| |----backupMode | String | 备份方式,逻辑备份或物理备份。 |
| |----dataBackupRecoverableInfo | Object | 数据备份的可恢复信息,只在结点类型是数据备份时有效。 |
| |----freezeTime | OffsetDateTime | 数据备份对应的冻结时间。 |
| |----recoverableTime | OffsetDateTime | 数据备份的可恢复时间。 |
| |----dataVersion | Long | 数据版本。 |
| |----fullBackupSetId | Long | 全量备份集 ID,用于标记物理备份中全量数据备份与增量数据备份的关系,ID 相同的全量备份与增量备份是对应的。 |
| |----logRecoverableTimeInterval | Object | 日志备份的时间区间,只在结点类型是日志备份区间时有效。 |
| |----startTime | OffsetDateTime | 起始时间。 |
| |----endTime | OffsetDateTime | 结束时间。 |
| |----logRecoverableTimeInterval | Object | 真正的可恢复时间区间,只在结点类型是可恢复时间区间时有效。 |
| |----startTime | OffsetDateTime | 起始时间。 |
| |----endTime | OffsetDateTime | 结束时间。 |
示例
请求示例
解析 ID 为 1 的集群备份信息。
GET /api/v2/ob/clusters/1/backup/info
返回示例
{
"data": {
"clusterId": 1000005,
"clusterName": "yc0820_17",
"obClusterId": 5,
"obRecoverableInfoAggregation": {
"latestSevenDaysAggregation": {
"obRecoverableSectionItems": [
{
"backupMode": "PHYSICAL_BACKUP",
"dataBackupRecoverableInfo": {
"dataVersion": 32,
"freezeTime": "2021-09-16T02:00:10.986847+08:00",
"fullBackupSetId": 23,
"recoverableTime": "2021-09-16T17:25:02.993613+08:00"
},
"obRecoverableSectionItemType": "FULL_DATA_BACKUP"
},
{
"backupMode": "PHYSICAL_BACKUP",
"logRecoverableTimeInterval": {
"endTime": "2021-09-23T15:13:20.657125+08:00",
"startTime": "2021-09-16T15:14:51.397+08:00"
},
"obRecoverableSectionItemType": "LOG_BACKUP"
},
{
"backupMode": "PHYSICAL_BACKUP",
"obRecoverableSectionItemType": "RECOVERABLE",
"realRecoverableTimeInterval": {
"endTime": "2021-09-23T15:13:20.657125+08:00",
"startTime": "2021-09-16T15:14:51.397+08:00"
}
}
]
},
"obQueryTimeScopeType": "LATEST_SEVEN_DAYS"
},
"online": true,
"tenantBackupInfos": [
{
"clusterId": 1000005,
"clusterName": "yc0820_17",
"obClusterId": 5,
"obRecoverableInfoAggregation": {
"latestSevenDaysAggregation": {
"obRecoverableSectionItems": [
{
"backupMode": "PHYSICAL_BACKUP",
"dataBackupRecoverableInfo": {
"dataVersion": 32,
"freezeTime": "2021-09-16T02:00:10.986847+08:00",
"fullBackupSetId": 23,
"recoverableTime": "2021-09-16T17:25:02.993613+08:00"
},
"obRecoverableSectionItemType": "FULL_DATA_BACKUP"
},
{
"backupMode": "PHYSICAL_BACKUP",
"logRecoverableTimeInterval": {
"endTime": "2021-09-23T15:13:17.654205+08:00",
"startTime": "2021-09-16T15:14:51.397+08:00"
},
"obRecoverableSectionItemType": "LOG_BACKUP"
},
{
"backupMode": "PHYSICAL_BACKUP",
"obRecoverableSectionItemType": "RECOVERABLE",
"realRecoverableTimeInterval": {
"endTime": "2021-09-23T15:13:17.654205+08:00",
"startTime": "2021-09-16T15:14:51.397+08:00"
}
}
]
},
"obQueryTimeScopeType": "LATEST_SEVEN_DAYS"
},
"obTenantId": 1002,
"online": true,
"tenantId": 2000004,
"tenantName": "ycrestore"
},
{
"clusterId": 1000005,
"clusterName": "yc0820_17",
"obClusterId": 5,
"obRecoverableInfoAggregation": {
"latestSevenDaysAggregation": {
"obRecoverableSectionItems": [
{
"backupMode": "PHYSICAL_BACKUP",
"dataBackupRecoverableInfo": {
"dataVersion": 32,
"freezeTime": "2021-09-16T02:00:10.986847+08:00",
"fullBackupSetId": 23,
"recoverableTime": "2021-09-16T17:25:02.993613+08:00"
},
"obRecoverableSectionItemType": "FULL_DATA_BACKUP"
},
{
"backupMode": "PHYSICAL_BACKUP",
"logRecoverableTimeInterval": {
"endTime": "2021-09-23T15:13:20.657125+08:00",
"startTime": "2021-09-16T15:14:51.397+08:00"
},
"obRecoverableSectionItemType": "LOG_BACKUP"
},
{
"backupMode": "PHYSICAL_BACKUP",
"obRecoverableSectionItemType": "RECOVERABLE",
"realRecoverableTimeInterval": {
"endTime": "2021-09-23T15:13:20.657125+08:00",
"startTime": "2021-09-16T15:14:51.397+08:00"
}
}
]
},
"obQueryTimeScopeType": "LATEST_SEVEN_DAYS"
},
"obTenantId": 1001,
"online": true,
"tenantId": 1000012,
"tenantName": "yctest"
}
]
},
"duration": 1085,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-23T15:14:52.48+08:00",
"traceId": "3c0d0f99f6d649ce"
}