呼叫 ModifyImageAttribute 介面,並可以指定 ImageId、ImageFamily 等參數,修改一份自訂映像的屬性,例如映像族系、名稱、啟動模式、狀態以及是否支援 NVMe 等。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:ModifyImageAttribute |
update |
*Image
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
自訂映像所在的地域 ID。您可以呼叫 DescribeRegions 查看最新的阿里雲地域清單。 |
cn-hangzhou |
| ImageId |
string |
是 |
自訂映像的 ID。 |
m-bp18ygjuqnwhechc**** |
| ImageName |
string |
否 |
自訂映像的名稱。長度為 2~128 個字元。必須以大小寫字母或中文開頭,不能以 aliyun 或 acs: 開頭,不能包含 http:// 或者 https://。可以包含數字、半形句號(.)、半形冒號(:)、底線(_)或者連字號(-)。 預設值:空,表示保持原有名稱不變。 |
testImageName |
| Status |
string |
否 |
映像狀態,取值範圍:
說明
如果您需要復原映像族系中的自訂映像至上一個版本,可以將最新可用的自訂映像設定為棄用狀態,但如果該映像為映像族系中唯一一個可用狀態的自訂映像,則棄用映像以後該映像族系將無可用狀態自訂映像用來建立執行個體,因此請謹慎操作。 |
Deprecated |
| ImageFamily |
string |
否 |
映像族系名稱。長度為 2~128 個字元。必須以大小寫字母或中文開頭,不能以 aliyun 或 acs: 開頭,不能包含 http:// 或者 https://。可以包含數字、半形句號(.)、半形冒號(:)、底線(_)或者連字號(-)。 預設值:空。 |
hangzhou-daily-update |
| BootMode |
string |
否 |
修改映像的啟動模式。取值範圍:
重要
為了避免使用映像不支援的啟動模式導致執行個體無法正常啟動,請您務必在修改之前了解目標映像支援的啟動模式。映像啟動模式詳情,請參見映像啟動模式。 枚舉值:
|
BIOS |
| LicenseType |
string |
否 |
匯入映像後,啟用作業系統採用的授權類型。目前僅支援 BYOL。 BYOL:來源作業系統自帶的授權。採用 BYOL 時,您必須確保您的授權金鑰支援在阿里雲使用。 |
BYOL |
| Description |
string |
否 |
自訂映像的描述資訊。長度為 2~256 個字元。不能以 http:// 或 https:// 開頭。 預設值:空,表示保持原有描述資訊不變。 |
testDescription |
| Features |
object |
否 |
映像特性相關屬性。 |
|
| NvmeSupport |
string |
否 |
修改映像的 NVMe 支援屬性,不傳則保持不變。 重要 開啟前必須確保 OS 已預裝 NVMe 驅動程式。建議路徑:執行個體安裝驅動程式 - 製作自訂映像 - 呼叫本介面。若無驅動程式強行開啟將導致執行個體啟動失敗。 |
supported |
| ImdsSupport |
string |
否 |
映像的中繼資料存取模式,可能值:
|
v2 |
| DryRun |
boolean |
否 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
樣本
正常返回樣本
JSON格式
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidImageName.Malformed | Image names must be between 2 and 128 characters long, using either English or Chinese characters. The name must start with a letter or a Chinese character, and can include numbers, colons, underscores and hyphens. | 映像名稱的長度為 2~128 個英文或中文字元。必須以大小寫字母或中文開頭,可以包含數字、半形冒號(:)、底線(_)或者連字號(-)。 |
| 400 | MissingParameter | The input parameter "RegionId" that is mandatory for processing this request is not supplied. | |
| 400 | InvalidImageName.Duplicated | The specified Image name has already bean used. | 指定的映像名稱已被使用。 |
| 400 | InvalidDescription.Malformed | The specified description is wrongly formed. | 指定的參數 description 無效。 |
| 400 | ImageQuotaFull.ImageFamily | The specified image family has exceeded max number of images for one image family. | |
| 400 | InvalidImageFamily.Malformed | The specified parameter "ImageFamily" is malformed. | |
| 400 | ImageFamilyQuotaFull | The specified region has exceeded max number of image family. | |
| 400 | InvalidBootMode.NotSupport | The specified parameter BootMode is not supported. | |
| 400 | InvalidLicenseType.NotSupported | The specified parameter LicenseType is not supported. | |
| 400 | InvalidParameter.FeaturesImdsSupport | The specified parameter Features.ImdsSupport is not supported. | 指定的參數 Features.ImdsSupport 不支援。 |
| 403 | ImageStatus.NotAvailable | The specified image status is not available. | 指定的映像狀態不是 Available。 |
| 403 | ImageStatus.NotDeprecated | The specified image status is not deprecated. | 指定的映像狀態未棄用。 |
| 403 | ImageUseShared | The specified image has been shared to others, please remove shared accounts first. | |
| 403 | OperationDeined.ImageUsingByInstance | The boot mode of the image cannot be modified because it has associated instances. | 映像有關聯執行個體時,不允許修改映像的啟動模式屬性。 |
| 403 | InvalidOperation.FeaturesImdsSupportNotMatch | The specified parameter Features.ImdsSupport can not be set to v1 from v2. | 指定的參數 Features.ImdsSupport 不能從 v2 設定成 v1。 |
| 403 | InvalidStatus.ImageIsCreating | The operation cannot be performed because the image is creating. Please wait until the creation is complete and try again. | 映像還在建立中,該操作無法執行,請等待建立完畢再重試。 |
| 403 | InvalidOperation.PublicImageUnsupported | The community image's publisher is not the current account. Modification is not permitted. | 社群映像的發佈者不是當前帳戶。不允許修改。 |
| 403 | InvalidDescription.Malformed | The specified parameter description is not valid. | 指定的參數 description 無效。 |
| 403 | InvalidBootMode.SecureBootUnsupported | Secure Boot requires UEFI or UEFI-Preferred boot mode. Please check the BootMode and try again. | 安全啟動要求使用 UEFI 或 UEFI-Preferred 啟動模式。請檢查啟動模式後重試。 |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | 沒有找到指定的映像,請確保映像在當前區域存在或映像狀態可用。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。