更新时间:2024-04-18 GMT+08:00

查询带宽列表

功能介绍

查询带宽列表。

URI

GET /v1/{project_id}/bandwidths

参数说明请参见表1
表1 参数说明

名称

是否必选

参数类型

说明

project_id

String

项目ID

marker

String

分页查询的起始资源ID,表示从指定资源的下一条记录开始查询。

marker需要和limit配合使用:

  • 若不传入marker和limit参数,查询结果返回第一页全部资源记录。
  • 若不传入marker参数,limit为10,查询结果返回第1~10条资源记录。
  • 若marker为第10条记录的资源ID,limit为10,查询结果返回第11~20条资源记录。
  • 若marker为第10条记录的资源ID,不传入limit参数,查询结果返回第11条及之后的所有资源记录。

limit

Integer

分页查询每页返回的记录个数,取值范围为0~intmax(2^31-1),默认值2000。

limit需要和marker配合使用,详细规则请见marker的参数说明。

  • 请求样例
    GET https://{Endpoint}/v1/{project_id}/bandwidths?limit={limit}&marker={marker}

响应消息

  • 响应参数
    表2 响应参数

    名称

    参数类型

    说明

    bandwidths

    Array of bandwidths objects

    带宽列表对象,请参见表3

    表3 bandwidths字段说明

    名称

    参数类型

    说明

    name

    String

    • 功能说明:带宽名称
    • 取值范围:1-64个字符,支持数字、字母、中文、_(下划线)、-(中划线)、.(点)

    size

    Integer

    • 功能说明:带宽大小,单位Mbit/s。
    • 取值范围:默认1Mbit/s~300Mbit/s(具体范围以各区域配置为准,请参见控制台对应页面显示)。

    id

    String

    带宽唯一标识

    share_type

    String

    • 取值为PER,表示独享带宽

    不设置时,默认返回所有带宽列表。

    publicip_info

    Array of publicip_info objects

    • 功能说明:带宽对应的弹性公网IP信息。详见表4

    tenant_id

    String

    项目ID

    bandwidth_type

    String

    • 功能说明:带宽类型。
    • 取值范围:取值为bgp

    charge_mode

    String

    • 功能说明:按流量计费还是按带宽计费。
    • 取值范围:bandwidth(按带宽计费),traffic(按流量计费),不返回或者为空时表示是bandwidth。

    status

    String

    • 功能说明:带宽的状态
    • 取值范围:
      • FREEZED:冻结
      • NORMAL:正常

    表4 publicip_info对象

    名称

    参数类型

    说明

    publicip_id

    String

    功能说明:带宽对应的弹性公网IP的唯一标识

    publicip_address

    String

    功能说明:IPv4时是申请到的弹性公网IP地址

    publicip_type

    String

    • 功能说明:弹性公网IP的类型
    • 取值范围:5_bgp
    • 约束:
      • 必须是系统具体支持的类型
      • publicip_id为IPv4端口,所以"publicip_type"字段未给定时,默认为5_bgp。
  • 响应样例
    {
      "bandwidths": [
        {
          "id": "09b99c91-da7c-449f-94e2-f4934c5b2a71",
          "name": "test-f632a7b0-ef50-4ac5-97e9-ddc56b3d5977",
          "size": 200,
          "share_type": "PER",
          "publicip_info": [
            {
              "publicip_id": "2a65923c-7133-415d-ae3b-cf9635a942c5",
              "publicip_address": "10.xx.xx.3",
              "ip_version": 4,
              "publicip_type": "5_bgp"
            }
          ],
          "tenant_id": "26ae5181a416420998eb2093aaed84d9",
          "bandwidth_type": "bgp",
          
          "status": "NORMAL"
        },
        {
          "id": "0a583ff1-b43e-4000-ade3-e7af0097f832",
          "name": "test-7e880d5b-f458-40ad-a7e5-735c44cd8b7d",
          "size": 300,
          "share_type": "PER",
          "publicip_info": [
            {
              "publicip_id": "c754bc9a-16d5-4763-9674-d7561917aa80",
              "publicip_address": "10.xx.xx.9",
              "ip_version": 4,
              "publicip_type": "5_bgp"
            }
          ],
          "tenant_id": "26ae5181a416420998eb2093aaed84d9",
          "bandwidth_type": "bgp",
          
          "status": "NORMAL"
        },
        {
          "id": "0a673f00-3640-4a13-949e-7049b2916baf",
          "name": "bandwidth123",
          "size": 10,
          "share_type": "PER",
          "publicip_info": [
            {
              "publicip_id": "cec7fb70-2f82-4561-bd83-2121fb642fdc",
              "publicip_address": "10.xx.xx.184",
              "ip_version": 4,
              "publicip_type": "5_bgp"
            }
          ],
          "tenant_id": "26ae5181a416420998eb2093aaed84d9",
          "bandwidth_type": "bgp",
          
          "status": "NORMAL"
        },
        {
          "id": "0dde1eae-1783-46dc-998c-930fbe261ff9",
          "name": "bandwidth123",
          "size": 100,
          "share_type": "PER",
          "publicip_info": [
            {
              "publicip_id": "24232038-e178-40ad-80e4-5abb75db84be",
              "publicip_address": "10.xx.xx.101",
              "ip_version": 4,
              "publicip_type": "5_bgp"
            }
          ],
          "tenant_id": "26ae5181a416420998eb2093aaed84d9",
          "bandwidth_type": "bgp",
          
          "status": "NORMAL"
        }
      ]
    }

状态码

请参见状态码

错误码

请参考错误码