呼叫 DeleteImage 介面,並可以指定參數 ImageId、Force 刪除一份自訂映像。
介面說明
對於不允許刪除自訂映像的情況以及映像刪除後的注意事項,請參見刪除自訂映像。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:DeleteImage |
delete |
*Image
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
自訂映像所在的地域 ID。您可以呼叫 DescribeRegions 查看最新的阿里雲地域列表。 |
cn-hangzhou |
| ImageId |
string |
是 |
映像 ID。如果指定的自訂映像不存在,則請求將被忽略。 |
m-bp67acfmxazb4p**** |
| Force |
boolean |
否 |
是否執行強制刪除。取值範圍:
預設值:false。 |
false |
| DryRun |
boolean |
否 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
樣本
正常返回樣本
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
異常返回樣本
JSON格式
{
"RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 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. | |
| 403 | ImageUseShared | The specified image has been shared to others. You can use the DescribeImageSharePermission API to query the users who have been shared. | |
| 403 | OperationDenied.ImageCopying | The image is being copied. Please use the CancelCopyImage API. | |
| 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. | |
| 403 | ImageIsPublic | You can not delete public image, please modify it to private. | |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。