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

CopyImage

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

首次发布时间2022.09.02 08:59:35

调用 CopyImage 接口,跨地域复制自定义镜像。

说明

  • 每个地域下最多支持50个自定义镜像。
  • 请在目标地域调用DescribeTasks接口,在ResourceIds.N(资源ID)参数中传入目标镜像ID,查询复制镜像任务进度。
  • 本功能正在邀测中,如需试用,请提交工单或联系客户经理申请。

调试

请求参数

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

DestinationRegion

String

cn-shanghai

目标地域,指定目标镜像所在地域。

注意

目标地域不能与源自定义镜像所在地域相同。

ImageName

String

testlyb1

目标自定义镜像名称。命名规范如下:

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

Description

String

winserver

目标镜像描述,不填默认与源自定义镜像一致。填写规范如下:

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

ProjectName

String

default

资源所属项目。

注意

调用接口账号若仅拥有部分项目权限,本参数必填。授权账号操作项目详情,可查看管理项目权限

CopyImageTags

Boolean

true

是否复制原镜像标签。取值:

  • false(默认):不复制
  • true:复制

返回参数

名称类型示例值描述
ImageIdStringimage-4431h3l7hl31a0******目标镜像ID。

请求示例

GET /?Action=CopyImage&Version=2022-06-15&ImageId=image-4431h3l7hl31a0******&DestinationRegion=cn-shanghai&ImageName=testlyb1 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
Service: ecs

返回示例

{
    "ResponseMetadata": {
        "RequestId": "2022061517394001022514606307*****",
        "Action": "CopyImage",
        "Version": "2022-06-15",
        "Service": "ecs",
        "Region": "cn-beijing",
    },
    "Result": {
        "ImageId": "image-3teco18f1w5a71******"
    }
}

错误码

HttpCode错误码错误信息描述
400InvalidArgumentThe specified argument is invalid.指定的参数不合法。
400MissingParameter.ImageIdThe required parameter ImageId is not supplied.镜像ID不能为空。
400MissingParameter.ImageNameThe required parameter ImageName is not supplied.镜像名称不能为空。
400MissingParameter.DestinationRegionThe required parameter DestinationRegion is not supplied.目标地域不能为空。
400InvalidImageName.MalformedThe specified ImageName is malformed.目标镜像名称不合法。
400InvalidDescription.MalformedThe specified Description is malformed.指定的描述不合法。
400InvalidDestinationRegion.MalformedThe specified DestinationRegion is malformed.目的地域不合法。
400InvalidImageForCopyImage.UnSupportedThe specified image cannot be used for CopyImage.指定的镜像不支持复制镜像操作。
400LimitExceeded.MaximumImageCountYou've reached the limit on the number of image that you can create.目的地域创建的镜像达到上限。
400LimitExceeded.MaximumImageSizeYou've reached the limit on the number of image size that you can copy.指定的镜像大小(GiB)超出限制。
400InvalidRegionForCopyImage.UnSupportedThe specified region cannot be used for CopyImage.指定的源地域或目的地域不支持复制镜像操作。
404InvalidImage.NotFoundThe specified image does not exist.指定的镜像不存在。
404InvalidActionOrVersionCould not find operation %s for version %s.请求接口不存在。
404InvalidProject.NotFoundThe specified Project does not exist.指定的Project不存在。
412InvalidDestinationRegion.MismatchThe destination region cannot be equal to the target region.复制镜像的源地域不能等于目标地域。
412OperationDenied.ResourceLockedThe specified operation is denied as your resource is locked for another operation.指定的操作被拒绝,因为您的资源已为其他操作锁定。
500InternalErrorAn internal error has occurred.内部错误,请重试。如果多次尝试失败,请提交工单。