文档

CopySnapshot - 复制快照

更新时间:

调用CopySnapshot将一份普通快照或加密快照从一个地域复制到另一个地域。

接口说明

调用该接口时,您需要注意:

  • 复制后的新快照不能回滚源快照对应的云盘。
  • 不支持复制本地快照。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
ecs:CopySnapshotWrite
  • Snapshot
    acs:ecs:{#regionId}:{#accountId}:snapshot/{#snapshotId}
  • ecs:tag

请求参数

名称类型必填描述示例值
ResourceGroupIdstring

该参数暂未开放使用。

rg-bp67acfmxazb4p****
Tagobject []

新快照的标签信息。

Keystring

新快照的标签键。一旦传入该值,则不允许为空字符串。最多支持 128 个字符,不能以 aliyun 和 acs:开头,不能包含 http://或者 https://。

TestKey
Valuestring

新快照的标签值。一旦传入该值,允许为空字符串。最多支持 128 个字符,不能以 aliyun 和 acs:开头,不能包含 http://或者 https://。

TestValue
RegionIdstring

源快照所在的地域。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

cn-chengdu
DestinationRegionIdstring

新快照的目标地域 ID。

us-east-1
SnapshotIdstring

源快照 ID。

s-bp67acfmxazb4p****
DestinationSnapshotNamestring

新快照的名称。长度为 2~128 个英文或中文字符,必须以大小字母或中文开头,不能以 http://和 https:// 开头。可以包含数字、半角冒号(:)、下划线(_)或者短划线(-)。

默认值:空。

CopySnapshotDemo
DestinationSnapshotDescriptionstring

新快照的描述信息。长度为 2~256 个英文或中文字符,不能以 http://或 https://开头。

默认值:空。

CopySnapshotDemo
RetentionDaysinteger

新快照的保留时长,单位为天,到期后快照会被自动释放。取值范围:1~65536。

默认值:空,表示快照不会被自动释放。

60
Encryptedboolean

是否加密云盘。取值范围:

  • true:是。
  • false:否。

默认值:false。

false
KMSKeyIdstring

目标地域的 KMS 用户主密钥。

0e478b7a-4262-4802-b8cb-00d3fb40****
Arnobject []
说明 该参数正在邀测中,暂不支持使用。
RoleTypestring
说明 该参数暂未开放使用。
null
Rolearnstring
说明 该参数暂未开放使用。
null
AssumeRoleForlong
说明 该参数暂未开放使用。
0
DestinationStorageLocationArnstring
说明 该参数暂未开放使用。
null

返回参数

名称类型描述示例值
object
SnapshotIdstring

新快照的 ID。

s-bp17441ohwka0yui****
RequestIdstring

请求 ID。

C8B26B44-0189-443E-9816-D951F596****

示例

正常返回示例

JSON格式

{
  "SnapshotId": "s-bp17441ohwka0yui****",
  "RequestId": "C8B26B44-0189-443E-9816-D951F596****"
}

错误码

HTTP status code错误码错误信息描述
400Duplicate.TagKeyThe Tag.N.Key contain duplicate key.标签中存在重复的键,请保持键的唯一性。
400InvalidTagKey.MalformedThe specified Tag.n.Key is not valid.指定的标签键参数有误。
400InvalidTagValue.MalformedThe specified Tag.n.Value is not valid.指定的标签值参数有误。
400InvalidRegionId.MalFormedThe specified RegionId is not valid.指定的地域不存在,请检查该参数是否正确。
403InvalidSnapshotId.EncryptedNotSupportThe specified snapshot with encrypted does not support copy.-
403InvalidSnapshotId.NotFoundThe specified snapshot is not exists.指定的源快照不存在。
403InvalidSnapshotCategory.NotSupportCopyThe specified snapshot's category does not support copy.-
403InvalidUser.NotInWhiteListThe user is not in the white list of copying snapshot.您暂未授权执行该操作。
403InvalidParamter%s-
403InvalidAccountStatus.NotEnoughBalanceYour account does not have enough balance.账号余额不足,请您先充值再进行该操作。
403InvalidAccountStatus.SnapshotServiceUnavailableSnapshot service has not been opened yet.快照服务未开通,操作无法执行。
403InvalidSnapshotId.NotReadyThe specified snapshot has not completed yet.指定的快照未完成。
403InvalidOperation.UnauthorizedThe specified operation is unauthorized.-
403InvalidOperation.UnfinishedCrossRegionCopyThis disk has unfinished cross-region copy snapshots in the target region.-
403InvalidOperation.NotSupportCopyInSameRegionCopying snapshot in the same region is not supported.-
403InvalidSnapshotName.MalformedThe specified SnapshotName is wrongly formed.快照名称格式不合法。
403InvalidDescription.MalformedThe specified description is wrongly formed.指定的资源描述格式不合法。长度为 2-256 个字符,不能以 http:// 和 https:// 开头。
403InvalidRetentionDays.MalformedThe specified RetentionDays is not valid.指定的保留天数无效。请检查 RetentionDays 参数值是否正确。
403InvalidRegionId.NotSupportedEncryptedSnapshotCopyThe specified region not support copy encrypted snapshot.-
403InvalidRegion.NotSupportThe specified region does not support byok.该地域不支持BYOK。
403InvalidRegionId.NotSupportEncryptAlgorithmThe current region does not support creating encrypted disks with EncryptAlgorithm.-
403InvalidRegionId.NotExistsRegion not exists.-
403InvalidEncryptAlgorithmThe specified parameter EncryptAlgorithm is not valid.-
403InvalidEncrypted.NotMatchKmsKeyIdThe specified parameter Encrypted must be true when KmsKeyId is not empty.-
403InvalidEncrypted.NotMatchEncryptAlgorithmThe specified parameter Encrypted must be true when EncryptAlgorithm is not empty.-
403InvalidEncrypted.NotSupportDecryptEncrypted snapshot not support copy to decrypt snapshot.-
403InvalidSnapshotCategory.NotSupportCrossRegionCopyThe specified snapshot is not support cross region copy.-
403InvalidSnapshotCategory.NotSupportEncryptedCopyThe specified snapshot is not support encrypted copy.-
403InvalidParameter.KmsNotEnabledThe specified operation need enable KMS.当前操作需要开启KMS。
403InvalidParameter.DataEncryptedKeyCreateFailedCreate kms data encrypted key fail. If you need further assistance, you can contact the KMS Technical Support.-
403InvalidParameter.KMSKeyId.NotFoundThe specified KMSKeyId does not exist.指定的参数 KMSKeyId 不存在。
403InvalidParameter.KMSKeyId.CMKUnauthorizedThis operation for kmsKeyId is forbidden by KMS. If you need further assistance, you can contact the KMS Technical Support.-
403InvalidParameter.KMSKeyId.CMKNotEnabledThe CMK needs to be enabled.加密云盘设置了 KMSKeyId 后,CMK必须处于启用状态。您可以调用密钥管理服务的 DescribeKey 接口查询指定CMK的相关信息。
403InvalidParameter.KMSKeyId.KMSUnauthorizedECS service have no right to access your KMS.ECS 服务无权访问您的 KMS。
403InvalidKMSKeyId.NotSymmetricThe specified parameter KmsKeyId must be symmetric.-
403InvalidEncrypted.NotMatchKmsKeyIdThe specified parameter Encrypted must be true when kmsKeyId is not null.-
403QuotaExceed.SnapshotQuotaThe quota is insufficient, please contact your channel partner to increase the quota.您当前配额不足,请您可以联系渠道伙伴为您增加额度。
403InvalidOperation.UnfinishedEncryptedSnapshotCopyThis disk has unfinished encrypted copy snapshots in the target region.-
403InvalidParameterDestinationStorageLocationArn.UnauthorizedThe operation has failed due to lack of permission for the specified "DestinationStorageLocationArn". Please use a resource with appropriate permission for the operation.-
403InvalidParameterDestinationStorageLocationArn.RegionNotMatchThe region information in the specified parameter "DestinationStorageLocationArn" is inconsistent with "DestinationRegionId". Please use the correct information for the operation.-
403InvalidSnapshot.StorageLocationNotSupportedThe storage location of the current snapshot does not support this operation.-
403InvalidSnapshot.EncryptedNotSupportedThe current operation does not support the use of encrypted snapshots.加密快照不支持此操作
403InvalidParameterDestinationStorageLocationArn.MalformedThe specified DestinationStorageLocationArn is wrongly formed.-
403OperationDenied.NonCompliantDestinationRegionThe copy operation to the destination region is not in compliance with regulations.目标地域不符合安全合规要求。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2023-12-18OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 403 变更
    删除错误码:400
2023-08-02OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 403 变更
    删除错误码:400
入参OpenAPI 入参发生变更
    新增入参:DestinationStorageLocationArn
2023-06-19OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 403 变更
    删除错误码:400
2023-03-01OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 403 变更
    删除错误码:400
  • 本页导读 (1)
文档反馈