tencent cloud

云硬盘

新手指引
产品公告
腾讯云云硬盘快照正式商业化计费公告
腾讯云云硬盘快照跨地域复制功能正式商业化计费公告
产品简介
产品概述
产品优势
应用场景
地域和可用区
云硬盘实例
云硬盘快照
访问管理
相关产品
上一代产品
Service Regions and Service Providers
产品计费
计费概述
价格总览
购买指引
续费指引
欠费说明
快速入门
步骤1:创建云硬盘
步骤2:挂载云硬盘
步骤3:初始化云硬盘
用户指南
操作总览
使用限制
创建云硬盘
挂载云硬盘
初始化云硬盘
扩容云硬盘
卸载云硬盘
销毁云硬盘
查看云硬盘信息
调整云硬盘类型
调整云硬盘性能
云硬盘数据防护配置
云硬盘数据备份点
管理快照
监控与告警
实践教程
如何衡量云硬盘的性能
多块弹性云硬盘构建 LVM 逻辑卷
MBR 分区云硬盘扩容至大于 2TB
故障处理
Windows 云服务器无法卸载云硬盘
Linux 云服务器重启后云硬盘未自动挂载
API 文档
History
Introduction
API Category
Making API Requests
Snapshot APIs
Cloud Disk APIs
Data Types
Error Codes
常见问题
功能相关问题
计费相关问题
性能相关问题
快照相关问题
使用相关问题
服务等级协议
联系我们
词汇表

DescribeDisks

PDF
聚焦模式
字号
最后更新时间: 2023-06-21 15:01:17

1. API Description

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

This API (DescribeDisks) is used to query the list of cloud disks.

  • The details of the cloud disk can be queried based on the ID, type or status of the cloud disk. The relationship between different conditions is AND. For more information about filtering, please see the Filter.
  • If the parameter is empty, a certain number (specified by Limit; the default is 20) of cloud disk lists are returned to the current user.

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

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 Params. The value used for this API: DescribeDisks.
Version Yes String Common Params. The value used for this API: 2017-03-12.
Region No String Common Params. This parameter is not required for this API.
DiskIds.N No Array of String Query by one or more cloud disk IDs, such as disk-11112222. For the format of this parameter, please see the ids.N section of the API Introduction. This parameter does not support specifying both DiskIds and Filters.
Filters.N No Array of Filter Filters. You cannot specify DiskIds and Filters at the same time.
  • disk-usage - Array of String - Optional - Filters by cloud disk type. (SYSTEM_DISK: system disk | DATA_DISK: data disk)
  • disk-charge-type - Array of String - Optional - Filters by cloud disk billing method. (POSTPAID_BY_HOUR: pay-as-you-go)
  • portable - Array of String- Optional - Filters by whether the cloud disk is elastic or not. (TRUE: elastic | FALSE: non-elastic)
  • project-id - Array of Integer - Optional - Filters by the ID of the project to which a cloud disk belongs.
  • disk-id - Array of String - Optional - Filters by cloud disk ID, such as disk-11112222.
  • disk-name - Array of String - Optional - Filters by cloud disk name.
  • disk-type - Array of String - Optional - Filters by cloud disk media type (CLOUD_BASIC: HDD cloud disk | CLOUD_PREMIUM: Premium Cloud Storage | CLOUD_SSD: SSD cloud disk.)
  • disk-state - Array of String - Optional - Filters by cloud disk state. (UNATTACHED: not mounted | ATTACHING: being mounted | ATTACHED: mounted | DETACHING: being unmounted | EXPANDING: being expanded | ROLLBACKING: being rolled back | TORECYCLE: to be repossessed.)
  • instance-id - Array of String - Optional - Filters by the ID of the CVM instance on which a cloud disk is mounted. You can use this parameter to query the cloud disks mounted on specific CVMs.
  • zone - Array of String - Optional - Filters by availability zone
  • instance-ip-address - Array of String - Optional - Filters by the private or public IP of the CVM on which a cloud disk is mounted.
  • instance-name - Array of String - Optional - Filters by the name of the instance on which a cloud disk is mounted.
  • tag-key - Array of String - Optional - Filters by tag key.
  • tag-value - Array of String - Optional - Filters by tag value.
  • tag:tag-key - Array of String - Optional - Filters by tag key-value pair. Please replace tag-key with a specific tag key.
  • 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 cloud disk list is sorted. Value range:
  • CREATE_TIME: sorted by the creation time of cloud disks
  • DEADLINE: sorted by the expiration time of cloud disks
    By default, the cloud disk list is sorted by the creation time of cloud disks.
  • ReturnBindAutoSnapshotPolicy No Boolean Whether the ID of the periodic snapshot policy bound to the cloud disk needs to be returned in the cloud disk details. TRUE: return; FALSE: do not return.

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer The quantity of cloud disks meeting the conditions.
    DiskSet Array of Disk List of cloud disk details.
    RequestId String The unique request ID, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 Querying all attached data disks

    This example shows you how to query all attached data disks.

    Input Example

    POST / HTTP/1.1
    Host: cbs.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDisks
    <Common request parameters>
    
    {
        "Filters": [
            {
                "Values": [
                    "ATTACHED"
                ],
                "Name": "disk-state"
            },
            {
                "Values": [
                    "DATA_DISK"
                ],
                "Name": "disk-usage"
            }
        ]
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "RequestId": "e2386a23-48c1-4c18-9a36-4e7354f333b2",
            "DiskSet": [
                {
                    "DeleteWithInstance": false,
                    "Encrypt": false,
                    "DiskType": "CLOUD_BASIC",
                    "AutoRenewFlagError": false,
                    "Rollbacking": false,
                    "RenewFlag": "NOTIFY_AND_MANUAL_RENEW",
                    "DiskName": "test",
                    "Tags": [],
                    "InstanceId": "",
                    "DifferDaysOfDeadline": 1,
                    "DiskId": "disk-b94t5dzt",
                    "DiskState": "ATTACHED",
                    "Placement": {
                        "ProjectId": 0,
                        "Zone": "ap-guangzhou-2"
                    },
                    "IsReturnable": false,
                    "DeadlineTime": "2018-10-26 10:55:43",
                    "Attached": true,
                    "DiskSize": 10,
                    "DiskUsage": "DATA_DISK",
                    "Portable": true,
                    "DiskChargeType": "PREPAID",
                    "SnapshotAbility": true,
                    "DeadlineError": false,
                    "RollbackPercent": 100,
                    "AutoSnapshotPolicyIds": null,
                    "ReturnFailCode": 3,
                    "CreateTime": "2018-09-26 17:36:07",
                    "ThroughputPerformance": 1,
                    "Migrating": true,
                    "InstanceIdList": [
                        "ins-test1234"
                    ],
                    "Shareable": true,
                    "MigratePercent": 100,
                    "SnapshotSize": 100,
                    "SnapshotCount": 0,
                    "BackupDisk": true,
                    "AttachMode": "PF",
                    "DiskBackupQuota": 1,
                    "DiskBackupCount": 1,
                    "DeleteSnapshot": 0,
                    "InstanceType": "CVM"
                }
            ]
        }
    }
    

    5. Developer Resources

    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.
    UnsupportedOperation Unsupported operation

    帮助和支持

    本页内容是否解决了您的问题?

    填写满意度调查问卷,共创更好文档体验。

    文档反馈