Kunci Snapshot dalam mode compliance untuk melindunginya dari penghapusan yang tidak disengaja atau berbahaya. Selama dikunci, Snapshot tersebut tidak dapat dihapus.
Deskripsi operasi
Anda juga dapat menggunakan antarmuka ini untuk mengonfigurasi ulang Snapshot yang telah dikunci. Opsi konfigurasi yang tersedia bergantung pada mode penguncian dan status kunci:
Jika Snapshot dikunci dalam mode compliance dan masih berada dalam periode cool-off, Anda dapat memperpanjang atau memperpendek periode cool-off serta durasi kunci.
Jika Snapshot dikunci dalam mode compliance dan periode cool-off-nya telah berakhir, Anda hanya dapat memperpanjang durasi kunci.
Mengonfigurasi ulang Snapshot yang dikunci selama periode cool-off akan memulai operasi penguncian baru. Operasi ini mengatur ulang semua parameter kunci sekaligus, bukan menyesuaikannya satu per satu.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:LockSnapshot |
update |
*Snapshot
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah. Anda dapat memanggil operasi DescribeRegions untuk mengambil daftar terbaru wilayah Alibaba Cloud. |
cn-hangzhou |
| SnapshotId |
string |
Yes |
ID Snapshot. |
s-9dp2qojdpdfmgfmf**** |
| LockMode |
string |
Yes |
Mode kunci. Nilai yang valid:
|
compliance |
| LockDuration |
integer |
Yes |
Durasi penguncian Snapshot. Kunci akan kedaluwarsa secara otomatis pada akhir periode ini. Unit: hari. Nilai yang valid: 1 hingga 36500. |
1 |
| CoolOffPeriod |
integer |
Yes |
Periode cool-off. Dalam mode compliance, Anda dapat menetapkan periode cool-off atau melewatkannya untuk mengunci Snapshot segera. Selama periode cool-off, pengguna dengan izin RAM yang diperlukan dapat meng-unlock Snapshot, mengubah periode cool-off, dan durasi kunci. Snapshot tidak dapat dihapus selama periode cool-off. Setelah periode cool-off berakhir, Anda hanya dapat memperpanjang durasi kunci. Unit: jam. Nilai yang valid: 0 hingga 72. Nilai Jika Snapshot sudah dikunci dalam mode compliance, Anda harus menetapkan parameter ini ke |
3 |
| DryRun |
boolean |
No |
Menentukan apakah akan melakukan dry run untuk permintaan. Nilai yang valid:
|
false |
| ClientToken |
string |
No |
Token yang Anda berikan untuk memastikan idempotensi permintaan. Token hanya boleh berisi karakter ASCII dan tidak boleh lebih dari 64 karakter. Untuk detailnya, lihat Cara memastikan idempotensi. |
5EC38E7D-389F-1925-ABE2-D7925A8F**** |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Skema respons |
||
| RequestId |
string |
ID permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
| LockedSnapshotInfo |
object |
Informasi tentang Snapshot yang dikunci. |
|
| SnapshotId |
string |
ID Snapshot. |
s-9dp2qojdpdfmgfmf**** |
| LockMode |
string |
Mode kunci. Nilai yang mungkin:
|
compliance |
| LockStatus |
string |
Status kunci. Nilai yang mungkin:
|
compliance-cooloff |
| LockCreationTime |
string |
Waktu saat Snapshot dikunci. Waktu dalam UTC dan diformat sebagai |
2025-10-15T10:00:00Z |
| CoolOffPeriod |
integer |
Periode cool-off untuk mode compliance. Unit: jam. |
3 |
| CoolOffPeriodExpiredTime |
string |
Waktu saat periode cool-off untuk mode compliance berakhir. Waktu dalam UTC dan diformat sebagai |
2025-10-15T13:00:00Z |
| LockDuration |
integer |
Durasi kunci. Snapshot akan otomatis di-unlock ketika durasi ini berakhir. Unit: hari. |
1 |
| LockDurationStartTime |
string |
Waktu mulai durasi kunci. Waktu dalam UTC dan diformat sebagai Jika Anda mengunci Snapshot dalam status |
2025-10-15T10:00:00Z |
| LockExpiredTime |
string |
Waktu saat kunci kedaluwarsa. Waktu dalam UTC dan diformat sebagai |
2025-10-16T10:00:00Z |
Contoh
Respons sukses
JSONformat
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"LockedSnapshotInfo": {
"SnapshotId": "s-9dp2qojdpdfmgfmf****",
"LockMode": "compliance",
"LockStatus": "compliance-cooloff",
"LockCreationTime": "2025-10-15T10:00:00Z",
"CoolOffPeriod": 3,
"CoolOffPeriodExpiredTime": "2025-10-15T13:00:00Z",
"LockDuration": 1,
"LockDurationStartTime": "2025-10-15T10:00:00Z",
"LockExpiredTime": "2025-10-16T10:00:00Z"
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidLockMode.Malformed | The specified parameter LockMode is invalid. Please check the valid range for this parameter. | |
| 400 | InvalidLockDuration.ExceedRetentionDays | The specified parameter LockDuration is invalid. The LockDuration should be less than the snapshot RetentionDays. | |
| 400 | InvalidCoolOffPeriod.ExceedLockDuration | The specified parameter CoolOffPeriod is invalid. The CoolOffPeriod should be less than the LockDuration. | |
| 403 | InvalidOperation.SnapshotNotAvailable | The unavailable snapshot does not support locking. | |
| 403 | InvalidOperation.ResourceManagedByCloudProduct | The current operation is not supported because the resource is managed by a cloud product [%s]. Please contact the relevant cloud product to confirm the reason. | |
| 403 | InvalidOperation.LockSharedSnapshotUnsupported | The shared snapshot does not support locking. | |
| 403 | InvalidOperation.CoolOffPeriodExpired | The snapshot is locked in compliance mode, and the cool-off period has expired. The current operation is not supported. | |
| 404 | InvalidSnapshotId.NotFound | The specified snapshot is not found |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.