Added JSON and XML payloads tabs with RFC 8040 URL 75/90575/7
authorAman <170030039@iitdh.ac.in>
Mon, 22 Jun 2020 18:06:58 +0000 (23:36 +0530)
committerRobert Varga <nite@hq.sk>
Mon, 7 Sep 2020 12:53:56 +0000 (12:53 +0000)
Modified docs/bgp/bgp-user-guide-test-tools.rst by adding JSON,XML examples with corresponding sphinx tabs

Change-Id: I277e40fb90b1140d9c59ff492024db0361845599
Signed-off-by: Aman <170030039@iitdh.ac.in>
docs/bgp/bgp-user-guide-test-tools.rst

index 79addc17ca466763f3df3190a774fab33d5a1281..a476239adb41422f449d9092fe0e2c839da744a1 100644 (file)
@@ -70,21 +70,45 @@ Install ``odl-bgpcep-bgp-benchmark`` feature and reconfigure BGP Application Pee
 
 **URL:** ``/restconf/config/odl-bgp-app-peer-benchmark-config:config``
 
+**RFC8040 URL:** ``/rests/data/odl-bgp-app-peer-benchmark-config:config``
+
 **Method:** ``PUT``
 
-**Content-Type:** ``application/xml``
+.. tabs::
+
+   .. tab:: XML
+
+      **Content-Type:** ``application/xml``
+
+      **Request Body:**
+
+      .. code-block:: xml
+         :linenos:
+         :emphasize-lines: 2
+
+         <odl-bgp-app-peer-benchmark-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">
+            <app-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">10.25.1.9</app-peer-id>
+         </odl-bgp-app-peer-benchmark-config>
 
-**Request Body:**
+      @line 2: The *Application Peer* identifier.
 
-.. code-block:: xml
-   :linenos:
-   :emphasize-lines: 2
+   .. tab:: JSON
 
-   <odl-bgp-app-peer-benchmark-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">
-      <app-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">10.25.1.9</app-peer-id>
-   </odl-bgp-app-peer-benchmark-config>
+      **Content-Type:** ``application/json``
 
-@line 2: The *Application Peer* identifier.
+      **Request Body:**
+
+      .. code-block:: json
+         :linenos:
+         :emphasize-lines: 3
+
+         {
+             "odl-bgp-app-peer-benchmark-config": {
+                 "app-peer-id": "10.25.1.9"
+             }
+         }
+
+      @line 3: The *Application Peer* identifier.
 
 Inject routes
 '''''''''''''
@@ -92,50 +116,105 @@ Routes injection can be invoked via RPC:
 
 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:add-prefix``
 
+**RFC8040 URL:** ``/rests/operations/odl-bgp-app-peer-benchmark:add-prefix``
+
 **Method:** ``POST``
 
-**Content-Type:** ``application/xml``
+.. tabs::
+
+   .. tab:: XML
+
+      **Content-Type:** ``application/xml``
+
+      **Request Body:**
+
+      .. code-block:: xml
+         :linenos:
+         :emphasize-lines: 2,3,4,5
+
+         <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
+             <prefix>1.1.1.1/32</prefix>
+             <count>100000</count>
+             <batchsize>2000</batchsize>
+             <nexthop>192.0.2.2</nexthop>
+         </input>
+
+      @line 2: A initial IPv4 prefix carried in route. Value is incremented for following routes.
+
+      @line 3: An amount of routes to be added to *Application Peer's* programmable RIB.
+
+      @line 4: A size of the transaction batch.
+
+      @line 5: A NEXT_HOP attribute value used in all injected routes.
+
+      **Response Body:**
+
+      .. code-block:: xml
+         :linenos:
+         :emphasize-lines: 3,4,5
 
-**Request Body:**
+         <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
+             <result>
+                 <duration>4301</duration>
+                 <rate>25000</rate>
+                 <count>100000</count>
+             </result>
+         </output>
 
-.. code-block:: xml
-   :linenos:
-   :emphasize-lines: 2,3,4,5
+      @line 3: Request duration in milliseconds.
 
-   <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
-       <prefix>1.1.1.1/32</prefix>
-       <count>100000</count>
-       <batchsize>2000</batchsize>
-       <nexthop>192.0.2.2</nexthop>
-   </input>
+      @line 4: Writes per second rate.
 
-@line 2: A initial IPv4 prefix carried in route. Value is incremented for following routes.
+      @line 5: An amount of routes added to *Application Peer's* programmable RIB.
 
-@line 3: An amount of routes to be added to *Application Peer's* programmable RIB.
+   .. tab:: JSON
 
-@line 4: A size of the transaction batch.
+      **Content-Type:** ``application/json``
 
-@line 5: A NEXT_HOP attribute value used in all injected routes.
+      **Request Body:**
 
-**Response Body:**
+      .. code-block:: json
+         :linenos:
+         :emphasize-lines: 3,4,5,6
 
-.. code-block:: xml
-   :linenos:
-   :emphasize-lines: 3,4,5
+         {
+             "odl-bgp-app-peer-benchmark:input": {
+                 "prefix": "1.1.1.1/32",
+                 "count": 100000,
+                 "batchsize": 2000,
+                 "nexthop": "192.0.2.2"
+             }
+         }
 
-   <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
-       <result>
-           <duration>4301</duration>
-           <rate>25000</rate>
-           <count>100000</count>
-       </result>
-   </output>
+      @line 3: A initial IPv4 prefix carried in route. Value is incremented for following routes.
 
-@line 3: Request duration in milliseconds.
+      @line 4: An amount of routes to be added to *Application Peer's* programmable RIB.
 
-@line 4: Writes per second rate.
+      @line 5: A size of the transaction batch.
 
-@line 5: An amount of routes added to *Application Peer's* programmable RIB.
+      @line 6: A NEXT_HOP attribute value used in all injected routes.
+
+      **Response Body:**
+
+      .. code-block:: json
+         :linenos:
+         :emphasize-lines: 4,5,6
+
+         {
+             "output": {
+                 "result": {
+                     "duration": 4757,
+                     "rate": 25000,
+                     "count": 100000
+                 }
+             }
+         }
+
+      @line 4: Request duration in milliseconds.
+
+      @line 5: Writes per second rate.
+
+      @line 6: An amount of routes added to *Application Peer's* programmable RIB.
 
 Remove routes
 '''''''''''''
@@ -143,36 +222,80 @@ Routes deletion can be invoked via RPC:
 
 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:delete-prefix``
 
+**RFC8040 URL:** ``/rests/operations/odl-bgp-app-peer-benchmark:delete-prefix``
+
 **Method:** ``POST``
 
-**Content-Type:** ``application/xml``
+.. tabs::
+
+   .. tab:: XML
+
+      **Content-Type:** ``application/xml``
+
+      **Request Body:**
+
+      .. code-block:: xml
+         :linenos:
+         :emphasize-lines: 2,3,4
+
+         <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
+             <prefix>1.1.1.1/32</prefix>
+             <count>100000</count>
+             <batchsize>2000</batchsize>
+         </input>
+
+      @line 2: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes.
+
+      @line 3: An amount of routes to be removed from *Application Peer's* programmable RIB.
+
+      @line 4: A size of the transaction batch.
+
+      **Response Body:**
+
+      .. code-block:: xml
+
+         <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
+             <result>
+                 <duration>1837</duration>
+                 <rate>54500</rate>
+                 <count>100000</count>
+             </result>
+         </output>
+
+   .. tab:: JSON
+
+      **Content-Type:** ``application/json``
 
-**Request Body:**
+      **Request Body:**
 
-.. code-block:: xml
-   :linenos:
-   :emphasize-lines: 2,3,4
+      .. code-block:: json
+         :linenos:
+         :emphasize-lines: 3,4,5
 
-   <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
-       <prefix>1.1.1.1/32</prefix>
-       <count>100000</count>
-       <batchsize>2000</batchsize>
-   </input>
+         {
+             "odl-bgp-app-peer-benchmark:input": {
+                 "prefix": "1.1.1.1/32",
+                 "count": 100000,
+                 "batchsize": 2000
+             }
+         }
 
-@line 2: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes.
+      @line 3: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes.
 
-@line 3: An amount of routes to be removed from *Application Peer's* programmable RIB.
+      @line 4: An amount of routes to be removed from *Application Peer's* programmable RIB.
 
-@line 4: A size of the transaction batch.
+      @line 5: A size of the transaction batch.
 
-**Response Body:**
+      **Response Body:**
 
-.. code-block:: xml
+      .. code-block:: json
 
-   <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
-       <result>
-           <duration>1837</duration>
-           <rate>54500</rate>
-           <count>100000</count>
-       </result>
-   </output>
+         {
+             "odl-bgp-app-peer-benchmark:output": {
+                "result": {
+                   "duration": 1837,
+                   "rate": 54500,
+                   "count": 100000
+                }
+             }
+         }