Help Center/ Elastic IP/ API Reference/ API V3/ Bandwidth/ Querying Bandwidths (Old API)
Updated on 2026-11-06 GMT+08:00

Querying Bandwidths (Old API)

Function

This API is used to query bandwidths.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    eip:bandwidths:list

    List

    bandwidth *

    -

    vpc:bandwidths:list

    -

    -

    g:EnterpriseProjectId

URI

GET /v3/{project_id}/eip-bandwidths

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Maximum: 32

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

limit

No

String

  • Definition: Number of resources returned on each page.

  • Range: 1 to 2000

marker

No

String

  • Definition: Start resource ID of pagination query. If the parameter is left blank, only resources on the first page are queried.

Minimum: 0

Maximum: 36

id

No

String

  • Definition: Bandwidth ID, which uniquely identifies the bandwidth.

bandwidth_type

No

String

  • Definition: Bandwidth type. The default value for the shared bandwidth is share.

  • Range:

    • share: shared bandwidth

    • bgp: dynamic BGP

    • telcom: China Unicom

    • sbgp: static BGP

name

No

String

  • Definition: Bandwidth name, which is used to filter bandwidths.

name_like

No

String

  • Definition: Fuzzy search by bandwidth name.

tenant_id

No

String

  • Definition: Tenant ID, which is used to filter bandwidths.

ingress_size

No

String

  • Definition: Inbound bandwidth size, which is used to filter bandwidths.

admin_state

No

String

  • Definition: Bandwidth status is used as a filter.

  • Constraints: N/A

  • Range:

    • NORMAL: The bandwidth is normal.

    • FREEZED: The bandwidth is frozen.

  • Default Value: N/A

billing_info

No

String

  • Definition: Billing information, which is used to filter bandwidths.

tags

No

String

  • Definition: Tag, which is used to filter bandwidths.

enable_bandwidth_rules

No

String

  • Definition: Whether to filter bandwidths by whether bandwidth rules are enabled.

  • Range: true and false

rule_quota

No

Integer

  • Definition: Rule number, which is used to filter bandwidths.

public_border_group

No

String

  • Definition: Public border group, which is used to filter bandwidths.

charge_mode

No

String

  • Definition: Whether the bandwidth is billed by traffic, bandwidth, or enhanced 95th percentile bandwidth.

  • Range: Possible values can be bandwidth (billed by bandwidth), traffic (billed by traffic), or 95peak_plus (billed by enhanced 95th percentile bandwidth). If no value is returned or the value is left blank, value bandwidth is used.

  • Constraints: Only shared bandwidths support 95peak_plus (billed by enhanced 95th percentile bandwidth). If you use the enhanced 95th percentile bandwidth, specify the guaranteed bandwidth percentage. The default value is 20%.

size

No

String

  • Definition: Bandwidth size. The shared bandwidth has a minimum limit, which may vary by site. The default minimum value is 5 Mbit/s.

  • Range: The value ranges from 5 Mbit/s to 2000 Mbit/s by default. The specific range may vary by region. You can see the available bandwidth range on the management console.

The minimum increment for bandwidth adjustment varies by the bandwidth range.

  • The minimum increment is 1 Mbit/s if the allowed bandwidth ranges from 0 Mbit/s to 300 Mbit/s (with 300 Mbit/s included).

  • The minimum increment is 50 Mbit/s if the allowed bandwidth ranges from 300 Mbit/s to 1000 Mbit/s (with 1000 Mbit/s included).

  • The minimum increment is 500 Mbit/s if the allowed bandwidth exceeds 1000 Mbit/s.

type

No

String

  • Definition: Whether the bandwidth is shared or dedicated.

  • Range:

    • WHOLE: shared bandwidth

    • PER: dedicated bandwidth

fields

No

String

  • Definition: Query field. Format: "fields=id&fields=bandwidth_type&..."

  • Supported fields: id, name, tenant_id, size, ratio_95peak_plus, ingress_size, bandwidth_type, admin_state, billing_info, charge_mode, type, publicip_info, tags, enable_bandwidth_rules, rule_quota, bandwidth_rules, publicip_border_group, created_at, updated_at, lock_infos, and enterprise_project_id

Minimum: 0

Maximum: 1024

Request Parameters

None

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

eip_bandwidths

Array of EipBandwidthResponseBody objects

Bandwidths

page_info

PageInfoDict object

Pagination page number information.

request_id

String

Request ID.

Table 4 EipBandwidthResponseBody

Parameter

Type

Description

admin_state

String

  • Definition: Bandwidth status is used as a filter.

  • Constraints: N/A

  • Range:

    • NORMAL: The bandwidth is normal.

    • FREEZED: The bandwidth is frozen.

  • Default Value: N/A

ingress_size

Integer

  • Definition: Inbound bandwidth size, in Mbit/s

rule_quota

Integer

  • Definition: Number of bandwidth rules. The minimum value can be adjusted.

ratio_95peak_plus

Integer

  • Definition: Guaranteed rate of the enhanced 95th percentile bandwidth. The minimum rate is 20%.

enable_bandwidth_rules

Boolean

  • Definition: Whether to enable bandwidth rules for rate limiting.

bandwidth_rules

Array of BandWidthRules objects

  • Definition: Bandwidth rules (This parameter is available only in CN East-Shanghai1.)

public_border_group

String

  • Definition: Whether it is a central or edge resource. Value center indicates a central bandwidth.

bandwidth_type

String

  • Definition: Bandwidth type. The default value for the shared bandwidth is share.

  • Range:

    • share: shared bandwidth

    • bgp: dynamic BGP

    • telcom: China Unicom

    • sbgp: static BGP

Minimum: 1

Maximum: 36

billinginfo

String

  • Definition: Billing information

Minimum: 0

Maximum: 255

id

String

  • Definition: Bandwidth ID, which uniquely identifies the bandwidth.

Minimum: 1

Maximum: 36

name

String

  • Definition: Bandwidth name.

  • Range: The value can contain 1 to 64 characters, including letters, digits, underscores (_), hyphens (-), and periods (.).

Minimum: 1

Maximum: 64

publicip_info

Array of PublicipInfoResponseBody objects

  • Definition: EIPs added to the bandwidth.

  • Constraints: A bandwidth of the WHOLE type can have multiple EIPs, while a bandwidth of the PER type can have only one EIP.

type

String

  • Definition: Whether the bandwidth is shared or dedicated.

  • Range:

    • WHOLE: Shared bandwidth

    • PER: Dedicated bandwidth

size

Integer

  • Definition: Bandwidth size.

  • Range: The value ranges from 5 Mbit/s to 2000 Mbit/s by default. (The specific range may vary depending on the configuration in each region. You can see the available bandwidth range on the management console.)

Minimum: 5

Maximum: 2000

tenant_id

String

  • Definition: ID of the project that the user belongs to.

tags

Array of strings

  • Definition: EIP tag

created_at

String

  • Definition: Time (UTC) when a resource was created. The format is YYYY-MM-DDTHH:MM:SS.

updated_at

String

  • Definition: Time (UTC) when a resource was updated. The format is YYYY-MM-DDTHH:MM:SS.

Table 5 BandWidthRules

Parameter

Type

Description

id

String

  • Definition: Bandwidth rule ID.

Maximum: 36

name

String

  • Definition: Bandwidth rule name.

Minimum: 0

Maximum: 64

admin_state_up

Boolean

  • Definition: Configuration status. The value False indicates that the configuration does not take effect.

egress_size

Integer

  • Definition: Maximum outbound bandwidth in Mbit/s

  • The value range ranges from 0 to n, where n indicates the bandwidth size. If the value is set to 0, the maximum bandwidth size will be used.

Minimum: 0

Default: 0

egress_guarented_size

Integer

  • Definition: Guaranteed outbound bandwidth in Mbit/s.

  • The value ranges from 0 to x, where x indicates the remaining bandwidth.

Minimum: 0

Default: 0

publicip_info

Array of PublicipInfoResponseBody objects

  • Definition: EIPs added to the bandwidth.

  • Constraints: A bandwidth of the WHOLE type can have multiple EIPs, while a bandwidth of the PER type can have only one EIP.

Table 6 PublicipInfoResponseBody

Parameter

Type

Description

publicip_address

String

  • Definition: IPv4 or IPv6 EIP

publicip_id

String

  • Definition: ID of the IPv4 or IPv6 EIP that uses the bandwidth

publicip_type

String

Definition

EIP type.

Range

5_bgp (dynamic BGP), 5_sbgp (static BGP), and 5_bgp-premium (premium BGP)

  • CN South-Guangzhou: 5_bgp and 5_sbgp

  • CN East-Shanghai1: 5_bgp and 5_sbgp

  • CN East-Shanghai2: 5_bgp and 5_sbgp

  • CN North-Beijing1: 5_bgp and 5_sbgp

  • CN-Hong Kong: 5_bgp, 5_bgp-premium

  • AP-Bangkok: 5_bgp

  • AP-Singapore: 5_bgp

  • AF-Johannesburg: 5_bgp

  • CN Southwest-Guiyang1: 5_sbgp

  • CN North-Beijing4: 5_bgp and 5_sbgp

  • LA-Santiago: 5_bgp

  • LA-Sao Paulo1: 5_bgp

  • LA-Mexico City1: 5_bgp

  • LA-Buenos Aires1: 5_bgp

  • LA-Lima1: 5_bgp

  • LA-Santiago2: 5_bgp

publicipv6_address

String

  • Definition: IPv6 EIP. This parameter does not display when you assign an IPv4 EIP.

ip_version

Integer

  • Definition: IP address version.

  • Range:

4: IPv4

6: IPv6

Table 7 PageInfoDict

Parameter

Type

Description

previous_marker

String

Marker value of the previous page.

next_marker

String

Marker value of the next page.

current_count

Integer

Total number of data records on the current page.

Example Requests

Query the bandwidths. You can filter the bandwidths based on the query field.

GET https://{Endpoint}/v3/{project_id}/eip-bandwidths?limit=3&marker=4779ab1c-7c1a-44b1-a02e-93dfc361b32d

Example Responses

Status code: 200

{
  "request_id" : "4e5945ddd409f306b3cb4fd921a45390",
  "eip_bandwidths" : [ {
    "name" : "bandwidth-838f",
    "id" : "08b4700e-cc3c-4aed-a35a-66022bcbd0f6",
    "tenant_id" : "cb576f8cf0df40b8bb6cea0a1765c569",
    "size" : 10,
    "bandwidth_type" : "bgp",
    "ratio_95peak_plus" : null,
    "admin_state" : "NORMAL",
    "ingress_size" : 10,
    "type" : "PER",
    "enable_bandwidth_rules" : false,
    "rule_quota" : 0,
    "created_at" : "2023-05-17T02:06:49Z",
    "updated_at" : "2023-05-17T02:06:49Z",
    "bandwidth_rules" : [ ],
    "publicip_info" : [ {
      "publicip_address" : "10.83.15.65",
      "publicip_type" : "5_bgp",
      "publicip_id" : "e73fcc26-c009-4ea3-9b57-d546359bda38",
      "ip_version" : 4,
      "publicipv6_address" : null
    } ],
    "tags" : [ ],
    "public_border_group" : "center"
  } ],
  "page_info" : [ {
    "next_marker" : "08b4700e-cc3c-4aed-a35a-66022bcbd0f6",
    "previous_marker" : "08b4700e-cc3c-4aed-a35a-66022bcbd0f6",
    "current_count" : 1
  } ]
}

SDK Sample Code

The SDK sample code is as follows.

Java

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package com.huaweicloud.sdk.test;

import com.huaweicloud.sdk.core.auth.ICredential;
import com.huaweicloud.sdk.core.auth.BasicCredentials;
import com.huaweicloud.sdk.core.exception.ConnectionException;
import com.huaweicloud.sdk.core.exception.RequestTimeoutException;
import com.huaweicloud.sdk.core.exception.ServiceResponseException;
import com.huaweicloud.sdk.eip.v3.region.EipRegion;
import com.huaweicloud.sdk.eip.v3.*;
import com.huaweicloud.sdk.eip.v3.model.*;


public class ListEipBandwidthsSolution {

    public static void main(String[] args) {
        // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
        // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
        String ak = System.getenv("CLOUD_SDK_AK");
        String sk = System.getenv("CLOUD_SDK_SK");
        String projectId = "{project_id}";

        ICredential auth = new BasicCredentials()
                .withProjectId(projectId)
                .withAk(ak)
                .withSk(sk);

        EipClient client = EipClient.newBuilder()
                .withCredential(auth)
                .withRegion(EipRegion.valueOf("<YOUR REGION>"))
                .build();
        ListEipBandwidthsRequest request = new ListEipBandwidthsRequest();
        try {
            ListEipBandwidthsResponse response = client.listEipBandwidths(request);
            System.out.println(response.toString());
        } catch (ConnectionException e) {
            e.printStackTrace();
        } catch (RequestTimeoutException e) {
            e.printStackTrace();
        } catch (ServiceResponseException e) {
            e.printStackTrace();
            System.out.println(e.getHttpStatusCode());
            System.out.println(e.getRequestId());
            System.out.println(e.getErrorCode());
            System.out.println(e.getErrorMsg());
        }
    }
}

Python

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkeip.v3.region.eip_region import EipRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkeip.v3 import *

if __name__ == "__main__":
    # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak = os.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]
    projectId = "{project_id}"

    credentials = BasicCredentials(ak, sk, projectId)

    client = EipClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(EipRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ListEipBandwidthsRequest()
        response = client.list_eip_bandwidths(request)
        print(response)
    except exceptions.ClientRequestException as e:
        print(e.status_code)
        print(e.request_id)
        print(e.error_code)
        print(e.error_msg)

Go

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    eip "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/eip/v3"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/eip/v3/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/eip/v3/region"
)

func main() {
    // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security.
    // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment
    ak := os.Getenv("CLOUD_SDK_AK")
    sk := os.Getenv("CLOUD_SDK_SK")
    projectId := "{project_id}"

    auth, err := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        WithProjectId(projectId).
        SafeBuild()

    if err != nil {
        fmt.Println(err)
        return
    }

    hcClient, err := eip.EipClientBuilder().
         WithRegion(region.ValueOf("<YOUR REGION>")).
         WithCredential(auth).
         SafeBuild()


    if err != nil {
        fmt.Println(err)
        return
    }

    client := eip.NewEipClient(hcClient)

    request := &model.ListEipBandwidthsRequest{}
	response, err := client.ListEipBandwidths(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

More

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

Normal response to the GET operation

Error Codes

See Error Codes.