Querying Sparse Backup Policies
Function
This API is used to query sparse backup policies of a DB instance.
- Before calling this API, learn how to authenticate it.
- Before calling this API, learn about the request header parameters.
Authorization Information
- If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
| Action | Access Level | Resource Type (*: required) | Condition Key | Alias | Dependencies |
|---|---|---|---|---|---|
| rds:instance:getBackupPolicy | read | instance | g:EnterpriseProjectId g:ResourceTag/<tag-key> | rds:instance:list | - |
Constraints
This API is available only for RDS for PostgreSQL.
URI
- URI format
GET /v3/{project_id}/instances/{instance_id}/backups/sparse-policy
- Parameter description
Table 1 Parameters Parameter
Mandatory
Type
Description
project_id
Yes
String
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
String
Definition
Instance ID.
You can obtain the value of this parameter from id in Table 4 by calling the API for querying DB instances.
Constraints
N/A
Range
N/A
Default Value
N/A
Request
None
Example Request
Query sparse backup policies of a DB instance.
GET https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/a2471f32101d4b57ae2a09f489ac16cein03/backups/sparse-policy Response
- Normal response
Table 2 Parameters Parameter
Type
Description
policies
Array of objects
Definition
Backup policies.
For details, see Table 3.
Table 3 policies field description Parameter
Type
Description
id
String
Definition
Backup policy ID.
Range
N/A
period
String
Definition
Backup cycle.
Range
The value is a cron expression in the format of "day month week" in the UTC time zone.
- The day can be a number ranging from 1 to 31, the special character * (indicating any value), or the special character L (indicating the last day). You can enter multiple values ranging from 1 to 31 or L and separate them with commas (,).
- The month can be a number ranging from 1 to 12 or the special character * (indicating any value).
- The week can be a number ranging from 1 to 7 (1 indicates Monday, 2 indicates Tuesday, and so on) or the special character * (indicating any value). You can enter multiple values ranging from 1 to 7 and separate them with commas (,).
keep_days
Integer
Definition
Backup retention days.
Range
1–3660
start_time
String
Definition
Full backup time window. Automated backups will be triggered during the backup time window.
Range
The value is in the format of hh:mm-HH:MM (UTC time).
- The value of HH is 1 greater than that of hh.
- The values of mm and MM must be the same and must be set to 00.
- Example normal response
{ "policies": [ { "period": "1 * *", "id": "13223393-b6e9-4845-b053-539d5f53d584", "keep_days": 30, "start_time": "10:00-11:00" }, { "period": "1 3 *", "id": "2803a1bc-a0f6-42e9-acdb-16eb87c79b4b", "keep_days": 365, "start_time": "10:00-11:00" }, { "period": "* * 4", "id": "a43571b1-1164-4928-b235-26a2e355ea4e", "keep_days": 7, "start_time": "10:00-11:00" } ] } - Abnormal response
For details, see Abnormal Request Results.
Status Code
- Normal
- Abnormal
For details, see Status Codes.
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot