Mengubah kebijakan snapshot otomatis, seperti pengatur waktu pembuatan snapshot, tanggal pengulangan, dan periode retensi.
Deskripsi operasi
Saat memanggil operasi ini, perhatikan hal-hal berikut:
Kebijakan sistem tidak dapat diubah.
Setelah Anda mengubah kebijakan snapshot otomatis, disk yang telah menerapkan kebijakan tersebut akan langsung menjalankan kebijakan snapshot otomatis yang telah dimodifikasi.
Jika replikasi snapshot lintas wilayah diaktifkan dan tidak ada parameter enkripsi yang dikonfigurasi, snapshot terenkripsi akan dienkripsi secara default menggunakan kunci layanan wilayah tujuan.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifyAutoSnapshotPolicyEx |
update |
*Snapshot.
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| regionId |
string |
Yes |
ID wilayah kebijakan snapshot otomatis. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| autoSnapshotPolicyId |
string |
Yes |
ID kebijakan snapshot otomatis. Anda dapat memanggil DescribeAutoSnapshotPolicyEx untuk mengkueri kebijakan snapshot otomatis yang tersedia. |
sp-bp12m37ccmxvbmi5**** |
| autoSnapshotPolicyName |
string |
No |
Nama kebijakan snapshot otomatis. Jika parameter ini dikosongkan, nama tidak akan diubah. |
SPTestName |
| timePoints |
string |
No |
Waktu pembuatan snapshot otomatis. Waktu ditampilkan dalam UTC+8. Unit: hours. Nilai valid: 0 hingga 23, yang sesuai dengan 24 pengatur waktu dari 00:00 hingga 23:00. Misalnya, 1 menunjukkan 01:00. Untuk membuat beberapa snapshot otomatis dalam satu hari, tentukan beberapa pengatur waktu:
|
["0", "1"] |
| repeatWeekdays |
string |
No |
Hari dalam seminggu saat snapshot otomatis dibuat. Unit: days. Siklusnya mingguan. Nilai valid: 1 hingga 7. Misalnya, 1 menunjukkan Senin. Untuk membuat beberapa snapshot otomatis dalam satu minggu, tentukan beberapa hari:
|
["1", "7"] |
| retentionDays |
integer |
No |
Periode retensi snapshot otomatis. Unit: days. Nilai valid:
Nilai default: -1. |
30 |
| EnableCrossRegionCopy |
boolean |
No |
Apakah akan mengizinkan replikasi lintas wilayah secara otomatis.
|
false |
| TargetCopyRegions |
string |
No |
Wilayah tujuan tempat snapshot direplikasi lintas wilayah. Saat ini, Anda hanya dapat mengatur satu wilayah tujuan. |
["cn-hangzhou"] |
| CopiedSnapshotsRetentionDays |
integer |
No |
Periode retensi replika snapshot lintas wilayah. Unit: days. Nilai valid:
Nilai default: -1. |
30 |
| CopyEncryptionConfiguration |
object |
No |
Objek parameter enkripsi untuk replikasi snapshot lintas wilayah. |
|
| Arn |
array<object> |
No |
Parameter ini tidak tersedia untuk publik. |
|
|
object |
No |
|||
| AssumeRoleFor |
integer |
No |
Parameter ini tidak tersedia untuk publik. |
1000000000 |
| RoleType |
string |
No |
Parameter ini tidak tersedia untuk publik. |
hide |
| Rolearn |
string |
No |
Parameter ini tidak tersedia untuk publik. |
hide |
| Encrypted |
boolean |
No |
Apakah akan mengaktifkan enkripsi untuk replikasi snapshot lintas wilayah. Nilai valid:
Nilai default: false. |
false |
| KMSKeyId |
string |
No |
ID kunci KMS yang digunakan untuk replikasi snapshot lintas wilayah terenkripsi. |
0e478b7a-4262-4802-b8cb-00d3fb40826X |
| TargetTags |
array<object> |
No |
Daftar tag Sumber daya target. Kebijakan snapshot otomatis mencocokkan Sumber daya target berdasarkan tag. |
|
|
object |
No |
Tag Sumber daya target. |
||
| Key |
string |
No |
Kunci tag. Nilai valid N: 1 hingga 5. Kunci tag tidak boleh berupa string kosong. Kunci tag dapat memiliki panjang hingga 128 karakter dan tidak boleh diawali dengan aliyun atau acs:. Kunci tag tidak boleh mengandung http:// atau https://. |
|
| Value |
string |
No |
Nilai tag. Nilai valid N: 1 hingga 5. Nilai tag dapat memiliki panjang hingga 128 karakter dan tidak boleh mengandung Catatan
Jika Anda memasukkan nilai kosong atau string kosong, nilai tag akan mencocokkan nilai apa pun. |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Contoh
Respons sukses
JSONformat
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter.EncryptedIllegal | The Encrypted parameter must be set to true when KMSKeyId is specified. Please adjust the parameters and try again. | |
| 400 | InvalidParameter.KmsNotEnabled | The operation failed because KMS is not activated. Please activate KMS in the KMS console and try again. | |
| 400 | InvalidParameter.Encrypted.KmsNotEnable | The operation failed because KMS is not activated. Please activate KMS in the KMS console and try again. | |
| 400 | InvalidParam.EncryptedMismatch | Creating a disk from a shared encrypted image requires encryption with your own KMS key. Please set the Encrypted parameter to true. | |
| 400 | InvalidTargetTags.NotSupported | When the parameter AssociationType is set to AssociatedWithDisk, the TargetTags parameter is not supported. | |
| 400 | InvalidTargetTagKey.Malformed | The specified TargetTag.n.Key [%s] is not valid. | |
| 400 | InvalidTargetTagValue.Malformed | The specified TargetTag.n.Value [%s] is not valid. | |
| 400 | Duplicate.TargetTagKey | Duplicate keys exist in the specified parameter TargetTags. Please ensure key uniqueness. | |
| 400 | InvalidTargetTag.LimitExceed | The number [%s] of the specified parameter TargetTag exceeds the limit [%s]. | |
| 403 | ParameterInvalid | The specified RegionId parameter is invalid. | Kebijakan snapshot otomatis yang ditentukan tidak ada. Periksa apakah kebijakan snapshot otomatis benar. |
| 403 | InvalidParameter.TargetCopyRegions | The specified TargetCopyRegions is invalid. | |
| 403 | InvalidParameter.CopiedSnapshotsRetentionDays | The specified CopiedSnapshotsRetentionDays is invalid. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service does not have permission to access your KMS key. Please verify that the specified KMS key has authorized the ECS service. | |
| 403 | Abs.InvalidAction.RegionNotSupport | This region does not support this action. | Wilayah ini tidak mendukung operasi ini. |
| 403 | InvalidOperation.PolicyTypeUnsupported | The current policy type does not support this operation. Only custom policies are permitted. | Jenis kebijakan saat ini tidak mendukung operasi ini. Hanya kebijakan kustom yang mengizinkan operasi ini. |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The specified KMS key must be in an enabled state. Please enable the key in the KMS console and try again. | |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The specified KMS key is not authorized for the ECS service. Please grant the ECS service permission to use the key in the KMS console and try again. | |
| 403 | InvalidOperation.CopyingDataToThisRegionUnsupported | Data transfer to the current region from other regions is not supported. | Hanya wilayah tertentu yang dapat mereplikasi data ke wilayah saat ini. |
| 404 | ParameterInvalid | The specified automatic snapshot policy does not exist. | |
| 404 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. Please verify that the key ID is correct and that the key resides in the current region. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.