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
Test
RAM authorization
|
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:
|
i-bp1************dl8 |
| Disabled |
string |
No |
Specifies whether the policy is suspended for the data source. Valid values:
|
true |
| SourceType |
string |
No |
The data source type. Valid values:
|
UDM_ECS |
| Source |
string |
No |
The source path. The meaning varies based on the value of SourceType:
|
/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
|
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:
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.
|
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 |
| 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 |
| AdvPolicy |
boolean |
No |
Specifies whether to use the advanced policy. Valid values:
|
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 |
| 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 |
| 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 |
| 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 |
| 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.