Adds a Border Gateway Protocol (BGP) peer to a BGP group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateBgpPeer

The operation that you want to perform. Set the value to CreateBgpPeer.

RegionId String Yes cn-shanghai

The ID of the region to which the BGP group belongs.

You can call the DescribeRegions operation to query the most recent region list.

BgpGroupId String Yes bgpg-wz9f62v4fbg****

The ID of the BGP group.

PeerIpAddress String No 116.62.XX.XX

The IP address of the BGP peer.

EnableBfd Boolean No true

Specifies whether to enable the Bidirectional Forwarding Detection (BFD) feature. Valid values:

  • true: enables BFD.
  • false: disables BFD.
ClientToken String No 123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request.

You can use the client to generate the value, but you must make sure that the value is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length.

Note If you do not set this parameter, the system uses the value of RequestId as ClientToken. The value of RequestId for each API request is different.
IpVersion String No ipv4

The IP version. Valid values:

  • IPv4: This is the default value.
  • IPv6: IPv6 is supported only if the VBR for which you want to create the BGP group has IPv6 enabled.
BfdMultiHop Integer No 3

The BFD hop count. Valid values: 1 to 255.

This parameter is required only if you enable BFD.

The parameter specifies the maximum number of network devices that a packet can traverse from the source to the destination. Set a value based on your network topology.

Response parameters

Parameter Type Example Description
BgpPeerId String bgp-m5eoyp2mwegk8ce9v****

The ID of the BGP peer.

RequestId String D4B7649A-61BB-4C64-A586-1DFF1EDA6A42

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateBgpPeer
&RegionId=cn-shanghai
&BgpGroupId=bgpg-wz9f62v4fbg****
&PeerIpAddress=116.62.XX.XX
&EnableBfd=true
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&IpVersion=ipv4
&BfdMultiHop=3
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateBgpPeerResponse>
    <BgpPeerId>bgp-m5eoyp2mwegk8ce9v****</BgpPeerId>
    <RequestId>D4B7649A-61BB-4C64-A586-1DFF1EDA6A42</RequestId>
</CreateBgpPeerResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "BgpPeerId" : "bgp-m5eoyp2mwegk8ce9v****",
  "RequestId" : "D4B7649A-61BB-4C64-A586-1DFF1EDA6A42"
}

Error codes

HttpCode Error code Error message Description
400 QuotaExceeded.Bgp bgp peer count per vbr quota exceed. The error message returned because the number of BGP groups in the VBR has reached the upper limit.
400 QuotaExceeded.Bgp bgp group count per vbr quota exceed. The error message returned because the number of BGP groups in the VBR has reached the upper limit.
400 QuotaExceeded.Nqa nqa count per vbr quota exceed. The error message returned because the Network Quality Analyzer (NQA) number has reached the upper limit.
400 QuotaExceeded.BgpNetwork bgp network count per vbr quota exceed. The error message returned because the number of BGP networks in the VBR has reached the upper limit.
400 InvalidPeerIpAddress multi pconn peer ip can not be null. The error message returned because the IP addresses of multiple Express Connect circuits cannot be empty.
400 InvalidVbrNetwork vbr netowrk not exists The error message returned because the specified VBR does not exist. Check whether the specified VBR is valid.
400 InvalidBgpGroup bgp group not exists The error message returned because the BGP group does not exist.
400 InvalidBgpName.Malformed Specified Bgp Group name is not valid. The error message returned because the name of the BGP group is invalid.
400 InvalidBgpDiscription.Malformed Specified Bgp Group description is not valid. The error message returned because the description of the BGP group is invalid.
400 InvalidBgpAuthkey.Malformed Specified Bgp Group authkey is not valid. The error message returned because the authentication key of the BGP group is invalid.
400 InvalidIP.Malformed Ip malformed. The error message returned because the format of the IP address is invalid.
400 InvalidPeerAsn.Malformed invalid peer asn cannot equals aliyun asn:45104 The error message returned because the AS number cannot be the same as the AS number on the Alibaba Cloud side.
400 InvalidParams.NotNull invalid peer asn cannot equals aliyun asn:45104 The error message returned because the AS number cannot be the same as the AS number on the Alibaba Cloud side.
400 InvalidParams.NotFound instance not found The error message returned because the specified instance does not exist.
400 InvalidParams.NotFound vpc instance not found The error message returned because the specified virtual private cloud (VPC) does not exist. Check whether the specified VPC ID is valid.
400 InvalidParams.AlreadyExists bgp network already exists The error message returned because the BGP network already exists.
400 InvalidStatus.CannotOperate invalid status cannot operate The error message returned because you cannot perform the operation when the specified resource is in the current state.
400 InvalidParams.PeerIpAddressMustPointOut vbr has 0 or more than 1 subif ,point out peerIpAddress. The error message returned because the PeerIpAddress parameter was not set.
400 InvalidParams.PeerIpAddressInUse peer ip address in use ,cannot create bgp peer. The error message returned because the peer IP address is being used and you cannot create a BGP peer.
400 OperationFailed.PconnTrafficNotEnable The operation is failed because of PconnTrafficNotEnable. The error message returned because outbound data transfer billing is disabled.
400 UnsupportedFeature.Vpconn The feature of Vpconn is not supported. The error message returned because the Express Connect circuit type is not supported.
400 DuplicatedParam.PeerIpAddress The param of PeerIpAddress is duplicated. The error message returned because the IP address of the BGP peer is duplicate.
400 DuplicatedParam.LocalIpAddress The LocalIpAddress already exists. The error message returned because a duplicate local IP address is used. Change the local IP address and try again.
400 DuplicatedParam.PeerIpv6Address The PeerIpv6Address already exists. The error message returned because a duplicate peer IP address is used. Change the peer IP address and try again.
400 DuplicatedParam.LocalIpv6Address The LocalIpv6Address already exists. The error message returned because a duplicate local IP address is used. Change the local IP address and try again.
400 IllegalParam.LocalGatewayIpAndMask The LocalGatewayIpAndMask value is invalid. The error message returned because the local gateway IP address and the subnet mask are invalid. Specify valid values and try again.
400 IllegalParam.PeeringIpv6SubnetMask The PeeringIpv6SubnetMask value is invalid. The error message returned because the subnet mask is invalid. Specify a valid subnet mask and try again.
404 InvalidRegionId.NotFound Specified value of "regionId" is not supported. The error message returned because the value of the RegionId parameter is invalid. Check whether the service is available in the specified region and try again.

For a list of error codes, see Service error codes.