Sal Models for meter table. 82/1282/2
authorPrasanna Huddar <prasanna.huddar@ericsson.com>
Thu, 19 Sep 2013 04:27:59 +0000 (21:27 -0700)
committerPrasanna Huddar <prasanna.huddar@ericsson.com>
Thu, 19 Sep 2013 04:42:29 +0000 (04:42 +0000)
Removed tab space from group models and formatted the same.

Signed-off-by: Prasanna Huddar <prasanna.huddar@ericsson.com>
Change-Id: I2415ac716c344ae308907f708da3d1f3b5559093

opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/group-types.yang
opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/meter-types.yang [new file with mode: 0644]
opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/group-service.yang
opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/meter-service.yang [new file with mode: 0644]

index 626eabd16a5a452beea20945957d71c17d117912..e0f60e4054e4b919fc5303ec4b062b6a3d1bce07 100644 (file)
@@ -4,92 +4,92 @@ module opendaylight-group-types {
 
     import ietf-inet-types {prefix inet;}
     import ietf-yang-types {prefix yang;}
-       import opendaylight-flow-types {prefix flow-types;}
+    import opendaylight-flow-types {prefix flow-types;}
 
-    revision "2013-09-17" {
+    revision "2013-09-18" {
         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 {
+    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 {
+        
+        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;
-                                               }
+        
+        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";         
             
-                                               uses flow-types:action;
-                                       }
-                               }
-                       }
-               }
+            leaf group-id {
+                type int32;
+            }           
+        }
     }
-       
-       grouping group-statistics-request {
-               list group-stats {
-                       key "group-id";                 
-                       
-                       leaf group-id {
-                               type int32;
-                       }                       
-               }
-       }
-       
-       grouping group-statistics {
-                       
-               leaf group-id {
+    
+    grouping group-statistics {
+            
+        leaf group-id {
             type int32;
-               }
-               
-           leaf ref-count {
+        }
+        
+        leaf ref-count {
             type yang:counter32;
-               }
-               
-               leaf packet-count {
+        }
+        
+        leaf packet-count {
             type yang:counter64;
         } 
-               
+        
         leaf byte-count {
             type yang:counter64;
         }
@@ -102,74 +102,74 @@ module opendaylight-group-types {
                 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;
-                               }
-                       }
-               }               
+        
+        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-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;
-                       }       
+        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;
-                       }
-               }
-       }    
+            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-base/src/main/yang/meter-types.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-base/src/main/yang/meter-types.yang
new file mode 100644 (file)
index 0000000..cf309f1
--- /dev/null
@@ -0,0 +1,213 @@
+module opendaylight-meter-types {
+    namespace "urn:opendaylight:meter:types";
+    prefix meter;
+
+    import ietf-inet-types {prefix inet;}
+    import ietf-yang-types {prefix yang;}
+
+
+    revision "2013-09-18" {
+        description "Initial revision of meter service";
+    }
+
+    typedef meter-ref {
+            type instance-identifier;
+    }
+    
+    grouping meter-flags {
+        leaf flags {
+            type enumeration {
+                enum meter-kbps;
+                enum meter_pktps;
+                enum meter_burst;
+                enum meter_stats;
+            }
+        }
+    }
+    
+    grouping meter-band-type {
+        leaf flags {
+            type enumeration {
+                enum ofpmbt-drop;
+                enum ofpmbt-dscp-remark;
+                enum ofpmbt-experimenter;               
+            }
+        }
+    }
+    
+    grouping band-type {
+        choice band-type {
+            case drop {
+                leaf rate {
+                    type uint32;
+                }
+                
+                leaf burst-size {
+                    type uint32;
+                }
+            }
+
+            case dscp-remark {
+                leaf rate {
+                    type uint32;
+                }
+                
+                leaf burst-size {
+                    type uint32;
+                }
+                
+                leaf perc_level {
+                    type uint8;
+                }
+            }
+            
+            case experimenter {
+                leaf rate {
+                    type uint32;
+                }
+                
+                leaf burst-size {
+                    type uint32;
+                }
+                
+                leaf experimenter {
+                    type uint32;
+                }
+            }
+        }
+    }
+    
+    grouping meter {
+        
+        uses meter-flags;        
+        
+        leaf meter-id {
+            type meter-ref;
+        }
+        
+        container meter-band-headers {
+            list meter-band-header {
+                key "order";
+                leaf order {
+                    type int32;
+                }
+                
+                container meter-band-types {
+                    uses meter-band-type;
+                }
+            
+                leaf burst-size {
+                    type uint32;
+                }
+                uses band-type;
+            }
+        }
+    }
+    
+    grouping meter-stats-config-request {
+        list meter-stats {
+            key "meter-id";         
+            
+            leaf meter-id {
+                type int32;
+            }           
+        }
+    }
+    
+    grouping meter-statistics {
+            
+        leaf meter-id {
+            type int32;
+        }
+        
+        leaf flow-count {
+            type yang:counter32;
+        }
+        
+        leaf packet-in-count {
+            type yang:counter64;
+        } 
+        
+        leaf byte-in-count {
+            type yang:counter64;
+        }
+
+        container duration {
+            leaf second {
+                type yang:counter32;
+            }
+            leaf nanosecond {
+                type yang:counter32;
+            }
+        }
+        
+        container meter-band-stats {
+            list band-stat {
+                key "order";
+                leaf order {
+                    type int32;
+                }
+            
+                leaf packet-band-count {
+                    type yang:counter64;
+                } 
+        
+                leaf byte-band-count {
+                    type yang:counter64;
+                }
+            }       
+        }
+    }
+
+    grouping meter-statistics-reply {
+        list meter-stats {
+            key "meter-stats-order";
+            leaf meter-stats-order {
+                type int32;
+            }
+            uses meter-statistics;
+        }
+    }
+    
+    grouping meter-config-stats {
+        list meter-config-stats {
+            key "meter-config-order";
+            
+            leaf meter-config-order {
+                type int32;
+            }
+            
+            uses meter;
+        } 
+    }
+    
+    grouping meter-features {
+        list meter-features {
+            key "meter-feature-order";
+            
+            leaf meter-feature-order {
+                type yang:counter32;
+            }          
+            
+            leaf max_meter {
+                type yang:counter32;
+            }
+            
+            leaf band_types {
+                type yang:counter32;
+            }
+            
+            leaf capabilities {
+                type yang:counter32;
+            }
+            
+            leaf max_bands {
+                type uint8;
+            }
+            
+            leaf max_color {
+                type uint8;
+            }
+        }
+    }    
+}
\ No newline at end of file
index 1ea2d34a38ac9e8ad05f5ba7996aca7ffb75e487..866b359c29959ec63c1a6915d51b85dbc23c7407 100644 (file)
@@ -7,10 +7,10 @@ module sal-group {
     import ietf-inet-types {prefix inet;}
     import opendaylight-group-types {prefix group-type;}
 
-    revision "2013-09-17" {
+    revision "2013-09-18" {
         description "Initial revision of group service";
     }        
-       
+    
     grouping node-group {
         leaf node {
             type inv:node-ref;
diff --git a/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/meter-service.yang b/opendaylight/sal/yang-prototype/sal/model/model-flow-service/src/main/yang/meter-service.yang
new file mode 100644 (file)
index 0000000..f9cbd64
--- /dev/null
@@ -0,0 +1,49 @@
+module sal-meter {
+    namespace "urn:opendaylight:meter:service";
+    prefix meter;
+
+    import yang-ext {prefix ext;}
+    import opendaylight-inventory {prefix inv;}
+    import ietf-inet-types {prefix inet;}
+    import opendaylight-meter-types {prefix meter-type;}
+
+    revision "2013-09-18" {
+        description "Initial revision of meter service";
+    }        
+    
+    metering node-meter {
+        leaf node {
+            type inv:node-ref;
+        }
+        
+        uses meter-type:meter;
+    }
+
+    /** Base configuration structure **/
+    metering meter-update {
+        container original-meter {
+            uses meter-type:meter;
+        }
+        container updated-meter {
+            uses meter-type:meter;
+        }
+    }
+
+    rpc add-meter {
+        input {
+            uses node-meter;
+        }
+    }
+
+    rpc remove-meter {
+        input {
+            uses node-meter;
+        }
+    }
+
+    rpc update-meter {
+        input {
+            uses node-meter;
+        }
+    }     
+}
\ No newline at end of file