All Products
Search
Document Center

Cloud Backup:CreatePolicyBindings

Last Updated:Jun 11, 2026

Mengikat satu atau lebih sumber data ke kebijakan pencadangan.

Deskripsi operasi

  • Anda hanya dapat mengikat sumber data ke satu kebijakan dalam setiap permintaan.

  • Instance Elastic Compute Service (ECS) hanya dapat diikat ke satu kebijakan.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

hbr:CreatePolicyBindings

create

*All Resource

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

PolicyId

string

No

ID kebijakan pencadangan.

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

PolicyBindingList

array<object>

No

Sumber data yang ingin Anda ikat ke kebijakan pencadangan.

array<object>

No

Detail sumber data yang ingin Anda ikat ke kebijakan pencadangan.

PolicyBindingDescription

string

No

Deskripsi asosiasi.

Bind data sources to a backup policy

DataSourceId

string

No

ID sumber data. Arti parameter ini bergantung pada parameter SourceType. Nilai yang valid:

  • UDM_ECS: ID instance Elastic Compute Service (ECS)

  • OSS: nama bucket Object Storage Service (OSS)

  • NAS: ID sistem file File Storage NAS (NAS)

  • COMMON_NAS: ID sistem file NAS on-premises

  • ECS_FILE: ID instance ECS

  • File: ID klien Cloud Backup

  • COMMON_FILE_SYSTEM: ID sumber data pencadangan Cloud Parallel File Storage (CPFS)

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

Disabled

string

No

Menentukan apakah akan menonaktifkan kebijakan pencadangan untuk sumber data. Nilai yang valid:

  • true: menonaktifkan kebijakan pencadangan untuk sumber data

  • false: mengaktifkan kebijakan pencadangan untuk sumber data

true

SourceType

string

No

Jenis sumber data. Nilai yang valid:

  • UDM_ECS: instance ECS

  • OSS: bucket OSS

  • NAS: sistem file NAS

  • COMMON_NAS: sistem file NAS on-premises

  • ECS_FILE: file ECS

  • File: file on-premises

  • COMMON_FILE_SYSTEM: sistem file CPFS

UDM_ECS

Source

string

No

  • Jika parameter SourceType diatur ke OSS, atur parameter Source ke awalan jalur folder yang ingin Anda cadangkan. Jika Anda tidak menentukan parameter Source, seluruh bucket (direktori root) akan dicadangkan.

  • Jika parameter SourceType diatur ke ECS_FILE atau File, atur parameter Source ke jalur file yang ingin Anda cadangkan. Jika Anda tidak menentukan parameter Source, semua jalur akan dicadangkan.

  • Parameter ini wajib jika parameter SourceType diatur ke COMMON_FILE_SYSTEM. Parameter ini menentukan jalur yang akan dicadangkan. Untuk mencadangkan jalur /src, masukkan ["/src"]. Untuk mencadangkan jalur root, masukkan ["/"].

backup/

Include

string

No

Parameter ini wajib hanya jika Anda mengatur parameter SourceType ke ECS_FILE, File, NAS, COMMON_NAS, atau COMMON_FILE_SYSTEM. Parameter ini menentukan jenis file yang akan dicadangkan. Semua file dengan jenis yang ditentukan akan dicadangkan. Nilai dapat memiliki panjang hingga 255 karakter.

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

Exclude

string

No

Parameter ini wajib hanya jika Anda mengatur parameter SourceType ke ECS_FILE, File, NAS, COMMON_NAS, atau COMMON_FILE_SYSTEM. Parameter ini menentukan jenis file yang tidak perlu dicadangkan. Tidak ada file dengan jenis yang ditentukan yang akan dicadangkan. Nilai dapat memiliki panjang hingga 255 karakter.

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

SpeedLimit

string

No

Parameter ini wajib hanya jika Anda mengatur parameter SourceType ke ECS_FILE atau File. Parameter ini menentukan aturan pembatasan. Format: {start}{end}{bandwidth}. Pisahkan beberapa aturan pembatasan dengan tanda pipa (|). Rentang waktu aturan pembatasan tidak boleh tumpang tindih.

  • start: jam mulai.

  • end: jam selesai.

  • bandwidth: bandwidth. Unit: KB/s.

0:24:1024

AdvancedOptions

object

No

Opsi lanjutan.

UdmDetail

object

No

Opsi lanjutan untuk pencadangan instance ECS.

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

Opsi lanjutan untuk pencadangan Object Storage Service (OSS).

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

Opsi lanjutan untuk pencadangan file.

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

Opsi lanjutan untuk pencadangan NAS on-premises.

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

Opsi lanjutan untuk pencadangan CPFS.

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

Menentukan apakah akan mencadangkan dan memulihkan data dalam akun Alibaba Cloud yang sama atau di seluruh akun Alibaba Cloud. Nilai default: SELF_ACCOUNT. Nilai yang valid:

  • SELF_ACCOUNT: mencadangkan data dalam akun Alibaba Cloud yang sama.

  • CROSS_ACCOUNT: mencadangkan data di seluruh akun Alibaba Cloud.

SELF_ACCOUNT

CrossAccountUserId

integer

No

ID akun Alibaba Cloud sumber yang memberi otorisasi kepada akun Alibaba Cloud saat ini untuk mencadangkan data di seluruh akun Alibaba Cloud.

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

CrossAccountRoleName

string

No

Nama peran RAM yang dibuat dalam akun Alibaba Cloud sumber dan ditetapkan ke akun Alibaba Cloud saat ini untuk memberi otorisasi kepada akun Alibaba Cloud saat ini untuk mencadangkan data di seluruh akun Alibaba Cloud.

hbrcrossrole

Elemen respons

Element

Type

Description

Example

object

CreatePolicyBindingsResponse

Success

boolean

Menunjukkan apakah panggilan berhasil. Nilai yang valid:

  • true: Panggilan berhasil.

  • false: Panggilan gagal.

true

Code

string

Kode status HTTP. Kode status 200 menunjukkan bahwa panggilan berhasil.

200

Message

string

Pesan yang dikembalikan. Jika panggilan berhasil, "successful" dikembalikan. Jika panggilan gagal, pesan kesalahan dikembalikan.

successful

RequestId

string

ID permintaan.

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

Contoh

Respons sukses

JSONformat

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

Kode kesalahan

HTTP status code

Error code

Error message

Description

400 PolicyAlreadyBoundWithThisDataSource This datasource has already been bound with the policy, please use another one.

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.