Querying a Backup List
Function
This API is used to query a backup list according to search criteria.
- Learn how to authenticate this API before using it.
- Before calling this API, obtain the required region and endpoint.
URI
- URI format
GET https://{Endpoint}/mysql/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}
- Example
GET https://{Endpoint}/mysql/v3/97b026aa9cc4417888c14c84a1ad9860/backups?instance_id=43e4feaab48f11e89039fa163ebaa7e4br01&backup_id=c0c9f155c7b7423a9d30f0175998b63bbr01&backup_type=auto&offset=0&limit=10&begin_time=2020-07-06T10:41:14+0800&end_time=2020-07-16T10:41:14+0800
- Parameter description
Table 1 Parameter description Name
Type
Mandatory
Description
project_id
String
Yes
Project ID of a tenant in a region.
To obtain this value, see Obtaining a Project ID.
instance_id
String
No
DB instance ID.
backup_id
String
No
Backup ID.
backup_type
String
No
Backup type. Value:
- auto: automated full backup
- manual: manual full backup
offset
String
No
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 cannot be a negative number.
limit
String
No
Number of records 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
String
No
Query start time. 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. For example, in the Beijing time zone, the time zone offset is shown as +0800.
end_time
Integer
No
Query end time. The format 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.
Request
None
Response
- Normal response
Table 2 Parameter description Name
Type
Description
backups
Array of objects
Backup information.
For details, see Table 3.
total_count
Integer
Total number of records.
Table 3 backups field data structure description Name
Type
Description
id
String
Backup ID.
name
String
Backup name.
begin_time
String
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
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.
status
String
Backup status. Value:
- BUILDING: Backup in progress
- COMPLETED: Backup completed
- FAILED: Backup failed
- AVAILABLE: Backup available
take_up_time
Integer
Backup duration in minutes.
type
String
Backup type. Value:
- auto: automated full backup
- manual: manual full backup
size
Double
Backup size in MB.
datastore
Object
Database information.
For details, see Table 4.
instance_id
String
DB instance ID.
backup_level
String
Backup level. This parameter is returned when the level-1 backup function is enabled. Value:
- 1: level-1 backup
- 2: level-2 backup
- 0: Backup being created or creation failed
- Example normal response
{ "backups": [{ "id": "1fe4feaab48f11e6654hfa163eba87e4b66u", "name": "GaussDBforMySQL-gauss-e747-20200705185048266", "begin_time": "2018-08-06T12:41:14+0800", "end_time": "2018-08-06T12:45:14+0800", "take_up_time": 2, "status": "COMPLETED", "type": "auto", "size": 2803, "datastore": { "type": "gaussdb-mysql", "version": "8.0" }, "instance_id": "43e4feaab48f11e89039fa163ebaa7e4br01", "backup_level": "2" }], "total_count": 1 }
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
Last Article: Creating a Manual Backup
Next Article: Querying an Automated Backup Policy
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.