Eliminate blueprint for southbound-cli commands
[openflowplugin.git] / model / model-flow-base / src / main / yang / opendaylight-flow-types.yang
1 module opendaylight-flow-types {
2     namespace "urn:opendaylight:flow:types";
3     prefix flow;
4
5     import ietf-yang-types {prefix yang; revision-date "2013-07-15";}
6     import opendaylight-match-types {prefix match; revision-date "2013-10-26";}
7     import opendaylight-action-types {prefix action;}
8     import opendaylight-meter-types {prefix meter; revision-date "2013-09-18";}
9     import openflow-protocol { prefix ofproto; revision-date "2013-07-31"; }
10     import openflow-types { prefix oft; revision-date "2013-07-31"; }
11     import opendaylight-multipart-types { prefix multipart; revision-date "2017-01-12"; }
12
13     revision "2013-10-26" {
14         description "Initial revision of flow service";
15     }
16
17     typedef flow-ref {
18         type instance-identifier;
19     }
20
21     typedef flow-cookie {
22         description "openflow specific type - flow cookie / flow cookie mask";
23         type uint64;
24     }
25
26     typedef output-port-values {
27         type enumeration {
28             enum MAX {
29                 value 1;
30             }
31             enum IN_PORT {
32                 value 2;
33             }
34             enum TABLE {
35                 value 3;
36             }
37             enum NORMAL {
38                 value 4;
39             }
40             enum FLOOD {
41                 value 5;
42             }
43             enum ALL {
44                 value 6;
45             }
46             enum CONTROLLER {
47                 value 7;
48             }
49             enum LOCAL {
50                 value 8;
51             }
52             enum ANY {
53                 value 9;
54             }
55              enum NONE {
56                 value 10;
57             }
58
59         }
60     }
61     grouping instruction-list {
62         list instruction {
63             key "order";
64             uses action:ordered;
65             uses instruction;
66         }
67     }
68
69      grouping instruction {
70          choice instruction {
71             case go-to-table-case {
72                 container go-to-table {
73                  leaf table_id {
74                      type uint8;
75                  }
76              }
77             }
78
79             case write-metadata-case {
80                 container write-metadata {
81                  leaf metadata {
82                      type uint64;
83                  }
84
85                  leaf metadata-mask {
86                      type uint64;
87                  }
88              }
89             }
90
91             case write-actions-case {
92                 container write-actions {
93                  uses action:action-list;
94              }
95             }
96
97             case apply-actions-case {
98                 container apply-actions {
99                  uses action:action-list;
100              }
101             }
102
103             case clear-actions-case {
104                 container clear-actions {
105                  uses action:action-list;
106              }
107             }
108
109             case meter-case {
110                 container meter {
111                      leaf meter-id {
112                         type meter:meter-id;
113                      }
114                  }
115              }
116          }
117     }
118
119     typedef flow-mod-flags {
120         type bits {
121             bit CHECK_OVERLAP;
122             bit RESET_COUNTS;
123             bit NO_PKT_COUNTS;
124             bit NO_BYT_COUNTS;
125             bit SEND_FLOW_REM;
126         }
127     }
128      typedef removed-flow-reason {
129             type enumeration {
130                 enum OFPRR_IDLE_TIMEOUT{
131                     value 0;
132                     description "Flow idle time exceeded idle_timeout.";
133                 }
134                 enum OFPRR_HARD_TIMEOUT {
135                     value 1;
136                     description "Time exceeded hard_timeout.";
137                 }
138                 enum OFPRR_DELETE {
139                     value 2;
140                     description "Evicted by a DELETE flow mod.";
141                 }
142                 enum OFPRR_GROUP_DELETE {
143                     value 3;
144                     description "Group was removed.";
145                 }
146
147             }
148      }
149
150     grouping generic_flow_attributes {
151         leaf priority {
152             type uint16;
153         }
154
155         leaf idle-timeout {
156             type uint16;
157         }
158
159         leaf hard-timeout {
160             type uint16;
161         }
162
163         leaf cookie {
164             type flow-cookie;
165         }
166
167         leaf table_id {
168             type uint8;
169         }
170     }
171
172     grouping flow {
173         container match {
174             uses match:match;
175         }
176
177         container instructions {
178             uses instruction-list;
179         }
180
181         uses generic_flow_attributes;
182
183         leaf container-name {
184             type string;
185         }
186
187         leaf cookie_mask {
188             type flow-cookie;
189         }
190
191         leaf buffer_id {
192             type uint32;
193         }
194
195         leaf out_port {
196             type uint64;
197         }
198
199         leaf out_group {
200             type uint32;
201         }
202
203         leaf flags {
204             type flow-mod-flags;
205         }
206
207         leaf flow-name {
208             type string;
209         }
210
211         leaf installHw {
212             type boolean;
213         }
214
215         leaf barrier {
216             type boolean;
217         }
218
219         leaf strict {
220             type boolean;
221             default "false";
222         }
223
224     }
225
226     grouping flow-statistics {
227         leaf packet-count {
228             type yang:counter64;
229         }
230
231         leaf byte-count {
232             type yang:counter64;
233         }
234
235         container duration {
236             leaf second {
237                 type yang:counter64;
238             }
239             leaf nanosecond {
240                 type yang:counter64;
241             }
242         }
243     }
244
245     grouping flow-table-statistics {
246         leaf active {
247             type yang:counter64;
248         }
249
250         leaf lookup {
251             type yang:counter64;
252         }
253
254         leaf matched {
255             type yang:counter64;
256         }
257     }
258
259     grouping flow-mod-removed {
260         uses generic_flow_attributes;
261
262         leaf removed_reason {
263             type removed-flow-reason;
264         }
265
266         leaf duration_nsec {
267             type uint32;
268         }
269
270         leaf duration_sec {
271             type uint32;
272         }
273
274         leaf packet_count {
275             type uint64;
276         }
277
278         leaf byte_count {
279             type uint64;
280         }
281
282         container match {
283             uses match:match;
284         }
285     }
286
287     container flow-message {
288         uses flow;
289         uses ofproto:ofHeader;
290
291         leaf command {
292             type oft:flow-mod-command;
293         }
294     }
295
296     augment "/multipart:multipart-request/multipart:multipart-request-body" {
297         case multipart-request-flow-stats {
298             container flow-stats {
299                 uses flow;
300             }
301         }
302         case multipart-request-flow-aggregate-stats {
303             container flow-aggregate-stats {
304                 uses flow;
305             }
306         }
307     }
308 }