Menghapus image kustom. Anda dapat menentukan parameter ImageId dan Force untuk menghapus image kustom.
Deskripsi operasi
Untuk skenario di mana penghapusan image kustom tidak diizinkan dan tindakan pencegahan setelah image dihapus, lihat Menghapus image 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 image kustom. Anda dapat memanggil DescribeRegions untuk mengkueri daftar wilayah terbaru. |
cn-hangzhou |
| ImageId |
string |
Yes |
ID image. Jika image kustom yang ditentukan tidak ada, permintaan akan diabaikan. |
m-bp67acfmxazb4p**** |
| Force |
boolean |
No |
Menentukan apakah akan menghapus paksa image kustom. Nilai yang valid:
Nilai default: false. |
false |
| DryRun |
boolean |
No |
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"
}
Respons error
JSONformat
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
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 telah digunakan untuk membuat instance. Anda dapat menggunakan API DescribeInstances untuk meng-query instance-instance tersebut, atau menggunakan parameter 'force' untuk melanjutkan eksekusi. |
| 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. Anda dapat menggunakan API DescribeImageSharePermission untuk meng-query pengguna yang telah menerima share tersebut. |
| 403 | OperationDenied.ImageCopying | The image is being copied. Please use the CancelCopyImage API. | Image sedang disalin, harap gunakan API CancelCopyImage. |
| 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. Anda dapat menggunakan API DescribeTasks untuk memeriksa status tugas dan membatalkannya jika diperlukan. |
| 403 | ImageIsPublic | You can not delete public image, please modify it to private. | Image yang ditentukan merupakan image komunitas dan tidak dapat dihapus secara langsung. Anda perlu memanggil ModifyImageSharePermission terlebih dahulu untuk menarik image komunitas, lalu coba hapus kembali. |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | Image yang ditentukan tidak ada di akun pengguna ini, harap periksa apakah ID image sudah benar. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.