Configuring Same-Region Backup Policies
Function
This API is used to modify same-region backup policies. You can customize standard backup policies and sparse backup policies. Before calling this API:
- Learn how to authenticate it.
- Obtain the required region and endpoint.
Calling Method
For details, see Calling APIs.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- 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
Dependency
gaussdbformysql:backup:modifyPolicy
Permission_management
-
gaussdbformysql:ReplicationTargetRegion
gaussdb:instance:modifyBackupPolicy
-
URI
PUT /v3/{project_id}/instances/{instance_id}/backups/advanced-policy
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. Constraints N/A Range The value contains 32 characters. Only letters and digits are allowed. Default Value N/A |
| instance_id | Yes | String | Definition Instance ID, which uniquely identifies an instance. To obtain this value, see Querying DB Instances. Constraints N/A Range The value contains 36 characters with a suffix of in07. Only letters and digits are allowed. Default Value N/A |
Request Parameters
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| X-Auth-Token | Yes | String | Definition User token. To obtain this value, call the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the token value. Constraints N/A Range N/A Default Value N/A |
| Content-Type | Yes | String | Definition Content type. Constraints N/A Range application/json Default Value application/json |
| X-Language | No | String | Definition Request language type. Constraints N/A Range Default Value en-us |
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| begin_time | Yes | String | Definition Start time of the backup time window. Constraints N/A Range The value must be a valid time in the hh:mm format. hh ranges from 0 to 23, and mm ranges from 0 to 59. The current time is the UTC time. Default Value N/A |
| end_time | Yes | String | Definition End time of the backup time window. Constraints The value of end_time must be later than that of begin_time. Range The value must be a valid time in the hh:mm format. hh ranges from 0 to 23, and mm ranges from 0 to 59. The current time is the UTC time. Default Value N/A |
| retention_num_backup_level1 | No | Integer | Definition Number of retained level-1 backups. Constraints This parameter is mandatory when the level-1 backup function is enabled. Otherwise, this parameter cannot be transferred. Range Default Value 0 |
| policies | Yes | Array of Policy objects | Definition Backup policy set, including the backup cycle, retention days, and policy type. For details, see the Policy data structure. Constraints N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| status | String | Definition Status. Range COMPLETED: The backup policy is successfully configured. |
| instance_id | String | Definition Instance ID, which is compliant with the UUID format. Range The value is the same as the instance ID in the request. |
| instance_name | String | Definition Instance name. Range Instance name corresponding to the instance ID |
Status code: 400
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Status code: 500
| Parameter | Type | Description |
|---|---|---|
| error_code | String | Error code. |
| error_msg | String | Error message. |
Example Request
Modifying the automated backup policy of an instance (Data is backed up from 19:00 to 20:00 every Monday to Sunday. Backups are stored for seven days.)
PUT https://{endpoint}/v3/054e292c9880d4992f02c0196d3ea468/instances/21b6ea5a78244de98c1c2622e1dc593ain07/backups/advanced-policy
{
"begin_time" : "19:00",
"end_time" : "20:00",
"policies" : [ {
"period" : "* * 1,2,3,4,5",
"retention_days" : 7,
"policy_type" : "base"
} ]
} Example Response
Status code: 200
Success.
{
"status" : "COMPLETED",
"instance_id" : "21b6ea5a78244de98c1c2622e1dc593ain07",
"instance_name" : "Taurus-123"
} Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
What is your overall rating for this page?
Thank 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