Creates a backup policy.
Operation description
A backup policy records the information required for backup. After you execute a backup policy, a backup job is generated to record the backup progress and the backup result. If a backup job is completed, a backup snapshot is generated. You can use a backup snapshot to create a restore job.
- A backup policy supports multiple data sources. The data sources can be only Elastic Compute Service (ECS) instances.
- You can specify only one interval as a backup cycle in a backup policy.
- Each backup policy allows you to back up data to only one backup vault.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PolicyName | string | No | The name of the backup policy. | Daily Local Backup + Remote Backup |
PolicyDescription | string | No | The description of the backup policy. | Data is backed up at 10:00:00 every day and replicated to the China (Shanghai) region for geo-redundancy. |
Rules | object [] | No | The rules in the backup policy. | |
RuleType | string | Yes | The type of the rule. Each backup policy must have at least one rule of the BACKUP type and only one rule of the TRANSITION type.
| BACKUP |
Schedule | string | No | This parameter is required only if you set the RuleType parameter to BACKUP. This parameter specifies the backup schedule settings. Format:
| I|1648647166|P1D |
BackupType | string | No | This parameter is required only if you set the RuleType parameter to BACKUP. This parameter specifies the backup type. Valid value: COMPLETE, which indicates full backup. | COMPLETE |
Retention | long | No | This parameter is required only if you set the RuleType parameter to TRANSITION or REPLICATION.
| 7 |
ReplicationRegionId | string | No | This parameter is required only if you set the RuleType parameter to REPLICATION. This parameter specifies the ID of the destination region. | cn-shanghai |
RetentionRules | object [] | No | This parameter is required only if you set the RuleType parameter to TRANSITION. This parameter specifies the special retention rules. | |
AdvancedRetentionType | string | No | The type of the special retention rule. Valid values:
| YEARLY |
WhichSnapshot | long | No | Specifies which backup is retained based on the special retention rule. Only the first backup can be retained. | 1 |
Retention | long | No | The retention period of the backup data. Minimum value: 1. Unit: days. | 730 |
KeepLatestSnapshots | long | No | Specifies whether to enable the feature of keeping at least one backup version. Valid values:
| 1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Success": true,
"Code": "200",
"Message": "successful",
"RequestId": "EEC65C22-2152-5E31-8AD6-D6CBF1BFF49F",
"PolicyId": "po-000000zemnuyx2li3y9y"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|