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
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
hbr:CreatePolicyV2 | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
PolicyName | string | No | The name of the backup policy. | Daily Local Backup + Remote Backup |
PolicyType | string | No | The policy type. Valid values:
If the policy type is not specified, Cloud Backup automatically sets the policy type based on whether the backup vault is specified in the rules of the policy:
| STANDARD |
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 | array<object> | No | The rules in the backup policy. | |
Rule | object | No | The details of the rule. | |
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. Valid values:
| BACKUP |
Schedule | string | No | This parameter is required only if the RuleType parameter is set to BACKUP. This parameter specifies the backup schedule settings. Format:
| I|1648647166|P1D |
BackupType | string | No | This parameter is required only if the RuleType parameter is set 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 the RuleType parameter is set to TRANSITION or REPLICATION.
| 7 |
ReplicationRegionId | string | No | This parameter is required only if the RuleType parameter is set to REPLICATION. This parameter specifies the ID of the destination region. | cn-shanghai |
RetentionRules | array<object> | No | This parameter is required only if the RuleType parameter is set to TRANSITION. This parameter specifies the special retention rules. | |
object | No | The special retention rule. | ||
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 special retention period of backups. Minimum value: 1. Unit: days. | 730 |
VaultId | string | No | This parameter is required only if the RuleType parameter is set to BACKUP. The ID of the backup vault. | v-0001************aseg |
KeepLatestSnapshots | long | No | Specifies whether to enable the feature of keeping at least one backup version. Valid values:
| 1 |
Immutable | boolean | No | This parameter is required only if the PolicyType parameter is set to UDM_ECS_ONLY. This parameter specifies whether to enable the immutable backup feature. | true |
DataSourceFilters | array<object> | No | This parameter is required only if the RuleType parameter is set to TAG. This parameter specifies the data source filter rule. | |
object | No | |||
SourceType | string | No | The type of the data source. Valid value:
| UDM_ECS |
DataSourceIds | array | No | This parameter is deprecated. | |
string | No | This parameter is deprecated. | [\"i-uf6e6py**********bgc\"] | |
TagFilters | array<object> | No | This parameter is required only if the RuleType parameter is set to TAG. This parameter specifies the resource tag filter rule. | |
object | No | |||
Key | string | No | The tag key. | env |
Value | string | No | The tag value. If you leave this parameter empty, the value is any value. | prod |
Operator | string | No | The tag-based matching rule. Valid values:
| EQUAL |
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 |
---|---|---|
2024-11-13 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-09-25 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-09-19 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2024-07-23 | The request parameters of the API has changed | View Change Details |
2024-04-18 | The internal configuration of the API is changed, but the call is not affected | View Change Details |