Merge changes I1474351f,I2ddc5ffa
[controller.git] / opendaylight / md-sal / model / model-flow-statistics / src / main / yang / flow-statistics.yang
index 7e00a36c0d8a9ba27c21868321bc4440f2a30e6e..3bd37bcf3387ae4500f45d372f6a6454c949526f 100644 (file)
@@ -2,41 +2,159 @@ module opendaylight-flow-statistics {
     namespace "urn:opendaylight:flow:statistics";
     prefix flowstat;
 
-    import yang-ext {prefix ext;}
-    import opendaylight-inventory {prefix inv;}
-    import opendaylight-flow-types {prefix flow-types;}
+    import yang-ext {prefix ext; revision-date "2013-07-09";}
+    import ietf-yang-types {prefix yang; revision-date "2010-09-24";}   
+    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
+    import opendaylight-flow-types {prefix flow-types;revision-date "2013-10-26";}
+    import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";}
+    import opendaylight-table-types {prefix table-types;revision-date "2013-10-26";}
+    import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
+    import flow-capable-transaction {prefix tr;}
     import sal-flow {prefix flow;}
-    import opendaylight-statistics-types {prefix stat-types;}
+    
 
     revision "2013-08-19" {
-        description "Initial revision of flow service";
+        description "Initial revision of flow statistics service";
+    }
+       
+       //Augment flow statistics data to the flow-capable-node->table->flow
+       augment "/inv:nodes/inv:node/flow-node:table/flow-node:flow" {
+        ext:augment-identifier "flow-statistics-data";
+        uses flow-statistics;
+    }
+       
+       grouping flow-statistics {
+        container flow-statistics {
+            //config "false";
+               uses flow-types:flow;
+               uses stat-types:generic-statistics;
+        }
+       }    
+       
+       typedef flow-id {
+               description "flow id";
+               type yang:counter32;
+       }
+       
+       grouping flow-and-statistics-map-list {
+               description "List of flow and statistics map";
+               list flow-and-statistics-map-list {
+                       key "flow-id";
+                       leaf flow-id {
+                               type flow-id;
+                       }
+                       uses flow-and-statistics-map;
+               }
+       }
+       
+       grouping flow-and-statistics-map{
+               description "Mapping between flow and its statistics";
+               uses flow-types:flow;
+               uses stat-types:generic-statistics;
+       }
+       
+    // RPC calls to fetch flow statistics
+    rpc get-all-flows-statistics-from-all-flow-tables {
+       description "Fetch statistics of all the flow present in all the flow tables of the switch"; 
+        input {
+            uses inv:node-context-ref;
+        }
+        output {
+            uses flow-and-statistics-map-list;
+            uses tr:transaction-aware;
+        }
+    
     }
 
-    rpc get-node-connector-statistics {
+    rpc get-all-flow-statistics-from-flow-table {
+       description "Fetch statistics of all the flow present in the specific flow table of the switch"; 
         input {
-            leaf node {
-                ext:context-reference "node-context";
-                type inv:node-ref;
-            }
-            leaf node-connector {
-                type inv:node-connector-ref;
+            uses inv:node-context-ref;
+            leaf table-id {
+               type table-types:table-id;
             }
         }
         output {
-            uses stat-types:node-connector-statistics;
+            uses flow-and-statistics-map-list;
+            uses tr:transaction-aware;
         }
     }
 
-    notification node-connector-statistics-updated {
-        uses stat-types:node-connector-statistics;
+    rpc get-flow-statistics-from-flow-table {
+       description "Fetch statistics of the specific flow present in the specific flow table of the switch"; 
+        input {
+            uses inv:node-context-ref;
+            uses flow-types:flow;
+        }
+        output {
+            uses flow-and-statistics-map-list;
+            uses tr:transaction-aware;
+        }
+    }
+
+    notification flows-statistics-update {
+       description "Flows statistics sent by switch";
+               leaf moreReplies {
+            type boolean;
+        }
+        uses inv:node;
+               uses flow-and-statistics-map-list;
+               uses tr:transaction-aware;
     }
 
-    rpc get-flow-statistics {
+       //Models for aggregate flow statistics collection
+       augment "/inv:nodes/inv:node/flow-node:table" {
+        ext:augment-identifier "aggregate-flow-statistics-data";
+        uses aggregate-flow-statistics;
+    }
+       
+       grouping aggregate-flow-statistics {
+        container aggregate-flow-statistics {
+            //config "false";
+               uses stat-types:aggregate-flow-statistics;
+        }
+       }    
+       
+    // RPC calls to fetch flow statistics
+    rpc get-aggregate-flow-statistics-from-flow-table-for-all-flows {
+       description "Fetch aggregate statistics for all the flows present in the specific flow table of the switch"; 
         input {
-            leaf node {
-                ext:context-reference "node-context";
-                type inv:node-ref;
+            uses inv:node-context-ref;
+            leaf table-id {
+               type table-types:table-id;
             }
+        }
+        output {
+               uses stat-types:aggregate-flow-statistics;
+            uses tr:transaction-aware;
+        }
+    }
+    rpc get-aggregate-flow-statistics-from-flow-table-for-given-match {
+       description "Fetch aggregate statistics for all the flow matches to the given match from the given table of the switch"; 
+        input {
+            uses inv:node-context-ref;
+            uses flow-types:flow;
+        }
+        output {
+               uses stat-types:aggregate-flow-statistics;
+            uses tr:transaction-aware;
+        }
+    }
+
+    notification aggregate-flow-statistics-update {
+       description "Aggregate flow statistics for a table, sent by switch";
+               leaf moreReplies {
+            type boolean;
+        }
+        uses inv:node;
+               uses stat-types:aggregate-flow-statistics;
+               uses tr:transaction-aware;
+    }
+       
+       //Keeping flow statistics RPC call for backward compatibility for sal-compatibility layer --START
+       rpc get-flow-statistics {
+        input {
+            uses inv:node-context-ref;
             uses flow-types:flow;
         }
         output {
@@ -44,17 +162,51 @@ module opendaylight-flow-statistics {
         }
     }
 
+    rpc get-all-flow-statistics {
+        input {
+            uses inv:node-context-ref;
+        }
+        output {
+            list flow-statistics {
+                uses flow-types:flow-statistics;
+            }
+        }
+    }
+
     notification flow-statistics-updated {
         uses flow-types:flow-statistics;
     }
+       
+       //Keeping flow statistics RPC call for backward compatibility for sal-compatibility layer --END
+       
+       //RPC call to fetch node connector statistics
+    rpc get-node-connector-statistics {
+        input {
+            uses inv:node-context-ref;
+            leaf node-connector {
+                type inv:node-connector-ref;
+            }
+        }
+        output {
+            uses stat-types:node-connector-statistics;
+        }
+    }
 
-    rpc get-flow-table-statistics {
+    rpc get-all-node-connector-statistics {
         input {
-            leaf node {
-                ext:context-reference "node-context";
-                type inv:node-ref;
+            uses inv:node-context-ref;
+        }
+        output {
+            list node-connector-statistics {
+                uses stat-types:node-connector-statistics;
             }
         }
+    }
+
+    rpc get-flow-table-statistics {
+        input {
+            uses inv:node-context-ref;
+        }
         output {
             uses flow-types:flow-table-statistics;
         }
@@ -67,4 +219,7 @@ module opendaylight-flow-statistics {
         uses flow-types:flow-table-statistics;
     }
 
-}
\ No newline at end of file
+    notification node-connector-statistics-updated {
+        uses stat-types:node-connector-statistics;
+    }
+}