BUG-421: Define multipart-transaction-aware 33/5333/1
authorRobert Varga <rovarga@cisco.com>
Fri, 14 Feb 2014 19:31:14 +0000 (20:31 +0100)
committerRobert Varga <rovarga@cisco.com>
Fri, 14 Feb 2014 19:33:46 +0000 (20:33 +0100)
This bundles up the 'moreReplies' leaf into a grouping, as it is used in
multiple places. The new multipart-transaction-aware is used instead,
resulting in a common class shared between the notifications, which
should allow for better code reuse.

Change-Id: If225ba4a24d64158893c9f67b5115a6b8b19fcd9
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-capable-transaction.yang
opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-table.yang
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang
opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang

index 1c675f0..160291c 100644 (file)
@@ -1,17 +1,17 @@
 module flow-capable-transaction {
-       namespace "urn:opendaylight:flow:transaction";
+    namespace "urn:opendaylight:flow:transaction";
     prefix type;
 
     import opendaylight-inventory {prefix inv; revision-date "2013-08-19";}
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
     import yang-ext {prefix ext; revision-date "2013-07-09";}
-    
+
     revision "2013-11-03" {
         description "Initial revision";
     }
 
     typedef transaction-id {
-       type uint64;
+        type uint64;
     }
     // This refers to MD-SAL transaction reference.
     grouping transaction-metadata {
@@ -19,13 +19,22 @@ module flow-capable-transaction {
             type inet:uri;
         }
     }
-    
+
     grouping transaction-aware {
         leaf transaction-id {
             type transaction-id;
         }
     }
 
+    grouping multipart-transaction-aware {
+        uses transaction-aware;
+
+        leaf moreReplies {
+            type boolean;
+            default false;
+        }
+    }
+
     rpc get-next-transaction-id {
         input {
             leaf node {
@@ -34,7 +43,7 @@ module flow-capable-transaction {
             }
         }
         output {
-               uses transaction-aware;
+            uses transaction-aware;
         }
     }
 
@@ -50,4 +59,4 @@ module flow-capable-transaction {
             }
         }
     }
-}
\ No newline at end of file
+}
index 66990d4..b125116 100644 (file)
@@ -33,10 +33,7 @@ module sal-table {
     
     notification table-updated {
         uses "inv:node-context-ref";
-        uses tr:transaction-aware;
-        leaf moreReplies {
-            type boolean;
-        }
+        uses tr:multipart-transaction-aware;
         uses table-type:table-features;
     }
 }
index 94e2c0a..e0df924 100644 (file)
@@ -10,51 +10,51 @@ module opendaylight-flow-statistics {
     import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
     import flow-capable-transaction {prefix tr;}
     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
-    
+
 
     revision "2013-08-19" {
         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" {
+
+    //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 {
+
+    grouping flow-statistics {
         container flow-statistics {
             //config "false";
-               uses flow-types:flow;
-               uses stat-types:generic-statistics;
+            uses flow-types:flow;
+            uses stat-types:generic-statistics;
+        }
+    }
+
+    typedef flow-id {
+        description "flow id";
+        type inet:uri;
+    }
+
+    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;
         }
-       }    
-       
-       typedef flow-id {
-               description "flow id";
-               type inet:uri;
-       }
-       
-       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;
-       }
-       
+    }
+
+    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"; 
+        description "Fetch statistics of all the flow present in all the flow tables of the switch";
         input {
             uses inv:node-context-ref;
         }
@@ -62,15 +62,15 @@ module opendaylight-flow-statistics {
             uses flow-and-statistics-map-list;
             uses tr:transaction-aware;
         }
-    
+
     }
 
     rpc get-all-flow-statistics-from-flow-table {
-       description "Fetch statistics of all the flow present in the specific flow table of the switch"; 
+        description "Fetch statistics of all the flow present in the specific flow table of the switch";
         input {
             uses inv:node-context-ref;
             leaf table-id {
-               type table-types:table-id;
+                type table-types:table-id;
             }
         }
         output {
@@ -80,7 +80,7 @@ module opendaylight-flow-statistics {
     }
 
     rpc get-flow-statistics-from-flow-table {
-       description "Fetch statistics of the specific flow present in the specific flow table of the switch"; 
+        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;
@@ -92,61 +92,58 @@ module opendaylight-flow-statistics {
     }
 
     notification flows-statistics-update {
-       description "Flows statistics sent by switch";
-               leaf moreReplies {
+        description "Flows statistics sent by switch";
+        leaf moreReplies {
             type boolean;
         }
         uses inv:node;
-               uses flow-and-statistics-map-list;
-               uses tr:transaction-aware;
+        uses flow-and-statistics-map-list;
+        uses tr:transaction-aware;
     }
 
-       //Models for aggregate flow statistics collection
-       augment "/inv:nodes/inv:node/flow-node:table" {
+    //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 {
+
+    grouping aggregate-flow-statistics {
         container aggregate-flow-statistics {
             //config "false";
-               uses stat-types:aggregate-flow-statistics;
+            uses stat-types:aggregate-flow-statistics;
         }
-       }    
-       
+    }
+
     // RPC calls to fetch aggregate 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"; 
+        description "Fetch aggregate statistics for all the flows present in the specific flow table of the switch";
         input {
             uses inv:node-context-ref;
             leaf table-id {
-               type table-types:table-id;
+                type table-types:table-id;
             }
         }
         output {
-               uses stat-types:aggregate-flow-statistics;
+            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"; 
+        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 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;
-        }
+        description "Aggregate flow statistics for a table, sent by switch";
         uses inv:node;
-               uses stat-types:aggregate-flow-statistics;
-               uses tr:transaction-aware;
+        uses stat-types:aggregate-flow-statistics;
+        uses tr:multipart-transaction-aware;
     }
 }
index ab84f50..431ef50 100644 (file)
@@ -2,7 +2,7 @@ module opendaylight-flow-table-statistics {
     namespace "urn:opendaylight:flow:table:statistics";
     prefix flowtablestat;
 
-       import flow-capable-transaction {prefix tr;}
+    import flow-capable-transaction {prefix tr;}
     import yang-ext {prefix ext; revision-date "2013-07-09";}
     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
     import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
@@ -19,50 +19,47 @@ module opendaylight-flow-table-statistics {
     }
     
     //Augment flow table statistics data to the table
-       augment "/inv:nodes/inv:node/flow-node:table" {
+    augment "/inv:nodes/inv:node/flow-node:table" {
         ext:augment-identifier "flow-table-statistics-data";
         uses flow-table-statistics;
     }
-       
-       grouping flow-table-statistics {
+    
+    grouping flow-table-statistics {
         container flow-table-statistics {
             //config "false";
-               uses stat-types:generic-table-statistics;
+            uses stat-types:generic-table-statistics;
         }
-       }    
+    }    
     
     //RPC calls to fetch flow table statistics
     grouping flow-table-and-statistics-map {
-       list flow-table-and-statistics-map {
-               key "table-id";
-               leaf table-id {
-                       type table-types:table-id;
-               }
-               uses stat-types:generic-table-statistics;
-       }
+        list flow-table-and-statistics-map {
+            key "table-id";
+            leaf table-id {
+                type table-types:table-id;
+            }
+            uses stat-types:generic-table-statistics;
+        }
     }
     
     rpc get-flow-tables-statistics {
-       description "Fetch statistics of all the flow tables present on the tarnet node";
-       input {
-               uses inv:node-context-ref;
-       }
-       output {
-               uses flow-table-and-statistics-map;
-               uses tr:transaction-aware;
-       }
+        description "Fetch statistics of all the flow tables present on the tarnet node";
+        input {
+            uses inv:node-context-ref;
+        }
+        output {
+            uses flow-table-and-statistics-map;
+            uses tr:transaction-aware;
+        }
     }
     
     //Notification to receive table statistics update
     
     notification flow-table-statistics-update {
-       description "Receive flow table statistics update";
-       
-               leaf moreReplies {
-            type boolean;
-        }
+        description "Receive flow table statistics update";
+        
         uses inv:node;
-               uses flow-table-and-statistics-map;
-               uses tr:transaction-aware;
+        uses flow-table-and-statistics-map;
+        uses tr:multipart-transaction-aware;
     }
 }
index 2f5c5bb..7779819 100644 (file)
@@ -16,37 +16,37 @@ module opendaylight-group-statistics {
         description "Initial revision of group statistics service";
     }
     
-       grouping group-statistics {
+    grouping group-statistics {
         container group-statistics {
             //config "false";
             uses group-types:group-statistics;
         }
-       }    
+    }    
     
     augment "/inv:nodes/inv:node/fni:group" {
         ext:augment-identifier "node-group-statistics";
         uses group-statistics;
     }
 
-       grouping group-desc {
+    grouping group-desc {
         container group-desc {
             //config "false";
             uses group-types:group;
         }
-       }
+    }
     
     augment "/inv:nodes/inv:node/fni:group" {
         ext:augment-identifier "node-group-desc-stats";
         uses group-desc;
     }
 
-       grouping group-features {
-               container group-features {
+    grouping group-features {
+            container group-features {
             //config "false";
             uses group-types:group-features-reply;
         }
     }
-           
+        
     augment "/inv:nodes/inv:node" {
         ext:augment-identifier "node-group-features";
         uses group-features;
@@ -103,29 +103,20 @@ module opendaylight-group-statistics {
     //Notification calls
     
     notification group-statistics-updated {
-        leaf moreReplies {
-            type boolean;
-        }
         uses inv:node;
         uses group-types:group-statistics-reply;
-        uses tr:transaction-aware;
+        uses tr:multipart-transaction-aware;
     }
     
     notification group-desc-stats-updated {
-        leaf moreReplies {
-            type boolean;
-        }
         uses inv:node;
         uses group-types:group-desc-stats-reply;
-        uses tr:transaction-aware;
+        uses tr:multipart-transaction-aware;
     }
 
     notification group-features-updated {
-        leaf moreReplies {
-            type boolean;
-        }
         uses inv:node;
         uses group-types:group-features-reply;
-        uses tr:transaction-aware;
+        uses tr:multipart-transaction-aware;
     }
 }
index b2cf78b..0055dc3 100644 (file)
@@ -90,32 +90,20 @@ module opendaylight-meter-statistics {
     //Notification calls
     
     notification meter-statistics-updated {
-        leaf moreReplies {
-            type boolean;
-        }
-        
         uses inv:node;
         uses meter-types:meter-statistics-reply;
-        uses tr:transaction-aware;
+        uses tr:multipart-transaction-aware;
     }
     
     notification meter-config-stats-updated {
-        leaf moreReplies {
-            type boolean;
-        }
-        
         uses inv:node;
         uses meter-types:meter-config-stats-reply;
-        uses tr:transaction-aware;
+        uses tr:multipart-transaction-aware;
     }
 
     notification meter-features-updated {
-        leaf moreReplies {
-            type boolean;
-        }
-        
         uses inv:node;
         uses meter-types:meter-features-reply;
-        uses tr:transaction-aware;
+        uses tr:multipart-transaction-aware;
     }
 }
index 22f0aca..e711877 100644 (file)
@@ -2,7 +2,7 @@ module opendaylight-port-statistics {
     namespace "urn:opendaylight:port:statistics";
     prefix portstat;
 
-       import flow-capable-transaction {prefix tr;}
+    import flow-capable-transaction {prefix tr;}
     import yang-ext {prefix ext; revision-date "2013-07-09";}
     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
     import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";}
@@ -14,64 +14,61 @@ module opendaylight-port-statistics {
     revision "2013-12-14" {
         description "Initial revision of port statistics model";
     }
-    
+
     //Augment port statistics data to the flow-capable-node-connector
-       augment "/inv:nodes/inv:node/inv:node-connector" {
+    augment "/inv:nodes/inv:node/inv:node-connector" {
         ext:augment-identifier "flow-capable-node-connector-statistics-data";
         uses flow-capable-node-connector-statistics;
     }
-       
-       grouping flow-capable-node-connector-statistics {
+    
+    grouping flow-capable-node-connector-statistics {
         container flow-capable-node-connector-statistics {
             //config "false";
             uses stat-types:node-connector-statistics;
         }
-       }    
-       
+    }
+    
     // RPC calls
     rpc get-all-node-connectors-statistics {
-       description "Get statistics for all node connectors from the node";
+        description "Get statistics for all node connectors from the node";
         input {
             uses inv:node-context-ref;
         }
         output {
-                       uses node-connector-statistics-and-port-number-map;
+            uses node-connector-statistics-and-port-number-map;
             uses tr:transaction-aware;
         }
     }
-    
+
     rpc get-node-connector-statistics {
-       description "Get statistics for given node connector from the node";
-       input {
-               uses inv:node-context-ref;
-               leaf node-connector-id {
-                       type inv:node-connector-id;
-               }
-       }
-       output {
+        description "Get statistics for given node connector from the node";
+        input {
+            uses inv:node-context-ref;
+            leaf node-connector-id {
+                type inv:node-connector-id;
+            }
+        }
+        output {
             uses stat-types:node-connector-statistics;
             uses tr:transaction-aware;
-       }
+        }
     }
-    
-    //Notification for node connector statistics update
-       grouping node-connector-statistics-and-port-number-map {
-               description "List of map - node connectors and their statistics";
-               list node-connector-statistics-and-port-number-map {
-                       key "node-connector-id";
-                       leaf node-connector-id {
-                               type inv:node-connector-id;
-                       }
-                       uses stat-types:node-connector-statistics;
-               }
-       }
 
-       notification node-connector-statistics-update {
-        leaf moreReplies {
-            type boolean;
+    //Notification for node connector statistics update
+    grouping node-connector-statistics-and-port-number-map {
+        description "List of map - node connectors and their statistics";
+        list node-connector-statistics-and-port-number-map {
+            key "node-connector-id";
+            leaf node-connector-id {
+                type inv:node-connector-id;
+            }
+            uses stat-types:node-connector-statistics;
         }
+    }
+
+    notification node-connector-statistics-update {
         uses inv:node;
-               uses node-connector-statistics-and-port-number-map;
-        uses tr:transaction-aware;
+        uses node-connector-statistics-and-port-number-map;
+        uses tr:multipart-transaction-aware;
     }
 }
index 9c48cfd..caf52aa 100644 (file)
@@ -2,7 +2,7 @@ module opendaylight-queue-statistics {
     namespace "urn:opendaylight:queue:statistics";
     prefix queuestat;
 
-       import flow-capable-transaction {prefix tr;}
+    import flow-capable-transaction {prefix tr;}
     import yang-ext {prefix ext; revision-date "2013-07-09";}
     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
     import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";}
@@ -18,35 +18,35 @@ module opendaylight-queue-statistics {
     }
     
     //Augment queue statistics data to the flow-capable-node-connector
-       augment "/inv:nodes/inv:node/inv:node-connector/flow-node:queue" {
+    augment "/inv:nodes/inv:node/inv:node-connector/flow-node:queue" {
         ext:augment-identifier "flow-capable-node-connector-queue-statistics-data";
         uses flow-capable-node-connector-queue-statistics;
     }
-       
-       grouping flow-capable-node-connector-queue-statistics {
+    
+    grouping flow-capable-node-connector-queue-statistics {
         container flow-capable-node-connector-queue-statistics {
             //config "false";
             uses stat-types:generic-queue-statistics;
         }
-       }    
-       
-       //RPC calls to fetch queue statistics
+    }    
+    
+    //RPC calls to fetch queue statistics
     grouping queue-id-and-statistics-map {
-       list queue-id-and-statistics-map {
-               key "queue-id node-connector-id";
-               leaf queue-id {
-                       type queue-types:queue-id;
-               }
-               leaf node-connector-id {
-                       type inv:node-connector-id;
-               }
-               
+        list queue-id-and-statistics-map {
+            key "queue-id node-connector-id";
+            leaf queue-id {
+                type queue-types:queue-id;
+            }
+            leaf node-connector-id {
+                type inv:node-connector-id;
+            }
+            
             uses stat-types:generic-queue-statistics;
-       }
+        }
     }
     
     rpc get-all-queues-statistics-from-all-ports {
-       description "Get statistics for all the queues attached to all the ports from the node";
+        description "Get statistics for all the queues attached to all the ports from the node";
         input {
             uses inv:node-context-ref;
         }
@@ -57,44 +57,41 @@ module opendaylight-queue-statistics {
     }
     
     rpc get-all-queues-statistics-from-given-port {
-       description "Get statistics for all queues for given port of the node";
-       input {
-               uses inv:node-context-ref;
-               leaf node-connector-id {
-                       type inv:node-connector-id;
-               }
-       }
-       output {
+        description "Get statistics for all queues for given port of the node";
+        input {
+            uses inv:node-context-ref;
+            leaf node-connector-id {
+                type inv:node-connector-id;
+            }
+        }
+        output {
             uses queue-id-and-statistics-map;
             uses tr:transaction-aware;
-       }
+        }
     }
     
     rpc get-queue-statistics-from-given-port {
-       description "Get statistics for given queues from given port of the node";
-       input {
-               uses inv:node-context-ref;
-               leaf node-connector-id {
-                       type inv:node-connector-id;
-               }
-               leaf queue-id {
-                       type queue-types:queue-id;
-               }
-       }
-       output {
+        description "Get statistics for given queues from given port of the node";
+        input {
+            uses inv:node-context-ref;
+            leaf node-connector-id {
+                type inv:node-connector-id;
+            }
+            leaf queue-id {
+                type queue-types:queue-id;
+            }
+        }
+        output {
             uses queue-id-and-statistics-map;
             uses tr:transaction-aware;
-       }
+        }
     }
 
     //Notification for port statistics update
 
-       notification queue-statistics-update {
-        leaf moreReplies {
-            type boolean;
-        }
+    notification queue-statistics-update {
         uses inv:node;
-               uses queue-id-and-statistics-map;
-        uses tr:transaction-aware;
+        uses queue-id-and-statistics-map;
+        uses tr:multipart-transaction-aware;
     }
 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.