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

CopyImage - 复制镜像

最近更新时间2024.05.21 10:26:16

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

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

注意事项

本功能正在邀测中,如需试用,请联系客户经理申请。

请求说明

  • 每个地域下最多支持50个自定义镜像。
  • 请在目标地域调用DescribeTasks接口,在ResourceIds.N(资源ID)参数中传入目标镜像ID,查询复制镜像任务进度。

调试

请求参数

下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数

参数
类型
是否必填
示例值
描述
Action
String

CopyImage

要执行的操作,取值:CopyImage。

Version
String

2020-04-01

API的版本,取值:2020-04-01。

CopyImageTags
Boolean

false

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

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

winserver

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

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

cn-beijing

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

注意

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

ImageId
String

image-4431h3l7hl31a0******

源自定义镜像ID。您可以调用DescribeImages接口并传入Visibility=private参数,查询获取自定义镜像ID。

ImageName
String

image-1

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

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

default

镜像所属项目。

注意

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

返回参数

下表仅列出本接口特有的返回参数。更多信息请参见返回结构

参数
类型
示例值
描述
ImageId
String

image-4431h3l7hl31a0******

目标镜像ID。

请求示例

GET /?Action=CopyImage&Version=2020-04-01&ImageId=image-4431h3l7hl31a0******&DestinationRegion=cn-shanghai&ImageName=image-1 HTTP/1.1
Host: open.volcengineapi.com
Region: cn-beijing
ServiceName: ecs

返回示例

{
    "ResponseMetadata": {
        "RequestId": "2022061517394001022514606307*****",
        "Action": "CopyImage",
        "Version": "2020-04-01",
        "Service": "ecs",
        "Region": "cn-beijing"
    },
    "Result": {
        "ImageId": "image-3teco18f1w5a71******"
    }
}

错误码

下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。

状态码
错误码
错误信息
说明
400
MissingParameter.DestinationRegion
The required parameter DestinationRegion is not supplied.

目标地域不能为空。

400
MissingParameter.ImageName
The required parameter ImageName is not supplied.

镜像名称不能为空。

400
MissingParameter.ImageId
The required parameter ImageId is not supplied.

镜像ID不能为空。

400
InvalidArgument
The specified argument is invalid.

指定的参数不合法。

400
LimitExceeded.MaximumImageSize
You've reached the limit on the number of image size that you can %s.

指定的镜像大小超过限制。

400
LimitExceeded.MaximumImageCount
You've reached the limit on the number of image that you can create.

可创建的自定义镜像个数超过限制。

400
InvalidRegionForCopyImage.UnSupported
The specified region cannot be used for CopyImage.

指定的源地域或目标地域不支持复制镜像操作。

400
InvalidImageName.Malformed
The specified ImageName is malformed.

指定的镜像名称不合法。

400
InvalidImageForCopyImage.UnSupported
The specified image cannot be used for CopyImage.

指定的镜像不支持复制镜像操作。

400
InvalidDestinationRegion.Malformed
The specified DestinationRegion is malformed.

目的地域不合法。

400
InvalidDescription.Malformed
The specified Description is malformed.

指定的描述不合法。

404
InvalidProject.NotFound
The specified Project does not exist.

指定的Project不存在。

404
InvalidImage.NotFound
The specified image does not exist.

指定的镜像不存在。

404
InvalidActionOrVersion
Could not find operation %s for version %s.

请求接口不存在。

412
OperationDenied.ResourceLocked
The specified operation is denied as your resource is locked for another operation.

指定的操作被拒绝,因为您的资源已被其他操作锁定。

412
InvalidDestinationRegion.Mismatch
The destination region cannot be equal to the target region.

复制镜像的源地域不能等于目标地域。

500
InternalError
An internal error has occurred.

内部错误,请重试。如果多次尝试失败,请提交工单。