• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. APIs
  5. Bandwidth
  6. Querying Bandwidths

Querying Bandwidths

Function

This interface is used to query bandwidths using search criteria.

URI

GET /v1/{project_id}/bandwidths

Example:
/v1/{project_id}/bandwidths?limit=10&marker=4779ab1c-7c1a-44b1-a02e-93dfc361b32d
Table 1 Parameter description

Name

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

marker

No

String

Specifies the start resource ID of pagination query. If the parameter is left blank, only resources on the first page are queried.

limit

No

int

  • Specifies the number of records returned on each page.
  • The value ranges from 0 to intmax.

Request Message

  • Request parameter

    None

  • Example request

    None

Response Message

  • Response parameter
    Table 2 Response parameter

    Name

    Type

    Description

    bandwidths

    List data structure

    Specifies the bandwidth list object.

    Table 3 Description of the bandwidths field

    Name

    Type

    Description

    name

    String

    Specifies the bandwidth name.

    size

    int

    Specifies the bandwidth size.

    id

    String

    Specifies the bandwidth ID, which uniquely identifies the bandwidth.

    share_type

    String

    • The value is PER, indicating that the bandwidth is dedicated.

    publicip_info

    Dictionary data structure

    • Specifies information about the EIP that uses the bandwidth.

    tenant_id

    String

    Specifies the project ID.

    bandwidth_type

    String

    Specifies the bandwidth type.

    The value is bgp.

    charge_mode

    String

    • Specifies whether the bandwidth is billed by traffic or by bandwidth size.
    • The value can be bandwidth or traffic. If the value is an empty character string or no value is specified, value bandwidth is used.
    Table 4 publicip_info object

    Name

    Type

    Description

    publicip_id

    String

    Specifies the ID of the EIP that uses the bandwidth.

    publicip_address

    String

    Specifies the obtained EIP if only IPv4 EIPs are available.

    publicip_type

    String

    • Specifies the EIP type.
    • The value is 5_bgp.
  • Example response
    {
        "bandwidths": [
            {
                "id": "a79fd11a-047b-4f5b-8f12-99c178cc780a",
                "name": "ddddd",
                "size": 5,
                "share_type": "PER",
                "publicip_info": [
                    {
                        "publicip_id": "80d5b82e-43b9-4f82-809a-37bec5793bd4",
                        "publicip_address": "161.xx.xx.10",
                        "publicip_type": "5_bgp"
                    }
                ],
                "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c",
                "bandwidth_type": "bgp",
                "charge_mode": "bandwidth"
              
     
            },
            {
                "id": "3fa5b383-5a73-4dcb-a314-c6128546d855",
                "name": "22212",
                "size": 6,
                "share_type": "PER",
                "publicip_info": [
                    {
                        "publicip_id": "6285e7be-fd9f-497c-bc2d-dd0bdea6efe0",
                        "publicip_address": "161.xx.xx.9",
                        "publicip_type": "5_bgp"
                    }
                ],
                "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c",
                "charge_mode": "bandwidth",
                "bandwidth_type": "bgp"
            },
            {
                "id": "f54e0df7-422d-4ab6-8d65-fd436151479c",
                "name": "2222",
                "size": 5,
                "share_type": "PER",
                "publicip_info": [
                    {
                        "publicip_id": "4ca21961-8e52-4ff4-b9c5-af2dcc2c7b50",
                        "publicip_address": "161.xx.xx.13",
                        "publicip_type": "5_bgp"
                    }
                ],
                "tenant_id": "8b7e35ad379141fc9df3e178bd64f55c",
                "charge_mode": "bandwidth",
                "bandwidth_type": "bgp"
            }
        ]
    }

Status Codes

For details, see section Status Codes.

Error Codes

For details, see section Error Codes.