Modifying a Sparse Backup Policy of a DB Instance
Function
This API is used to modify a sparse backup policy 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:modifyBackupPolicy | permission_management | instance | g:EnterpriseProjectId rds:BackupEnabled g:ResourceTag/<tag-key> | - | - |
Constraints
- This API is available for RDS for PostgreSQL only.
- The start_time parameter of a sparse backup policy cannot be set separately. It is the same as that of the basic backup policy of the instance. To obtain the value, see Obtaining an Automated Backup Policy.
URI
- URI format
POST /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
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| policies | Yes | Array of Object | Definition Backup policies. For details, see Table 3. Constraints N/A |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| id | No | String | Definition Backup policy ID. Constraints A backup policy may be associated with multiple generated backups. Modifying or deleting a policy will take effect for the generated backups associated with this policy. If you shorten the retention period of a policy or delete the policy, the existing full backups associated with this policy can be deleted due to expiration. Check the policy settings carefully. Range
Default Value N/A |
| period | No | String | Definition Backup cycle. Constraints This field is a cron expression in the UTC time zone. It works together with start_time. The value of start_time for a sparse backup policy is the same as that for the basic backup policy. To obtain the value of start_time for the basic backup policy of an instance, see Obtaining an Automated Backup Policy. For example, if the local time zone is UTC+08:00 and the value of start_time queried by an API is 21:00-22:00, the corresponding backup time is 05:00-06:00 local time. If you set the period of a sparse backup policy to 1 * *, the policy will trigger a backup task from 21:00 to 22:00 (UTC) on the 1st day of each month. This corresponds to 05:00 to 06:00 on the 2nd day of each month in your local time zone (UTC+08:00). This parameter is mandatory when you add a policy. Range The value must be a cron expression in the format of "day month week" in the UTC time zone, and the expression must comply with the following rules for weekly, monthly, or yearly policies:
Default Value N/A |
| keep_days | No | Integer | Definition Backup retention days. Constraints This parameter is mandatory when you add a policy. Range 0–3660. The value 0 indicates that the backup policy will be deleted. Default Value N/A |
| reserve_backups | No | Boolean | Definition Whether to retain the backups when deleting a backup policy. Constraints This parameter is valid only when keep_days is set to 0. This parameter is mandatory when you delete a backup policy. A backup policy may be associated with multiple generated backups. If this parameter is set to false, all backup data associated with the policy will be deleted immediately. Exercise caution when performing this operation. Range
Default Value N/A |
Example Request
Modify a sparse backup policy of a DB instance.
POST https://{Endpoint}/v3/0483b6b16e954cb88930a360d2c4e663/instances/a2471f32101d4b57ae2a09f489ac16cein03/backups/sparse-policy
{
"policies": [
{
"period": "3 7 *",
"keep_days": 7
}
]
} Response
- Normal response
None
- Example normal response
None
- 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