All Products
Search
Document Center

Cloud Backup:CreatePolicyBindings

Last Updated:Jul 30, 2026

Binds one or more data sources to a policy.

Operation description

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

  • ECS instances (full server backup) 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 list of policy bindings.

array<object>

No

The details of a policy binding.

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 value has different meanings depending on the SourceType field:

  • UDM_ECS: The ECS instance ID.

  • OSS: The OSS bucket name.

  • NAS: The Alibaba Cloud NAS file system ID.

  • COMMON_NAS: The on-premises NAS instance ID.

  • ECS_FILE: The ECS instance ID.

  • File: The Cloud Backup client ID.

  • COMMON_FILE_SYSTEM: The CPFS backup data source ID.

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

Disabled

string

No

Specifies whether the policy is suspended for this data source.

  • true: Suspended.

  • false: Not suspended.

true

SourceType

string

No

The data source type. Valid values:

  • UDM_ECS: ECS full server backup.

  • OSS: OSS backup.

  • NAS: Alibaba Cloud NAS backup.

  • COMMON_NAS: On-premises NAS backup.

  • ECS_FILE: ECS File Backup Essential Edition.

  • File: On-premises file backup.

  • COMMON_FILE_SYSTEM: CPFS backup.

  • OTS: Tablestore backup.

UDM_ECS

Source

string

No

The value has different meanings depending on the SourceType value:

  • OSS: The prefix to back up. If not specified, the entire bucket root directory is backed up. Only a single prefix is supported. To back up /backup, specify /backup.

  • ECS_FILE: The file directories to back up. If not specified, all directories are backed up. Multiple directories are supported. To back up files under /a and /b, specify ["/a", "/b"].

  • File: The file directories to back up. If not specified, all directories are backed up. Multiple directories are supported. To back up files under /a and /b, specify ["/a", "/b"].

  • COMMON_FILE_SYSTEM: Required. The source paths to back up. Multiple paths are supported. To back up /a and /b, specify ["/a", "/b"]. To back up the root path, specify ["/"].

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

  • OTS: The list of data tables to back up. If not specified, all data tables are backed up. Multiple data tables are supported. To back up tables a and b, specify ["a", "b"].

backup/

Include

string

No

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

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

Exclude

string

No

This parameter can be configured when SourceType is set to ECS_FILE, File, NAS, COMMON_NAS, or COMMON_FILE_SYSTEM. Specifies the file types to exclude from the backup. All files of these types are not backed up. The value can be up to 255 characters in length.

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

SpeedLimit

string

No

This parameter is required only when SourceType is set to ECS_FILE or File. Specifies the backup traffic control. The format is {start}{end}{bandwidth}. Multiple traffic control configurations are separated by delimiters, and the time ranges must not overlap.

  • start: The start hour.

  • end: The end hour.

  • bandwidth: The rate limit, in KB/s.

0:24:1024

AdvancedOptions

object

No

The advanced options.

UdmDetail

object

No

The advanced options for ECS full server backup.

ExcludeDiskIdList

array

No

The IDs of the disks that do not need to be protected. If the DiskIdList parameter is not empty, this parameter is ignored.

string

No

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

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

DiskIdList

array

No

The IDs of the disks that need to be protected. If all disks need to be protected, this parameter is empty.

string

No

The ID of the disk that needs to be protected.

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

SnapshotGroup

boolean

No

Specifies whether to create a snapshot-consistent group. You can create a snapshot-consistent group only if all disks are Enterprise SSDs (ESSDs).

true

AppConsistent

boolean

No

Specifies whether to enable application consistency. You can enable application consistency only if all disks are ESSDs.

false

RamRoleName

string

No

This parameter is required only if you set the AppConsistent parameter to true. This parameter specifies the name of the Resource Access Management (RAM) role that is required to create application-consistent snapshots.

AliyunECSInstanceForHbrRole

PreScriptPath

string

No

This parameter is required only if you set the AppConsistent parameter to true. This parameter specifies the path of the pre-freeze scripts that are executed before application-consistent snapshots are created.

/tmp/prescript.sh

PostScriptPath

string

No

This parameter is required only if you set the AppConsistent parameter to true. This parameter specifies the path of the post-thaw scripts that are executed after application-consistent snapshots are created.

/tmp/postscript.sh

EnableFsFreeze

boolean

No

This parameter is required only if you set the AppConsistent parameter to true. This parameter specifies whether to enable Linux fsfreeze to put file systems into the read-only state before application-consistent snapshots are created. Default value: true.

true

TimeoutInSeconds

integer

No

This parameter is required only if you set the AppConsistent parameter to true. This parameter specifies the I/O freeze timeout period. Default value: 30. Unit: seconds.

30

EnableWriters

boolean

No

This parameter is required only if you set the AppConsistent parameter to true. This parameter specifies whether to create application-consistent snapshots. 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 parameter is not empty, the OSS inventory is used for performance optimization.

  • If you want to back up more than 100 million OSS objects, we recommend that you use inventory lists to accelerate incremental backup. Storage fees for inventory lists are included into your OSS bills.

  • A certain amount of time is required for OSS to generate inventory lists. Before inventory lists are generated, OSS objects may fail to be backed up. In this case, you can back up the OSS objects in the next backup cycle.

oss-inventory-default

InventoryCleanupPolicy

string

No

Specifies whether the system deletes the inventory lists when a backup is completed. This parameter is valid only when OSS inventories are used. Valid values:

  • NO_CLEANUP: does not delete inventory lists.

  • DELETE_CURRENT: deletes the current inventory list.

  • DELETE_CURRENT_AND_PREVIOUS: deletes all inventory lists.

NO_CLEANUP

IgnoreArchiveObject

boolean

No

Do not prompt for archival type 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. Valid values:

  • true: enables the feature.

  • false: disables the feature.

true

AdvPolicy

boolean

No

Specifies whether to use an 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 the system performs full backup if incremental backup fails. Valid values:

  • true: The system performs full backup if incremental backup fails.

  • false: The system does not perform full backup if incremental backup fails.

true

FetchSliceSize

integer

No

The size of backup shards (the number of files).

100000

ClusterId

string

No

The ID of the backup client group. When you perform on-premises NAS backup, Cloud Backup selects clients from the specified backup client group.

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

CommonFileSystemDetail

object

No

The advanced options for CPFS backup.

FullOnIncrementFail

boolean

No

Specifies whether the system performs full backup if incremental backup fails. Valid values:

  • true: The system performs full backup if incremental backup fails.

  • false: The system does not perform full backup if incremental backup fails.

true

FetchSliceSize

integer

No

The size of backup shards (the number of files).

100000

CrossAccountType

string

No

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

  • SELF_ACCOUNT: Backup within the same account.

  • CROSS_ACCOUNT: Cross-account backup.

SELF_ACCOUNT

CrossAccountUserId

integer

No

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

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

CrossAccountRoleName

string

No

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

hbrcrossrole

Response elements

Element

Type

Description

Example

object

The response parameters.

Success

boolean

Indicates whether the request was successful.

  • true: Successful.

  • false: Failed.

true

Code

string

The return code. A value of 200 indicates success.

200

Message

string

The returned message. "successful" is returned on success. An error message is returned on failure.

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.