Fixed as per comments by changed leaf name
[controller.git] / opendaylight / md-sal / model / model-flow-base / src / main / yang / group-types.yang
1 module opendaylight-group-types {
2     namespace "urn:opendaylight:group:types";
3     prefix group;
4
5     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
6     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}   
7     import opendaylight-action-types {prefix action;}
8
9     revision "2013-10-18" {
10         description "Initial revision of group service";
11     }
12
13     typedef group-id {
14         type uint32;
15     }
16     
17     typedef bucket-id {
18         type uint32;
19     }
20     
21     typedef group-types {        
22         type enumeration {
23             enum group-all;
24             enum group-select;
25             enum group-indirect;
26             enum group-ff;
27         }        
28     }
29     
30     typedef group-capabilities { 
31         type enumeration {
32             enum select-weight;
33             enum select-liveness;
34             enum chaining;
35             enum chaining-checks;
36         }   
37     }
38     
39     identity group-type {
40         description "Base identity for all the available group types"; 
41     }
42     
43     identity group-all {
44         base group-type;
45         description "All (multicast/broadcast) group";
46     }
47     
48     identity group-select {
49         base group-type;
50         description "Select group";
51     }
52     
53     identity group-indirect {
54         base group-type;
55         description "Indirect group";
56     }
57     
58     identity group-ff {
59         base group-type;
60         description "Fast failover group";
61     }
62     
63     identity group-capability {
64         description "Base identity for all the supported group capabilities";
65     }
66     
67     identity select-weight{
68         base group-capability;
69         description "Support weight for select groups";
70     }
71
72     identity select-liveness{
73         base group-capability;
74         description "Support liveness for select groups";
75     }
76
77     identity chaining{
78         base group-capability;
79         description "Support chaining groups";
80     }
81
82     identity chaining-checks{
83         base group-capability;
84         description "Check chaining for loops and delete";
85     }
86     
87     typedef group-ref {
88         type instance-identifier;
89     }
90     
91     grouping group {
92         
93         leaf group-type {
94             type group-types;
95         }
96         
97         leaf group-id {
98             type group-id;
99         }
100         
101         leaf group-name {
102             type string;
103         }
104         
105         leaf container-name {
106             type string; 
107         }
108         
109         leaf install {
110             type boolean; 
111         } 
112         
113         leaf barrier {
114             type boolean; 
115         }       
116         
117         container buckets {
118             list bucket {
119                 key "bucket-id";
120                 leaf bucket-id {
121                     type bucket-id;
122                 }
123                 
124                 leaf weight {
125                     type uint16;
126                 }
127                 
128                 leaf watch_port {
129                     type uint32;
130                 }
131                 
132                 leaf watch_group {
133                     type uint32;
134                 }
135                 
136                 uses action:action-list;
137             }
138         }
139     }
140     
141     grouping group-statistics {
142             
143         leaf group-id {
144             type group-id;
145         }
146         
147         leaf ref-count {
148             type yang:counter32;
149         }
150         
151         leaf packet-count {
152             type yang:counter64;
153         } 
154         
155         leaf byte-count {
156             type yang:counter64;
157         }
158
159         container duration {
160             leaf second {
161                 type yang:counter32;
162             }
163             leaf nanosecond {
164                 type yang:counter32;
165             }
166         }
167         
168         container buckets {
169             list bucket-counter {
170                 key "bucket-id";
171                 leaf bucket-id {
172                     type bucket-id;
173                 }
174                 
175                 leaf packet-count {
176                     type yang:counter64;
177                 } 
178         
179                 leaf byte-count {
180                     type yang:counter64;
181                 }
182             }
183         }       
184     }
185
186     grouping group-features {
187     
188         leaf-list group-types-supported {
189                 type identityref {
190                         base group-type;
191                 }
192                 }
193             
194         leaf-list group-capabilities-supported {
195                 type identityref {
196                         base group-capability;
197                 }
198                 }
199
200         leaf-list max-groups {
201             type uint32;
202             description "Maximum number of groups for each type";
203             max-elements 4;
204         }
205             
206         leaf-list actions {
207             type uint32;
208             description "Bitmap number OFPAT_* that are supported";
209             max-elements 4;
210         }
211     }
212     
213     grouping group-statistics-request {
214         list group-stats {
215             key "group-id";         
216             leaf group-id {
217                 type group-id;
218             }           
219         }
220     }
221     
222     
223     grouping group-statistics-reply {
224         
225         list group-stats {
226             key "group-id";
227             uses group-statistics;
228         }
229     }
230     
231     grouping group-desc-stats-reply {
232         
233         list group-desc-stats {
234             key "group-id";         
235             uses group;
236         }
237     }
238     
239     grouping group-features-reply {
240         uses group-features;
241     }
242     
243     grouping groups {
244         list group {
245             key "group-id";                  
246         
247             uses group;
248         }
249     }
250     
251 }