This API is used to set an automated backup policy.
PUT https://{Endpoint}/v3/{project_id}/instances/{instance_id}/backups/policy
Name |
Mandatory |
Description |
---|---|---|
project_id |
Yes |
Specifies the project ID of a tenant in a region. |
instance_id |
Yes |
Specifies the instance ID, which can be obtained by calling the API for querying instances. If you do not have an instance, you can call the API used for creating an instance. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
backup_policy |
Yes |
Object |
Specifies the backup policy object, including the backup retention period (days) and start time. For more information, see Table 3. |
Name |
Mandatory |
Type |
Description |
---|---|---|---|
keep_days |
Yes |
String |
Specifies the number of days to retain the generated backup files. The value range is from 0 to 732. The value 0 indicates that the automated backup policy is disabled. |
start_time |
No |
String |
Specifies the backup time window. Automated backups will be triggered during the backup time window. This parameter is mandatory if the automated backup policy is enabled. This parameter is not transferred if the automated backup policy is disabled. The value must be a valid value in the "hh:mm-HH:MM" format. The current time is in the UTC format.
Example value: 23:00-00:00 |
period |
No |
String |
Specifies the backup cycle configuration. Data will be automatically backed up on the selected days every week. Value range: The value is a number separated by DBS case commas (,). The number indicates the week. The restrictions on the backup retention period are as follows:
|
{ "backup_policy": { "keep_days": 9, "start_time": "23:00-00:00", "period": "1,4,5,6,7" } }
{ "backup_policy": { "keep_days": 0 } }
{}
For more information, see Error Code.