• Relational Database Service

rds
  1. Help Center
  2. Relational Database Service
  3. API Reference
  4. API v3 (Recommended)
  5. Backup and Restoration
  6. Obtaining a Backup List

Obtaining a Backup List

Function

This API is used to obtain a backup list.

URI

  • URI format

    PATH: /{version_id}/{project_id}/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}

    Method: GET

  • Parameter description
    Table 1 Parameter description

    Name

    Mandatory

    Description

    version_id

    Yes

    Specifies the API version. It is case-sensitive and the value is v3.

    project_id

    Yes

    Specifies the project ID of a tenant in a region.

    instance_id

    Yes

    Specifies the DB instance ID.

    backup_id

    No

    Specifies the backup ID.

    backup_type

    No

    Specifies the backup type. Value:

    • auto: automated full backup
    • manual: manual full backup
    • fragment: differential full backup
    • incremental: automated incremental backup

    offset

    No

    Specifies the index position. If offset is set to N, the resource query starts from the N+1 piece of data. The value is 0 by default, indicating that the query starts from the first piece of data. The value must be a positive number.

    limit

    No

    Specifies the number of resources to be queried. The default value is 100. The value cannot be a negative number. The minimum value is 1 and the maximum value is 100.

    begin_time

    No

    Specifies the start time for obtaining the backup list. The format of the start time is "yyyy-mm-ddThh:mm:ssZ".

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.

    NOTE:

    When end_time is not empty, begin_time is mandatory.

    end_time

    No

    Specifies the end time for obtaining the backup list. The format of the end time is "yyyy-mm-ddThh:mm:ssZ" and the end time must be later than the start time.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.

    NOTE:

    When begin_time is not empty, end_time is mandatory.

  • Restrictions

    This API is used to query full backups of MySQL, PostgreSQL, and Microsoft SQL Server databases and incremental backups of MySQL databases.

Example

  • MySQL

    GET /v3/97b026aa9cc4417888c14c84a1ad9860 /backups?instance_id=43e4feaab48f11e89039fa163ebaa7e4br01&offset=0&limit=10&begin_time=2018-08-06T10:41:14+0800&end_time=2018-08-16T10:41:14+0800

  • PostgreSQL

    GET /v3/97b026aa9cc4417888c14c84a1ad9860 /backups?instance_id=43e4feaab48f11e89039fa163ebaa7e4br03&offset=0&limit=10&begin_time=2018-08-06T10:41:14+0800&end_time=2018-08-16T10:41:14+0800

  • Microsoft SQL Server

    GET /v3/97b026aa9cc4417888c14c84a1ad9860 /backups?instance_id=43e4feaab48f11e89039fa163ebaa7e4br04&offset=0&limit=10&begin_time=2018-08-06T10:41:14+0800&end_time=2018-08-16T10:41:14+0800

Request

N/A

Normal Response

  • Parameter description
    Table 2 Parameter description

    Name

    Type

    Description

    backups

    List data structure

    Indicates the backup list.

    For details, see Table 3.

    total_count

    int

    Indicates the total number of records.

    Table 3 backups field data structure description

    Name

    Type

    Description

    id

    String

    Indicates the backup ID.

    name

    String

    Indicates the backup name.

    type

    String

    Indicates the backup type. Value:

    • auto: automated full backup
    • manual: manual full backup
    • fragment: differential full backup
    • incremental: automated incremental backup

    size

    Long

    Indicates the backup size in KB.

    status

    String

    Indicates the backup status. Value:

    • BUILDING: Backup in progress
    • COMPLETED: Backup completed
    • FAILED: Backup failed
    • DELETING: Backup being deleted

    begin_time

    String

    Indicates the backup start time in the "yyyy-mm-ddThh:mm:ssZ" format.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.

    end_time

    String

    Indicates the backup end time in the "yyyy-mm-ddThh:mm:ssZ" format.

    T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, in the Beijing time zone, the time zone offset is shown as +0800.

    datastore

    Dictionary data structure

    Indicates the database version.

    For details, see Table 4.

    databases

    List data structure

    Indicates a list of self-built Microsoft SQL Server databases that support partial backups.

    For details, see Table 5.

    instance_id

    String

    Indicates the ID of the DB instance for which the backup is created.

    Table 4 datastore field data structure description

    Name

    Type

    Description

    type

    String

    Indicates the DB engine. Currently, MySQL, PostgreSQL, and Microsoft SQL Server are supported.

    The value is MySQL, PostgreSQL, or SQLServer.

    version

    String

    Indicates the database version.

    Table 5 databases field data structure description

    Name

    Type

    Description

    name

    String

    Indicates the name of the self-built database.

  • Response example

    Obtaining a backup list of a MySQL DB instance:

    {
    	"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"
    	}],
    	"total_count": 1
    }

    Obtaining a backup list of a PostgreSQL DB instance:

    {
    	"backups": [{
    		"id": "43e4feaab48f11e89039fa163ebaa7e4br03",
    		"name": "xxxx.xxx",
    		"type": "incremental",
    		"size": 2803,
    		"status": "COMPLETED",
    		"begin_time": "2018 - 08 - 06 T12: 41: 14 + 0800",
    		"end_time": "2018 - 08 - 06 T12: 43: 14 + 0800",
    		"datastore": {
    			"type": "PostgreSQL",
    			"version": "9.6"
    		},
    		"instance_id": "a48e43ff268f4c0e879652d65e63d0fbin03 "
    	}],
    	"total_count": 1
    }

    Obtaining a backup list of a Microsoft SQL Server DB instance:

    {
    	"backups": [{
    		"id ": "43e4feaab48f11e89039fa163ebaa7e4br04",
    		"name": "xxxx.xxx",
    		"type": "manual",
    		"size": 2803,
    		"status": "COMPLETED",
    		"begin_time": "2018-08-06T12:41:14+0800",
    		"end_time": "2018-08-06T12:43:14+0800",
    		"datastore": {
    			"type": "SQLServer",
    			"version": "2014_WEB"
    		},
    		"databases": [{
    			"name": "user01"
    		}, {
    			"name": "user02"
    		}],
    		"instance_id": "a48e43ff268f4c0e879652d65e63d0fbin04"
    	}],
    	"total_count": 1
    }

Abnormal Response

For details, see Abnormal Request Results.