All Products
Search
Document Center

Cloud Backup:UpdatePolicyV2

Last Updated:Jun 11, 2026

Mengubah kebijakan cadangan.

Deskripsi operasi

If you modify a backup policy, the modification takes effect on all data sources that are bound to the backup policy. Proceed with caution.

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:UpdatePolicyV2

update

*All Resource

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

PolicyId

string

No

ID kebijakan cadangan.

po-000************viy

PolicyName

string

No

Nama kebijakan cadangan.

Daily Local Backup + Remote Backup

PolicyDescription

string

No

Deskripsi kebijakan cadangan.

Data is backed up at 10:00:00 every day and replicated to the China (Shanghai) region for geo-redundancy.

Rules

array<object>

No

Aturan dalam kebijakan cadangan.

array<object>

No

The details of the rule.

RuleId

string

No

The rule ID.

rule-000************rof

RuleType

string

No

The type of the rule. Each backup policy must have at least one rule of the BACKUP type and only one rule of the TRANSITION type. Valid values:

  • BACKUP: backup rule

  • TRANSITION: lifecycle rule

  • REPLICATION: replication rule

BACKUP

Schedule

string

No

This parameter is required only if the RuleType parameter is set to BACKUP. This parameter specifies the backup schedule settings. Formats:

  • I|{startTime}|{interval}: The system runs the first backup job at a point in time that is specified in the {startTime} parameter and the subsequent backup jobs at an interval that is specified in the {interval} parameter. For example, I|1631685600|P1D indicates that the system runs the first backup job at 14:00:00 on September 15, 2021 and the subsequent backup jobs once a day.

    • startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds.

    • interval: the interval at which the system runs a backup job. The interval must follow the ISO 8601 standard. For example, PT1H specifies an interval of 1 hour. P1D specifies an interval of one day.

  • C|{startTime}|{crontab}: The system runs backup jobs at a point in time that is specified in the {startTime} parameter based on the {crontab} expression. For example, C|1631685600|0 0 2 ?* 3,5,7 indicates that the system runs backup jobs at 02:00:00 every Tuesday, Thursday, and Saturday from14:00:00 on September 15, 2021.``

    • startTime: the time at which the system starts to run a backup job. The time must follow the UNIX time format. Unit: seconds.

    • crontab: the crontab expression. For example, 0 0 2 ?* 3,5,7 indicates 02:00:00 every Tuesday, Thursday, and Saturday.``

The system does not run a backup job before the specified point in time. Each backup job, except the first one, starts only after the previous backup job is completed.

I|1648647166|P1D

BackupType

string

No

This parameter is required only if the RuleType parameter is set to BACKUP. This parameter specifies the backup type. Valid value: COMPLETE, which indicates full backup.

COMPLETE

Retention

integer

No

This parameter is required only if the RuleType parameter is set to TRANSITION or REPLICATION.

  • If the RuleType parameter is set to TRANSITION, this parameter specifies the retention period of the backup data. Minimum value: 1. Unit: days.

  • If the RuleType parameter is set to REPLICATION, this parameter specifies the retention period of remote backups. Minimum value: 1. Unit: days.

7

ReplicationRegionId

string

No

This parameter is required only if the RuleType parameter is set to REPLICATION. This parameter specifies the ID of the destination region.

cn-shanghai

ArchiveDays

integer

No

This parameter is required only if the RuleType parameter is set to TRANSITION. This parameter specifies the time when data is dumped from a backup vault to an archive vault. Unit: days.

90

ColdArchiveDays

integer

No

This parameter is required only if the RuleType parameter is set to TRANSITION. This parameter specifies the time when data is dumped from a backup vault to a cold archive vault. Unit: days.

365

VaultId

string

No

This parameter is required only if the RuleType parameter is set to BACKUP. The ID of the backup vault.

v-0001************aseg

RetentionRules

array<object>

No

This parameter is required only if the RuleType parameter is set to TRANSITION. This parameter specifies the special retention rules.

object

No

The special retention rule.

AdvancedRetentionType

string

No

The type of the special retention rule. Valid values:

  • WEEKLY: retains weekly backups

  • MONTHLY: retains monthly backups

  • YEARLY: retains yearly backups

YEARLY

WhichSnapshot

integer

No

Specifies which backup is retained based on the special retention rule. Only the first backup can be retained.

1

Retention

integer

No

The special retention period of backups. Minimum value: 1. Unit: days.

365

KeepLatestSnapshots

integer

No

Specifies whether to enable the feature of keeping at least one backup version. Valid values:

  • 0: The feature is disabled.

  • 1: The feature is enabled.

1

DataSourceFilters

array<object>

No

This parameter is required only if the RuleType parameter is set to TAG. This parameter specifies the data source filter rule.

object

No

SourceType

string

No

The type of the data source. Valid values:

  • UDM_ECS: Elastic Compute Service (ECS) instance This type of data source is supported only if the RuleType parameter is set to UDM_ECS_ONLY.

  • OSS: Object Storage Service (OSS) bucket This type of data source is supported only if the RuleType parameter is set to STANDARD.

  • NAS: File Storage NAS (NAS) file system This type of data source is supported only if the RuleType parameter is set to STANDARD.

  • ECS_FILE: ECS file This type of data source is supported only if the RuleType parameter is set to STANDARD.

  • OTS: Tablestore instance This type of data source is supported only if the RuleType parameter is set to STANDARD.

UDM_ECS

DataSourceIds

array

No

This parameter is deprecated.

string

No

This parameter is deprecated.

deprecated

TagFilters

array<object>

No

This parameter is required only if the RuleType parameter is set to TAG. This parameter specifies the resource tag filter rule.

object

No

Key

string

No

The tag key.

env

Value

string

No

The tag value. If you leave this parameter empty, the value is any value.

prod

Operator

string

No

The tag-based matching rule. Valid values:

  • EQUAL: Both the tag key and tag value are matched.

  • NOT: The tag key is matched and the tag value is not matched.

EQUAL

Immutable

boolean

No

This parameter is required only if the PolicyType parameter is set to UDM_ECS_ONLY. This parameter specifies whether to enable the immutable backup feature.

true

Elemen respons

Element

Type

Description

Example

object

UpdatePolicyResponse

Success

boolean

Indicates whether the call is successful. Valid values:

  • true: The call is successful.

  • false: The call fails.

true

Code

string

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

200

Message

string

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

successful

RequestId

string

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Contoh

Respons sukses

JSONformat

{
  "Success": true,
  "Code": "200",
  "Message": "successful",
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Kode kesalahan

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.