BUG-9223:Remove hardcoded value of lldp interval
[openflowplugin.git] / model / model-flow-base / src / main / yang / opendaylight-meter-types.yang
1 module opendaylight-meter-types {
2     namespace "urn:opendaylight:meter:types";
3     prefix meter;
4
5     import ietf-yang-types {prefix yang; revision-date "2013-07-15";}
6
7
8     revision "2013-09-18" {
9         description "Initial revision of meter service";
10     }
11
12     typedef meter-id {
13         type uint32;
14     }
15     typedef band-id {
16         type uint32;
17     }
18     
19     typedef meter-flags {        
20         type bits {
21             bit meter-kbps;
22             bit meter-pktps;
23             bit meter-burst;
24             bit meter-stats;
25         }        
26     }
27     
28     identity meter-capability {
29         description "Base identity for all the supported meter capabilities/flags";
30     }
31     identity meter-kbps {
32         base meter-capability;
33         description "Rate value in kb/s (kilo-bit per second)";
34     } 
35     identity meter-pktps {
36         base meter-capability;
37         description "Rate value in packet/sec.";
38     } 
39     identity meter-burst {
40         base meter-capability;
41         description "Do burst size.";
42     } 
43     identity meter-stats {
44         base meter-capability;
45         description "Collect statistics.";
46     } 
47     
48     typedef meter-band-type {
49         type bits {
50             bit ofpmbt-drop;
51             bit ofpmbt-dscp-remark;
52             bit ofpmbt-experimenter;               
53         }
54     }
55     
56     identity meter-band {
57         description "Base identity for all the band type available";
58     }
59     identity meter-band-drop {
60         base meter-band;
61         description "Drop packet";
62     }
63     identity meter-band-dscp-remark {
64         base meter-band;
65         description "Remark DSCP in the IP header";
66     }
67     identity meter-band-experimenter {
68         base meter-band;
69         description "Experimenter meter band";
70     }
71
72     grouping band-type {
73         choice band-type {
74             case drop {
75                 leaf drop-rate {
76                     description "Rate for dropping packets";
77                     type uint32;
78                 }
79                 
80                 leaf drop-burst-size {
81                     description "Size of bursts";
82                     type uint32;
83                 }
84             }
85
86             case dscp-remark {
87                 leaf dscp-remark-rate {
88                     description "Rate for remarking packets";
89                     type uint32;
90                 }
91                 
92                 leaf dscp-remark-burst-size {
93                     description "Size of bursts";
94                     type uint32;
95                 }
96                 
97                 leaf prec_level {
98                     description "Number of drop precedence level to add";
99                     type uint8;
100                 }
101             }
102             
103             case experimenter {
104                 leaf experimenter-rate {
105                     description "Rate for remarking packets";
106                     type uint32;
107                 }
108                 
109                 leaf experimenter-burst-size {
110                     description "Size of bursts";
111                     type uint32;
112                 }
113                 
114                 leaf experimenter {
115                     description "Experimenter id";
116                     type uint32;
117                 }
118             }
119         }
120     }
121     
122     typedef meter-ref {
123         type instance-identifier;
124     }
125     
126     grouping meter {
127         
128         leaf flags {
129            description "Meter configuration flags";
130            type meter-flags;        
131         }
132         
133         leaf meter-id {
134             description "Meter instance";
135             type meter-id;
136         }       
137         
138         leaf barrier {
139             description "If true, barrier message is sent";
140             type boolean; 
141         }
142         
143         leaf meter-name {
144             description "Name of meter instance";
145             type string;
146         }
147         
148         leaf container-name {
149             description "Name of container";
150             type string; 
151         }
152         
153         container meter-band-headers {
154             list meter-band-header {
155                 key "band-id";
156                 leaf band-id {
157                     description "Meter band id";
158                     type band-id;
159                 }
160                 
161                 container meter-band-types {
162                     leaf flags {
163                         description "Meter band flags";
164                         type meter-band-type;
165                     }
166                 }
167             
168                 leaf band-rate {
169                     description "Rate for this band";
170                     type uint32;
171                 }
172         
173                 leaf band-burst-size {
174                     description "Size of bursts";
175                     type uint32;
176                 }
177                 uses band-type;
178             }
179         }
180     }
181     
182     grouping meter-statistics {
183             
184         leaf meter-id {
185             type meter-id;
186         }
187         
188         leaf flow-count {
189             type yang:counter32;
190         }
191         
192         leaf packet-in-count {
193             type yang:counter64;
194         } 
195         
196         leaf byte-in-count {
197             type yang:counter64;
198         }
199
200         container duration {
201             leaf second {
202                 type yang:counter32;
203             }
204             leaf nanosecond {
205                 type yang:counter32;
206             }
207         }
208         
209         container meter-band-stats {
210             list band-stat {
211                 key "band-id";
212                 leaf band-id {
213                     type band-id;
214                 }
215             
216                 leaf packet-band-count {
217                     type yang:counter64;
218                 } 
219         
220                 leaf byte-band-count {
221                     type yang:counter64;
222                 }
223             }       
224         }
225     }
226
227     grouping meter-features {
228                             
229         leaf max_meter {
230             type yang:counter32;
231         }
232            
233         leaf-list meter-band-supported {
234                 type identityref {
235                         base meter-band;
236                 }
237                 }
238         
239         leaf-list meter-capabilities-supported {
240                 type identityref {
241                         base meter-capability;
242                 }
243                 }
244         
245         leaf max_bands {
246             type uint8;
247         }
248         
249         leaf max_color {
250             type uint8;
251         }
252     }
253
254     grouping meter-stats-config-request {
255         list meter-stats {
256             key "meter-id";         
257             leaf meter-id {
258                 type meter-id;
259             }           
260         }
261     }
262     
263     grouping meter-statistics-reply {
264         list meter-stats {
265             key "meter-id";
266             uses meter-statistics;
267         }
268     }
269     
270     grouping meter-config-stats-reply {
271         list meter-config-stats {
272             key "meter-id";
273             uses meter;
274         } 
275     }
276     
277     grouping meter-features-reply {
278         uses meter-features;
279     }
280     
281 }