You need to enable JavaScript to run this app.
导航

获取云盘列表

最近更新时间2024.03.12 19:08:28

首次发布时间2024.03.12 19:08:28

本接口用于查询已创建的云盘的列表。

请求方法

POST

请求参数

下表列出了接口特定的请求参数以及公共请求参数 Action 和 Version。其他公共参数,请参见公共参数

名称

类型

是否必选

示例值

描述

Action

String

ListEbsInstances

公共参数。该参数表示接口名称。取值:ListEbsInstances。

Version

String

2021-04-30

公共参数。该参数表示接口版本。取值:2021-04-30。

with_attachment_info

Boolean

true

是否展示挂载信息。取值范围:

  • true:展示挂载信息。
  • false(默认值):不展示挂载信息。

res_ids

[]String

["veen1020125208252511****"]

云盘所挂载的边缘实例的 ID。

ebs_ids

[]String

["disk-tvs2gmln****"]

云盘的 ID。

ebs_names

[]String

["cloud_disk_01"]

云盘的名称。

regions

[]String

云盘所属的区域。取值范围:

  • SouthChina:华南
  • EastChina:华东
  • Southwest:西南
  • Northwest:西北
  • NorthChina:华北
  • Northeast:东北
  • CentralChina:华中

cluster_names

[]String

["**cu01"]

云盘所属的节点的名称。

status

[]String

云盘的状态。取值范围:

  • creating:创建中
  • detached:未挂载
  • attaching:挂载中
  • attached:已挂载
  • detaching:卸载中
  • scaling:扩容中
  • deleting:删除中
  • error:错误

当云盘创建或挂载耗费时长超过 2 分钟后,云盘状态被置为 error。出现该情况时,您可以提交工单进行咨询。

ebs_type

[]String

data

云盘的类型。取值范围:

  • data:数据盘。

charge_type

[]String

HourUsed

云盘的计费类型。取值范围:

  • HourUsed:按量计费。

fuzzy_veen_external_ip

String

122.*.*.85

云盘所挂载的边缘实例的 IP 地址。该 IP 地址可以是公网 IP 地址或私网 IP 地址。支持模糊查询。

delete_with_res

Boolean

true

“随实例删除”功能是否开启。取值范围:

  • true:“随实例删除”功能开启。
  • false:“随实例删除”功能关闭。

fuzzy_ebs_id_or_name

String

cloud_disk_01

云盘的 ID 或名称。支持模糊查询。

projects

[]String

default

云盘所属的项目。

page_option

PageOption

{
 "page_no": "2",
 "page_size": "10"
}

分页查询设置。

order_option

OrderOption

排序设置。

PageOption

名称

类型

是否必选

示例值

描述

page_no

Integer

2

云盘列表的页码。

page_size

Integer

10

分页查询时设置的每页行数。
默认值:10

OrderOption

名称

类型

是否必选

示例值

描述

order_by

String

status

查询出来的云盘的排序依据。取值范围:

  • create_time:云盘的创建时间。
  • update_time:云盘的更新时间。

如果不指定该参数,系统默认按照创建时间对云盘进行排序。

asc

Boolean

true

是否按照升序排列:

  • true:按照升序排列。
  • false(默认值):按照降序排列。

返回数据

名称

类型

示例值

描述

ebs_instances

[]EbsInstances

请参见返回示例

云盘的列表。

total_cnt

Integer

5

云盘的数量。

EbsInstances

名称

类型

示例值

描述

ebs_id

String

disk-tvs2gmln****

云盘的 ID。

ebs_name

String

cloud_disk_01

云盘的名称。

status

String

attached

云盘的状态:

  • creating:创建中。
  • detached:未挂载。
  • attaching:挂载中。
  • attached:已挂载。
  • detaching:卸载中。
  • scaling:扩容中。
  • deleting:删除中。
  • error:错误。

cluster

Cluster

请参见返回示例

云盘所属的节点的信息。

storage_type

String

CloudBlockSSD

存储类型:

  • CloudBlockSSD:SSD 型云盘。
  • CloudBlockHDD:HDD 型云盘。

capacity

String

50

云盘的容量。单位:GB。

ebs_type

String

data

云盘的类型:

  • data:数据盘。

charge_type

String

HourUsed

计费类型。

desc

String

cloud_disk_01

云盘的描述信息。

attachment

Attachment

请参见返回示例

云盘的挂载信息。
仅当云盘已挂载到边缘实例时,该参数才会返回。

delete_with_res

Boolean

false

是否随挂载的边缘实例一起删除:

  • true:边缘实例被删除时,云盘也会一起被删除。
  • false:边缘实例被删除时,云盘会被保留。

project

String

default

云盘所属的项目。

status_reason

String

create

云盘出现 error 状态的原因。只有当云盘状态为 error 时,系统会返回参数值。

  • create:创建失败。
  • attach:挂载失败。

start_time

Integer

1634108660

云盘的启动时间。云盘从启动时间开始计费。

create_time

Integer

1634108660

云盘的创建时间。

update_time

Integer

1635474133

云盘的更新时间。

Cluster

名称

类型

示例值

描述

cluster_name

String

**ct05

节点名称。

country

String

CN

国家。

region

String

EastChina

区域。

province

String

ZJ

省份。

city

String

330200

城市。

isp

String

CTCC

运营商。

alias

String

浙江**电信01

节点的中文别名。

Attachment

名称

类型

示例值

描述

ebs_id

String

disk-tvs2gmln****

云盘的 ID。

res_type

String

veen

云盘挂载到的资源的类型:

  • veen:边缘实例。

res_id

String

veen1020125208252511****

云盘挂载到的资源的 ID。

res_name

String

veen_01

云盘挂载到的资源的名称。
该参数仅在您设置了资源名称的情况下会返回。

请求示例

POST https://veenedge.volcengineapi.com/?Action=ListEbsInstances&Version=2021-04-30
&<其他公共参数>
{
    "with_attachment_info": true,
    "res_ids": [
        "veen0522220112101114****"
    ]
}

返回示例

{
    "ResponseMetadata": {
        "RequestId": "202401251656520B93E636B479205C****",
        "Action": "ListEbsInstances",
        "Version": "2021-04-30",
        "Service": "veenedge",
        "Region": "cn-north-1"
    },
    "Result": {
        "ebs_instances": [
            {
                "account_id": 210006****,
                "ebs_id": "disk-25mdrqmd5nd****",
                "ebs_name": "test12",
                "status": "attached",
                "cluster": {
                    "cluster_name": "**ct03",
                    "country": "CN",
                    "region": "NorthChina",
                    "province": "TJ",
                    "city": "120000",
                    "isp": "CTCC",
                    "alias": "**电信03"
                },
                "storage_type": "CloudBlockSSD",
                "capacity": "20",
                "ebs_type": "data",
                "charge_type": "HourUsed",
                "desc": "",
                "attachment": {
                    "ebs_id": "disk-25mdrqmd5nd****",
                    "res_type": "veen",
                    "res_id": "veen0522220112101114****",
                    "res_name": ""
                },
                "delete_with_res": false,
                "project": "default",
                "create_by_res": false,
                "status_reason": "",
                "start_time": 1706167826,
                "create_time": 1706167825,
                "update_time": 1706167837
            },
            {
                "account_id": 210006****,
                "ebs_id": "disk-gxs44vr2wp2****",
                "ebs_name": "test_yx",
                "status": "attached",
                "cluster": {
                    "cluster_name": "**ct03",
                    "country": "CN",
                    "region": "NorthChina",
                    "province": "TJ",
                    "city": "120000",
                    "isp": "CTCC",
                    "alias": "**电信03"
                },
                "storage_type": "CloudBlockSSD",
                "capacity": "30",
                "ebs_type": "data",
                "charge_type": "HourUsed",
                "desc": "",
                "attachment": {
                    "ebs_id": "disk-gxs44vr2wp2****",
                    "res_type": "veen",
                    "res_id": "veen0522220112101114****",
                    "res_name": ""
                },
                "delete_with_res": false,
                "project": "default",
                "create_by_res": false,
                "pvc_ns": "",
                "pvc_name": "",
                "status_reason": "",
                "start_time": 1705391772,
                "create_time": 1705391770,
                "update_time": 1706171929
            }
        ],
        "total_cnt": 2
    }
}

错误码

如果响应正文中包含 Error 字段,则表示 API 请求失败。关于错误码的更多信息,参见错误码