All Products
Search
Document Center

:CopySnapshot

更新時間:Dec 06, 2023

Copies a normal or encrypted snapshot from one region to another.

Usage notes

Take note of the following items:

  • New snapshots (snapshot copies) cannot be used to roll back the disks for which source snapshots (copied snapshots) were created.
  • Local snapshots cannot be copied.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes CopySnapshot

The operation that you want to perform. Set the value to CopySnapshot.

ResourceGroupId String No rg-bp67acfmxazb4p****

This parameter is not publicly available.

Tag.N.Key String No TestKey

The key of tag N to add to the new snapshot. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

Tag.N.Value String No TestValue

The value of tag N to add to the new snapshot. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with acs: or aliyun.

RegionId String Yes cn-chengdu

The region ID of the source snapshot. You can call the DescribeRegions operation to query the most recent region list.

DestinationRegionId String Yes us-east-1

The ID of the destination region to which to copy the source snapshot.

SnapshotId String Yes s-bp67acfmxazb4p****

The ID of the source snapshot.

DestinationSnapshotName String Yes CopySnapshotDemo

The name of the new snapshot. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).

This parameter is empty by default.

DestinationSnapshotDescription String Yes CopySnapshotDemo

The description of the new snapshot. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

This parameter is empty by default.

RetentionDays Integer No 60

The retention period of the new snapshot. Unit: day. The new snapshot is automatically released when its retention period ends. Valid values: 1 to 65536.

This parameter is empty by default, which indicates that the snapshot is not automatically released.

Encrypted Boolean No false

Specifies whether to encrypt the new snapshot. Valid values:

  • true
  • false

Default value: false.

KMSKeyId String No 0e478b7a-4262-4802-b8cb-00d3fb40****

The ID of the customer master key (CMK) in Key Management Service (KMS) in the destination region.

Arn.N.RoleType String No null
Note This parameter is not publicly available.
Arn.N.Rolearn String No null
Note This parameter is not publicly available.
Arn.N.AssumeRoleFor Long No 0
Note This parameter is not publicly available.
DestinationStorageLocationArn String No null
Note This parameter is not publicly available.

Response parameters

Parameter

Type

Example

Description

SnapshotId String s-bp17441ohwka0yui****

The ID of the new snapshot.

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

The ID of the request.

Examples

Sample requests

http(s)://ecs.aliyuncs.com/?Action=CopySnapshot
&ResourceGroupId=hide
&Tag=[{"Key":"TestKey","Value":"TestValue"}]
&RegionId=cn-chengdu
&DestinationRegionId=us-east-1
&SnapshotId=s-bp67acfmxazb4p****
&DestinationSnapshotName=CopySnapshotDemo
&DestinationSnapshotDescription=CopySnapshotDemo
&RetentionDays=60
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CopySnapshotResponse>
    <RequestId>C8B26B44-0189-443E-9816-D951F596****</RequestId>
    <SnapshotId>s-bp17441ohwka0yui****</SnapshotId>
</CopySnapshotResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

HTTP status code

Error code

Error message

Description

400 Duplicate.TagKey The Tag.N.Key contain duplicate key. The tag key already exists. Tag keys must be unique.
400 InvalidTagKey.Malformed The specified Tag.n.Key is not valid. Invalid Tag.N.Key value.
400 InvalidTagValue.Malformed The specified Tag.n.Value is not valid. Invalid Tag.N.Value value.
400 InvalidRegionId.MalFormed The specified RegionId is not valid. Invalid RegionId value.
403 InvalidSnapshotId.NotFound The specified snapshot is not exists. The specified source snapshot does not exist.
403 InvalidUser.NotInWhiteList The user is not in the white list of copying snapshot. You do not have the permissions to perform the operation.
403 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance. The account balance is insufficient. Add funds to the account and try again.
403 InvalidAccountStatus.SnapshotServiceUnavailable Snapshot service has not been opened yet. The operation is not supported while the snapshot service is not activated.
403 InvalidSnapshotId.NotReady The specified snapshot has not completed yet. The specified snapshot is being created.
403 InvalidSnapshotName.Malformed The specified SnapshotName is wrongly formed. The specified snapshot name is invalid.
403 InvalidDescription.Malformed The specified description is wrongly formed. Invalid DestinationSnapshotDescription format. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
403 InvalidRetentionDays.Malformed The specified RetentionDays is not valid. Invalid RetentionDays value. Check whether the RetentionDays value is correct.
403 InvalidRegion.NotSupport The specified region does not support byok. The Bring Your Own Key (BYOK) feature is not supported in the specified region.
403 InvalidParameter.KMSKeyId.NotFound The specified KMSKeyId does not exist. The KMS key ID does not exist.
403 InvalidParameter.KMSKeyId.CMKNotEnabled The CMK needs to be enabled. The CMK is not enabled when the ID of the CMK is specified for a disk. You can call the DescribeKey operation of KMS to query the information about the specified CMK.
403 InvalidParameter.KMSKeyId.KMSUnauthorized ECS service have no right to access your KMS. Elastic Compute Service (ECS) is not authorized to access your KMS resources.
403 QuotaExceed.SnapshotQuota The quota is insufficient, please contact your channel partner to increase the quota. The quota is insufficient. You can contact your channel partner to request a quota increase.
403 InvalidSnapshot.EncryptedNotSupported The current operation does not support the use of encrypted snapshots. Encrypted snapshots do not support the operation.

For a list of error codes, see Service error codes.