更新时间:2024-03-12 GMT+08:00
分享

查询跨区域备份列表

功能介绍

在备份目标区域获取实例的跨区域备份列表。

调试

您可以在API Explorer中调试该接口。

接口约束

RDS for SQL Server支持查询备份类型为自动全量备份、手动备份、自动增量备份的备份列表。

URI

  • URI格式

    GET /v3/{project_id}/offsite-backups?instance_id={instance_id}&backup_id={backup_id}&backup_type={backup_type}&offset={offset}&limit={limit}&begin_time={begin _time}&end_time={end_time}

  • 参数说明
    表1 参数说明

    名称

    是否必选

    说明

    project_id

    租户在某一Region下的项目ID。

    获取方法请参见获取项目ID

    instance_id

    实例ID。

    backup_type

    备份类型,取值如下:

    • auto:自动全量备份和手动备份。仅RDS for SQL Server支持跨区域备份的手动备份类型。
    • incremental:自动增量备份。

    backup_id

    备份ID。

    offset

    索引位置,偏移量。从第一条数据偏移offset条数据后开始查询,默认为0(偏移0条数据,表示从第一条数据开始查询),必须为数字,不能为负数。

    limit

    查询记录数。默认为100,不能为负数,最小值为1,最大值为100。

    begin_time

    查询开始时间,格式为“yyyy-mm-ddThh:mm:ssZ”。

    其中,T指某个时间的开始;Z指时区偏移量,例如北京时间偏移显示为+0800。

    说明:

    “begin_time”有值时,“end_time”必选。

    end_time

    查询结束时间,格式为“yyyy-mm-ddThh:mm:ssZ”,且大于查询开始时间。

    其中,T指某个时间的开始;Z指时区偏移量,例如北京时间偏移显示为+0800。

    说明:

    “end_time”有值时,“begin_time”必选。

请求消息

  • 请求参数

    无。

  • URI样例

    GET https://{endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/offsite-backups?instance_id=43e4feaab48f11e89039fa163ebaa7e4br01&backup_id=c0c9f155c7b7423a9d30f0175998b63bbr01&backup_type=auto&offset=0&limit=10&begin_time=2018-08-06T10:41:14+0800&end_time=2018-08-16T10:41:14+0800

响应消息

  • 正常响应要素说明
    表2 要素说明

    名称

    参数类型

    说明

    backups

    Array of objects

    备份列表。

    详情请参见表3

    total_count

    Integer

    总记录数。

    表3 backups字段数据结构说明

    名称

    参数类型

    说明

    id

    String

    备份ID。

    name

    String

    备份名称。

    type

    String

    备份类型。

    取值如下:

    • auto:自动全量备份和手动备份。仅RDS for SQL Server支持跨区域备份的手动备份类型。
    • incremental:自动增量备份。

    size

    Long

    备份大小(单位:KB)。

    status

    String

    备份状态,取值如下:

    • BUILDING: 备份中。
    • COMPLETED: 备份完成。
    • FAILED:备份失败。
    • DELETING:备份删除中。

    databases

    Array of objects

    用户自建库,仅RDS for SQL Server返回该字段。

    详情请参见表4

    begin_time

    String

    备份开始时间,格式为“yyyy-mm-ddThh:mm:ssZ”。

    其中,T指某个时间的开始;Z指时区偏移量,例如北京时间偏移显示为+0800。

    end_time

    String

    备份结束时间。

    • 全量备份类型下,指备份结束时间。
    • RDS for MySQL增量备份类型,指备份文件中最后一个事务的提交时间。

    格式为“yyyy-mm-ddThh:mm:ssZ”,其中,T指某个时间的开始;Z指时区偏移量,例如北京时间偏移显示为+0800。

    datastore

    Object

    数据库版本信息。

    详情请参见表5

    instance_id

    String

    备份所在实例ID。

    associated_with_ddm

    Boolean

    是否关联DDM标志。仅RDS for MySQL返回该字段。

    表4 databases字段数据结构说明

    名称

    参数类型

    说明

    name

    String

    用户自建数据库名。

    表5 datastore字段数据结构说明

    名称

    参数类型

    说明

    type

    String

    数据库引擎,当前仅支持MySQL引擎和SQL Server引擎。

    version

    String

    数据库版本。

  • 正常响应样例

    MySQL:

    {
    	"backups": [{
    		"id": "43e4feaab48f11e89039fa163ebaa7e4br01",
    		"name": "xxxx.xxx",
    		"type": "auto",
    		"size": 2803,
    		"status": "COMPLETED",
    		"begin_time": "2018-08-06T12:41:14+0800",
    		"end_time": "2018-08-06T12:43:14+0800",
    		"datastore": {
    			"type": "MySQL",
    			"version": "5.6"
    		},
    		"instance_id": "a48e43ff268f4c0e879652d65e63d0fbin01",
                    "associated_with_ddm": false
    	}],
    	"total_count": 1
    }

    PostgreSQL:

    {
    	"backups": [{
    		"id": "43e4feaab48f11e89039fa163ebaa7e4br01",
    		"name": "xxxx.xxx",
    		"type": "auto",
    		"size": 2803,
    		"status": "COMPLETED",
    		"begin_time": "2018-08-06T12:41:14+0800",
    		"end_time": "2018-08-06T12:43:14+0800",
    		"datastore": {
    			"type": "PostgreSQL",
    			"version": "9.6"
    		},
    		"instance_id": "a48e43ff268f4c0e879652d65e63d0fbin01"
    	}],
    	"total_count": 1
    }
    SQL Server:
    {
        "backups": [
            {
                "id": "d0ea632a5c32451dbdb157ef5c2ad3ecbr04", 
                "name": "sqlserver-rds-1784-20221202062025775", 
                "type": "auto", 
                "size": 5956, 
                "status": "COMPLETED", 
                "begin_time": "2022-12-02T06:20:25+0000", 
                "end_time": "2022-12-02T06:24:45+0000", 
                "datastore": {
                    "type": "sqlserver", 
                    "version": "2019_SE"
                }, 
                "instance_id": "ad4ee2b80adb430082d8336d7da2e14din04"
            }, 
            {
                "id": "07d6a8ab12304f9aa3f368a6cff21ac9br04", 
                "name": "backup-81f1", 
                "type": "auto", 
                "size": 773, 
                "status": "COMPLETED", 
                "begin_time": "2022-12-02T06:12:22+0000", 
                "end_time": "2022-12-02T06:16:37+0000", 
                "datastore": {
                    "type": "sqlserver", 
                    "version": "2019_SE"
                }, 
                "instance_id": "ad4ee2b80adb430082d8336d7da2e14din04"
            }
        ], 
        "total_count": 2
    }
  • 异常响应

    请参见异常请求结果

状态码

错误码

请参见错误码

分享:

    相关文档

    相关产品