Call the ModifyImageAttribute API to modify the attributes of a custom image, such as its image family, name, boot mode, status, or whether NVMe is supported.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifyImageAttribute |
update |
*Image
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The ID of the region where the custom image is located. You can call the DescribeRegions operation to view the latest list of Alibaba Cloud regions. |
cn-hangzhou |
| ImageId |
string |
Yes |
The ID of the custom image. |
m-bp18ygjuqnwhechc**** |
| ImageName |
string |
No |
The name of the custom image. The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character. The name cannot start with If you do not specify this parameter, the original name is retained. |
testImageName |
| Status |
string |
No |
The image status. Valid values:
Note
However, if this is the only available custom image in the image family, deprecating it prevents the creation of instances from any image in that family. Use this option with caution. |
Deprecated |
| ImageFamily |
string |
No |
The name of the image family. The name must be 2 to 128 characters in length. It must start with a letter or a Chinese character. The name cannot start with By default, this parameter is empty. |
hangzhou-daily-update |
| BootMode |
string |
No |
The boot mode of the image. Valid values:
Important
To prevent startup failures, verify the boot modes that the image supports before you change its boot mode. For more information, see Boot modes. Valid values:
|
BIOS |
| LicenseType |
string |
No |
The license type for activating the operating system after you import the image. The only valid value is
|
BYOL |
| Description |
string |
No |
The new description of the custom image. The description must be 2 to 256 characters in length and cannot start with If you do not specify this parameter, the original description is retained. |
testDescription |
| Features |
object |
No |
The features of the image. |
|
| NvmeSupport |
string |
No |
Specifies whether the image supports NVMe. Valid values:
|
supported |
| ImdsSupport |
string |
No |
The metadata access mode of the image. Valid values:
|
v2 |
| DryRun |
boolean |
No |
Specifies whether to perform a dry run to check whether the request is valid. Valid values:
|
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response data. |
||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 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. | The length of the image name is 2 to 128 English or Chinese characters. It must start with an uppercase letter or a Chinese character and can contain numbers, colons (:), underscores (_), or dashes (-). |
| 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. | The resource description is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or 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. | The specified parameter Features.ImdsSupport is not supported. |
| 403 | ImageStatus.NotAvailable | The specified image status is not available. | |
| 403 | ImageStatus.NotDeprecated | The specified image status is not deprecated. | The specified image is not in the Deprecated state. |
| 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. | The boot mode of the image cannot be modified while the image has associated instances. |
| 403 | InvalidOperation.FeaturesImdsSupportNotMatch | The specified parameter Features.ImdsSupport can not be set to v1 from v2. | The specified parameter Features.ImdsSupport can not be set to v1 from v2. |
| 403 | InvalidStatus.ImageIsCreating | The operation cannot be performed because the image is creating. Please wait until the creation is complete and try again. | 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. | The community image's publisher is not the current account. Modification is not permitted. |
| 403 | InvalidDescription.Malformed | The specified parameter description is not valid. | The specified parameter description is invalid. |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | The specified image does not exist in this account. Check whether the image ID is correct. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.