**URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
+**RFC8040 URL:** ``/rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/protocols``
+
**Method:** ``POST``
-**Content-Type:** ``application/xml``
-
-**Request Body:**
-
-.. code-block:: xml
-
- <protocol xmlns="http://openconfig.net/yang/network-instance">
- <name>bgp-example</name>
- <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
- <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
- <global>
- <config>
- <router-id>192.0.2.2</router-id>
- <as>65000</as>
- </config>
- <afi-safis>
- <afi-safi>
- <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
- </afi-safi>
- <afi-safi>
- <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
- </afi-safi>
- </afi-safis>
- </global>
- </bgp>
- </protocol>
+.. tabs::
+
+ .. tab:: XML
+
+ **Content-Type:** ``application/xml``
+
+ **Request Body:**
+
+ .. code-block:: xml
+
+ <protocol xmlns="http://openconfig.net/yang/network-instance">
+ <name>bgp-example</name>
+ <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
+ <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
+ <global>
+ <config>
+ <router-id>192.0.2.2</router-id>
+ <as>65000</as>
+ </config>
+ <afi-safis>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
+ </afi-safi>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
+ </afi-safi>
+ </afi-safis>
+ </global>
+ </bgp>
+ </protocol>
+
+ .. tab:: JSON
+
+ **Content-Type:** ``application/json``
+
+ **Request Body:**
+
+ .. code-block:: json
+
+ {
+ "protocol": [
+ {
+ "identifier": "openconfig-policy-types:BGP",
+ "name": "bgp-example",
+ "bgp-openconfig-extensions:bgp": {
+ "global": {
+ "config": {
+ "router-id": "192.0.2.2",
+ "as": 65000
+ },
+ "afi-safis": {
+ "afi-safi": [
+ {
+ "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST"
+ },
+ {
+ "afi-safi-name": "openconfig-bgp-types:IPV6-UNICAST"
+ }
+ ]
+ }
+ }
+ }
+ }
+ ]
+ }
BGP Peer
''''''''
**Method:** ``POST``
-**Content-Type:** ``application/xml``
+.. tabs::
+
+ .. tab:: XML
+
+ **Content-Type:** ``application/xml``
+
+ **Request Body:**
+
+ .. code-block:: xml
+
+ <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
+ <neighbor-address>192.0.2.1</neighbor-address>
+ <afi-safis>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
+ </afi-safi>
+ <afi-safi>
+ <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
+ </afi-safi>
+ </afi-safis>
+ </neighbor>
+
+ .. tab:: JSON
+
+ **Content-Type:** ``application/json``
-**Request Body:**
+ **Request Body:**
-.. code-block:: xml
+ .. code-block:: json
- <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
- <neighbor-address>192.0.2.1</neighbor-address>
- <afi-safis>
- <afi-safi>
- <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
- </afi-safi>
- <afi-safi>
- <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
- </afi-safi>
- </afi-safis>
- </neighbor>
+ {
+ "neighbor": [
+ {
+ "neighbor-address": "192.0.2.1",
+ "afi-safis": {
+ "afi-safi": [
+ {
+ "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST"
+ },
+ {
+ "afi-safi-name": "openconfig-bgp-types:IPV6-UNICAST"
+ }
+ ]
+ }
+ }
+ ]
+ }
IP Unicast API
^^^^^^^^^^^^^^
**Method:** ``GET``
-**Response Body:**
-
-.. code-block:: xml
-
- <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
- <ipv4-route>
- <route-key>193.0.2.1/32</route-key>
- <path-id>0</path-id>
- <prefix>193.0.2.1/32</prefix>
- <attributes>
- <as-path></as-path>
- <origin>
- <value>igp</value>
- </origin>
- <local-pref>
- <pref>100</pref>
- </local-pref>
- <ipv4-next-hop>
- <global>10.0.0.1</global>
- </ipv4-next-hop>
- </attributes>
- </ipv4-route>
- </ipv4-routes>
+.. tabs::
+
+ .. tab:: XML
+
+ **Response Body:**
+
+ .. code-block:: xml
+
+ <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
+ <ipv4-route>
+ <route-key>193.0.2.1/32</route-key>
+ <path-id>0</path-id>
+ <prefix>193.0.2.1/32</prefix>
+ <attributes>
+ <as-path></as-path>
+ <origin>
+ <value>igp</value>
+ </origin>
+ <local-pref>
+ <pref>100</pref>
+ </local-pref>
+ <ipv4-next-hop>
+ <global>10.0.0.1</global>
+ </ipv4-next-hop>
+ </attributes>
+ </ipv4-route>
+ </ipv4-routes>
+
+ .. tab:: JSON
+
+ **Response Body:**
+
+ .. code-block:: json
+
+ {
+ "bgp-inet:ipv4-routes":{
+ "ipv4-route": [
+ {
+ "route-key":"193.0.2.1/32",
+ "path-id": 0,
+ "prefix": "193.0.2.1/32",
+ "attributes": {
+ "origin": {
+ "value": "igp"
+ },
+ "local-pref": {
+ "pref": 100
+ },
+ "ipv4-next-hop": {
+ "global": "10.0.0.1"
+ }
+ }
+ }
+ ]
+ }
+ }
IPv6 Unicast
''''''''''''
**Method:** ``GET``
-**Response Body:**
-
-.. code-block:: xml
-
- <ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
- <ipv6-route>
- <route-key>2a02:b80:0:1::/64</route-key>
- <path-id>0</path-id>
- <prefix>2a02:b80:0:1::/64</prefix>
- <attributes>
- <as-path></as-path>
- <origin>
- <value>igp</value>
- </origin>
- <local-pref>
- <pref>200</pref>
- </local-pref>
- <ipv6-next-hop>
- <global>2a02:b80:0:2::1</global>
- </ipv6-next-hop>
- </attributes>
- </ipv6-route>
- </ipv6-routes>
+.. tabs::
+
+ .. tab:: XML
+
+ **Response Body:**
+
+ .. code-block:: xml
+
+ <ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
+ <ipv6-route>
+ <route-key>2a02:b80:0:1::/64</route-key>
+ <path-id>0</path-id>
+ <prefix>2a02:b80:0:1::/64</prefix>
+ <attributes>
+ <as-path></as-path>
+ <origin>
+ <value>igp</value>
+ </origin>
+ <local-pref>
+ <pref>200</pref>
+ </local-pref>
+ <ipv6-next-hop>
+ <global>2a02:b80:0:2::1</global>
+ </ipv6-next-hop>
+ </attributes>
+ </ipv6-route>
+ </ipv6-routes>
+
+ .. tab:: JSON
+
+ **Response Body:**
+
+ .. code-block:: json
+
+ {
+ "bgp-inet:ipv6-routes":{
+ "ipv6-route": [
+ {
+ "route-key":"2a02:b80:0:1::/64",
+ "path-id": 0,
+ "prefix": "2a02:b80:0:1::/64",
+ "attributes": {
+ "origin": {
+ "value": "igp"
+ },
+ "local-pref": {
+ "pref": 200
+ },
+ "ipv6-next-hop": {
+ "global": "2a02:b80:0:2::1"
+ }
+ }
+ }
+ ]
+ }
+ }
.. note:: IPv4/6 routes mapping to topology nodes is supported by BGP Topology Provider.
**Method:** ``POST``
-**Content-Type:** ``application/xml``
-
-**Request Body:**
-
-.. code-block:: xml
-
- <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
- <route-key>10.0.0.11/32</route-key>
- <prefix>10.0.0.11/32</prefix>
- <path-id>0</path-id>
- <attributes>
- <as-path></as-path>
- <origin>
- <value>igp</value>
- </origin>
- <local-pref>
- <pref>100</pref>
- </local-pref>
- <ipv4-next-hop>
- <global>10.11.1.1</global>
- </ipv4-next-hop>
- </attributes>
- </ipv4-route>
+.. tabs::
+
+ .. tab:: XML
+
+ **Content-Type:** ``application/xml``
+
+ **Request Body:**
+
+ .. code-block:: xml
+
+ <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
+ <route-key>10.0.0.11/32</route-key>
+ <prefix>10.0.0.11/32</prefix>
+ <path-id>0</path-id>
+ <attributes>
+ <as-path></as-path>
+ <origin>
+ <value>igp</value>
+ </origin>
+ <local-pref>
+ <pref>100</pref>
+ </local-pref>
+ <ipv4-next-hop>
+ <global>10.11.1.1</global>
+ </ipv4-next-hop>
+ </attributes>
+ </ipv4-route>
+
+ .. tab:: JSON
+
+ **Content-Type:** ``application/json``
+
+ **Request Body:**
+
+ .. code-block:: json
+
+ {
+ "ipv4-route": [
+ {
+ "route-key":"10.0.0.11/32",
+ "path-id": 0,
+ "prefix": "10.0.0.11/32",
+ "attributes": {
+ "origin": {
+ "value": "igp"
+ },
+ "local-pref": {
+ "pref": 100
+ },
+ "ipv4-next-hop": {
+ "global": "10.11.1.1"
+ }
+ }
+ }
+ ]
+ }
-----
**Method:** ``POST``
-**Content-Type:** ``application/xml``
-
-**Request Body:**
-
-.. code-block:: xml
-
- <ipv6-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
- <route-key>2001:db8:30::3/128</route-key>
- <prefix>2001:db8:30::3/128</prefix>
- <path-id>0</path-id>
- <attributes>
- <ipv6-next-hop>
- <global>2001:db8:1::6</global>
- </ipv6-next-hop>
- <as-path/>
- <origin>
- <value>igp</value>
- </origin>
- <local-pref>
- <pref>100</pref>
- </local-pref>
- </attributes>
- </ipv6-route>
+.. tabs::
+
+ .. tab:: XML
+
+ **Content-Type:** ``application/xml``
+
+ **Request Body:**
+
+ .. code-block:: xml
+
+ <ipv6-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
+ <route-key>2001:db8:30::3/128</route-key>
+ <prefix>2001:db8:30::3/128</prefix>
+ <path-id>0</path-id>
+ <attributes>
+ <ipv6-next-hop>
+ <global>2001:db8:1::6</global>
+ </ipv6-next-hop>
+ <as-path/>
+ <origin>
+ <value>igp</value>
+ </origin>
+ <local-pref>
+ <pref>100</pref>
+ </local-pref>
+ </attributes>
+ </ipv6-route>
+
+ .. tab:: JSON
+
+ **Content-Type:** ``application/json``
+
+ **Request Body:**
+
+ .. code-block:: json
+
+ {
+ "ipv6-route": [
+ {
+ "route-key": "2001:db8:30::3/128",
+ "path-id": 0,
+ "prefix": "2001:db8:30::3/128",
+ "attributes": {
+ "ipv6-next-hop": {
+ "global": "2001:db8:1::6"
+ },
+ "origin": {
+ "value": "igp"
+ },
+ "local-pref": {
+ "pref": 100
+ }
+ }
+ }
+ ]
+ }
-----