All Products
Search
Document Center

Cloud Backup:CreatePolicyBindings

Last Updated:Oct 26, 2026

Binds one or more data sources to a policy.

Operation description

  • Each call supports binding only data sources of the same type to the same policy.

  • An ECS instance can be bound to only one policy.

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:CreatePolicyBindings

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

PolicyId

string

No

The policy ID.

po-000************8ep

PolicyBindingList

array<object>

No

The policy binding list.

array<object>

No

The policy binding details.

PolicyBindingDescription

string

No

The description of the policy binding.

This is a description of the policy binding

DataSourceId

string

No

The data source ID. The meaning varies based on the SourceType field:

  • UDM_ECS: The ID of the ECS instance.

  • OSS: The name of the OSS bucket.

  • NAS: The ID of the Alibaba Cloud NAS file system.

  • COMMON_NAS: The ID of the on-premises NAS instance.

  • ECS_FILE: The ID of the ECS instance.

  • File: The ID of the Cloud Backup client.

  • COMMON_FILE_SYSTEM: The data source ID for CPFS (agent-based backup).

  • CPFS: The ID of the CPFS file system (agentless backup).

i-bp1************dl8

Disabled

string

No

Specifies whether the policy is suspended for the data source. Valid values:

  • true: Suspended.

  • false: Not suspended.

true

SourceType

string

No

The data source type. Valid values:

  • UDM_ECS: ECS instance backup.

  • OSS: OSS backup.

  • NAS: Alibaba Cloud NAS backup.

  • COMMON_NAS: on-premises NAS backup.

  • ECS_FILE: ECS File Backup Standard Edition.

  • File: on-premises file backup.

  • COMMON_FILE_SYSTEM: CPFS agent-based backup.

  • OTS: Tablestore backup.

  • CPFS: CPFS agentless backup.

UDM_ECS

Source

string

No

The source path. The meaning varies based on the value of SourceType:

  • OSS: the prefix to back up. If you do not specify this parameter, the root directory of the entire bucket is backed up. Only a single prefix is supported. To back up objects whose names start with the data prefix, enter data instead of /data.

  • ECS_FILE: the directories to back up. If you do not specify this parameter, all directories are backed up. You can specify multiple directories at the same time. To back up files in the /a and /b directories, enter ["/a", "/b"].

  • File: the directories to back up. If you do not specify this parameter, all directories are backed up. You can specify multiple directories at the same time. To back up files in the /a and /b directories, enter ["/a", "/b"].

  • COMMON_FILE_SYSTEM: required. The paths to back up. You can specify multiple paths at the same time. To back up the /a and /b paths, enter ["/a", "/b"]. To back up the root path, enter ["/"].

  • COMMON_NAS: required. The path to back up. Only a single path is supported. To back up the /a path, enter ["/a"]. To back up the root path, enter ["/"].

  • OTS: the list of tables to back up. If you do not specify this parameter, all tables are backed up. You can specify multiple tables at the same time. To back up Table a and Table b, enter ["a", "b"].

  • CPFS: required. The paths to back up. You can specify multiple paths at the same time. To back up the /a and /b paths, enter ["/a", "/b"]. To back up the root path, enter ["/"].

/src

Include

string

No

The file types to include in the backup. This parameter is available when SourceType is set to ECS_FILE, File, NAS, COMMON_NAS, COMMON_FILE_SYSTEM, or CPFS. All files of the specified types are backed up. The value can be up to 255 characters in length.

[\"*.doc\",\"*.xltm\"]

Exclude

string

No

The file types to exclude from the backup. This parameter is available when SourceType is set to ECS_FILE, File, NAS, COMMON_NAS, COMMON_FILE_SYSTEM, or CPFS. No files of the specified types are backed up. The value can be up to 255 characters in length.

[\"*.doc\",\"*.xltm\"]

SpeedLimit

string

No

The backup traffic throttling. This parameter is required when SourceType is set to ECS_FILE or File. The format is {start}{end}{bandwidth}. Multiple throttling configurations must be separated, and their time periods cannot overlap.

  • start: the start hour.

  • end: the end hour.

  • bandwidth: the bandwidth limit, in KB/s.

0:24:1024

AdvancedOptions

object

No

The advanced options.

UdmDetail

object

No

The advanced options for ECS instance backup.

ExcludeDiskIdList

array

No

The IDs of the cloud disks that do not need to be protected. This parameter is ignored if DiskIdList is not empty.

string

No

The ID of the cloud disk that does not need to be protected.

d-bp1************apo

DiskIdList

array

No

The IDs of the cloud disks to be protected. This value is empty when all cloud disks are protected.

string

No

The ID of the cloud disk to be protected.

d-bp1************apo

SnapshotGroup

boolean

No

Specifies whether to create a snapshot-consistent group. A snapshot-consistent group can be created only when all cloud disks are ESSDs.

true

AppConsistent

boolean

No

Specifies whether to enable application consistency. Application-consistent snapshots can be created only when all cloud disks are ESSDs.

false

RamRoleName

string

No

The name of the RAM role configured for creating application-consistent snapshots. This parameter is required when AppConsistent is set to true.

AliyunECSInstanceForHbrRole

PreScriptPath

string

No

The path of the pre-freeze script to be executed before creating an application-consistent snapshot. This parameter is required when AppConsistent is set to true.

/tmp/prescript.sh

PostScriptPath

string

No

The path of the post-thaw script to be executed after creating an application-consistent snapshot. This parameter is required when AppConsistent is set to true.

/tmp/postscript.sh

EnableFsFreeze

boolean

No

This parameter is required only when AppConsistent is set to true. Specifies whether to use the Linux FsFreeze mechanism to ensure read-only consistency of the file system before creating an application-consistent snapshot. Default value: true.

true

TimeoutInSeconds

integer

No

The I/O freeze timeout period, in seconds. This parameter is required when AppConsistent is set to true. Default value: 30.

30

EnableWriters

boolean

No

Specifies whether to configure application-consistent snapshots. This parameter is required when AppConsistent is set to true. Valid values:

  • true: creates application-consistent snapshots.

  • false: creates file system-consistent snapshots.

Default value: true.

true

OssDetail

object

No

The advanced options for OSS backup.

InventoryId

string

No

The name of the OSS inventory. If this value is not empty, the OSS inventory is used for performance tuning.

  • We recommend that you use an inventory to improve incremental backup performance when backing up more than 100 million OSS objects. Storage fees generated by the inventory files are charged separately by OSS.

  • It takes time to generate OSS inventory files. Backups may fail before the inventory files are generated. You can wait for the next cycle to execute the backup.

oss-inventory-default

InventoryCleanupPolicy

string

No

Specifies whether to delete the inventory files after the backup. This parameter is valid only when an OSS inventory is used. Valid values:

  • NO_CLEANUP: does not delete the files.

  • DELETE_CURRENT: deletes the current file.

  • DELETE_CURRENT_AND_PREVIOUS: deletes all files.

NO_CLEANUP

IgnoreArchiveObject

boolean

No

Specifies whether to ignore archive objects in task statistics and failed file lists.

true

FileDetail

object

No

The advanced options for file backup.

UseVSS

boolean

No

Specifies whether to enable the Volume Shadow Copy Service (VSS) feature for Windows. Valid values:

  • true: enables the feature.

  • false: disables the feature.

true

AdvPolicy

boolean

No

Specifies whether to use the advanced policy. Valid values:

  • true: uses the advanced policy.

  • false: does not use the advanced policy.

true

CommonNasDetail

object

No

The advanced options for on-premises NAS backup.

FullOnIncrementFail

boolean

No

Specifies whether to switch to a full backup when an incremental backup fails. Valid values:

  • true: switches to a full backup upon failure.

  • false: does not switch to a full backup upon failure.

true

FetchSliceSize

integer

No

The sub-task slice size, measured by the number of files.

100000

ClusterId

string

No

The ID of the backup client group. For on-premises NAS backup, a client is selected from the backup client group to perform the backup.

cl-000**************ggu

CommonFileSystemDetail

object

No

The advanced options for CPFS backup.

FullOnIncrementFail

boolean

No

Specifies whether to switch to a full backup when an incremental backup fails. Valid values:

  • true: switches to a full backup upon failure.

  • false: does not switch to a full backup upon failure.

true

FetchSliceSize

integer

No

The sub-task slice size, measured by the number of files.

100000

CrossAccountType

string

No

The cross-account backup type. Default value: SELF_ACCOUNT. Valid values:

  • SELF_ACCOUNT: backs up data within the current account.

  • CROSS_ACCOUNT: backs up data across accounts.

SELF_ACCOUNT

CrossAccountUserId

integer

No

The Alibaba Cloud UID of the source account used for cross-account backup.

144**********732

CrossAccountRoleName

string

No

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

hbrcrossrole

Response elements

Element

Type

Description

Example

object

The response data.

Success

boolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

Code

string

The return code. A value of 200 indicates success.

200

Message

string

The return message. A value of successful indicates success, and an error message is returned when an error occurs.

successful

RequestId

string

The request ID.

82CC5B6C-72F7-5D39-92F6-67887DF9AD46

Examples

Success response

JSON format

{
  "Success": true,
  "Code": "200",
  "Message": "successful",
  "RequestId": "82CC5B6C-72F7-5D39-92F6-67887DF9AD46"
}

Error codes

HTTP status code

Error code

Error message

Description

400 PolicyAlreadyBoundWithThisDataSource This datasource has already been bound with the policy, please use another one. The data source is already bound to this policy. Try binding a new policy.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.