All Products
Search
Document Center

Cloud Backup:CreateBackupPlan

Last Updated:Dec 24, 2024
This topic is generated by a machine translation engine without any human intervention. ALIBABA CLOUD DOES NOT GUARANTEE THE ACCURACY OF MACHINE TRANSLATED CONTENT. To request a human-translated version of this topic or provide feedback on this translation, please include it in the feedback form.

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
hbr:CreateBackupPlancreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
SourceTypestringYes

Data source type, with the following options:

  • ECS_FILE: Backs up ECS files
  • OSS: Backs up Alibaba Cloud OSS
  • NAS: Backs up Alibaba Cloud NAS
  • OTS: Backs up Alibaba Cloud OTS
  • UDM_ECS: Backs up the entire ECS instance
ECS_FILE
PlanNamestringYes

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
BackupTypestringYes

Backup type. Value: COMPLETE, indicating a full backup.

COMPLETE
VaultIdstringNo

Backup vault ID.

v-0006******q
SchedulestringYes

Backup policy. Optional format: I|{startTime}|{interval}. This indicates that a backup task will be executed every {interval} starting from {startTime}. It does not compensate for missed backup tasks due to past time. 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.

  • startTime: Start time of the backup, in UNIX timestamp, in seconds.
  • interval: ISO8601 time interval. For example, PT1H indicates an interval of one hour, and P1D indicates an interval of one day.
I|1602673264|P1D
RetentionlongYes

Number of days to retain the backup, with a minimum value of 1, in days.

7
FileSystemIdstringNo

This parameter is required when SourceType is set to NAS. It represents the file system ID.

005494
CreateTimelongNo

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
BucketstringNo

This parameter is required when SourceType is set to OSS. It represents the OSS bucket name.

hbr-backup-oss
PrefixstringNo

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
InstanceIdstringNo

This parameter is required when SourceType is set to ECS_FILE. It represents the ECS instance ID.

i-m5e*****6q
DetailobjectNo

Details of the whole machine backup, in JSON string format.

  • snapshotGroup: Whether to use a consistent snapshot group (only valid if all instance disks are ESSD).
  • appConsistent: Whether to use application consistency (requires the use of preScriptPath and postScriptPath parameters).
  • preScriptPath: Path to the freeze script.
  • postScriptPath: Path to the thaw script.
{\"EnableFsFreeze\":true,\"appConsistent\":false,\"postScriptPath\":\"\",\"preScriptPath\":\"\",\"snapshotGroup\":true,\"timeoutInSeconds\":60}
UdmRegionIdstringNo

Region where the whole machine backup instance is located.

cn-shanghai
SpeedLimitstringNo

This parameter is required when SourceType is set to ECS_FILE. It represents the backup traffic control. Format: {start}:{end}:{bandwidth}. Multiple traffic control configurations are separated by |, and the configured times should not overlap.

  • start: Start hour.
  • end: End hour.
  • bandwidth: Limit rate, in KB/s.
0:24:5120
IncludestringNo

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"]
ExcludestringNo

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"]
OptionsstringNo

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.

  • This feature only supports Windows type ECS instances.
  • If there are data changes in the backup source and you need to ensure consistency between the backup data and the source data, you can configure it as ["UseVSS":true].
  • After choosing to use VSS, multiple file directories cannot be backed up simultaneously.
{"UseVSS":false}
PatharrayNo

Backup paths.

stringNo

Backup paths. Up to 65536 characters. The rules for backup paths are as follows:

  • Without wildcards (*), you can input 20 lines of paths.

  • When using wildcards (*), only one line of path can be input, supporting wildcard patterns like /*/*.

  • Each line only supports absolute paths.

  • When using VSS, multiple paths, UNC paths, wildcards, and exclusion files are not supported.

  • When using UNC, VSS, wildcards, and exclusion files are not supported. If the backup source includes a UNC path, Windows ACLs will not be backed up.

["/home"]
Rulearray<object>No

Backup plan rules.

objectNo

Backup plan rules.

DestinationRetentionlongNo

Number of days to retain offsite backups.

7
SchedulestringNo

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.

  • startTime: The start time of the backup, in UNIX time, in seconds.
  • interval: ISO8601 time interval. For example, PT1H means an interval of one hour. P1D means an interval of one day.
I|1602673264|P1D
RetentionlongNo

Backup retention period.

7
DisabledbooleanNo

Whether the rule is enabled.

true
DoCopybooleanNo

Whether to enable offsite replication.

true
DestinationRegionIdstringNo

ID of the region for offsite replication.

cn-hangzhou
RuleNamestringNo

Rule name.

rule-test-name
BackupTypestringNo

Backup type.

COMPLETE
InstanceNamestringNo

Table store instance name.

instancename
OtsDetailOtsDetailNo

Table store instance details.

CrossAccountTypestringNo

Cross-account backup type. Supported values:

  • SELF_ACCOUNT: Backup within the same account
  • CROSS_ACCOUNT: Cross-account backup
CROSS_ACCOUNT
CrossAccountUserIdlongNo

The original account ID used for cross-account backup.

15897534xxxx4625
CrossAccountRoleNamestringNo

The role name created in the RAM of the original account for cross-account backup.

BackupRole
KeepLatestSnapshotslongNo

Whether to enable retaining at least one backup version.

  • 0 - Do not retain
  • 1 - Retain
Enumeration Value:
  • 0: 不保留.
  • 1: 保留.
1
DestSourceTypestringNo

Destination data source type. (Required only for synchronization)

OSS
DestDataSourceIdstringNo

Destination data source ID. (Required only for synchronization)

ds-*********************
DestDataSourceDetailobjectNo

Destination data source details. (Required only for synchronization)

{\"prefix\":\"/\"}
ChangeListPathstringNo

Configuration for the incremental file synchronization list. (Required only for synchronization)

{"dataSourceId": "ds-123456789", "path": "/changelist"}
DisabledbooleanNo

Is the plan disabled by default

true

Response parameters

ParameterTypeDescriptionExample
object

Returned data.

Codestring

Return code, 200 indicates success.

200
Messagestring

Description of the return message, usually returns 'successful' upon success, and corresponding error messages in case of failure.

successful
RequestIdstring

Request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E
PlanIdstring

Backup plan ID.

plan-*********************
Successboolean

Whether the request was successful.

  • true: Success.
  • false: Failure.
true

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
No change history