Added JSON and XML payloads tabs with RFC 8040 URL 29/90529/8
authorAman <170030039@iitdh.ac.in>
Sat, 20 Jun 2020 19:07:34 +0000 (00:37 +0530)
committerRobert Varga <nite@hq.sk>
Mon, 7 Sep 2020 13:06:25 +0000 (13:06 +0000)
Modified docs/bgp/bgp-user-guide-graceful-restart-capability.rst by adding JSON,XML examples with corresponding sphinx tabs

Change-Id: I277e40fb90b1140d9c59ff492024db0361845718
Signed-off-by: Aman <170030039@iitdh.ac.in>
docs/bgp/bgp-user-guide-graceful-restart-capability.rst

index c3331c23adaff600c61931d5227a8d7f5f0c489b..5ec6f53d33d6e7b2226d98c40f6e7f3d09da93e2 100644 (file)
@@ -27,21 +27,45 @@ or
 
 **Method:** ``PUT``
 
-**Content-Type:** ``application/xml``
+.. tabs::
 
-**Request Body:**
+   .. tab:: XML
 
-.. code-block:: xml
-   :linenos:
-   :emphasize-lines: 3
+      **Content-Type:** ``application/xml``
 
-   <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
-       <config>
-           <restart-time>60</restart-time>
-        </config>
-    </graceful-restart>
+      **Request Body:**
 
-@line 3: value of Graceful Restart timer in seconds
+      .. code-block:: xml
+         :linenos:
+         :emphasize-lines: 3
+
+         <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
+             <config>
+                 <restart-time>60</restart-time>
+             </config>
+         </graceful-restart>
+
+      @line 3: value of Graceful Restart timer in seconds
+
+   .. tab:: JSON
+
+      **Content-Type:** ``application/json``
+
+      **Request Body:**
+
+      .. code-block:: json
+         :linenos:
+         :emphasize-lines: 4
+
+         {
+             "graceful-restart": {
+                 "config": {
+                     "restart-time": 60
+                 }
+             }
+         }
+
+      @line 4: value of Graceful Restart timer in seconds
 
 .. note:: If case that Graceful Restart timer is configured for both neighbor and peer-group, the one from peer-group is used.
    If no Graceful Restart timer is configured value of HOLD timer is used.
@@ -58,21 +82,45 @@ or
 
 **Method:** ``PUT``
 
-**Content-Type:** ``application/xml``
+.. tabs::
+
+   .. tab:: XML
+
+      **Content-Type:** ``application/xml``
+
+      **Request Body:**
+
+      .. code-block:: xml
+         :linenos:
+         :emphasize-lines: 3
 
-**Request Body:**
+         <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
+            <config>
+               <enable>true</enable>
+            </config>
+         </graceful-restart>
 
-.. code-block:: xml
-   :linenos:
-   :emphasize-lines: 3
+      @line 3: True if we want to preserve family routing information during Graceful Restart
 
-   <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
-      <config>
-         <enable>true</enable>
-       </config>
-   </graceful-restart>
+   .. tab:: JSON
 
-@line 3: True if we want to preserve family routing information during Graceful Restart
+      **Content-Type:** ``application/json``
+
+      **Request Body:**
+
+      .. code-block:: json
+         :linenos:
+         :emphasize-lines: 4
+
+         {
+             "graceful-restart": {
+                 "config": {
+                     "enable": true
+                 }
+             }
+         }
+
+      @line 4: True if we want to preserve family routing information during Graceful Restart
 
 Usage
 ^^^^^
@@ -83,20 +131,43 @@ To perform Graceful Restart with peer, invoke RPC:
 
 **Method:** ``POST``
 
-**Content-Type:** ``application/xml``
+.. tabs::
+
+   .. tab:: XML
+
+      **Content-Type:** ``application/xml``
+
+      **Request Body:**
+
+      .. code-block:: xml
+         :linenos:
+         :emphasize-lines: 3
+
+         <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
+             <peer-ref xmlns:rib="urn:opendaylight:params:xml:ns:yang:bgp-rib">/rib:bgp-rib/rib:rib[rib:id="bgp-example"]/rib:peer[rib:peer-id="bgp://10.25.1.9"]</peer-ref>
+             <selection-deferral-time>60</selection-deferral-time>
+         </input>
+
+      @line 3: Value of Selection Deferral timer in seconds
+
+   .. tab:: JSON
+
+      **Content-Type:** ``application/json``
 
-**Request Body:**
+      **Request Body:**
 
-.. code-block:: xml
-   :linenos:
-   :emphasize-lines: 3
+      .. code-block:: json
+         :linenos:
+         :emphasize-lines: 4
 
-   <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
-       <peer-ref xmlns:rib="urn:opendaylight:params:xml:ns:yang:bgp-rib">/rib:bgp-rib/rib:rib[rib:id="bgp-example"]/rib:peer[rib:peer-id="bgp://10.25.1.9"]</peer-ref>
-       <selection-deferral-time>60</slection-deferral-time>
-   </input>
+         {
+             "bgp-peer-rpc:input": {
+                 "peer-ref": "/rib:bgp-rib/rib:rib[rib:id=\"bgp-example\"]/rib:peer[rib:peer-id=\"bgp://10.25.1.9\"]",
+                 "selection-deferral-time": 60
+             }
+         }
 
-@line 3: Value of Selection Deferral timer in seconds
+      @line 4: Value of Selection Deferral timer in seconds
 
 References
 ^^^^^^^^^^