All Products
Search
Document Center

:CreatePolicyBindings

Last Updated:Feb 01, 2023

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.

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
PolicyBindingListarrayNo

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

objectNo

The details of 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
DisabledstringNo

Specifies whether to disable the backup policy for the data source. Valid values:

  • true: disables the backup policy for the data source
  • false: enables the backup policy for the data source
true
SourceTypestringNo

The type of the data source. Valid values:

  • UDM_ECS: ECS instance backup
UDM_ECS
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 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 you set the AppConsistent parameter 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 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
PostScriptPathstringNo

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
EnableFsFreezebooleanNo

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
TimeoutInSecondslongNo

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
EnableWritersbooleanNo

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

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

Example

Normal return example

JSONFormat

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

Error codes

For a list of error codes, visit the API error center.