You need to enable JavaScript to run this app.
导航

ModifyImageAttribute

最近更新时间2024.03.22 16:45:43

首次发布时间2022.07.01 09:24:19

调用 ModifyImageAttribute 修改自定义镜像的名称、描述信息、启动模式等。

调试

请求参数

名称类型是否必填示例值描述
ActionStringModifyImageAttribute要执行的操作,取值:ModifyImageAttribute。
VersionString2020-04-01接口的版本,取值:2020-04-01。
ImageIdStringimage-ebgy1og99tfct0gw****镜像ID。您可以调用DescribeImages接口并传入Visibility=private参数,查询获取自定义镜像ID。

ImageName

String

image-1

镜像名称。

  • 必须以字母、汉字开头
  • 只能包含中文,字母,数字,下划线“_”,中划线“-”,英文句号“.”
  • 长度限制为1 ~ 128个字符

Description

String

This is my first image

镜像描述。

  • 必须以字母、汉字开头
  • 只能包含中文,字母,数字,下划线“_”,中划线“-”,等号“=”,英文逗号“,”和英文句号“.”,中文逗号“,”和中文句号“。”和空格
  • 长度限制为0 ~ 255个字符
  • 不填则保持原有配置

  • 传入空字符串时,将清空原有描述信息。

BootMode

String

UEFI

镜像的启动模式,不填则保持原有配置。取值:

  • BIOS:BIOS启动模式。
  • UEFI:UEFI启动模式。
    • 弹性裸金属实例只支持UEFI启动模式。
    • ARM镜像默认值为UEFI,且只能设置为UEFI。

返回数据

操作接口仅返回公共参数及错误码。

请求示例

GET /?Action=ModifyImageAttribute&Version=2020-04-01&ImageId=image-ebgy1og99tfct0gw****&ImageName=image1&Description=abc HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: ecs

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202106111445100102252431000052****",
        "Action": "ModifyImageAttribute",
        "Version": "2020-04-01",
        "Service": "ecs",
        "Region": "cn-beijing"
    },
    "Result": {}
}

错误码

HttpCode错误码错误信息描述
400MissingParameter.ImageIdThe required parameter ImageId is not supplied.镜像ID不能为空。
400InvalidImageName.MalformedThe specified ImageName is malformed.指定的镜像名称不合法。
400InvalidDescription.MalformedThe specified Description is malformed.指定的描述不合法。
400InvalidImageStatusThe specified image is not in the correct status for the request.当前镜像状态不支持此操作。
400InvalidBootMode.MalformedThe specified BootMode is malformed.指定的启动方式不合法。
404InvalidImage.NotFoundThe specified image does not exist.指定的镜像不存在。
500InternalErrorAn internal error has occurred.内部错误,请重试。如果多次尝试失败,请提交工单。