You can call this operation to modify the name, description, status, 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. If you use a custom HTTP URL or HTTPS URL
to make an API request, you must specify the |
ImageId | String | Yes | m-bp18ygjuqnwhechc**** |
The ID of the custom image. |
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. |
ImageName | String | No | testImageName |
The name of the custom image. The name must be 2 to 128 characters in length and can contain letters, digits, colons (:), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://. This parameter is empty by default, which indicates that the original name is retained. |
Status | String | No | Deprecated |
The status 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. Proceed with
caution if only one custom image is in the Available state within the image family.
You will not be able to create instances if no custom images are in the Available
state within the instance family.
|
ImageFamily | String | No | hangzhou-daily-update |
The name of the image family. The name must be 2 to 128 characters in length and can contain letters, digits, colons (:), underscores (_), and hyphens (-). It must start with a letter and cannot start with acs: or aliyun. It cannot contain http:// or https://. This parameter is empty by default. |
Description | String | No | testDescription |
The 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. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
The ID of the request. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=ModifyImageAttribute
&ImageId=m-bp18ygjuqnwhechc****
&RegionId=cn-hangzhou
&ImageName=testImageName
&Description=testDescription
&<Common request parameters>
Sample success responses
XML
format
<ModifyImageAttributeResponse>
<RequestId>C8B26B44-0189-443E-9816-D951F59623A9</RequestId>
</ModifyImageAttributeResponse>
JSON
format
{
"RequestId": "C8B26B44-0189-443E-9816-D951F59623A9"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidImageName.Malformed | The specified Image name is wrongly formed. | The error message returned because the specified ImageName parameter is invalid. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). It must start with a letter and cannot start with http:// or https://. |
400 | MissingParameter | The input parameter "RegionId" that is mandatory for processing this request is not supplied. | The error message returned because the required RegionId parameter is not specified. |
400 | InvalidImageName.Duplicated | The specified Image name has already bean used. | The error message returned because the specified image name already exists. |
400 | InvalidDescription.Malformed | The specified description is wrongly formed. | The error message returned because the specified Description parameter is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://. |
404 | InvalidImageId.NotFound | The specified ImageId does not exist. | The error message returned because the specified image does not exist in this account. |
For a list of error codes, visit the API Error Center.