MD-SAL model for group feature in OF 1.3. 45/1245/2
authorPrasanna Huddar <prasanna.huddar@ericsson.com>
Wed, 18 Sep 2013 02:40:16 +0000 (19:40 -0700)
committerPrasanna Huddar <prasanna.huddar@ericsson.com>
Wed, 18 Sep 2013 03:10:02 +0000 (03:10 +0000)
Change-Id: I34db6a383b94c43682deefb2dd2b7ca9b04b1d87
Signed-off-by: Prasanna Huddar <prasanna.huddar@ericsson.com>
opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/group-types.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/group-service.yang [new file with mode: 0644]

diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/group-types.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/group-types.yang
new file mode 100644 (file)
index 0000000..626eabd
--- /dev/null
@@ -0,0 +1,175 @@
+module opendaylight-group-types {
+    namespace "urn:opendaylight:group:types";
+    prefix group;
+
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;}
+       import opendaylight-flow-types {prefix flow-types;}
+
+    revision "2013-09-17" {
+        description "Initial revision of group service";
+    }
+
+       typedef group-ref {
+               type instance-identifier;
+       }
+       
+       grouping group-types {
+               leaf group-type {
+                       type enumeration {
+                               enum group-all;
+                               enum group_select;
+                               enum group_indirect;
+                               enum group_ff;
+                       }
+               }
+       }
+       
+       grouping group {
+        
+        uses group-types;       
+               
+               leaf group-id {
+            type group-ref;
+        }
+               
+               container buckets {
+                       list bucket {
+                               key "order";
+                               leaf order {
+                                       type int32;
+                               }
+                               
+                               leaf weight {
+                                       type uint16;
+                               }
+                               
+                               leaf watch_port {
+                                       type uint32;
+                               }
+                               
+                               leaf watch_group {
+                                       type uint32;
+                               }
+                               
+                               container actions {
+                                       list action {
+                                               key "action-order";
+                                               leaf action-order {
+                                                       type int32;
+                                               }
+            
+                                               uses flow-types:action;
+                                       }
+                               }
+                       }
+               }
+    }
+       
+       grouping group-statistics-request {
+               list group-stats {
+                       key "group-id";                 
+                       
+                       leaf group-id {
+                               type int32;
+                       }                       
+               }
+       }
+       
+       grouping group-statistics {
+                       
+               leaf group-id {
+            type int32;
+               }
+               
+           leaf ref-count {
+            type yang:counter32;
+               }
+               
+               leaf packet-count {
+            type yang:counter64;
+        } 
+               
+        leaf byte-count {
+            type yang:counter64;
+        }
+
+        container duration {
+            leaf second {
+                type yang:counter32;
+            }
+            leaf nanosecond {
+                type yang:counter32;
+            }
+        }
+               
+               container buckets {
+                       list bucket-counter {
+                               key "order";
+                               leaf order {
+                                       type int32;
+                               }
+                               
+                               leaf packet-count {
+                                       type yang:counter64;
+                               } 
+               
+                               leaf byte-count {
+                                       type yang:counter64;
+                               }
+                       }
+               }               
+    }
+
+       grouping group-statistics-reply {
+               list group-stats {
+                       key "group-stats-order";
+                       leaf group-stats-order {
+                               type int32;
+                       }
+                       
+                       uses group-statistics;
+               }
+       }
+       
+       grouping group-desc-stats {
+               list group-desc-stats {
+                       key "order-id";                 
+                       
+                       leaf order-id {
+                               type int32;
+                       }
+                       
+                       uses group;
+               }
+       }
+       
+    grouping group-features {
+               list group-features {
+                       key "order";
+                       leaf order {
+                               type int32;
+                       }
+                       
+                       uses group-types;
+                       type capabilities {
+                               enum select-weight;
+                               enum select-liveness;
+                               enum chaining;
+                               enum chaining-checks;
+                       }       
+
+                       leaf-list max-groups {
+                               type uint32;
+                               description "Maximum number of groups for each type";
+                               max-elements 4;
+                       }
+                       
+                       leaf-list actions {
+                               type uint32;
+                               description "Bitmap number OFPAT_* that are supported";
+                               max-elements 4;
+                       }
+               }
+       }    
+}
\ No newline at end of file
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/group-service.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/group-service.yang
new file mode 100644 (file)
index 0000000..1ea2d34
--- /dev/null
@@ -0,0 +1,49 @@
+module sal-group {
+    namespace "urn:opendaylight:group:service";
+    prefix group;
+
+    import yang-ext {prefix ext;}
+    import opendaylight-inventory {prefix inv;}
+    import ietf-inet-types {prefix inet;}
+    import opendaylight-group-types {prefix group-type;}
+
+    revision "2013-09-17" {
+        description "Initial revision of group service";
+    }        
+       
+    grouping node-group {
+        leaf node {
+            type inv:node-ref;
+        }
+        
+        uses group-type:group;
+    }
+
+    /** Base configuration structure **/
+    grouping group-update {
+        container original-group {
+            uses group-type:group;
+        }
+        container updated-group {
+            uses group-type:group;
+        }
+    }
+
+    rpc add-group {
+        input {
+            uses node-group;
+        }
+    }
+
+    rpc remove-group {
+        input {
+            uses node-group;
+        }
+    }
+
+    rpc update-group {
+        input {
+            uses node-group;
+        }
+    }     
+}
\ No newline at end of file