Querying an Automated Backup Policy
Function
This API is used to query an automated backup policy. Before calling this API:
- Learn how to authenticate it.
- Obtain the required region and endpoint.
URI
- URI format
GET https://{endpoint}/mysql/v3/{project_id}/instances/{instance_id}/backups/policy
- Example
GET https://{endpoint}/mysql/v3/97b026aa9cc4417888c14c84a1ad9860/instances/c3ec2c6148ad4d71b1a8411a62df0d3cin07/backups/policy
- 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
Yes
DB instance ID.
Request
None
Response
- Normal response
Table 2 Parameter description Name
Type
Description
backup_policy
object
Backup policy information.
For details, see Table 3.
Table 3 backup_policy field data structure description Name
Type
Description
keep_days
Integer
Backup retention days. Value range: 1–732.
Minimum value: 1.
Maximum value: 732
start_time
String
Backup time window. Automated backups will be triggered during the backup time window.
The value must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.
period
String
Backup cycle configuration. Data will be automatically backed up on the selected days every week.
The value is a number separated by commas (,), indicating the days of the week.
retention_num_backup_level1
Integer
Number of retained level-1 backups. This parameter is returned when level-1 backup is enabled.
- Example normal response
{ "backup_policy": { "keep_days": 7, "start_time": "19:00-20:00", "period": "1,2", " retention_num_backup_level1": 1 } }
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.