ApplySnapshot

Last updated: 2020-04-03 10:29:10

1. API Description

Domain name for API request: cbs.tencentcloudapi.com.

This API (ApplySnapshot) is used to roll back a snapshot to the original cloud disk.

  • The snapshot can only be rolled back to the original cloud disk. For data disk snapshots, if you need to copy the snapshot data to other cloud disks, use the API CreateDisks to create an elastic cloud disk and then copy the snapshot data to the created cloud disk.
  • The snapshot for rollback must be in NORMAL status. The snapshot status can be queried in the SnapshotState field in the output parameters through the API DescribeSnapshots.
  • For elastic cloud disks, the cloud disk must be in UNMOUNTED status. The cloud disk status can be queried in the Attached field returned by the API DescribeDisks. For non-elastic cloud disks purchased together with instances, the instance must be in SHUTDOWN status. The instance status can be queried through the API DescribeInstancesStatus.

A maximum of 20 requests can be initiated per second for this API.

Note: This API supports Finance regions. If the common parameter Region is a Finance region, a domain name with the Finance region needs to be specified, for example: cbs.ap-shanghai-fsi.tencentcloudapi.com

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common parameter. The value used for this API: ApplySnapshot.
Version Yes String Common parameter. The value used for this API: 2017-03-12.
Region Yes String Common parameter. For more information, please see the list of regions supported by the product.
SnapshotId Yes String Snapshot ID, which can be queried via DescribeSnapshots.
DiskId Yes String ID of the original cloud disk corresponding to the snapshot, which can be queried via the API DescribeDisks.

3. Output Parameters

Parameter Name Type Description
RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Example

Example1 Create a snapshot

Input Example

https://cbs.tencentcloudapi.com/?Action=ApplySnapshot
&DiskId=disk-lzrg2pwi
&SnapshotId=snap-gybrif0z
&<common request parameters>

Output Example

{
  "Response": {
    "RequestId": "cc96242e-566c-ae6a-b74a-5a1f823683b2"
  }
}

5. Developer Resources

API Explorer

This tool allows online call, signature authentication, SDK code generation and quick search of APIs to greatly improve the efficiency of using TencentCloud APIs.

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
InvalidDisk.Busy The cloud disk is busy. Try again later.
InvalidDisk.NotSupported Indicates that the operation is not supported for the cloud disk.
InvalidDisk.SnapshotCreating A snapshot is being created for the cloud disk. Try again later.
InvalidDiskId.NotFound The ‘DiskId’ entered does not exist.
InvalidInstanceId.NotFound The ‘InstanceId’ entered does not exist.
InvalidParameter.DiskSizeNotMatch The size of the cloud disk does not match the snapshot size.
InvalidParameterValue Invalid parameter value. Parameter value format error or parameter value not supported.
InvalidSnapshot.NotSupported Indicates that the operation is not supported for the snapshot.
InvalidSnapshotId.NotFound The ‘SnapshotId’ entered does not exist.
MissingParameter Missing parameter. Request does not include the required parameter.
ResourceBusy The resource is busy. Try again later.