Querying the Virtual Interface List

Function

This API is used to query the virtual interface list.

URI

GET /v3/{project_id}/dcaas/virtual-interfaces

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Specifies the number of records returned on each page. Value range: 1-2000

Minimum: 1

Maximum: 2000

Default: 2000

marker

No

String

Specifies the ID of the last resource record on the previous page. If this parameter is left blank, the first page is queried. This parameter must be used together with limit.

Minimum: 0

Maximum: 36

fields

No

Array

Specifies the list of fields to be displayed.

Array length: 1-5

sort_dir

No

Array

Specifies the sorting order of returned results. The value can be asc (default) or desc.

sort_key

No

String

Specifies the field for sorting.

Default: id

Minimum: 0

Maximum: 36

enterprise_project_id

No

Array

Filters resource instances by enterprise project ID.

Array length: 1-10

id

No

Array

Specifies the resource ID by which instances are queried.

Array length: 1-5

status

No

Array

Specifies the status by which instances are queried.

Array length: 1-5

direct_connect_id

No

Array

Specifies the connection ID by which virtual interfaces are queried.

Array length: 1-5

vgw_id

No

Array

Specifies the virtual gateway ID by which virtual interfaces are queried.

Array length: 1-5

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. To obtain the token, see section "Obtaining the User Token" in the Identity and Access Management API Reference. The token is the value of X-Subject-Token in the response header.

Minimum: 0

Maximum: 10240

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Specifies the request ID.

virtual_interfaces

Array of VirtualInterface objects

Specifies the virtual interface.

page_info

PageInfo object

Specifies the pagination query information.

Table 5 VirtualInterface

Parameter

Type

Description

id

String

Specifies the virtual interface ID.

Maximum: 36

name

String

Specifies the virtual interface name.

Maximum: 64

admin_state_up

Boolean

Specifies the administrative status. The value can be true or false.

bandwidth

Integer

Specifies the virtual interface bandwidth.

Minimum: 2

Maximum: 2147483647

create_time

String

Specifies when the virtual interface was created. The UTC time format is yyyy-MM-ddTHH:mm:ss.SSSZ.

Maximum: 255

description

String

Provides supplementary information about the virtual interface.

Maximum: 128

direct_connect_id

String

Specifies the connection ID.

Maximum: 36

service_type

String

Specifies the gateway type. The value is VGW.

status

String

Specifies the operating status. The value can be ACTIVE, DOWN, BUILD, ERROR, PENDING_CREATE, PENDING_UPDATE, PENDING_DELETE, DELETED, AUTHORIZATION, or REJECTED.

tenant_id

String

Specifies the project ID.

Minimum: 32

Maximum: 32

type

String

Specifies the type of the virtual interface. The value is private.

Default: private

Maximum: 255

Enumeration value: private

vgw_id

String

Specifies the virtual gateway ID.

Minimum: 36

Maximum: 36

vlan

Integer

Specifies the VLAN for connecting to the customer gateway. The value ranges from 0 to 3999.

Minimum: 0

Maximum: 3999

route_limit

Integer

Specifies the remote subnet route configurations of the virtual interface.

Minimum: 1

Maximum: 200

Default: 50

enable_nqa

Boolean

Specifies whether NQA is enabled. The value can be true or false. (This is a reserved parameter and is not supported currently.)

enable_bfd

Boolean

Specifies whether BFD is enabled. The value can be true or false. (This is a reserved parameter and is not supported currently.)

lag_id

String

Specifies the ID of the LAG associated with the virtual interface.

Minimum: 36

Maximum: 36

device_id

String

Specifies the ID of the device that the virtual interface belongs to.

enterprise_project_id

String

Specifies the ID of the enterprise project that the virtual interface belongs to.

Minimum: 36

Maximum: 36

local_gateway_v4_ip

String

Specifies the IPv4 interface address of the gateway used on the cloud. This parameter has been migrated to the vifpeer parameter list and will be discarded later.

remote_gateway_v4_ip

String

Specifies the IPv4 interface address of the gateway used on premises. This parameter has been migrated to the vifpeer parameter list and will be discarded later.

ies_id

String

Specifies the edge site ID. (This parameter is not supported currently.)

reason

String

Displays error information if the status of a line is Error.

rate_limit

Boolean

Specifies whether rate limiting is enabled on a virtual interface.

address_family

String

Specifies the address family of the virtual interface. The value can be IPv4 or IPv6. This parameter has been migrated to the vifpeer parameter list and will be discarded later.

local_gateway_v6_ip

String

Specifies the IPv6 interface address of the gateway used on the cloud. This parameter has been migrated to the vifpeer parameter list and will be discarded later.

remote_gateway_v6_ip

String

Specifies the IPv6 interface address of the gateway used on premises. This parameter has been migrated to the vifpeer parameter list and will be discarded later.

lgw_id

String

Specifies the ID of the local gateway, which is used in IES scenarios. (This parameter is not supported currently.)

gateway_id

String

Specifies the ID of the gateway associated with the virtual interface. (This is a reserved parameter and is not supported currently.)

remote_ep_group

Array of strings

Specifies the remote subnet list, which records the CIDR blocks used in the on-premises data center. This parameter has been migrated to the vifpeer parameter list and will be discarded later.

service_ep_group

Array of strings

Specifies the list of public network addresses that can be accessed by the on-premises data center. This field is required in the APIs of public network connections. This parameter has been migrated to the vifpeer parameter list and will be discarded later.

bgp_route_limit

Integer

Specifies the BGP route configuration.

priority

String

Specifies the priority of a virtual interface. The value can be normal or low. If the priorities are the same, the virtual interfaces work in load balancing mode. If the priorities are different, the virtual interfaces work in active/standby pairs. Outbound traffic is preferentially forwarded to the normal virtual interface with a higher priority. This option is only supported by virtual interfaces that use BGP routing.

Default: normal

Enumeration values:

  • normal

  • low

vif_peers

Array of VifPeer objects

Provides information about virtual interface peers.

extend_attribute

VifExtendAttribute object

Provides extended parameter information. (This is a reserved parameter and is not supported currently.)

Table 6 VifPeer

Parameter

Type

Description

id

String

Specifies the resource ID.

Minimum: 36

Maximum: 36

tenant_id

String

Specifies the ID of the project that the virtual interface peer belongs to.

Minimum: 36

Maximum: 36

name

String

Specifies the name of the virtual interface peer.

Minimum: 0

Maximum: 64

description

String

Provides supplementary information about the virtual interface peer.

Minimum: 0

Maximum: 128

address_family

String

Specifies the address family of the virtual interface. The value can be IPv4 or IPv6.

local_gateway_ip

String

Specifies the gateway address of the virtual interface peer used on the cloud.

remote_gateway_ip

String

Specifies the gateway of the virtual interface peer used in the on-premises data center.

route_mode

String

Specifies the routing mode. The value can be static or bgp.

Maximum: 255

Enumeration values:

  • bgp

  • static

bgp_asn

Integer

Specifies the ASN of the BGP peer.

Minimum: 1

Maximum: 4294967295

bgp_md5

String

Specifies the MD5 password of the BGP peer.

remote_ep_group

Array of strings

Specifies the remote subnet list, which records the CIDR blocks used in the on-premises data center.

service_ep_group

Array of strings

Specifies the list of public network addresses that can be accessed by the on-premises data center. This field is required in the APIs of public network connections.

device_id

String

Specifies the ID of the device that the virtual interface peer belongs to.

bgp_route_limit

Integer

Specifies the BGP route configuration.

bgp_status

String

Specifies the BGP protocol status of the virtual interface peer. If the virtual interface peer uses static routing, the status is null.

Maximum: 10

status

String

Specifies the status of the virtual interface peer.

vif_id

String

Specifies the ID of the virtual interface corresponding to the virtual interface peer.

Minimum: 36

Maximum: 36

receive_route_num

Integer

Specifies the number of received BGP routes if BGP routing is used. If static routing is used, this parameter is meaningless and the value is -1. If this parameter cannot be obtained, contact customer service to migrate your ports.

enable_nqa

Boolean

Specifies whether NQA is enabled. The value can be true or false. (This is a reserved parameter and is not supported currently.)

enable_bfd

Boolean

Specifies whether BFD is enabled. The value can be true or false. (This is a reserved parameter and is not supported currently.)

Table 7 VifExtendAttribute

Parameter

Type

Description

ha_type

String

Specifies the availability detection type of the virtual interface.

Enumeration values:

  • nqa

  • bfd

ha_mode

String

Specifies the availability detection mode.

Enumeration values:

  • auto_single

  • auto_multi

  • static_single

  • static_multi

  • enhance_nqa

detect_multiplier

Integer

Specifies the number of detection retries.

Default: 5

min_rx_interval

Integer

Specifies the interval for receiving detection packets.

Default: 1000

min_tx_interval

Integer

Specifies the interval for sending detection packets.

Default: 1000

remote_disclaim

Integer

Specifies the remote identifier of the static BFD session.

local_disclaim

Integer

Specifies the local identifier of the static BFD session.

Table 8 PageInfo

Parameter

Type

Description

previous_marker

String

Specifies the marker of the previous page. The value is the resource UUID.

Minimum: 0

Maximum: 36

current_count

Integer

Specifies the number of resources in the current list.

Minimum: 0

Maximum: 2000

next_marker

String

Specifies the marker of the next page. The value is the resource UUID. If this parameter is left empty, the resource is on the last page.

Minimum: 0

Maximum: 36

Example Requests

Querying the virtual interface list

GET https://{dc_endpoint}/v3/57afb1b374964d41b242a062198cc84e/dcaas/virtual-interfaces?id=022f4e43-db50-40fd-8a3a-1f330bb1ab78

Example Responses

Status code: 200

OK

{
    "virtual_interfaces": [{
        "enterprise_project_id": "0",
        "name": "vif-cq-test",
        "id": "022f4e43-db50-40fd-8a3a-1f330bb1ab78",
        "description": null,
        "tenant_id": "57afb1b374964d41b242a062198cc84e",
        "direct_connect_id": "758ec882-d66d-48c4-bf30-c7ef402b5c72",
        "vgw_id": null,
        "type": "public",
        "service_type": "GEIP",
        "vlan": 1500,
        "bandwidth": 2,
        "local_gateway_v4_ip": null,
        "remote_gateway_v4_ip": null,
        "device_id": "29.0.185.90",
        "route_mode": "static",
        "bgp_asn": null,
        "bgp_md5": null,
        "status": "ACTIVE",
        "ies_id": null,
        "create_time": "2024-08-08T08:39:40.000Z",
        "reason": null,
        "admin_state_up": true,
        "rate_limit": false,
        "enable_bfd": false,
        "route_limit": 256,
        "address_family": "ipv6",
        "local_gateway_v6_ip": "1111::1/64",
        "remote_gateway_v6_ip": "1111::2/64",
        "enable_nqa": false,
        "lag_id": null,
        "lgw_id": null,
        "gateway_id": "722f950e-dcdc-4fec-a8b8-f5ace4a6f95e",
        "remote_ep_group": [],
        "service_ep_group": [],
        "vif_peers": [
            {
                "id": "d22edc36-360a-441a-98eb-b470b9aba1df",
                "tenant_id": "57afb1b374964d41b242a062198cc84e",
                "name": "vif-sxc-old",
                "description": null,
                "address_family": "ipv4",
                "local_gateway_ip": "13.13.13.1/30",
                "remote_gateway_ip": "13.13.13.2/30",
                "route_mode": "static",
                "bgp_asn": null,
                "bgp_md5": null,
                "device_id": "29.0.185.90",
                "enable_bfd": false,
                "enable_nqa": false,
                "bgp_route_limit": 256,
                "bgp_status": null,
                "status": "ACTIVE",
                "vif_id": "022f4e43-db50-40fd-8a3a-1f330bb1ab78",
                "receive_route_num": -1,
                "remote_ep_group": [
                    "215.255.30.255/32"
                ],
                "service_ep_group": null
            },
            {
                "id": "77db4123-c65c-46cc-a4ef-877cddc48305",
                "tenant_id": "57afb1b374964d41b242a062198cc84e",
                "name": "vif-cq-test",
                "description": null,
                "address_family": "ipv6",
                "local_gateway_ip": "1111::1/64",
                "remote_gateway_ip": "1111::2/64",
                "route_mode": "static",
                "bgp_asn": null,
                "bgp_md5": null,
                "device_id": "29.0.185.90",
                "enable_bfd": false,
                "enable_nqa": false,
                "bgp_route_limit": 256,
                "bgp_status": null,
                "status": "ACTIVE",
                "vif_id": "022f4e43-db50-40fd-8a3a-1f330bb1ab78",
                "receive_route_num": -1,
                "remote_ep_group": [],
                "service_ep_group": null
            }
        ],
        "bgp_route_limit": 256,
        "tags": [],
        "priority": "normal"
    }],
    "request_id": "b18287ddaf3003c3fdb3ee0daee47403",
    "page_info": {
        "previous_marker": "022f4e43-db50-40fd-8a3a-1f330bb1ab78",
        "current_count": 1
    }
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.