All Products
Search
Document Center

Elastic Compute Service:ModifyImageAttribute

Last Updated:Apr 11, 2024

Modifies the name, description, status, or image family of a custom image.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the custom image. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
ImageIdstringYes

The ID of the custom image.

m-bp18ygjuqnwhechc****
ImageNamestringNo

The name of the custom image. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with acs: or aliyun. It cannot contain http:// or https://. It can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-).

By default, this parameter is empty. In this case, the original name is retained.

testImageName
StatusstringNo

The new state of the custom image. Valid values:

  • Deprecated: puts the image into the Deprecated state. If the custom image is shared, you must unshare it before you can put it into the Deprecated state. Images in the Deprecated state cannot be shared or copied, but can be used to create instances or replace system disks.
  • Available: puts the image into the Available state. You can restore an image from the Deprecated state to the Available state.
Note If you want to roll back a custom image in the image family to a previous version, you can put the latest available custom image into the Deprecated state. If no custom images are in the Available state within the image family, an image family cannot be used to create instances. Proceed with caution if only a single custom image is in the Available state within the image family.
Deprecated
ImageFamilystringNo

The name of the image family. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with acs: or aliyun. It cannot contain http:// or https://. It can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-).

By default, this parameter is empty.

hangzhou-daily-update
BootModestringNo

The new boot mode of the custom image. Valid values:

  • BIOS
  • UEFI
Note You must be familiar with the boot modes that are supported by the image. When you use this parameter to change the boot mode of an image, specify a boot mode that is supported by the image to ensure that instances that use this image can start as expected.
BIOS
LicenseTypestringNo

The type of the license used to activate the operating system after the image is imported. Valid values:

  • Auto: Elastic Compute Service (ECS) checks the OS of the source image and allocates a license to the OS. ECS first checks whether the operating system distribution specified by Platform has a license allocated through an official Alibaba Cloud channel. If yes, the allocated license is used. If no, the license that comes with the source operating system is used.
  • Aliyun: The license allocated through an official Alibaba Cloud channel is used for the operating system distribution specified by Platform.
  • BYOL: The license that comes with the source operating system is used. In this case, make sure that your license key can be used in Alibaba Cloud.

Default value: Auto.

Auto
DescriptionstringNo

The new description of the custom image. The description must be 2 to 256 characters in length It cannot start with http:// or https://.

This parameter is empty by default, which specifies that the original description is retained.

testDescription
FeaturesobjectNo

The attributes of the custom image.

NvmeSupportstringNo

Specifies whether to support the Non-Volatile Memory Express (NVMe) protocol. Valid values:

  • supported: The image supports NVMe. Instances created from this image also support NVMe.
  • unsupported: The image does not support NVMe. Instances created from this image do not support NVMe.
supported

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidImageName.MalformedThe specified Image name is wrongly formed.The specified image name is invalid. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with acs: or aliyun. It can contain letters, digits, periods (.), colons (:), underscores (_), and hyphens (-). It cannot contain http:// or https://.
400MissingParameterThe input parameter "RegionId" that is mandatory for processing this request is not supplied.-
400InvalidImageName.DuplicatedThe specified Image name has already bean used.-
400InvalidDescription.MalformedThe 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://.
400ImageQuotaFull.ImageFamilyThe specified image family has exceeded max number of images for one image family.-
400InvalidImageFamily.MalformedThe specified parameter "ImageFamily" is malformed.-
400ImageFamilyQuotaFullThe specified region has exceeded max number of image family.-
400InvalidBootMode.NotSupportThe specified parameter BootMode is not supported.-
400InvalidLicenseType.NotSupportedThe specified parameter LicenseType is not supported.-
403ImageStatus.NotAvailableThe specified image status is not available.-
403ImageStatus.NotDeprecatedThe specified image status is not deprecated.The specified image is not in the Deprecated state.
403ImageUseSharedThe specified image has been shared to others, please remove shared accounts first.-
403OperationDeined.ImageUsingByInstanceThe 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.
404InvalidImageId.NotFoundThe specified ImageId does not exist.The specified image does not exist in this account. Check whether the image ID is correct.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-11-30The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400
    delete Error Codes: 404