BGP Support APIs

Table 1. BGP APIs

Action

Method

Payload Required

API

To configure BGP

POST

Yes

/api/config/routers/router/bgp/<as-number>

To update BGP

PUT

Yes

/api/config/routers/router/bgp/<as-number>

To delete BGP

DELETE

No

/api/config/routers/router/bgp/<as-number>

To get BGP configuration

GET

No

/api/config/routers/router/bgp?deep

Example for BGP payload


<bgp xmlns="http://www.cisco.com/nfvis/router">
  <as>200</as>
  <router-id>10.20.0.1</router-id>
     <address-family>
            <protocol>ipv4</protocol>    
            <routing-scheme>unicast</routing-scheme>
            <network>
                <network>10.20.0.0</network>
                <mask>255.255.255.0</mask>
            </network>
        <neighbor>
            <remote-ip>bgp-neighbor</remote-ip>
            <activate/>
        </neighbor>
      </address-family>
  <neighbor xmlns="http://www.cisco.com/nfvis/router">
    <remote-ip>bgp-neighbor</remote-ip>
    <remote-as>65000</remote-as>
  </neighbor>
</bgp>
Table 2. Description for BGP Payloads

Property

Type

Description

Mandatory

remote-ip

String

Neighbor IPv4 address or bgp-neighbor-name matching secure-overlay configuration

Yes

as

String

Local autonomous system number

Yes

remote-as

String

Remote autonomous system number

Yes

router-id

String

Local router id IP address

No

network

String

IP address of announced network

No

mask

String

Network mask (e.g. 255.255.255.0)

No

routing-scheme

String

Routing scheme used for announcing networks. Only unicast supported

No

activate

Activate neighbor under address family

No

protocol

String

Protocol to be used for the announcements over BGP. Only ipv4 supported

No

Example: POST create BGP local session


curl -k -v -u "admin:admin" -H Accept:application/vnd.yang.data+xml -H Content-Type:application/vnd.yang.data+xml -X POST https://209.165.201.1/api/config/routers/router/bgp/200 -d '
<bgp
	xmlns="http://www.cisco.com/nfvis/router">
	<as>200</as>
	<router-id>10.20.0.1</router-id>
	<neighbor
		xmlns="http://www.cisco.com/nfvis/router">
		<remote-ip>90.90.90.1</remote-ip>
		<remote-as>65000</remote-as>
	</neighbor>
</bgp>'

Example: PUT update BGP

curl -k -v -u "admin:admin" -X GET "https://209.165.201.1/api/config/routers/router/bgp?deep"

Example: DELETE BGP configuration

curl -k -v -u "admin:admin" -X DELETE "https://209.165.201.1/api/config/routers/router/bgp"

BGP over MPLS APIs

Table 3. BGP APIs

Action

Method

Payload Required

API

Add subnet to routes announced in address-family

POST

Yes

/api/config/router/bgp/<as_number>/address-family/network

Activate neighbor within address-family to announce routes specified

POST

Yes

/api/config/router/bgp/<as_number>/address-family/neighbor

Retrieve BGP status information

GET

No

/api/operational/bgp/<protocol>,<routing-scheme>/

Example for BGP payload


<router:bgp>
		<as>200</as>
		<address-family>
			<protocol>ipv4</protocol>
			<routing-scheme>unicast</routing-scheme>
			<network>
				<network>10.20.0.0</network>
				<mask>255.255.255.0</mask>
			</network>
			<neighbor>
				<remote-ip>90.90.90.1</remote-ip>
				<activate />
			</neighbor>
		</address-family>
		<neighbor>
			<remote-ip>90.90.90.1</remote-ip>
			<remote-as>65000</remote-as>
			<description>This is the CSR Headend</description>
		</neighbor>
	</router:bgp>