Creating a Virtual Interface Peer¶
Function¶
This API is used to create an IPv6 virtual interface peer. Each virtual interface can have two peers: an IPv4 peer and an IPv6 peer. When a virtual interface is created, an IPv4 peer is created by default.
URI¶
POST /v3/{project_id}/dcaas/vif-peers
Parameter | Mandatory | Type | Description |
---|---|---|---|
project_id | Yes | String | Specifies the project ID. |
Request 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 |
Parameter | Mandatory | Type | Description |
---|---|---|---|
vif_peer | No | CreateVifPeer object | Specifies the virtual interface peer to be created. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
name | Yes | String | Specifies the name of the virtual interface peer. Minimum: 0 Maximum: 64 |
description | No | String | Provides supplementary information about the virtual interface peer. Minimum: 0 Maximum: 128 |
address_family | Yes | String | Specifies the address family of the virtual interface. The value can be IPv4 or IPv6. |
local_gateway_ip | Yes | String | Specifies the gateway address of the virtual interface peer used on the cloud. |
remote_gateway_ip | Yes | String | Specifies the gateway of the virtual interface peer used in the on-premises data center. |
route_mode | No | String | Specifies the routing mode. The value can be static or bgp. Maximum: 255 Enumeration values:
|
bgp_asn | No | Integer | Specifies the ASN of the BGP peer. Minimum: 1 Maximum: 4294967295 |
bgp_md5 | No | String | Specifies the MD5 password of the BGP peer. |
remote_ep_group | No | Array of strings | Specifies the remote subnet list, which records the CIDR blocks used in the on-premises data center. |
vif_id | Yes | String | Specifies the ID of the virtual interface corresponding to the virtual interface peer. Minimum: 36 Maximum: 36 |
Response Parameters¶
Status code: 201
Parameter | Type | Description |
---|---|---|
vif_peer | VifPeer object | Specifies the virtual interface peer. |
request_id | String | Specifies the request ID. |
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_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.) |
enable_gre | Boolean | Specifies whether GRE tunneling is enabled. (This is a reserved parameter and is not supported currently.) |
gre_status | String | Specifies the GRE tunnel status. (This is a reserved parameter and is not supported currently.) |
remote_gre_tunnel_ip | String | Specifies the IP address of the GRE tunnel. (This is a reserved parameter and is not supported currently.) |
Example Requests¶
Creating an IPv4 virtual interface peer
POST https://{endpoint}/v3/4bd6efdb0fb747b39aa2c0162c112226/dcaas/vif-peers { "vif_peer": { "vif_id": "86f9556a-fa68-42b7-93c2-dd407408430b", "name": "vif-peer-test", "address_family": "ipv4", "route_mode": "static", "remote_ep_group": [8.8.8.0/30], "description": "", "local_gateway_ip": "5.5.5.1/30", "remote_gateway_ip": "5.5.5.2/30" } }
Creating an IPv6 virtual interface peer
POST https://{endpoint}/v3/4bd6efdb0fb747b39aa2c0162c112226/dcaas/vif-peers { "vif_peer": { "vif_id": "86f9556a-fa68-42b7-93c2-dd407408430b", "name": "vif-peer-test", "address_family": "ipv6", "route_mode": "static", "remote_ep_group": [], "description": "", "local_gateway_ip": "FD00::1/64", "remote_gateway_ip": "FD00::2/64" } }
Example Responses¶
Status code: 201
Created
The IPv4 virtual interface peer is created.
"vif_peer": { "name": "vif-peer-test", "id": "ba604c46-8cdd-40c6-8969-ccf6159bb02b", "description": "", "tenant_id": "4bd6efdb0fb747b39aa2c0162c112226", "address_family": "ipv4", "local_gateway_ip": "5.5.5.1/30", "remote_gateway_ip": "5.5.5.2/30", "route_mode": "static", "bgp_asn": null, "bgp_md5": null, "device_id": "26.151.63.100", "enable_bfd": false, "enable_nqa": false, "bgp_route_limit": 256, "bgp_status": null, "status": "PENDING_CREATE", "vif_id": "86f9556a-fa68-42b7-93c2-dd407408430b", "enable_gre": null, "local_gre_tunnel_ip": null, "remote_gre_tunnel_ip": null, "gre_status": null, "receive_route_num": -1, "remote_ep_group": [8.8.8.0/30] }, "request_id": "846eeab082e21a170f98c67fe33099f2" }
The IPv6 virtual interface peer is created.
"vif_peer": { "name": "vif-peer-test", "id": "ba604c46-8cdd-40c6-8969-ccf6159bb02b", "description": "", "tenant_id": "4bd6efdb0fb747b39aa2c0162c112226", "address_family": "ipv6", "local_gateway_ip": "FD00::1/64", "remote_gateway_ip": "FD00::2/64", "route_mode": "static", "bgp_asn": null, "bgp_md5": null, "device_id": "26.151.63.100", "enable_bfd": false, "enable_nqa": false, "bgp_route_limit": 256, "bgp_status": null, "status": "PENDING_CREATE", "vif_id": "86f9556a-fa68-42b7-93c2-dd407408430b", "enable_gre": null, "local_gre_tunnel_ip": null, "remote_gre_tunnel_ip": null, "gre_status": null, "receive_route_num": -1, "remote_ep_group": null }, "request_id": "746eeab082e21a170f98c67fe33099f2" }
Status Codes¶
Status Code | Description |
---|---|
201 | Created |
Error Codes¶
See Error Codes.