Fix to remove @ from id and type parameter of node and nodeconnector in Northbound...
[controller.git] / opendaylight / northbound / statistics / src / main / java / org / opendaylight / controller / statistics / northbound / StatisticsNorthbound.java
index 197ebabf9133d43f7b81f5360f46b7d3138b1f9e..acf6f864d1efb1a6c3192e31caff912707f6f214 100644 (file)
@@ -23,9 +23,12 @@ import org.codehaus.enunciate.jaxrs.ResponseCode;
 import org.codehaus.enunciate.jaxrs.StatusCodes;
 import org.codehaus.enunciate.jaxrs.TypeHint;
 import org.opendaylight.controller.containermanager.IContainerManager;
-
 import org.opendaylight.controller.northbound.commons.RestMessages;
-import org.opendaylight.controller.northbound.commons.exception.*;
+import org.opendaylight.controller.northbound.commons.exception.InternalServerErrorException;
+import org.opendaylight.controller.northbound.commons.exception.ResourceConflictException;
+import org.opendaylight.controller.northbound.commons.exception.ResourceNotFoundException;
+import org.opendaylight.controller.northbound.commons.exception.ServiceUnavailableException;
+import org.opendaylight.controller.northbound.commons.exception.UnauthorizedException;
 import org.opendaylight.controller.northbound.commons.utils.NorthboundUtils;
 import org.opendaylight.controller.sal.authorization.Privilege;
 import org.opendaylight.controller.sal.core.Node;
@@ -39,7 +42,7 @@ import org.opendaylight.controller.switchmanager.ISwitchManager;
 
 /**
  * Northbound APIs that returns various Statistics exposed by the Southbound
- * plugins such as Openflow.
+ * protocol plugins such as Openflow.
  *
  * <br>
  * <br>
@@ -107,9 +110,126 @@ public class StatisticsNorthbound {
      *            Name of the Container. The Container name for the base
      *            controller is "default".
      * @return List of FlowStatistics from all the Nodes
+     *
+     * <pre>
+     *
+     * Example:
+     *
+     * Request URL:
+     * http://localhost:8080/controller/nb/v2/statistics/default/flow
+     *
+     * Response in JSON:
+     * {
+     *     "flowStatistics": [
+     *         {
+     *             "node": {
+     *                 "id":"00:00:00:00:00:00:00:02",
+     *                 "type":"OF"
+     *             },
+     *             "flowStatistic": [
+     *                 {
+     *                     "flow": {
+     *                         "match": {
+     *                             "matchField": [
+     *                                 {
+     *                                     "type": "DL_TYPE",
+     *                                     "value": "2048"
+     *                                 },
+     *                                 {
+     *                                     "mask": "255.255.255.255",
+     *                                     "type": "NW_DST",
+     *                                     "value": "1.1.1.1"
+     *                                 }
+     *                             ]
+     *                         },
+     *                         "actions": {
+     *                             "@type": "output",
+     *                             "port": {
+     *                                 "node":{
+     *                                     "id":"00:00:00:00:00:00:00:02",
+     *                                     "type":"OF"
+     *                                 },
+     *                                 "id":"3",
+     *                                 "type":"OF"
+     *                             }
+     *                         },
+     *                         "priority": "1",
+     *                         "idleTimeout": "0",
+     *                         "hardTimeout": "0",
+     *                         "id": "0"
+     *                     },
+     *                     "tableId": "0",
+     *                     "durationSeconds": "1828",
+     *                     "durationNanoseconds": "397000000",
+     *                     "packetCount": "0",
+     *                     "byteCount": "0"
+     *                 }
+     *             ]
+     *         },
+     *         {   flow statistics of another node
+     *             ............
+     *             ................
+     *             ......................
+     *         }
+     *
+     *     ]
+     * }
+     *
+     * Response in XML:
+     * &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
+     * &lt;list&gt;
+     *     &lt;flowStatistics&gt;
+     *         &lt;node&gt;
+     *             &lt;id&gt;00:00:00:00:00:00:00:02&lt;/id&gt;
+     *             &lt;type&gt;OF&lt;/type&gt;
+     *         &lt;/node&gt;
+     *         &lt;flowStatistic&gt;
+     *             &lt;flow&gt;
+     *                 &lt;match&gt;
+     *                     &lt;matchField&gt;
+     *                         &lt;type&gt;DL_TYPE&lt;/type&gt;
+     *                         &lt;value&gt;2048&lt;/value&gt;
+     *                     &lt;/matchField&gt;
+     *                     &lt;matchField&gt;
+     *                         &lt;mask&gt;255.255.255.255&lt;/mask&gt;
+     *                         &lt;type&gt;NW_DST&lt;/type&gt;
+     *                         &lt;value&gt;1.1.1.2&lt;/value&gt;
+     *                     &lt;/matchField&gt;
+     *                 &lt;/match&gt;
+     *                 &lt;actions
+     *                     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:type=&quot;output&quot;&gt;
+     *                     &lt;port&gt;
+     *                         &lt;node&gt;
+     *                             &lt;id&gt;00:00:00:00:00:00:00:02&lt;/id&gt;
+     *                             &lt;type&gt;OF&lt;/type&gt;
+     *                         &lt;/node&gt;
+     *                         &lt;id&gt;3&lt;/id&gt;
+     *                         &lt;type&gt;OF&lt;/type&gt;
+     *                     &lt;/port&gt;
+     *                 &lt;/actions&gt;
+     *                 &lt;priority&gt;1&lt;/priority&gt;
+     *                 &lt;idleTimeout&gt;0&lt;/idleTimeout&gt;
+     *                 &lt;hardTimeout&gt;0&lt;/hardTimeout&gt;
+     *                 &lt;id&gt;0&lt;/id&gt;
+     *             &lt;/flow&gt;
+     *             &lt;tableId&gt;0&lt;/tableId&gt;
+     *             &lt;durationSeconds&gt;337&lt;/durationSeconds&gt;
+     *             &lt;durationNanoseconds&gt;149000000&lt;/durationNanoseconds&gt;
+     *             &lt;packetCount&gt;0&lt;/packetCount&gt;
+     *             &lt;byteCount&gt;0&lt;/byteCount&gt;
+     *         &lt;/flowStatistic&gt;
+     *     &lt;/flowStatistics&gt;
+     *     &lt;flowStatistics&gt;
+     *          flow statistics for another node
+     *          ..........
+     *          ................
+     *          .....................
+     *     &lt;/flowStatistics&gt;
+     * &lt;/list&gt;
+     * </pre>
      */
 
-    @Path("/{containerName}/flowstats")
+    @Path("/{containerName}/flow")
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @TypeHint(AllFlowStatistics.class)
@@ -159,12 +279,152 @@ public class StatisticsNorthbound {
      *            Name of the Container. The Container name for the base
      *            controller is "default".
      * @param nodeType
-     *            Node Type as specifid by Node class
+     *            Node Type as specifid in {@link org.opendaylight.controller.sal.core.Node} class
      * @param nodeId
      *            Node Identifier
-     * @return List of Flow Statistics for a given Node.
+     * @return List of Flow Statistics for a given Node. *
+     *
+     * <pre>
+     *
+     * Example:
+     *
+     * Request URL:
+     * http://localhost:8080/controller/nb/v2/statistics/default/flow/node/OF/00:00:00:00:00:00:00:01
+     *
+     * Response in JSON:
+     * {
+     *     "node": {
+     *         "id":"00:00:00:00:00:00:00:01",
+     *         "type":"OF"
+     *     },
+     *     "flowStatistic": [
+     *         {
+     *             "flow": {
+     *                 "match": {
+     *                     "matchField": [
+     *                         {
+     *                             "type": "DL_TYPE",
+     *                             "value": "2048"
+     *                         },
+     *                         {
+     *                             "mask": "255.255.255.255",
+     *                             "type": "NW_DST",
+     *                             "value": "1.1.1.2"
+     *                         }
+     *                     ]
+     *                 },
+     *                 "actions": [
+     *                     {
+     *                         "@type": "setDlDst",
+     *                         "address": "52d28b0f76ec"
+     *                     },
+     *                     {
+     *                         "@type": "output",
+     *                         "port":{
+     *                             "node":{
+     *                                 "id":"00:00:00:00:00:00:00:01",
+     *                                 "type":"OF"
+     *                              },
+     *                              "id":"5",
+     *                              "type":"OF"
+     *                         }
+     *                     }
+     *                 ],
+     *                 "priority": "1",
+     *                 "idleTimeout": "0",
+     *                 "hardTimeout": "0",
+     *                 "id": "0"
+     *             },
+     *             "tableId": "0",
+     *             "durationSeconds": "2089",
+     *             "durationNanoseconds": "538000000",
+     *             "packetCount": "0",
+     *             "byteCount": "0"
+     *         }
+     *     ]
+     * }
+     *
+     * Response in XML:
+     * &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
+     *     &lt;nodeFlowStatistics&gt;
+     *         &lt;node&gt;
+     *             &lt;id&gt;00:00:00:00:00:00:00:02&lt;/id&gt;
+     *             &lt;type&gt;OF&lt;/type&gt;
+     *         &lt;/node&gt;
+     *         &lt;flowStatistic&gt;
+     *             &lt;flow&gt;
+     *                 &lt;match&gt;
+     *                     &lt;matchField&gt;
+     *                         &lt;type&gt;DL_TYPE&lt;/type&gt;
+     *                         &lt;value&gt;2048&lt;/value&gt;
+     *                     &lt;/matchField&gt;
+     *                     &lt;matchField&gt;
+     *                         &lt;mask&gt;255.255.255.255&lt;/mask&gt;
+     *                         &lt;type&gt;NW_DST&lt;/type&gt;
+     *                         &lt;value&gt;1.1.1.2&lt;/value&gt;
+     *                     &lt;/matchField&gt;
+     *                 &lt;/match&gt;
+     *                 &lt;actions
+     *                     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:type=&quot;output&quot;&gt;
+     *                     &lt;port&gt;
+     *                         &lt;node&gt;
+     *                             &lt;id&gt;00:00:00:00:00:00:00:02&lt;/id&gt;
+     *                             &lt;type&gt;OF&lt;/type&gt;
+     *                         &lt;/node&gt;
+     *                         &lt;id&gt;3&lt;/id&gt;
+     *                         &lt;type&gt;OF&lt;/type&gt;
+     *                     &lt;/port&gt;
+     *                 &lt;/actions&gt;
+     *                 &lt;priority&gt;1&lt;/priority&gt;
+     *                 &lt;idleTimeout&gt;0&lt;/idleTimeout&gt;
+     *                 &lt;hardTimeout&gt;0&lt;/hardTimeout&gt;
+     *                 &lt;id&gt;0&lt;/id&gt;
+     *             &lt;/flow&gt;
+     *             &lt;tableId&gt;0&lt;/tableId&gt;
+     *             &lt;durationSeconds&gt;337&lt;/durationSeconds&gt;
+     *             &lt;durationNanoseconds&gt;149000000&lt;/durationNanoseconds&gt;
+     *             &lt;packetCount&gt;0&lt;/packetCount&gt;
+     *             &lt;byteCount&gt;0&lt;/byteCount&gt;
+     *         &lt;/flowStatistic&gt;
+     *         &lt;flowStatistic&gt;
+     *             &lt;flow&gt;
+     *                 &lt;match&gt;
+     *                     &lt;matchField&gt;
+     *                         &lt;type&gt;DL_TYPE&lt;/type&gt;
+     *                         &lt;value&gt;2048&lt;/value&gt;
+     *                     &lt;/matchField&gt;
+     *                     &lt;matchField&gt;
+     *                         &lt;mask&gt;255.255.255.255&lt;/mask&gt;
+     *                         &lt;type&gt;NW_DST&lt;/type&gt;
+     *                         &lt;value&gt;1.1.1.1&lt;/value&gt;
+     *                     &lt;/matchField&gt;
+     *                 &lt;/match&gt;
+     *                 &lt;actions
+     *                     xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:type=&quot;output&quot;&gt;
+     *                     &lt;port&gt;
+     *                         &lt;node&gt;
+     *                             &lt;id&gt;00:00:00:00:00:00:00:02&lt;/id&gt;
+     *                             &lt;type&gt;OF&lt;/type&gt;
+     *                         &lt;/node&gt;
+     *                         &lt;id&gt;3&lt;/id&gt;
+     *                         &lt;type&gt;OF&lt;/type&gt;
+     *                     &lt;/port&gt;
+     *                 &lt;/actions&gt;
+     *                 &lt;priority&gt;1&lt;/priority&gt;
+     *                 &lt;idleTimeout&gt;0&lt;/idleTimeout&gt;
+     *                 &lt;hardTimeout&gt;0&lt;/hardTimeout&gt;
+     *                 &lt;id&gt;0&lt;/id&gt;
+     *             &lt;/flow&gt;
+     *             &lt;tableId&gt;0&lt;/tableId&gt;
+     *             &lt;durationSeconds&gt;337&lt;/durationSeconds&gt;
+     *             &lt;durationNanoseconds&gt;208000000&lt;/durationNanoseconds&gt;
+     *             &lt;packetCount&gt;0&lt;/packetCount&gt;
+     *             &lt;byteCount&gt;0&lt;/byteCount&gt;
+     *         &lt;/flowStatistic&gt;
+     *     &lt;/nodeFlowStatistics&gt;
+     * </pre>
      */
-    @Path("/{containerName}/flowstats/{nodeType}/{nodeId}")
+    @Path("/{containerName}/flow/node/{nodeType}/{nodeId}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @TypeHint(FlowStatistics.class)
@@ -210,9 +470,142 @@ public class StatisticsNorthbound {
      *            controller is "default".
      * @return List of all the Port Statistics across all the NodeConnectors on
      *         all the Nodes.
+     *
+     * <pre>
+     *
+     * Example:
+     *
+     * Request URL:
+     * http://localhost:8080/controller/nb/v2/statistics/default/port
+     *
+     * Response in JSON:
+     * {
+     *     "portStatistics": [
+     *         {
+     *             "node": {
+     *                  "id":"00:00:00:00:00:00:00:02",
+     *                  "type":"OF"
+     *             },
+     *             "portStatistic": [
+     *                 {
+     *                     "nodeConnector":{
+     *                          "node":{
+     *                                 "id":"00:00:00:00:00:00:00:02",
+     *                                 "type":"OF"
+     *                           },
+     *                           "id":"3",
+     *                           "type":"OF"
+     *                     },
+     *                     "receivePackets": "182",
+     *                     "transmitPackets": "173",
+     *                     "receiveBytes": "12740",
+     *                     "transmitBytes": "12110",
+     *                     "receiveDrops": "0",
+     *                     "transmitDrops": "0",
+     *                     "receiveErrors": "0",
+     *                     "transmitErrors": "0",
+     *                     "receiveFrameError": "0",
+     *                     "receiveOverRunError": "0",
+     *                     "receiveCrcError": "0",
+     *                     "collisionCount": "0"
+     *                 },
+     *                 {
+     *                     "nodeConnector": {
+     *                          "node":{
+     *                                  "id":"00:00:00:00:00:00:00:02",
+     *                                  "type":"OF"
+     *                           },
+     *                           "id":"2",
+     *                           "type":"OF"
+     *                     },
+     *                     "receivePackets": "174",
+     *                     "transmitPackets": "181",
+     *                     "receiveBytes": "12180",
+     *                     "transmitBytes": "12670",
+     *                     "receiveDrops": "0",
+     *                     "transmitDrops": "0",
+     *                     "receiveErrors": "0",
+     *                     "transmitErrors": "0",
+     *                     "receiveFrameError": "0",
+     *                     "receiveOverRunError": "0",
+     *                     "receiveCrcError": "0",
+     *                     "collisionCount": "0"
+     *                 },
+     *
+     *             ]
+     *         },
+     *         {
+     *             "node": {
+     *                  "id":"00:00:00:00:00:00:00:03",
+     *                  "type":"OF"
+     *             },
+     *             "portStatistic": [
+     *                  ..................
+     *                  .......................
+     *                  ..........................
+     *             ]
+     *         }
+     *     ]
+     * }
+     *
+     * Response in XML:
+     * &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
+     * &lt;list&gt;
+     *     &lt;portStatistics&gt;
+     *          &lt;node&gt;
+     *             &lt;id&gt;00:00:00:00:00:00:00:02&lt;/id&gt;
+     *             &lt;type&gt;OF&lt;/type&gt;
+     *          &lt;/node&gt;
+     *          &lt;portStatistic&gt;
+     *             &lt;nodeConnector&gt;
+     *                &lt;node&gt;
+     *                   &lt;id&gt;00:00:00:00:00:00:00:02&lt;/id&gt;
+     *                   &lt;type&gt;OF&lt;/type&gt;
+     *                &lt;/node&gt;
+     *                &lt;id&gt;3&lt;/id&gt;
+     *                &lt;type&gt;OF&lt;/type&gt;
+     *             &lt;/nodeConnector&gt;
+     *             &lt;receivePackets&gt;181&lt;/receivePackets&gt;
+     *             &lt;transmitPackets&gt;172&lt;/transmitPackets&gt;
+     *             &lt;receiveBytes&gt;12670&lt;/receiveBytes&gt;
+     *             &lt;transmitBytes&gt;12040&lt;/transmitBytes&gt;
+     *             &lt;receiveDrops&gt;0&lt;/receiveDrops&gt;
+     *             &lt;transmitDrops&gt;0&lt;/transmitDrops&gt;
+     *             &lt;receiveErrors&gt;0&lt;/receiveErrors&gt;
+     *             &lt;transmitErrors&gt;0&lt;/transmitErrors&gt;
+     *             &lt;receiveFrameError&gt;0&lt;/receiveFrameError&gt;
+     *             &lt;receiveOverRunError&gt;0&lt;/receiveOverRunError&gt;
+     *             &lt;receiveCrcError&gt;0&lt;/receiveCrcError&gt;
+     *             &lt;collisionCount&gt;0&lt;/collisionCount&gt;
+     *         &lt;/portStatistic&gt;
+     *         &lt;portStatistic&gt;
+     *             &lt;nodeConnector&gt;
+     *                &lt;node&gt;
+     *                   &lt;id&gt;00:00:00:00:00:00:00:02&lt;/id&gt;
+     *                   &lt;type&gt;OF&lt;/type&gt;
+     *                &lt;/node&gt;
+     *                &lt;id&gt;2&lt;/id&gt;
+     *                &lt;type&gt;OF&lt;/type&gt;
+     *             &lt;/nodeConnector&gt;
+     *             &lt;receivePackets&gt;173&lt;/receivePackets&gt;
+     *             &lt;transmitPackets&gt;180&lt;/transmitPackets&gt;
+     *             &lt;receiveBytes&gt;12110&lt;/receiveBytes&gt;
+     *             &lt;transmitBytes&gt;12600&lt;/transmitBytes&gt;
+     *             &lt;receiveDrops&gt;0&lt;/receiveDrops&gt;
+     *             &lt;transmitDrops&gt;0&lt;/transmitDrops&gt;
+     *             &lt;receiveErrors&gt;0&lt;/receiveErrors&gt;
+     *             &lt;transmitErrors&gt;0&lt;/transmitErrors&gt;
+     *             &lt;receiveFrameError&gt;0&lt;/receiveFrameError&gt;
+     *             &lt;receiveOverRunError&gt;0&lt;/receiveOverRunError&gt;
+     *             &lt;receiveCrcError&gt;0&lt;/receiveCrcError&gt;
+     *             &lt;collisionCount&gt;0&lt;/collisionCount&gt;
+     *         &lt;/portStatistic&gt;
+     *     &lt;/portStatistics&gt;
+     * &lt;/list&gt;
+     * </pre>
      */
 
-    @Path("/{containerName}/portstats")
+    @Path("/{containerName}/port")
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @TypeHint(AllPortStatistics.class)
@@ -260,13 +653,128 @@ public class StatisticsNorthbound {
      *            Name of the Container. The Container name for the base
      *            controller is "default".
      * @param nodeType
-     *            Node Type as specifid by Node class
+     *            Node Type as specifid in {@link org.opendaylight.controller.sal.core.Node} class
      * @param Node
-     *            Identifier
+     *            Identifier (e.g. MAC address)
      * @return Returns a list of all the Port Statistics across all the
      *         NodeConnectors in a given Node.
+     *
+     * <pre>
+     *
+     * Example:
+     *
+     * Request URL:
+     * http://localhost:8080/controller/nb/v2/statistics/default/port/node/OF/00:00:00:00:00:00:00:01
+     *
+     * Response in JSON:
+     * {
+     *     "node": {
+     *         "id":"00:00:00:00:00:00:00:01",
+     *         "type":"OF"
+     *     },
+     *     "portStatistic": [
+     *         {
+     *             "nodeConnector": {
+     *                 "node":{
+     *                     "id":"00:00:00:00:00:00:00:01",
+     *                     "type":"OF"
+     *                 },
+     *                 "id":"3",
+     *                 "type":"OF"
+     *             },
+     *             "receivePackets": "171",
+     *             "transmitPackets": "2451",
+     *             "receiveBytes": "11970",
+     *             "transmitBytes": "235186",
+     *             "receiveDrops": "0",
+     *             "transmitDrops": "0",
+     *             "receiveErrors": "0",
+     *             "transmitErrors": "0",
+     *             "receiveFrameError": "0",
+     *             "receiveOverRunError": "0",
+     *             "receiveCrcError": "0",
+     *             "collisionCount": "0"
+     *         },
+     *         {
+     *             "nodeConnector": {
+     *                 "node":{
+     *                     "id":"00:00:00:00:00:00:00:01",
+     *                     "type":"OF"
+     *                 },
+     *                 "id":"2",
+     *                 "type":"OF"
+     *             },
+     *             "receivePackets": "179",
+     *             "transmitPackets": "2443",
+     *             "receiveBytes": "12530",
+     *             "transmitBytes": "234626",
+     *             "receiveDrops": "0",
+     *             "transmitDrops": "0",
+     *             "receiveErrors": "0",
+     *             "transmitErrors": "0",
+     *             "receiveFrameError": "0",
+     *             "receiveOverRunError": "0",
+     *             "receiveCrcError": "0",
+     *             "collisionCount": "0"
+     *         }
+     *     ]
+     * }
+     *
+     * Response in XML:
+     * &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
+     * &lt;nodePortStatistics&gt;
+     *     &lt;node&gt;
+     *         &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *         &lt;type&gt;OF&lt;/type&gt;
+     *     &lt;/node&gt;
+     *     &lt;portStatistic&gt;
+     *         &lt;nodeConnector&gt;
+     *             &lt;node&gt;
+     *                 &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *                 &lt;type&gt;OF&lt;/type&gt;
+     *             &lt;/node&gt;
+     *             &lt;id&gt;2&lt;/id&gt;
+     *             &lt;type&gt;OF&lt;/type&gt;
+     *         &lt;/nodeConnector&gt;
+     *         &lt;receivePackets&gt;180&lt;/receivePackets&gt;
+     *         &lt;transmitPackets&gt;2594&lt;/transmitPackets&gt;
+     *         &lt;receiveBytes&gt;12600&lt;/receiveBytes&gt;
+     *         &lt;transmitBytes&gt;249396&lt;/transmitBytes&gt;
+     *         &lt;receiveDrops&gt;0&lt;/receiveDrops&gt;
+     *         &lt;transmitDrops&gt;0&lt;/transmitDrops&gt;
+     *         &lt;receiveErrors&gt;0&lt;/receiveErrors&gt;
+     *         &lt;transmitErrors&gt;0&lt;/transmitErrors&gt;
+     *         &lt;receiveFrameError&gt;0&lt;/receiveFrameError&gt;
+     *         &lt;receiveOverRunError&gt;0&lt;/receiveOverRunError&gt;
+     *         &lt;receiveCrcError&gt;0&lt;/receiveCrcError&gt;
+     *         &lt;collisionCount&gt;0&lt;/collisionCount&gt;
+     *     &lt;/portStatistic&gt;
+     *     &lt;portStatistic&gt;
+     *         &lt;nodeConnector&gt;
+     *             &lt;node&gt;
+     *                 &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *                 &lt;type&gt;OF&lt;/type&gt;
+     *             &lt;/node&gt;
+     *             &lt;id&gt;5&lt;/id&gt;
+     *             &lt;type&gt;OF&lt;/type&gt;
+     *         &lt;/nodeConnector&gt;
+     *         &lt;receivePackets&gt;2542&lt;/receivePackets&gt;
+     *         &lt;transmitPackets&gt;2719&lt;/transmitPackets&gt;
+     *         &lt;receiveBytes&gt;243012&lt;/receiveBytes&gt;
+     *         &lt;transmitBytes&gt;255374&lt;/transmitBytes&gt;
+     *         &lt;receiveDrops&gt;0&lt;/receiveDrops&gt;
+     *         &lt;transmitDrops&gt;0&lt;/transmitDrops&gt;
+     *         &lt;receiveErrors&gt;0&lt;/receiveErrors&gt;
+     *         &lt;transmitErrors&gt;0&lt;/transmitErrors&gt;
+     *         &lt;receiveFrameError&gt;0&lt;/receiveFrameError&gt;
+     *         &lt;receiveOverRunError&gt;0&lt;/receiveOverRunError&gt;
+     *         &lt;receiveCrcError&gt;0&lt;/receiveCrcError&gt;
+     *         &lt;collisionCount&gt;0&lt;/collisionCount&gt;
+     *     &lt;/portStatistic&gt;
+     * &lt;/nodePortStatistics&gt;
+     * </pre>
      */
-    @Path("/{containerName}/portstats/{nodeType}/{nodeId}")
+    @Path("/{containerName}/port/node/{nodeType}/{nodeId}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @TypeHint(PortStatistics.class)
@@ -313,11 +821,104 @@ public class StatisticsNorthbound {
      *            controller is "default".
      *
      * @return Returns a list of all the Table Statistics in a given Node.
+     *
+     * <pre>
+     *
+     * Example:
+     *
+     * Request URL:
+     * http://localhost:8080/controller/nb/v2/statistics/default/table
+     *
+     * Response in JSON:
+     * {
+     *     "tableStatistics": [
+     *         {
+     *             "node": {
+     *                 "id":"00:00:00:00:00:00:00:02",
+     *                 "type":"OF"
+     *             },
+     *             "tableStatistic": [
+     *                 {
+     *                     "nodeTable": {
+     *                        "node":{
+     *                           "id":"00:00:00:00:00:00:00:02",
+     *                           "type":"OF"
+     *                         },
+     *                         "id":"0"
+     *                     },
+     *                     "activeCount": "11",
+     *                     "lookupCount": "816",
+     *                     "matchedCount": "220"
+     *                 },
+     *                 {
+     *                     ...another table
+     *                     .....
+     *                     ........
+     *                 }
+     *
+     *             ]
+     *         }
+     *     ]
+     * }
+     *
+     *  Response in XML:
+     *  &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
+     *  &lt;list&gt;
+     *  &lt;tableStatistics&gt;
+     *      &lt;node&gt;
+     *          &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *          &lt;type&gt;OF&lt;/type&gt;
+     *      &lt;/node&gt;
+     *      &lt;tableStatistic&gt;
+     *          &lt;nodeTable&gt;
+     *              &lt;node&gt;
+     *                  &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *                  &lt;type&gt;OF&lt;/type&gt;
+     *              &lt;/node&gt;
+     *              &lt;id&gt;0&lt;/id&gt;
+     *          &lt;/nodeTable&gt;
+     *          &lt;activeCount&gt;12&lt;/activeCount&gt;
+     *          &lt;lookupCount&gt;10935&lt;/lookupCount&gt;
+     *          &lt;matchedCount&gt;10084&lt;/matchedCount&gt;
+     *      &lt;/tableStatistic&gt;
+     *      &lt;tableStatistic&gt;
+     *          &lt;nodeTable&gt;
+     *              &lt;node&gt;
+     *                  &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *                  &lt;type&gt;OF&lt;/type&gt;
+     *              &lt;/node&gt;
+     *              &lt;id&gt;1&lt;/id&gt;
+     *          &lt;/nodeTable&gt;
+     *          &lt;activeCount&gt;0&lt;/activeCount&gt;
+     *          &lt;lookupCount&gt;0&lt;/lookupCount&gt;
+     *          &lt;matchedCount&gt;0&lt;/matchedCount&gt;
+     *      &lt;/tableStatistic&gt;
+     *      &lt;tableStatistic&gt;
+     *          &lt;nodeTable&gt;
+     *              &lt;node&gt;
+     *                  &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *                  &lt;type&gt;OF&lt;/type&gt;
+     *              &lt;/node&gt;
+     *              &lt;id&gt;2&lt;/id&gt;
+     *          &lt;/nodeTable&gt;
+     *          &lt;activeCount&gt;0&lt;/activeCount&gt;
+     *          &lt;lookupCount&gt;0&lt;/lookupCount&gt;
+     *          &lt;matchedCount&gt;0&lt;/matchedCount&gt;
+     *      &lt;/tableStatistic&gt;
+     *  &lt;/tableStatistics&gt;
+     *  &lt;tableStatistics&gt;
+     *  ...
+     *  ......
+     *  ........
+     *  &lt;/tableStatistics&gt;
+     *  &lt;/list&gt;
+     *
+     * </pre>
      */
-    @Path("/{containerName}/tablestats")
+    @Path("/{containerName}/table")
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
-    @TypeHint(TableStatistics.class)
+    @TypeHint(AllTableStatistics.class)
     @StatusCodes({
         @ResponseCode(code = 200, condition = "Operation successful"),
         @ResponseCode(code = 404, condition = "The containerName is not found"),
@@ -325,17 +926,15 @@ public class StatisticsNorthbound {
     public AllTableStatistics getTableStatistics(
             @PathParam("containerName") String containerName) {
 
-        if (!NorthboundUtils.isAuthorized(
-                getUserName(), containerName, Privilege.READ, this)) {
-            throw new UnauthorizedException(
-                    "User is not authorized to perform this operation on container "
-                            + containerName);
+        if (!NorthboundUtils.isAuthorized(getUserName(), containerName, Privilege.READ, this)) {
+            throw new UnauthorizedException("User is not authorized to perform this operation on container "
+                    + containerName);
         }
         handleDefaultDisabled(containerName);
 
         IStatisticsManager statisticsManager = getStatisticsService(containerName);
         if (statisticsManager == null) {
-            throw new ServiceUnavailableException("Statistics "
+            throw new ServiceUnavailableException("Statistics manager"
                     + RestMessages.SERVICEUNAVAILABLE.toString());
         }
 
@@ -357,18 +956,106 @@ public class StatisticsNorthbound {
     }
 
     /**
-     * Returns a list of all the Table Statistics on all Nodes.
+     * Returns a list of all the Table Statistics on a specific node.
      *
      * @param containerName
      *            Name of the Container. The Container name for the base
      *            controller is "default".
      * @param nodeType
-     *            Node Type as specifid by Node class
+     *            Node Type as specified in {@link org.opendaylight.controller.sal.core.Node} class (e.g. OF for Openflow)
      * @param Node
-     *            Identifier
+     *            Identifier (e.g. MAC address)
      * @return Returns a list of all the Table Statistics in a given Node.
+     *
+     * <pre>
+     *
+     * Example:
+     *
+     * Request URL:
+     * http://localhost:8080/controller/nb/v2/statistics/default/table/node/OF/00:00:00:00:00:00:00:01
+     *
+     * Response in JSON:
+     * {
+     *     "node": {
+     *         "id":"00:00:00:00:00:00:00:01",
+     *         "type":"OF"
+     *     },
+     *     "tableStatistic": [
+     *         {
+     *             "nodeTable": {
+     *                 "node":{
+     *                     "id":"00:00:00:00:00:00:00:01",
+     *                     "type":"OF"
+     *                 },
+     *                 "id":"0"
+     *             },
+     *             "activeCount": "12",
+     *             "lookupCount": "11382",
+     *             "matchedCount": "10524"
+     *         },
+     *         {
+     *             "nodeTable": {
+     *                 "node":{
+     *                     "id":"00:00:00:00:00:00:00:01",
+     *                     "type":"OF"
+     *                 },
+     *                 "id":"1"
+     *             },
+     *             "activeCount": "0",
+     *             "lookupCount": "0",
+     *             "matchedCount": "0"
+     *         }
+     *    ]
+     * }
+     *
+     * Response in XML:
+     * &lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;yes&quot;?&gt;
+     * &lt;nodeTableStatistics&gt;
+     *     &lt;node&gt;
+     *          &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *          &lt;type&gt;OF&lt;/type&gt;
+     *     &lt;/node&gt;
+     *     &lt;tableStatistic&gt;
+     *         &lt;nodeTable&gt;
+     *             &lt;node&gt;
+     *                 &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *                 &lt;type&gt;OF&lt;/type&gt;
+     *             &lt;/node&gt;
+     *             &lt;id&gt;0&lt;/id&gt;
+     *         &lt;/nodeTable&gt;
+     *         &lt;activeCount&gt;12&lt;/activeCount&gt;
+     *         &lt;lookupCount&gt;10935&lt;/lookupCount&gt;
+     *         &lt;matchedCount&gt;10084&lt;/matchedCount&gt;
+     *     &lt;/tableStatistic&gt;
+     *     &lt;tableStatistic&gt;
+     *         &lt;nodeTable&gt;
+     *             &lt;node&gt;
+     *                 &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *                 &lt;type&gt;OF&lt;/type&gt;
+     *             &lt;/node&gt;
+     *             &lt;id&gt;1&lt;/id&gt;
+     *         &lt;/nodeTable&gt;
+     *         &lt;activeCount&gt;0&lt;/activeCount&gt;
+     *         &lt;lookupCount&gt;0&lt;/lookupCount&gt;
+     *         &lt;matchedCount&gt;0&lt;/matchedCount&gt;
+     *     &lt;/tableStatistic&gt;
+     *     &lt;tableStatistic&gt;
+     *         &lt;nodeTable&gt;
+     *             &lt;node&gt;
+     *                 &lt;id&gt;00:00:00:00:00:00:00:01&lt;/id&gt;
+     *                 &lt;type&gt;OF&lt;/type&gt;
+     *             &lt;/node&gt;
+     *             &lt;id&gt;2&lt;/id&gt;
+     *         &lt;/nodeTable&gt;
+     *         &lt;activeCount&gt;0&lt;/activeCount&gt;
+     *         &lt;lookupCount&gt;0&lt;/lookupCount&gt;
+     *         &lt;matchedCount&gt;0&lt;/matchedCount&gt;
+     *     &lt;/tableStatistic&gt;
+     * &lt;/nodeTableStatistics&gt;
+     *
+     * </pre>
      */
-    @Path("/{containerName}/tablestats/{nodeType}/{nodeId}")
+    @Path("/{containerName}/table/node/{nodeType}/{nodeId}")
     @GET
     @Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
     @TypeHint(TableStatistics.class)