Creates a backup plan.
Operation description
- A backup schedule defines the data source, backup policy, and other configurations. After you execute a backup schedule, a backup job is generated to record the backup progress and the backup result. If a backup job is complete, a backup snapshot is generated. You can use a backup snapshot to create a restore job.
- You can specify only one type of data source in a backup schedule.
- You can specify only one interval as a backup cycle in a backup schedule.
- Each backup schedule 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:CreateBackupPlan | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
SourceType | string | Yes | The type of the data source. Valid values:
| ECS_FILE |
PlanName | string | Yes | The name of the backup schedule. The name must be 1 to 64 characters in length. The name of a backup schedule for each type of data source must be unique within a backup vault. | planname |
BackupType | string | Yes | The backup type. Valid value: COMPLETE, which indicates full backup. | COMPLETE |
VaultId | string | No | The ID of the backup vault. | v-0006******q |
Schedule | string | Yes | The backup policy. Format:
| I|1602673264|P1D |
Retention | long | Yes | The retention period of backup data. Minimum value: 1. Unit: days. | 7 |
FileSystemId | string | No | This parameter is required only if the SourceType parameter is set to NAS. This parameter specifies the ID of the NAS file system. | 005494 |
CreateTime | long | No | This parameter is required only if the SourceType parameter is set to NAS. This parameter specifies the time to create the file system. The value must be a UNIX timestamp. Unit: seconds. | 1607436917 |
Bucket | string | No | This parameter is required only if the SourceType parameter is set to OSS. This parameter specifies the name of the OSS bucket. | hbr-backup-oss |
Prefix | string | No | This parameter is required only if the SourceType parameter is set to OSS. This parameter specifies the prefix of objects that you want to back up. After a prefix is specified, only objects whose names start with the prefix are backed up. | oss-prefix |
InstanceId | string | No | This parameter is required only if the SourceType parameter is set to ECS_FILE. This parameter specifies the ID of the ECS instance. | i-m5e*****6q |
Detail | object | No | The details about ECS instance backup. The value is a JSON string.
| {\"EnableFsFreeze\":true,\"appConsistent\":false,\"postScriptPath\":\"\",\"preScriptPath\":\"\",\"snapshotGroup\":true,\"timeoutInSeconds\":60} |
UdmRegionId | string | No | The region in which the ECS instance that you want to back up resides. | cn-shanghai |
SpeedLimit | string | No | This parameter is required only if the SourceType parameter is set to ECS_FILE. This parameter specifies the throttling rules. Format:
| 0:24:5120 |
Include | string | No | This parameter is required only if the SourceType parameter is set to ECS_FILE. This parameter specifies the paths to the files that you want to back up. The value can be up to 255 characters in length. | ["/home/alice/*.pdf", "/home/bob/*.txt"] |
Exclude | string | No | This parameter is required only if the SourceType parameter is set to ECS_FILE. This parameter specifies the paths to the files that are excluded from the backup job. The value can be up to 255 characters in length. | ["/var", "/proc"] |
Options | string | No | This parameter is required only if the SourceType parameter is set to ECS_FILE. This parameter specifies whether to use Windows Volume Shadow Copy Service (VSS) to define a backup path.
| {"UseVSS":false} |
Path | array | No | The backup paths. | |
string | No | The backup path. The value can be up to 65,536 characters in length. Specify backup paths based on the following rules:
| ["/home"] | |
Rule | array<object> | No | The rules of the backup schedule. | |
object | No | The rule of the backup schedule. | ||
DestinationRetention | long | No | The retention period of the backup data in geo-redundancy mode. Unit: days. | 7 |
Schedule | string | No | The backup policy. Format: I|{startTime}|{interval}. The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is complete. For example, I|1631685600|P1D specifies that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day. startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds. interval: the interval at which the system runs a backup job. The interval must follow the ISO 8601 standard. For example, PT1H specifies an interval of one hour. P1D specifies an interval of one day. | I|1602673264|P1D |
Retention | long | No | The retention period of the backup data. Unit: days. | 7 |
Disabled | boolean | No | Specifies whether to enable the rule. | false |
DoCopy | boolean | No | Specifies whether to enable cross-region replication. | false |
DestinationRegionId | string | No | The ID of the region to which data is replicated. | cn-hangzhou |
RuleName | string | No | The name of the rule. | rule-test-name |
BackupType | string | No | The backup type. | COMPLETE |
InstanceName | string | No | The name of the Tablestore instance. | instancename |
OtsDetail | OtsDetail | No | The details about the Tablestore instance. | |
CrossAccountType | string | No | Specifies whether data is backed up and restored within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:
| CROSS_ACCOUNT |
CrossAccountUserId | long | No | The ID of the source Alibaba Cloud account that authorizes the current Alibaba Cloud account to back up and restore data across Alibaba Cloud accounts. | 15897534xxxx4625 |
CrossAccountRoleName | string | No | The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up and restore data across Alibaba Cloud accounts. | BackupRole |
KeepLatestSnapshots | long | No | Specifies whether to enable the "Keep at least one backup version" feature. Valid values:
| 1 |
ChangeListPath | string | No | The configurations of the incremental file synchronization. This parameter is required for data synchronization only. | {"dataSourceId": "ds-123456789", "path": "/changelist"} |
Disabled | boolean | No | Specifies whether to disable the plan 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 |
---|