Create a backup plan.
Operation description
- A backup plan associates data sources with backup policies and other necessary information for backups. After the execution of a backup plan, it generates a backup task that records the progress and results of the backup. If the backup task is successful, a backup snapshot is created. You can use the backup snapshot to create a recovery task.
- A backup plan supports only one type of data source.
- A backup plan supports only a single fixed interval backup cycle strategy.
- A backup plan can back up 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:CreateBackupPlan | create | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
SourceType | string | Yes | Data source type, with the following options:
| ECS_FILE |
PlanName | string | Yes | Name of the backup plan. 1 to 64 characters. The name must be unique for each data source type within a single backup vault. | planname |
BackupType | string | Yes | Backup type. Value: COMPLETE, indicating a full backup. | COMPLETE |
VaultId | string | No | Backup vault ID. | v-0006******q |
Schedule | string | Yes | Backup policy. Optional format:
| I|1602673264|P1D |
Retention | long | Yes | Number of days to retain the backup, with a minimum value of 1, in days. | 7 |
FileSystemId | string | No | This parameter is required when SourceType is set to NAS. It represents the file system ID. | 005494 |
CreateTime | long | No | This parameter is required when SourceType is set to NAS. It represents the creation time of the file system, in UNIX timestamp, in seconds. | 1607436917 |
Bucket | string | No | This parameter is required when SourceType is set to OSS. It represents the OSS bucket name. | hbr-backup-oss |
Prefix | string | No | This parameter is required when SourceType is set to OSS. It represents the backup prefix. When specified, only objects matching the prefix are backed up. | oss-prefix |
InstanceId | string | No | This parameter is required when SourceType is set to ECS_FILE. It represents the ECS instance ID. | i-m5e*****6q |
Detail | object | No | Details of the whole machine backup, in JSON string format.
| {\"EnableFsFreeze\":true,\"appConsistent\":false,\"postScriptPath\":\"\",\"preScriptPath\":\"\",\"snapshotGroup\":true,\"timeoutInSeconds\":60} |
UdmRegionId | string | No | Region where the whole machine backup instance is located. | cn-shanghai |
SpeedLimit | string | No | This parameter is required when SourceType is set to ECS_FILE. It represents the backup traffic control. Format:
| 0:24:5120 |
Include | string | No | This parameter is required when SourceType is set to ECS_FILE. It represents the path to be backed up, and all files under this path will be backed up. Supports up to 255 characters. | ["/home/alice/*.pdf", "/home/bob/*.txt"] |
Exclude | string | No | This parameter is required only when SourceType is set to ECS_FILE. It specifies the path that should not be backed up, meaning all files under this path will not be included in the backup. The maximum length is 255 characters. | ["/var", "/proc"] |
Options | string | No | This parameter is required when SourceType is set to ECS_FILE. It indicates whether to use the Windows system VSS to define the backup path.
| {"UseVSS":false} |
Path | array | No | Backup paths. | |
string | No | Backup paths. Up to 65536 characters. The rules for backup paths are as follows:
| ["/home"] | |
Rule | array<object> | No | Backup plan rules. | |
object | No | Backup plan rules. | ||
DestinationRetention | long | No | Number of days to retain offsite backups. | 7 |
Schedule | string | No | Backup strategy. Optional format: I|{startTime}|{interval}. This means that a backup task is executed every {interval} starting from {startTime}. Backup tasks for past times will not be executed. If the previous backup task has not been completed, the next backup task will not be triggered. For example, I|1631685600|P1D means a backup is performed every day starting from 2021-09-15 14:00:00.
| I|1602673264|P1D |
Retention | long | No | Backup retention period. | 7 |
Disabled | boolean | No | Whether the rule is enabled. | true |
DoCopy | boolean | No | Whether to enable offsite replication. | true |
DestinationRegionId | string | No | ID of the region for offsite replication. | cn-hangzhou |
RuleName | string | No | Rule name. | rule-test-name |
BackupType | string | No | Backup type. | COMPLETE |
InstanceName | string | No | Table store instance name. | instancename |
OtsDetail | OtsDetail | No | Table store instance details. | |
CrossAccountType | string | No | Cross-account backup type. Supported values:
| CROSS_ACCOUNT |
CrossAccountUserId | long | No | The original account ID used for cross-account backup. | 15897534xxxx4625 |
CrossAccountRoleName | string | No | The role name created in the RAM of the original account for cross-account backup. | BackupRole |
KeepLatestSnapshots | long | No | Whether to enable retaining at least one backup version.
Enumeration Value:
| 1 |
DestSourceType | string | No | Destination data source type. (Required only for synchronization) | OSS |
DestDataSourceId | string | No | Destination data source ID. (Required only for synchronization) | ds-********************* |
DestDataSourceDetail | object | No | Destination data source details. (Required only for synchronization) | {\"prefix\":\"/\"} |
ChangeListPath | string | No | Configuration for the incremental file synchronization list. (Required only for synchronization) | {"dataSourceId": "ds-123456789", "path": "/changelist"} |
Disabled | boolean | No | Is the plan disabled by default | true |
Response parameters
Examples
Sample success responses
JSON
format
{
"Code": "200",
"Message": "successful",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"PlanId": "plan-*********************",
"Success": true
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|