All Products
Search
Document Center

Cloud Backup:CreatePolicyBindings

Last Updated:Mar 03, 2024

Binds one or more data sources to a backup policy.

Operation description

  • You can bind data sources to only one policy in each request.
  • Elastic Compute Service (ECS) instances can be bound to only one policy.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
PolicyIdstringNo

The ID of the backup policy.

po-000************8ep
PolicyBindingListobject []No

The data sources that you want to bind to the backup policy.

PolicyBindingDescriptionstringNo

The description of the association.

Bind data sources to a backup policy
DataSourceIdstringNo

The ID of the data source.

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

The type of the data source. Valid values:

  • UDM_ECS: ECS instance backup
UDM_ECS
SourcestringNo

The prefix of the path to the folder that you want to back up. By default, the entire OSS bucket is backed up.

backup/
AdvancedOptionsobjectNo

Advanced options.

UdmDetailobjectNo

The details of ECS instance backup.

ExcludeDiskIdListarrayNo

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

stringNo

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

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

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

stringNo

The ID of the disk that needs to be protected.

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

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

true
AppConsistentbooleanNo

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

false
RamRoleNamestringNo

This parameter is required only if the AppConsistent parameter is set to true. This parameter specifies the name of the RAM role that is required to create application-consistent snapshots.

AliyunECSInstanceForHbrRole
PreScriptPathstringNo

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

/tmp/prescript.sh
PostScriptPathstringNo

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

/tmp/postscript.sh
EnableFsFreezebooleanNo

This parameter is required only if the AppConsistent parameter is set 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
TimeoutInSecondslongNo

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

30
EnableWritersbooleanNo

This parameter is required only if the AppConsistent parameter is set 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
OssDetailobjectNo

The advanced options for OSS backup.

InventoryIdstringNo

OSS inventory name.

  • If you want to back up more than 100 million OSS objects, we recommend that you use inventories to accelerate incremental backup. Storage fees for inventory lists are included into your OSS bills.
  • OSS inventory file generation takes time. The backup may fail before the OSS inventory file is generated. You can wait for the next cycle to execute.
oss-inventory-default
InventoryCleanupPolicystringNo

Whether delete inventory file after backup.

  • NO_CLEANUP: Do not delete.
  • DELETE_CURRENT: Delete current.
  • DELETE_CURRENT_AND_PREVIOUS: Delete all.
NO_CLEANUP
CrossAccountTypestringNo

Specifies whether data is backed up and restored within the same Alibaba Cloud account or across Alibaba Cloud accounts. Valid values:

  • SELF_ACCOUNT: Data is backed up and restored within the same Alibaba Cloud account.
  • CROSS_ACCOUNT: Data is backed up and restored across Alibaba Cloud accounts.
SELF_ACCOUNT
CrossAccountUserIdlongNo

The source Alibaba Cloud account ID when backup across Alibaba Cloud accounts.

144**********732
CrossAccountRoleNamestringNo

The name of the RAM role that is created within the source Alibaba Cloud account and assigned to the current Alibaba Cloud account to authorize the current Alibaba Cloud account to back up data across Alibaba Cloud accounts.

hbrcrossrole

Response parameters

ParameterTypeDescriptionExample
object

CreatePolicyBindingsResponse

Successboolean

Indicates whether the call is successful. Valid values:

  • true: The call is successful.
  • false: The call fails.
true
Codestring

The HTTP status code. The status code 200 indicates that the call is successful.

200
Messagestring

The message that is returned. If the call is successful, "successful" is returned. If the call fails, an error message is returned.

successful
RequestIdstring

The ID of the request.

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

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError message
400PolicyAlreadyBoundWithThisDataSourceThis datasource has already been bound with the policy, please use another one.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history