Menghapus gambar kustom dengan menentukan parameter ImageId dan Force.
Deskripsi operasi
Untuk informasi mengenai skenario di mana gambar kustom tidak dapat dihapus dan tindakan pencegahan setelah gambar dihapus, lihat Menghapus Gambar Kustom.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DeleteImage |
delete |
*Image
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
ID wilayah gambar kustom. Anda dapat memanggil operasi DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| ImageId |
string |
Yes |
ID gambar. Jika gambar kustom yang ditentukan tidak ada, permintaan akan diabaikan. |
m-bp67acfmxazb4p**** |
| Force |
boolean |
No |
Apakah akan menjalankan penghapusan paksa. Nilai valid:
Nilai default: false. |
false |
| DryRun |
boolean |
No |
Apakah akan menjalankan dry run. Nilai valid:
Nilai default: false. |
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 |
|---|---|---|---|
| 403 | ImageUsingByInstance | The specified image has been used to create instances. You can use the DescribeInstances API to query these instances, or you can use the force parameter to proceed. | Image yang ditentukan tidak dapat dihapus karena instans yang dibuat dari image ini masih ada. |
| 403 | ImageUseShared | The specified image has been shared to others. You can use the DescribeImageSharePermission API to query the users who have been shared. | Image yang ditentukan telah dibagikan kepada pengguna lain. |
| 403 | OperationDenied.ImageCopying | The image is being copied. Please use the CancelCopyImage API. | Image sedang disalin. Coba lagi nanti. |
| 403 | ImageIsImporting | The specified Image is importing. | |
| 403 | ImageIsExporting | The specified image is currently being exported. You can use the DescribeTasks API to check the status of related tasks and cancel them if needed. | Image yang ditentukan sedang diekspor. |
| 403 | ImageIsPublic | You can not delete public image, please modify it to private. | Image yang ditentukan sudah dalam status publik. Tidak diperlukan pengaturan ulang. |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | Image yang ditentukan tidak ada di bawah akun ini. Periksa apakah ID image benar. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.