Qos and Slicing REST API section

Change-Id: Ib3aa978a6f569d4f1318b86ebe77102193bb887a
diff --git a/advanced/qos.rst b/advanced/qos.rst
index 27a7aeb..cc7327d 100644
--- a/advanced/qos.rst
+++ b/advanced/qos.rst
@@ -127,3 +127,150 @@
         queue_count: 16
 
 An example of a complete QoS and Slicing configuration can be found `here <https://github.com/stratum/fabric-tna/blob/main/util/sample-qos-config.yaml>`_.
+
+REST API
+--------
+REST API supports adding/removing/querying slices and traffic classes.
+We can also classify a flow (identified by five tuples) via REST API.
+
+Slice
+^^^^^
+
+Add a slice
+"""""""""""
+A POST request with Slice ID as path parameter.
+``/slicing/slice/{sliceId}``
+
+.. image:: ../images/qos-rest-slice-add.png
+    :width: 700px
+
+Remove a slice
+"""""""""""""""
+A DELETE request with Slice ID as path parameter.
+``/slicing/slice/{sliceId}``
+
+.. image:: ../images/qos-rest-slice-remove.png
+    :width: 700px
+
+Get all slices
+""""""""""""""
+A GET request.
+Returns a collection of slice id.
+/slicing/slice
+
+.. image:: ../images/qos-rest-slice-get.png
+    :width: 700px
+
+Traffic Class
+^^^^^^^^^^^^^
+.. tip::
+    Traffic Class has following attributes: ``BEST_EFFORT``, ``CONTROL``, ``REAL_TIME``, ``ELASTIC``.
+
+Add a traffic class to a slice
+""""""""""""""""""""""""""""""
+A POST request with Slice ID and Traffic Class as path parameters.
+``/slicing/tc/{sliceId}/{tc}``
+
+.. image:: ../images/qos-rest-tc-add.png
+    :width: 700px
+
+Remove a traffic class from a slice
+"""""""""""""""""""""""""""""""""""
+A DELETE request with Slice ID and Traffic Class as path parameters.
+``/slicing/tc/{sliceId}/{tc}``
+
+.. image:: ../images/qos-rest-tc-remove.png
+    :width: 700px
+
+Get all traffic classes from a slice
+""""""""""""""""""""""""""""""""""""
+A GET request with Slice ID as path parameters.
+Returns a collection of traffic class.
+``/slicing/tc/{sliceId}``
+
+.. image:: ../images/qos-rest-tc-get.png
+    :width: 700px
+
+Classify Flow
+^^^^^^^^^^^^^
+
+A flow can be defined as
+
+.. code-block:: json
+
+  {
+    "criteria": [
+      {
+        "type": "IPV4_SRC",
+        "ip": "10.0.0.1/32"
+      },
+      {
+        "type": "IPV4_DST",
+        "ip": "10.0.0.2/32"
+      },
+      {
+        "type": "IP_PROTO",
+        "protocol": 6
+      },
+      {
+        "type": "TCP_SRC",
+        "tcpPort": 1000
+      },
+      {
+        "type": "TCP_DST",
+        "tcpPort": 80
+      },
+      {
+        "type": "UDP_SRC",
+        "udpPort": 1000
+      },
+      {
+        "type": "UDP_DST",
+        "udpPort": 1812
+      }
+    ]
+  }
+
+- ``IPV4_SRC``: Source IPv4 prefix
+
+- ``IPV4_DST``: Destination IPv4 prefix
+
+- ``IP_PROTO``: IP Protocol, accept 6 (TCP) and 17 (UDP)
+
+- ``TCP_SRC``: Source L4 (TCP) port
+
+- ``TCP_DST``: Destination L4 (TCP) port
+
+- ``UDP_SRC``: Source L4 (UDP) port
+
+- ``UDP_DST``: Destination L4 (UDP) port
+
+.. note::
+    SD-Fabric currently supports 5-tuple only.
+
+Classify a flow to a slice and traffic class
+""""""""""""""""""""""""""""""""""""""""""""
+A POST request with Slice ID and Traffic Class as path parameters.
+And a Json of a flow as body parameters.
+``/slicing/flow/{sliceId}/{tc}``
+
+.. image:: ../images/qos-rest-classifier-add.png
+    :width: 700px
+
+Remove a flow from a slice and traffic class
+""""""""""""""""""""""""""""""""""""""""""""
+A DELETE request with Slice ID and Traffic Class as path parameters.
+And a Json of a flow as body parameters.
+``/slicing/flow/{sliceId}/{tc}``
+
+.. image:: ../images/qos-rest-classifier-remove.png
+    :width: 700px
+
+Get all classified flows from a slice and traffic class
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""
+A GET request with Slice ID and Traffic Class as path parameters.
+Returns a collection of flow.
+``/slicing/flow/{sliceId}``
+
+.. image:: ../images/qos-rest-classifier-get.png
+    :width: 700px
diff --git a/images/qos-rest-classifier-add.png b/images/qos-rest-classifier-add.png
new file mode 100644
index 0000000..41e7b36
--- /dev/null
+++ b/images/qos-rest-classifier-add.png
Binary files differ
diff --git a/images/qos-rest-classifier-get.png b/images/qos-rest-classifier-get.png
new file mode 100644
index 0000000..5554dc0
--- /dev/null
+++ b/images/qos-rest-classifier-get.png
Binary files differ
diff --git a/images/qos-rest-classifier-remove.png b/images/qos-rest-classifier-remove.png
new file mode 100644
index 0000000..ee808c8
--- /dev/null
+++ b/images/qos-rest-classifier-remove.png
Binary files differ
diff --git a/images/qos-rest-slice-add.png b/images/qos-rest-slice-add.png
new file mode 100644
index 0000000..288d19e
--- /dev/null
+++ b/images/qos-rest-slice-add.png
Binary files differ
diff --git a/images/qos-rest-slice-get.png b/images/qos-rest-slice-get.png
new file mode 100644
index 0000000..d9ca228
--- /dev/null
+++ b/images/qos-rest-slice-get.png
Binary files differ
diff --git a/images/qos-rest-slice-remove.png b/images/qos-rest-slice-remove.png
new file mode 100644
index 0000000..684c0ec
--- /dev/null
+++ b/images/qos-rest-slice-remove.png
Binary files differ
diff --git a/images/qos-rest-tc-add.png b/images/qos-rest-tc-add.png
new file mode 100644
index 0000000..bf6511f
--- /dev/null
+++ b/images/qos-rest-tc-add.png
Binary files differ
diff --git a/images/qos-rest-tc-get.png b/images/qos-rest-tc-get.png
new file mode 100644
index 0000000..8f9e003
--- /dev/null
+++ b/images/qos-rest-tc-get.png
Binary files differ
diff --git a/images/qos-rest-tc-remove.png b/images/qos-rest-tc-remove.png
new file mode 100644
index 0000000..7082478
--- /dev/null
+++ b/images/qos-rest-tc-remove.png
Binary files differ