DescribeSnapshots

Last updated: 2020-10-16 18:48:56

1. API Description

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

This API (DescribeSnapshots) is used to query the details of snapshots.

  • Filter the results by the snapshot ID, the ID of cloud disk, for which the snapshot is created, and the type of cloud disk, for which the snapshot is created. The relationship between different conditions is AND. For more information about filtering, please see Filter.
  • If the parameter is empty, a certain number (specified by Limit; the default is 20) of snapshot lists are returned to the current user.

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

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

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: DescribeSnapshots.
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.
SnapshotIds.N No Array of String List of snapshot IDs to be queried. The parameter does not support specifying both SnapshotIds and Filters.
Filters.N No Array of Filter Filter conditions. The specification of both the SnapshotIds and Filters parameters is not supported.
  • snapshot-id - Array of String - Required or not: No - (Filter condition) Filter by the snapshot ID. The format of the snapshot ID is as follows: snap-11112222.
  • snapshot-name - Array of String - Required or not: No - (Filter condition) Filter by the snapshot name.
  • snapshot-state - Array of String - Required or not: No - (Filter condition) Filter by the snapshot status (NORMAL: normal | CREATING: creating | ROLLBACKING: rolling back).
  • disk-usage - Array of String - Required or not: No - (Filter condition) Filter by the type of the cloud disk for which the snapshot is created (SYSTEM_DISK: system disk | DATA_DISK: data disk).
  • project-id - Array of String - Required or not: No - (Filter condition) Filter by ID of the project to which the cloud disk belongs.
  • disk-id - Array of String - Required or not: No - (Filter condition) Filter by the ID of the cloud disk for which the snapshot is created.
  • zone - Array of String - Required or not: No - (Filter condition) Filter by Availability Zone.
  • encrypt - Array of String - Required or not: No - (Filter condition) According to whether it is an encrypted disk snapshot. (TRUE: indicates an encrypted disk snapshot | FALSE: indicates that it is not an encrypted disk snapshot.)
  • Offset No Integer Offset. Default is 0. For more information on Offset, please see relevant sections in API Introduction.
    Limit No Integer Number of results to be returned. Default is 20. Maximum is 100. For more information on Limit, please see relevant sections in API Introduction.
    Order No String Outputs the ordering of the cloud disk list. Value range:
  • ASC: Ascending order
  • DESC: Descending order.
  • OrderField No String The field by which the snapshot list is sorted. Value range:
  • CREATE_TIME: sorted by the creation time of the snapshots
    By default, the snapshot list is sorted by the creation time of snapshots.
  • 3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Number of snapshots.
    SnapshotSet Array of Snapshot List of snapshot details.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Querying Snapshots with NORMAL Status in Guangzhou Zone 2

    Input Example

    https://cbs.tencentcloudapi.com/?Action=DescribeSnapshots
    &Filters.0.Name=snapshot-state
    &Filters.0.Values.0=NORMAL
    &Filters.1.Name=zone
    &Filters.1.Values.0=ap-guangzhou-2
    &<common request parameters>

    Output Example

    {
      "Response": {
        "TotalCount": 2,
        "RequestId": "4ab150b9-538d-48fb-8821-7fa185f1d07c",
        "SnapshotSet": [
          {
            "Placement": {
              "ProjectId": 0,
              "Zone": "ap-guangzhou-2"
            },
            "CopyFromRemote": false,
            "IsPermanent": false,
            "DiskUsage": "DATA_DISK",
            "DeadlineTime": "2019-07-15 00:00:00",
            "Percent": 100,
            "SnapshotId": "snap-lfo71d1x",
            "ShareReference": 0,
            "SnapshotType": "PRIVATE_SNAPSHOT",
            "DiskSize": 10,
            "DiskId": "disk-aq3k1jn0",
            "SnapshotName": "auto_disk-aq3k1jn0_20190708_00",
            "Images": [],
            "CopyingToRegions": [],
            "Encrypt": false,
            "CreateTime": "2019-07-08 00:03:13",
            "ImageCount": 0,
            "SnapshotState": "NORMAL"
          },
          {
            "Placement": {
              "ProjectId": 0,
              "Zone": "ap-guangzhou-2"
            },
            "CopyFromRemote": false,
            "IsPermanent": false,
            "DiskUsage": "DATA_DISK",
            "DeadlineTime": "2019-07-15 00:00:00",
            "Percent": 100,
            "SnapshotId": "snap-jt5npvml",
            "ShareReference": 0,
            "SnapshotType": "PRIVATE_SNAPSHOT",
            "DiskSize": 10,
            "DiskId": "disk-38hlz2p0",
            "SnapshotName": "auto_disk-38hlz2p0_20190708_00",
            "Images": [],
            "CopyingToRegions": [],
            "Encrypt": false,
            "CreateTime": "2019-07-08 00:03:10",
            "ImageCount": 0,
            "SnapshotState": "NORMAL"
          }
        ]
      }
    }

    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
    InvalidFilter The specified Filter is not supported.
    InvalidParameterValue Invalid parameter value.
    MissingParameter Missing parameter.

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help