Modifies the name, description, state, 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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesModifyImageAttribute

The operation that you want to perform. Set the value to ModifyImageAttribute.

RegionIdStringYescn-hangzhou

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

ImageIdStringYesm-bp18ygjuqnwhechc****

The ID of the custom image.

ImageNameStringNotestImageName

The new 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 (-).

This parameter is empty by default, which indicates that the original name is retained.

StatusStringNoDeprecated

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. An image family that contains no custom images in the Available state cannot be used to create instances. Proceed with caution if only a single custom image in the image family is in the Available state.
ImageFamilyStringNohangzhou-daily-update

The new 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 (-).

This parameter is empty by default.

BootModeStringNoBIOS

The new boot mode of the image. Valid values:

  • BIOS
  • UEFI
Note If you create instances from an image after the boot mode of the image is changed, the new instances start in the new image boot mode. To ensure that instances can start as expected, make sure that the specified boot mode is supported by the image. If you do not know which boot modes are supported by the image, we recommend that you use the image check feature to perform a check. For more information about the image check feature, see Overview of image check.
LicenseTypeStringNoBYOL

The type of the license used to activate the operating system after the source image is imported. Set the value to BYOL.

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.

DescriptionStringNotestDescription

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

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

Features.NvmeSupportStringNosupported

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

  • supported: The image supports NVMe. Instances created from this image support the NVMe protocol.
  • unsupported: The image does not support NVMe. Instances that are created from this image do not support the NVMe protocol.

Response parameters

ParameterTypeExampleDescription
RequestIdString473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

The request ID.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=ModifyImageAttribute
&RegionId=cn-hangzhou
&ImageId=m-bp18ygjuqnwhechc****
&ImageName=testImageName
&Status=Deprecated
&ImageFamily=hangzhou-daily-update
&BootMode=BIOS
&Description=testDescription
&Features={"NvmeSupport":"supported"}
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ModifyImageAttributeResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
</ModifyImageAttributeResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HTTP status codeError codeError messageDescription
400InvalidImageName.MalformedThe specified Image name is wrongly formed.Invalid ImageName format. 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 (-).
400InvalidImageName.DuplicatedThe specified Image name has already bean used.The specified image name already exists.
400InvalidDescription.MalformedThe specified description is wrongly formed.Invalid Description format. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
403ImageStatus.NotAvailableThe specified image status is not available.The specified image is not in the Available state.
403ImageStatus.NotDeprecatedThe specified image status is not deprecated.The specified image is not in the Deprecated state.
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 is not found in this account. Check whether the image ID is correct.

For a list of error codes, see Service error codes.