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