Modifies the name, description, state, or image family of a custom image.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyImageAttribute | The operation that you want to perform. Set the value to ModifyImageAttribute. |
RegionId | String | Yes | cn-hangzhou | The region ID of the custom image. You can call the DescribeRegions operation to query the most recent region list. |
ImageId | String | Yes | m-bp18ygjuqnwhechc**** | The ID of the custom image. |
ImageName | String | No | testImageName | 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. |
Status | String | No | Deprecated | The new state of the custom image. Valid values:
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. |
ImageFamily | String | No | hangzhou-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. |
BootMode | String | No | BIOS | The new boot mode of the image. Valid values:
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. |
LicenseType | String | No | BYOL | 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. |
Description | String | No | testDescription | 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.NvmeSupport | String | No | supported | Specifies whether to support the Non-Volatile Memory Express (NVMe) protocol. Valid values:
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 473469C7-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 code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidImageName.Malformed | The 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 (-). |
400 | InvalidImageName.Duplicated | The specified Image name has already bean used. | The specified image name already exists. |
400 | InvalidDescription.Malformed | The 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://. |
403 | ImageStatus.NotAvailable | The specified image status is not available. | The specified image is not in the Available state. |
403 | ImageStatus.NotDeprecated | The specified image status is not deprecated. | The specified image is not in the Deprecated state. |
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. |
404 | InvalidImageId.NotFound | The 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.