From: Arunprakash D Date: Mon, 27 Jul 2020 15:43:29 +0000 (+0000) Subject: Merge "Added JSON and XML payloads tabs with RFC 8040 URL" X-Git-Tag: release/aluminium~10 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=a044ce53af46a062ec53a1064f9b63898e4b808e;hp=0f676c8339c3efff502578cb3945aa9d282d9735;p=openflowplugin.git Merge "Added JSON and XML payloads tabs with RFC 8040 URL" --- diff --git a/docs/users/operation.rst b/docs/users/operation.rst index 9f5d6bbe30..ba6ca1375a 100644 --- a/docs/users/operation.rst +++ b/docs/users/operation.rst @@ -68,84 +68,184 @@ request. To view the topology data for all the connected nodes, send the following request to the controller: -**Headers:** - -- **Content-type:** ``application/xml`` - -- **Accept:** ``application/xml`` - -- **Authentication:** ``admin:admin`` - **URL:** ``/restconf/operational/network-topology:network-topology/topology/flow:1`` -**Method:** GET +**RFC8040 URL:** ``/rests/data/network-topology:network-topology/topology=flow%3A1?content=nonconfig`` -**Sample output:** +**Method:** ``GET`` -.. code-block:: none +.. tabs:: + + .. tab:: XML + + **Headers:** + + **Content-type:** ``application/xml`` + + **Accept:** ``application/xml`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + + flow: 1 + + openflow: 2 + + openflow: 2: 2 + /a:nodes/a:node[a:id='openflow: 2']/a:node-connector[a:id='openflow: 2: 2'] + + + + openflow: 2: 1 + /a:nodes/a:node[a:id='openflow: 2']/a:node-connector[a:id='openflow: 2: 1'] + + + + openflow: 2:LOCAL + /a:nodes/a:node[a:id='openflow: 2']/a:node-connector[a:id='openflow: 2:LOCAL'] + + + /a:nodes/a:node[a:id='openflow: 2'] + + + + openflow: 1 + + openflow: 1: 1 + /a:nodes/a:node[a:id='openflow: 1']/a:node-connector[a:id='openflow: 1: 1'] + + + + openflow: 1:LOCAL + /a:nodes/a:node[a:id='openflow: 1']/a:node-connector[a:id='openflow: 1:LOCAL'] + + + + openflow: 1: 2 + /a:nodes/a:node[a:id='openflow: 1']/a:node-connector[a:id='openflow: 1: 2'] + + + /a:nodes/a:node[a:id='openflow: 1'] + + + + openflow:1:2 + + openflow:2:2 + openflow:2 + + + openflow:1 + openflow:1:2 + + + + openflow:2:2 + + openflow:1:2 + openflow:1 + + + openflow:2 + openflow:2:2 + + + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "topology": [ + { + "topology-id": "flow:1", + "node": [ + { + "node-id": "openflow:2", + "termination-point": [ + { + "tp-id": "openflow:2:2", + "opendaylight-topology-inventory:inventory-node-connector-ref": + "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:2']" + }, + { + "tp-id": "openflow:2:1", + "opendaylight-topology-inventory:inventory-node-connector-ref": + "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:1']" + }, + { + "tp-id": "openflow:2:LOCAL", + "opendaylight-topology-inventory:inventory-node-connector-ref": + "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:2:LOCAL']" + } + ], + "opendaylight-topology-inventory:inventory-node-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:2']" + }, + { + "node-id": "openflow:1", + "termination-point": [ + { + "tp-id": "openflow:1:1", + "opendaylight-topology-inventory:inventory-node-connector-ref": + "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:1:1']" + }, + { + "tp-id": "openflow:1:LOCAL", + "opendaylight-topology-inventory:inventory-node-connector-ref": + "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:1:LOCAL']" + }, + { + "tp-id": "openflow:1:2", + "opendaylight-topology-inventory:inventory-node-connector-ref": + "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']/opendaylight-inventory:node-connector[opendaylight-inventory:id='openflow:1:2']" + } + ], + "opendaylight-topology-inventory:inventory-node-ref": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']" + } + ], + "link": [ + { + "link-id": "openflow:1:2", + "destination": { + "dest-tp": "openflow:2:2", + "dest-node": "openflow:2" + }, + "source": { + "source-node": "openflow:1", + "source-tp": "openflow:1:2" + } + }, + { + "link-id": "openflow:2:2", + "destination": { + "dest-tp": "openflow:1:2", + "dest-node": "openflow:1" + }, + "source": { + "source-node": "openflow:2", + "source-tp": "openflow:2:2" + } + } + ] + } + ] + } - - flow:1 - - openflow:1 - /a:nodes/a:node[a:id='openflow:1'] - - openflow:1:1 - /a:nodes/a:node[a:id='openflow:1']/a:node-connector[a:id='openflow:1:1'] - - - openflow:1:LOCAL - /a:nodes/a:node[a:id='openflow:1']/a:node-connector[a:id='openflow:1:LOCAL'] - - - openflow:1:2 - /a:nodes/a:node[a:id='openflow:1']/a:node-connector[a:id='openflow:1:2'] - - - - openflow:2 - /a:nodes/a:node[a:id='openflow:2'] - - openflow:2:2 - /a:nodes/a:node[a:id='openflow:2']/a:node-connector[a:id='openflow:2:2'] - - - openflow:2:LOCAL - /a:nodes/a:node[a:id='openflow:2']/a:node-connector[a:id='openflow:2:LOCAL'] - - - openflow:2:1 - /a:nodes/a:node[a:id='openflow:2']/a:node-connector[a:id='openflow:2:1'] - - - - openflow:2:2 - - openflow:2 - openflow:2:2 - - - openflow:1 - openflow:1:2 - - - - openflow:1:2 - - openflow:1 - openflow:1:2 - - - openflow:2 - openflow:2:2 - - - - -.. note:: In the example above the OpenFlow node is represented as openflow:1 +.. note:: In the examples above the OpenFlow node is represented as openflow:1 where 1 is the datapath ID of the OpenFlow-enabled device. -.. note:: In the example above the OpenFlow node connector is represented as +.. note:: In the examples above the OpenFlow node connector is represented as openflow:1:2 where 1 is the datapath ID and 2 is the port ID of the OpenFlow-enabled device. @@ -219,109 +319,219 @@ Example of node inventory data To view the inventory data of a connected node, send the following request to the controller: -**Headers:** +**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1`` -- **Content-type:** ``application/xml`` +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1?content=nonconfig`` -- **Accept:** ``application/xml`` +**Method:** ``GET`` -- **Authentication:** ``admin:admin`` +.. tabs:: -**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1`` + .. tab:: XML -**Method:** ``GET`` + **Headers:** -**Sample output:** + **Content-type:** ``application/xml`` -.. code-block:: none + **Accept:** ``application/xml`` - - Open vSwitch - None - - 254 - 0 - flow-feature-capability-queue-stats - flow-feature-capability-table-stats - flow-feature-capability-flow-stats - flow-feature-capability-port-stats - flow-feature-capability-group-stats - - Nicira, Inc. - None - 2.8.1 - 192.168.0.24 - - --- Omitted output —-- - -.. note:: In the example above the OpenFlow node is represented as openflow:1 - where 1 is the datapath ID of the OpenFlow-enabled device. + **Authentication:** ``admin:admin`` -Example of port description and port statistics -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + .. code-block:: none -To view the port description and port statistics of a connected node, send the -following request to the controller: + + openflow:1 + None + 45170 + None + Open vSwitch + Nicira, Inc. + + 254 + flow-feature-capability-queue-stats + flow-feature-capability-flow-stats + flow-feature-capability-port-stats + flow-feature-capability-table-stats + 256 + -**Headers:** + --- Omitted output —-- -- **Content-type:** ``application/xml`` + .. tab:: JSON -- **Accept:** ``application/xml`` + **Headers:** -- **Authentication:** ``admin:admin`` + **Content-type:** ``application/json`` -**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:2`` + **Accept:** ``application/json`` -**Method:** ``GET`` + **Authentication:** ``admin:admin`` -**Sample output:** + .. code-block:: none -.. code-block:: none + { + "opendaylight-inventory:nodes": { + "node": [ + { + "id": "openflow:1", + "flow-node-inventory:serial-number": "None", + "flow-node-inventory:port-number": 45170, + "flow-node-inventory:description": "None", + "flow-node-inventory:hardware": "Open vSwitch", + "flow-node-inventory:manufacturer": "Nicira, Inc.", + "flow-node-inventory:switch-features": { + "max_tables": 254, + "capabilities": [ + "flow-node-inventory:flow-feature-capability-queue-stats", + "flow-node-inventory:flow-feature-capability-flow-stats", + "flow-node-inventory:flow-feature-capability-port-stats", + "flow-node-inventory:flow-feature-capability-table-stats" + ], + "max_buffers": 256 + }, + "flow-node-inventory:software": "2.0.2", + "flow-node-inventory:ip-address": "192.168.56.106", + "flow-node-inventory:table": [ + { + "id": 88, + "opendaylight-flow-table-statistics:flow-table-statistics": { + "packets-looked-up": "0", + "active-flows": 0, + "packets-matched": "0" + } + }, + + --- Omitted output —-- + +.. note:: In the examples above the OpenFlow node is represented as openflow:1 + where 1 is the datapath ID of the OpenFlow-enabled device. - - openflow:1:2 - - - 2 - 4e:92:4a:c8:4c:fa - ten-gb-fd copper - 0 - update - - - 10000000 - s1-eth2 - - false - false - true - - - 0 - - 444 - 444 - - 0 - 0 - 0 - 0 - - 37708 - 37708 - - 0 - 0 - - 2181 - 550000000 - - 0 - - +Example of port description and port statistics +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To view the port description and port statistics of a connected node, send the +following request to the controller: + +**URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/node-connector/openflow:1:2`` + +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/node-connector=openflow%3A1%3A2?content=nonconfig`` -.. note:: In the example above the OpenFlow node connector is represented as +**Method:** ``GET`` + +.. tabs:: + + .. tab:: XML + + **Headers:** + + **Content-type:** ``application/xml`` + + **Accept:** ``application/xml`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + + openflow:1:2 + + + 2 + 4e:92:4a:c8:4c:fa + ten-gb-fd copper + 0 + update + + + 10000000 + s1-eth2 + + false + false + true + + + 0 + + 444 + 444 + + 0 + 0 + 0 + 0 + + 37708 + 37708 + + 0 + 0 + + 2181 + 550000000 + + 0 + + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "node-connector": [ + { + "id": "openflow:1:2", + "flow-node-inventory:hardware-address": "ca:56:91:bf:07:c9", + "flow-node-inventory:supported": "", + "flow-node-inventory:peer-features": "", + "flow-node-inventory:advertised-features": "", + "flow-node-inventory:name": "s1-eth2", + "flow-node-inventory:port-number": 2, + "flow-node-inventory:current-speed": 10000000, + "flow-node-inventory:configuration": "", + "flow-node-inventory:current-feature": "ten-gb-fd copper", + "flow-node-inventory:maximum-speed": 0, + "flow-node-inventory:state": { + "blocked": false, + "link-down": false, + "live": false + }, + "opendaylight-port-statistics:flow-capable-node-connector-statistics": { + "packets": { + "transmitted": 203, + "received": 203 + }, + "receive-frame-error": 0, + "collision-count": 0, + "receive-errors": 0, + "transmit-errors": 0, + "bytes": { + "transmitted": 17255, + "received": 17255 + }, + "receive-crc-error": 0, + "duration": { + "nanosecond": 246000000, + "second": 1008 + }, + "receive-drops": 0, + "transmit-drops": 0, + "receive-over-run-error": 0 + } + } + ] + } + +.. note:: In the examples above the OpenFlow node connector is represented as openflow:1:2 where 1 is the datapath ID and 2 is the port ID of the OpenFlow-enabled device. @@ -333,33 +543,132 @@ Example of flow table and aggregated statistics To view the flow table and flow aggregated statistics for a connected node, send the following request to the controller: -**Headers:** - -- **Content-type:** ``application/xml`` - -- **Accept:** ``application/xml`` - -- **Authentication:** ``admin:admin`` - **URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/`` -**Method:** ``GET`` - -**Sample output:** - -.. code-block:: none +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/table=0?content=nonconfig`` - - 0 - - 3 - 548 - 535 - +**Method:** ``GET`` - --- Omitted output —-- +.. tabs:: + + .. tab:: XML + + **Headers:** + + **Content-type:** ``application/xml`` + + **Accept:** ``application/xml`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + +
+ 0 + + 1570 + 1 + 1570 + + + #UF$TABLE*0-1 + 0 + + + 4004 + 706000000 + + 786 + 66810 + + 0 + 0 + + 0 + 10 + SEND_FLOW_REM + + + 0 + + + 0 + + CONTROLLER + 65535 + + + + + + 0 + +
+ + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "flow-node-inventory:table": [ + { + "id": 0, + "opendaylight-flow-table-statistics:flow-table-statistics": { + "packets-looked-up": 1581, + "active-flows": 1, + "packets-matched": 1581 + }, + "flow": [ + { + "id": "#UF$TABLE*0-1", + "table_id": 0, + "opendaylight-flow-statistics:flow-statistics": { + "duration": { + "second": 4056, + "nanosecond": 4000000 + }, + "packet-count": 797, + "byte-count": 67745 + }, + "priority": 0, + "hard-timeout": 0, + "cookie_mask": 0, + "cookie": 10, + "flags": "SEND_FLOW_REM", + "instructions": { + "instruction": [ + { + "order": 0, + "apply-actions": { + "action": [ + { + "order": 0, + "output-action": { + "output-node-connector": "CONTROLLER", + "max-length": 65535 + } + } + ] + } + } + ] + }, + "idle-timeout": 0 + } + ] + } + ] + } -.. note:: In the example above the OpenFlow node table is 0. +.. note:: In the examples above the OpenFlow node table is 0. .. _example-of-individual-flow-statistics: @@ -367,65 +676,129 @@ Example of flow description and flow statistics ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To view the individual flow statistics, send the following request to the -controller: - -**Headers:** - -- **Content-type:** ``application/xml`` - -- **Accept:** ``application/xml`` - -- **Authentication:** ``admin:admin`` +controller but before that : **URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/fm-sr-link-discovery`` -**Method:** ``GET`` - -**Sample output:** +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/table=0/flow=fm-sr-link-discovery?content=nonconfig`` -.. code-block:: none - - - fm-sr-link-discovery - - 536 - - 174000000 - 2681 - - 45560 - - 99 - 0 - 0 - 0 - - - - 35020 - - - - 1000000000000001 - - - - 0 - - - 0 - - 65535 - CONTROLLER - - - - - - 0 - +**Method:** ``GET`` -.. note:: In the example above the flow ID fm-sr-link-discovery is internal to +.. tabs:: + + .. tab:: XML + + **Headers:** + + **Content-type:** ``application/xml`` + + **Accept:** ``application/xml`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + + fm-sr-link-discovery + + 536 + + 174000000 + 2681 + + 45560 + + 99 + 0 + 0 + 0 + + + + 35020 + + + + 1000000000000001 + + + + 0 + + + 0 + + 65535 + CONTROLLER + + + + + + 0 + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "flow-node-inventory:flow": [ + { + "id": "fm-sr-link-discovery", + "table_id": 0, + "opendaylight-flow-statistics:flow-statistics": { + "duration": { + "second": 2681, + "nanosecond": 174000000 + }, + "packet-count": 536, + "byte-count": 45560 + }, + "priority": 99, + "hard-timeout": 0, + "match": { + "ethernet-match": { + "ethernet-type": { + "type": 35020 + } + } + }, + "cookie_mask": 0, + "cookie": 1000000000000001, + "flags": "", + "instructions": { + "instruction": [ + { + "order": 0, + "apply-actions": { + "action": [ + { + "order": 0, + "output-action": { + "output-node-connector": "CONTROLLER", + "max-length": 65535 + } + } + ] + } + } + ] + }, + "idle-timeout": 0 + } + ] + } + +.. note:: In the examples above the flow ID fm-sr-link-discovery is internal to the controller and has to match the datastore configured flow ID. For more information see flow ID match section :ref:`flow-id-match-function`. @@ -438,66 +811,135 @@ Example of group description and group statistics To view the group description and group statistics, send the following request to the controller: -**Headers:** - -- **Content-type:** ``application/xml`` - -- **Accept:** ``application/xml`` - -- **Authentication:** ``admin:admin`` - **URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/group/2`` -**Method:** ``GET`` - -**Sample output:** +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/group=2?content=nonconfig`` -.. code-block:: none +**Method:** ``GET`` - - 2 - - - 0 - - 1 - - 0 - 2 - - - - 0 - - 34887 - - - 4294967295 - 0 - 2 - - - group-ff - - - - 0 +.. tabs:: + + .. tab:: XML + + **Headers:** + + **Content-type:** ``application/xml`` + + **Accept:** ``application/xml`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + + 2 + + + 0 + + 1 + + 0 + 2 + + + + 0 + + 34887 + + + 4294967295 + 0 + 2 + + + group-ff + + + + 0 + 0 + 0 + + + 2 0 0 - - - 2 - 0 - 0 - - 4116 - 746000000 - - 1 - - - -.. note:: In the example above the group ID 2 matches the switch stored + + 4116 + 746000000 + + 1 + + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "flow-node-inventory:group": [ + { + "group-id": 2, + "buckets": { + "bucket": [ + { + "bucket-id": 0, + "watch_group": 4294967295, + "action": [ + { + "order": 0, + "pop-mpls-action": { + "ethernet-type": 34887 + } + }, + { + "order": 1, + "output-action": { + "output-node-connector": "2", + "max-length": 0 + } + } + ], + "weight": 0, + "watch_port": 2 + } + ] + }, + "group-type": "group-ff", + "opendaylight-group-statistics:group-statistics": { + "byte-count": 0, + "group-id": 2, + "buckets": { + "bucket-counter": [ + { + "bucket-id": 0, + "packet-count": 0, + "byte-count": 0 + } + ] + }, + "duration": { + "nanosecond": 746000000, + "second": 4116 + }, + "ref-count": 1, + "packet-count": 0 + } + } + ] + } + +.. note:: In the examples above the group ID 2 matches the switch stored group ID. .. _example-of-meter-description-and-meter-statistics: @@ -508,58 +950,116 @@ Example of meter description and meter statistics To view the meter description and meter statistics, send the following request to the controller: -**Headers:** - -- **Content-type:** ``application/xml`` - -- **Accept:** ``application/xml`` - -- **Authentication:** ``admin:admin`` - **URL:** ``/restconf/operational/opendaylight-inventory:nodes/node/openflow:1/meter/2`` -**Method:** ``GET`` +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/meter=2?content=nonconfig`` -**Sample output:** +**Method:** ``GET`` -.. code-block:: none +.. tabs:: + + .. tab:: XML + + **Headers:** + + **Content-type:** ``application/xml`` + + **Accept:** ``application/xml`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + + + 2 + meter-kbps + + 0 + 0 + + + 0 + 0 + 0 + + + + 364000000 + 114 + + 2 + 0 + + + + 0 + 100 + 0 + + ofpmbt-drop + + 0 + 100 + + + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "flow-node-inventory:meter": [ + { + "meter-id": 2, + "meter-band-headers": { + "meter-band-header": [ + { + "band-id": 0, + "drop-rate": 100, + "drop-burst-size": 0, + "band-rate": 100, + "band-burst-size": 0, + "meter-band-types": { + "flags": "ofpmbt-drop" + } + } + ] + }, + "opendaylight-meter-statistics:meter-statistics": { + "packet-in-count": 0, + "flow-count": 0, + "meter-id": 2, + "byte-in-count": 0, + "meter-band-stats": { + "band-stat": [ + { + "band-id": 0, + "packet-band-count": 0, + "byte-band-count": 0 + } + ] + }, + "duration": { + "nanosecond": 364000000, + "second": 114 + } + }, + "flags": "meter-kbps" + } + ] + } - - - 2 - meter-kbps - - 0 - 0 - - - 0 - 0 - 0 - - - - 364000000 - 114 - - 2 - 0 - - - - 0 - 100 - 0 - - ofpmbt-drop - - 0 - 100 - - - - -.. note:: In the example above the meter ID 2 matches the switch stored +.. note:: In the examples above the meter ID 2 matches the switch stored meter ID. .. _openflow-programming-overview: @@ -592,55 +1092,110 @@ This example programs a flow that matches IPv4 packets (ethertype 0x800) with destination address in the 10.0.10.0/24 subnet and sends them to port 1. The flow is installed in table 0 of the switch with datapath ID 1. -**Headers:** +**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1`` -- **Content-type:** ``application/xml`` +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/table=0/flow=1`` -- **Accept:** ``application/xml`` +**Method:** ``PUT`` -- **Authentication:** ``admin:admin`` +.. tabs:: -**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1`` + .. tab:: XML -**Method:** ``PUT`` + **Headers:** -**Request body:** + **Content-type:** ``application/xml`` -.. code-block:: none + **Accept:** ``application/xml`` - - - 0 - 0 - 1 - 2 - flow1 - - - - 2048 - - - 10.0.10.0/24 - - 1 - 0 - - - 0 - - - - 1 - - 0 - - - - - + **Authentication:** ``admin:admin`` + + .. code-block:: none -.. note:: In the example above the flow ID 1 is internal to the controller and + + + 0 + 0 + 1 + 2 + flow1 + + + + 2048 + + + 10.0.10.0/24 + + 1 + 0 + + + 0 + + + + 1 + + 0 + + + + + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "flow-node-inventory:flow": [ + { + "id": "1", + "priority": 2, + "table_id": 0, + "hard-timeout": 0, + "match": { + "ethernet-match": { + "ethernet-type": { + "type": 2048 + } + }, + "ipv4-destination": "10.0.10.0/24" + }, + "cookie": 1, + "flow-name": "flow1", + "instructions": { + "instruction": [ + { + "order": 0, + "apply-actions": { + "action": [ + { + "order": 0, + "output-action": { + "output-node-connector": "1" + } + } + ] + } + } + ] + }, + "idle-timeout": 0 + } + ] + } + +.. note:: In the examples above the flow ID 1 is internal to the controller and the same ID can be found when retrieving the flow statistics if controller finds a match between the configured flow and the flow received from switch. For more information see flow ID match section @@ -674,6 +1229,8 @@ ID 1. **URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/0/flow/1`` +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/table=0/flow=1`` + **Method:** ``DELETE`` You can also use the below URL to delete all flows in table 0 of the switch @@ -691,49 +1248,99 @@ This example programs a flow that matches IPv4 packets (ethertype 0x800) with destination address in the 10.0.10.0/24 subnet and sends them to port 1. The flow is installed in table 0 of the switch with datapath ID 1. -**Headers:** +**URL:** ``/restconf/operations/sal-flow:add-flow`` -- **Content-type:** ``application/xml`` +**RFC8040 URL:** ``/rests/operations/sal-flow:add-flow`` -- **Accept:** ``application/xml`` +**Method:** ``POST`` -- **Authentication:** ``admin:admin`` +.. tabs:: -**URL:** ``/restconf/operations/sal-flow:add-flow`` + .. tab:: XML -**Method:** ``POST`` + **Headers:** -**Request body:** + **Content-type:** ``application/xml`` -.. code-block:: none + **Accept:** ``application/xml`` - - - /inv:nodes/inv:node[inv:id="openflow:1"] - 0 - 2 - - - - 2048 - - - 10.0.1.0/24 - - - - 0 - - - - 1 - + **Authentication:** ``admin:admin`` + + .. code-block:: none + + + + /inv:nodes/inv:node[inv:id="openflow:1"] + 0 + 2 + + + + 2048 + + + 10.0.1.0/24 + + + 0 - - - - - + + + + 1 + + 0 + + + + + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "input": { + "node": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']", + "table_id": 0, + "priority": 2, + "match": { + "ipv4-destination": "10.0.1.0/24", + "ethernet-match": { + "ethernet-type": { + "type": 2048 + } + } + }, + "instructions": { + "instruction": [ + { + "order": 0, + "apply-actions": { + "action": [ + { + "order": 0, + "output-action": { + "output-node-connector": "1", + "max-length": 0 + } + } + ] + } + } + ] + } + } + } .. note:: This payload does not require flow ID as this value is internal to controller and only used to store flows in the datastore. When @@ -751,37 +1358,70 @@ This example removes a flow that matches IPv4 packets (ethertype 0x800) with destination address in the 10.0.10.0/24 subnet from table 0 of the switch with datapath ID 1. -**Headers:** +**URL:** ``/restconf/operations/sal-flow:remove-flow`` -- **Content-type:** ``application/xml`` +**RFC8040 URL:** ``/rests/operations/sal-flow:remove-flow`` -- **Accept:** ``application/xml`` +**Method:** ``POST`` -- **Authentication:** ``admin:admin`` +.. tabs:: -**URL:** ``/restconf/operations/sal-flow:remove-flow`` + .. tab:: XML -**Method:** ``POST`` + **Headers:** -**Request body:** + **Content-type:** ``application/xml`` -.. code-block:: none + **Accept:** ``application/xml`` - - - /inv:nodes/inv:node[inv:id="openflow:1"] - 0 - 2 - true - - - - 2048 - - - 10.0.10.0/24 - - + **Authentication:** ``admin:admin`` + + .. code-block:: none + + + + /inv:nodes/inv:node[inv:id="openflow:1"] + 0 + 2 + true + + + + 2048 + + + 10.0.10.0/24 + + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "input": { + "node": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:1']", + "table_id": 0, + "priority": 2, + "strict": true, + "match": { + "ipv4-destination": "10.0.1.0/24", + "ethernet-match": { + "ethernet-type": { + "type": 2048 + } + } + } + } + } To verify that the flow has been correctly programmed in the switch, issue the RESTCONF request as provided in :ref:`example-of-table-statistics`. @@ -792,51 +1432,106 @@ Example of a group programming by using config datastore This example programs a select group to equally load balance traffic across port 1 and port 2 in switch with datapath ID 1. -**Headers:** +**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/2`` -- **Content-type:** ``application/json`` - -- **Accept:** ``application/json`` - -- **Authentication:** ``admin:admin`` - -**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/1`` +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/group=2`` **Method:** ``PUT`` -**Request body:** - -.. code-block:: none - - - - group-select - - - 1 - - - 1 - - 1 - - 1 - - - 1 - - - 2 - - 1 - - 2 - - - false - SelectGroup - 1 - +.. tabs:: + + .. tab:: XML + + **Headers:** + + **Content-type:** ``application/xml`` + + **Accept:** ``application/xml`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + + + group-select + + + 1 + + + 1 + + 1 + + 1 + + + 1 + + + 2 + + 1 + + 2 + + + false + SelectGroup + 2 + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "flow-node-inventory:group": [ + { + "group-id": 2, + "barrier": false, + "group-name": "SelectGroup", + "buckets": { + "bucket": [ + { + "bucket-id": 1, + "weight": 1, + "action": [ + { + "order": 1, + "output-action": { + "output-node-connector": "1" + } + } + ] + }, + { + "bucket-id": 2, + "weight": 1, + "action": [ + { + "order": 1, + "output-action": { + "output-node-connector": "2" + } + } + ] + } + ] + }, + "group-type": "group-select" + } + ] + } .. note:: In the example above the group ID 1 will be stored in the switch and will be used by the switch to report group statistics. @@ -877,7 +1572,9 @@ This example deletes the group ID 1 in the switch with datapath ID 1. - **Authentication:** ``admin:admin`` -**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/1`` +**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/group/2`` + +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/group=2`` **Method:** ``DELETE`` @@ -887,38 +1584,76 @@ Example of a meter programming by using config datastore This example programs a meter to drop traffic exceeding 256 kbps with a burst size of 512 in switch with datapath ID 1. -**Headers:** +**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/meter/2`` -- **Content-type:** ``application/json`` +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/meter=2`` -- **Accept:** ``application/json`` +**Method:** ``PUT`` -- **Authentication:** ``admin:admin`` +.. tabs:: -**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/meter/1`` + .. tab:: XML -**Method:** ``PUT`` + **Headers:** -**Request body:** + **Content-type:** ``application/xml`` -.. code-block:: none + **Accept:** ``application/xml`` - - - meter-kbps - - - 0 - 256 - 512 - - ofpmbt-drop - - - - 1 - Foo - + **Authentication:** ``admin:admin`` + + .. code-block:: none + + + + meter-kbps + + + 0 + 256 + 512 + + ofpmbt-drop + + + + 2 + Foo + + + .. tab:: JSON + + **Headers:** + + **Content-type:** ``application/json`` + + **Accept:** ``application/json`` + + **Authentication:** ``admin:admin`` + + .. code-block:: none + + { + "flow-node-inventory:meter": [ + { + "meter-id": 2, + "meter-band-headers": { + "meter-band-header": [ + { + "band-id": 0, + "drop-rate": 256, + "drop-burst-size": 512, + "meter-band-types": { + "flags": "ofpmbt-drop" + } + } + ] + }, + "flags": "meter-kbps", + "meter-name": "Foo" + } + ] + } .. note:: In the example above the meter ID 1 will be stored in the switch and will be used by the switch to report group statistics. @@ -959,7 +1694,9 @@ This example deletes the meter ID 1 in the switch with datapath ID 1. - **Authentication:** ``admin:admin`` -**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/meter/1`` +**URL:** ``/restconf/config/opendaylight-inventory:nodes/node/openflow:1/meter/2`` + +**RFC8040 URL:** ``/rests/data/opendaylight-inventory:nodes/node=openflow%3A1/meter=2`` **Method:** ``DELETE`` @@ -1103,13 +1840,15 @@ following request to the controller: **URL:** ``/restconf/operational/entity-owners:entity-owners`` +**RFC8040 URL:** ``/rests/data/entity-owners:entity-owners?content=nonconfig`` + **Method:** ``GET`` -**Sample output:** +**Sample JSON output:** .. code-block:: none - { + { "entity-owners":{ "entity-type":[ { @@ -1198,7 +1937,7 @@ following request to the controller: } } -In the above sample output, ``member 3`` is the master controller +In the above sample outputs, ``member 3`` is the master controller (EOS owner) for the OpenFlow device with datapath ID ``1``, and ``member-1`` is the master controller (EOS owner) for the OpenFlow devices with the datapath IDs of ``2`` and ``3``.