調用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。可能值:
|
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. | 指定的資源描述格式不合法。長度為 2-256 個字元,不能以 http:// 和 https:// 開頭。 |
| 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無效。 |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | 指定的鏡像在該使用者帳號下不存在,請您檢查鏡像 ID 是否正確。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。