Obtaining Backups
Function
This API is used to obtain backups of a DB instance.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about request header parameters.
Constraints
This API is used to query full and incremental backups of DB instances.
URI
- URI format
GET /v3/{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}
- Parameter description
Table 1 Parameters Parameter
Mandatory
Description
project_id
Yes
Definition
Project ID of a tenant in a region.
To obtain the value, see Obtaining a Project ID.
Constraints
N/A
Range
N/A
Default Value
N/A
instance_id
Yes
Definition
Instance ID.
Constraints
N/A
Range
N/A
Default Value
N/A
backup_id
No
Definition
Backup ID.
Constraints
N/A
Range
N/A
Default Value
N/A
backup_type
No
Definition
Backup type.
Constraints
N/A
Range
- auto: automated full backup
- manual: manual full backup
- fragment: differential full backup
- incremental: automated incremental backup (binlog backup for RDS for MySQL)
Default Value
N/A
status
No
Definition
Backup status. Only the statuses of RDS for SQL Server full backups can be filtered.
Constraints
N/A
Range
- BUILDING: backup in progress
- COMPLETED: backup completed
- FAILED: backup failed
Default Value
N/A
offset
No
Definition
Index offset.
Constraints
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 number but cannot be a negative number.
Range
An integer greater than or equal to 0
Default Value
0
limit
No
Definition
Number of records to be queried.
Constraints
The value cannot be a negative number.
Range
1–100
Default Value
100
begin_time
No
Definition
Query start time.
Constraints
When begin_time is not empty, end_time is mandatory.
Range
The value is 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.
Default Value
N/A
end_time
No
Definition
Query end time.
Constraints
When end_time is not empty, begin_time is mandatory.
Range
The value is in the "yyyy-mm-ddThh:mm:ssZ" format and must be later than the query start time.
T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset.
Default Value
N/A
Response
- Normal response
Table 2 Parameters Parameter
Type
Description
backups
Array of objects
Definition
Indicates the backup list.
For details, see Table 3.
total_count
Integer
Definition
Indicates the total number of records.
Range
N/A
Table 3 backups field data structure description Parameter
Type
Description
id
String
Definition
Indicates the backup ID.
Range
N/A
name
String
Definition
Indicates the backup name.
Range
N/A
type
String
Definition
Indicates the backup type.
Range
- auto: automated full backup
- manual: manual full backup
- fragment: differential full backup
- incremental: automated incremental backup (binlog backup for RDS for MySQL)
size
Long
Definition
Indicates the backup size in KB.
Range
N/A
status
String
Definition
Indicates the backup status.
Range
- BUILDING: backup in progress
- COMPLETED: backup completed
- FAILED: backup failed
- DELETING: backup being deleted
begin_time
String
Definition
Indicates the backup start time.
- For a full backup, it indicates the full backup start time.
- For an RDS for MySQL incremental backup, it indicates the time when the last transaction of the last incremental backup task is committed.
Range
The format 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.
end_time
String
Definition
Indicates the backup end time.
- For a full backup, it indicates the full backup end time.
- For an RDS for MySQL incremental backup, it indicates the time when the last transaction is committed.
Range
The format 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.
datastore
Object
Definition
Indicates the database version.
For details, see Table 4.
databases
Array of objects
Definition
Indicates a list of self-built Microsoft SQL Server databases that support partial backups.
For details, see Table 5.
instance_id
String
Definition
Indicates the ID of the DB instance for which the backup is created.
Range
N/A
associated_with_ddm
Boolean
Definition
Indicates whether this instance is associated with a DDM instance.
Range
- false: The instance is not associated with any DDM instance.
- true: The instance is associated with a DDM instance.
- Example normal response
Obtaining all backups of an RDS for MySQL 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.7" }, "instance_id": "a48e43ff268f4c0e879652d65e63d0fbin01", "associated_with_ddm": false }], "total_count": 1 }Obtaining all backups of an RDS for PostgreSQL instance:
{ "backups": [{ "id": "43e4feaab48f11e89039fa163ebaa7e4br03", "name": "xxxx.xxx", "type": "incremental", "size": 2803, "status": "COMPLETED", "begin_time": "2018-08-06T12:41:14+0800", "end_time": "2018-08-06T12:43:14+0800", "datastore": { "type": "PostgreSQL", "version": "1" }, "instance_id": "a48e43ff268f4c0e879652d65e63d0fbin03 ", "associated_with_ddm": false }], "total_count": 1 }Obtaining all backups of an RDS for SQL Server 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", "associated_with_ddm": false }], "total_count": 1 } - Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.