All Products
Search
Document Center

Cloud Backup:CreateBackupPlan

Last Updated:Aug 06, 2026

Creates a backup plan.

Operation description

Important
  • To use features such as ECS File Backup Essential Edition, cloud disk backup, container backup, Tablestore backup free trial, archiving, or data synchronization, call this operation.

  • To use the 30-day free trial of NAS backup or OSS backup, call the CreateTrialBackupPlan operation.

  • To use standard capabilities of ECS File Backup Standard Edition, local file backup, ECS full-copy backup, NAS backup, OSS backup, or CPFS backup, call the CreatePolicyV2 and CreatePolicyBindings operations.

  • A backup plan associates a data source with a backup policy and other information required for backup. After a backup plan is executed, a backup job is generated to record the backup progress and result. If the backup job succeeds, a backup snapshot is generated. You can use the backup snapshot to create a restore job.

  • A backup plan supports only one data source.

  • A backup plan supports only a single backup cycle policy with a fixed interval.

  • A backup plan can back up data to only one vault.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

hbr:CreateBackupPlan

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

SourceType

string

Yes

The type of the data source. Valid values:

  • 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 an entire ECS instance.

  • SYNC: data synchronization.

ECS_FILE

PlanName

string

No

The name of the backup plan. The name must be 1 to 64 characters in length. The backup plan name must be unique for each data source type within a single vault.

planname

BackupType

string

No

The backup type. Set the value to COMPLETE, which indicates full backup.

COMPLETE

VaultId

string

No

The vault ID.

v-0006******q

Schedule

string

No

The backup policy. Format: I|{startTime}|{interval}. This indicates that a backup job is executed at every {interval} starting from {startTime}. Backup jobs for past time periods are not compensated. If the previous backup job is not completed, the next backup job is not triggered. Example: I|1631685600|P1D indicates that a backup is performed once a day starting from 2021-09-15 14:00:00.

  • startTime: the start time of the backup. The value is a UNIX timestamp. Unit: seconds.

  • interval: the ISO 8601 time interval. Example: PT1H indicates an interval of one hour. P1D indicates an interval of one day.

I|1602673264|P1D

Retention

integer

No

The retention period of the backup data. Minimum value: 1. Unit: days.

7

ClusterId

string

No

The ID of the client group that executes the data synchronization plan. This parameter is required only for data synchronization.

cl-***************

FileSystemId

string

No

This parameter is required only when SourceType is set to NAS. The file system ID.

005494

CreateTime

integer

No

This parameter is required only when SourceType is set to NAS. The time when the file system was created. The value is a UNIX timestamp. Unit: seconds.

1607436917

Bucket

string

No

This parameter is required only when SourceType is set to OSS. The name of the OSS bucket.

hbr-backup-oss

Prefix

string

No

This parameter is required only when SourceType is set to OSS. The backup prefix. If specified, only objects that match the prefix are backed up.

oss-prefix

InstanceId

string

No

This parameter is required only when SourceType is set to ECS_FILE. The ECS instance ID.

i-m5e*****6q

Detail

object

No

The details of the full-copy backup. The value is a JSON string.

  • snapshotGroup: specifies whether to use a consistent snapshot group. This parameter is valid only when all cloud disks of the instance are ESSDs.

  • appConsistent: specifies whether to use application consistency. This parameter must be used together with the preScriptPath and postScriptPath parameters.

  • preScriptPath: the path of the pre-freeze script.

  • postScriptPath: the path of the post-thaw script.

{\"EnableFsFreeze\":true,\"appConsistent\":false,\"postScriptPath\":\"\",\"preScriptPath\":\"\",\"snapshotGroup\":true,\"timeoutInSeconds\":60}

UdmRegionId

string

No

The region where the ECS instance for full-copy backup resides.

cn-shanghai

SpeedLimit

string

No

This parameter is required only when SourceType is set to ECS_FILE. The backup traffic control. Format: {start}:{end}:{bandwidth}. Separate multiple traffic control configurations with vertical bars (|). The time ranges of the configurations cannot overlap.

  • start: the start hour.

  • end: the end hour.

  • bandwidth: the rate limit. Unit: KB/s.

0:24:5120

Include

string

No

This parameter is required only when SourceType is set to ECS_FILE. The path to include in the backup. All files in this path are backed 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 when SourceType is set to ECS_FILE. The path to exclude from the backup. All files in this path are not backed up. The value can be up to 255 characters in length.

["/var", "/proc"]

Options

string

No

This parameter is required only when SourceType is set to ECS_FILE. Specifies whether to use Windows Volume Shadow Copy Service (VSS) to define the source path.

  • This feature is supported only for Windows ECS instances.

  • If the backup source contains data changes and you need to ensure consistency between the backup data and the source data, set this parameter to ["UseVSS":true].

  • After VSS is enabled, multiple file folders cannot be backed up simultaneously.

{"UseVSS":false}

DataSourceId

string

No

The ID of the source data source. This parameter is required only for data synchronization.

ds-****************

Path

array

No

The source paths.

string

No

The source path. The value can be up to 65536 characters in length. The source path rules are as follows:

  • If no wildcard (*) is used, you can enter up to 20 paths.

  • If a wildcard (*) is used, you can enter only one path. Wildcards in the format of /*/* are supported.

  • Each line supports only absolute paths.

  • When VSS is used, multiple paths, UNC paths, wildcards, and file exclusion are not supported.

  • When UNC is used, VSS, wildcards, and file exclusion are not supported. When the backup source contains a UNC path, Windows ACLs are not backed up.

["/home"]

Rule

array<object>

No

The backup plan rules.

object

No

The backup plan rules.

DestinationRetention

integer

No

The retention period of the geo-redundancy backup. Unit: days.

7

Schedule

string

No

The backup policy. Format: I|{startTime}|{interval}. This indicates that a backup job is executed at every {interval} starting from {startTime}. Backup jobs for past time periods are not executed. If the previous backup job is not completed, the next backup job is not triggered. Example: I|1631685600|P1D indicates that a backup is performed once a day starting from 2021-09-15 14:00:00.

startTime: the start time of the backup. The value is a UNIX timestamp. Unit: seconds. interval: the ISO 8601 time interval. Example: PT1H indicates an interval of one hour. P1D indicates an interval of one day.

I|1602673264|P1D

Retention

integer

No

The retention period of the backup.

7

Disabled

boolean

No

Specifies whether the rule is disabled.

false

DoCopy

boolean

No

Specifies whether to enable cross-region replication.

false

DestinationRegionId

string

No

The ID of the destination region for cross-region replication.

cn-hangzhou

RuleName

string

No

The rule name.

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 of the Tablestore instance.

CrossAccountType

string

No

The cross-account backup type. Valid values:

  • SELF_ACCOUNT: backup within the same account.

  • CROSS_ACCOUNT: cross-account backup.

Valid values:

  • SELF_ACCOUNT :

    SELF_ACCOUNT

  • CROSS_ACCOUNT :

    CROSS_ACCOUNT

CROSS_ACCOUNT

CrossAccountUserId

integer

No

The ID of the source account for cross-account backup.

15897534xxxx4625

CrossAccountRoleName

string

No

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

BackupRole

KeepLatestSnapshots

integer

No

Specifies whether to retain at least one backup version. Valid values:

  • 0: does not retain.

  • 1: retains.

Valid values:

  • 0 :

    Does not retain.

  • 1 :

    Retains.

1

DestSourceType

string

No

The type of the destination data source. This parameter is required only for data synchronization.

OSS

DestDataSourceId

string

No

The ID of the destination data source. This parameter is required only for data synchronization.

ds-*********************

DestDataSourceDetail

object

No

The details of the destination data source. This parameter is required only for data synchronization.

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

ChangeListPath

string

No

The configuration of the incremental file synchronization list. This parameter is required only for data synchronization.

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

Disabled

boolean

No

Specifies whether the plan is disabled by default.

true

Edition

string

No

The edition type. Valid values: BASIC and STANDARD. Default value: STANDARD.

STANDARD

Response elements

Element

Type

Description

Example

object

The response parameters.

Code

string

The response code. The value 200 indicates success.

200

Message

string

The returned message. The value "successful" is returned for a success response. An error message is returned for a failure response.

successful

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

PlanId

string

The backup plan ID.

plan-*********************

Success

boolean

Indicates whether the request was successful.

  • true: The request was successful.

  • false: The request failed.

true

Examples

Success response

JSON format

{
  "Code": "200",
  "Message": "successful",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
  "PlanId": "plan-*********************",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.