Fixed deserialization of IdentityRefs in Restconf URI.
[controller.git] / opendaylight / md-sal / 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-inet-types {prefix inet; revision-date "2010-09-24";}
6     import ietf-yang-types {prefix yang; revision-date "2010-09-24";}    
7     import opendaylight-match-types {prefix match; revision-date "2013-10-26";}
8     import opendaylight-action-types {prefix action;}
9     import opendaylight-meter-types {prefix meter; revision-date "2013-09-18";}
10
11     revision "2013-10-26" {
12         description "Initial revision of flow service";
13     }
14     
15     grouping instruction-list {
16         list instruction {
17             key "order";
18             leaf order {
19                 type int32;
20             }
21             uses instruction;
22         }
23     }
24
25      grouping instruction {
26          choice instruction {
27             case go-to-table-case {
28                 container go-to-table {
29                  leaf table_id {
30                      type uint8;
31                  }
32              }
33             }
34              
35             case write-metadata-case {
36                 container write-metadata {
37                  leaf metadata {
38                      type uint64;
39                  }
40                  
41                  leaf metadata-mask {
42                      type uint64;
43                  }
44              }
45             }
46              
47             case write-actions-case {
48                 container write-actions {
49                  uses action:action-list;
50              }
51             }
52              
53             case apply-actions-case {
54                 container apply-actions {
55                  uses action:action-list;
56              }
57             }
58              
59             case clear-actions-case {
60                 container clear-actions {
61                  uses action:action-list;
62              }
63             }
64              
65             case meter-case {
66                 container meter {
67                      leaf meter-id {
68                         type meter:meter-id;
69                      } 
70                  }
71              }
72          }
73     }
74     
75     typedef flow-mod-flags {
76         type bits {
77             bit CHECK_OVERLAP;
78             bit RESET_COUNTS;
79             bit NO_PKT_COUNTS;
80             bit NO_BYT_COUNTS;
81             bit SEND_FLOW_REM;
82         }
83     }
84
85     typedef removed_reason_flags {
86         type bits {
87             bit IDLE_TIMEOUT;
88             bit HARD_TIMEOUT;
89             bit DELETE;
90             bit GROUP_DELETE;
91         }
92     }
93     
94     grouping generic_flow_attributes {
95         leaf priority {
96             type uint16;
97         }
98         
99         leaf idle-timeout {
100             type uint16;
101         }
102         
103         leaf hard-timeout {
104             type uint16;
105         }
106         
107         leaf cookie {
108             type uint64;
109         }
110         
111         leaf table_id {
112             type uint8;
113         }
114     }
115     
116     grouping flow {
117         container match {
118             uses match:match;
119         }
120         
121         container instructions {
122             uses instruction-list;
123         }          
124          
125         uses generic_flow_attributes;
126         
127         leaf container-name {
128             type string; 
129         }
130         
131         leaf cookie_mask {
132             type uint64;
133         }
134         
135         leaf buffer_id {
136             type uint32;
137         }
138         
139         leaf out_port {
140             type uint64;
141         }
142         
143         leaf out_group {
144             type uint32;
145         }
146         
147         leaf flags {
148             type flow-mod-flags;
149         }
150         
151         leaf flow-name {
152             type string;
153         }
154         
155         leaf installHw {
156             type boolean;
157         }
158
159         leaf barrier {
160             type boolean;
161         }
162
163         leaf strict {
164             type boolean;
165             default "false";
166         }
167
168     }
169
170     grouping flow-statistics {
171         leaf packet-count {
172             type yang:counter64;
173         }
174
175         leaf byte-count {
176             type yang:counter64;
177         }
178
179         container duration {
180             leaf second {
181                 type yang:counter64;
182             }
183             leaf nanosecond {
184                 type yang:counter64;
185             }
186         }
187     }
188
189     grouping flow-table-statistics {
190         leaf active {
191             type yang:counter64;
192         } 
193
194         leaf lookup {
195             type yang:counter64;
196         }
197
198         leaf matched {
199             type yang:counter64;   
200         }
201     }
202     
203     grouping flow-mod-removed {
204         uses generic_flow_attributes;
205         
206         leaf removed_reason {
207             type removed_reason_flags;
208         }
209
210         leaf duration_nsec {
211             type uint32;
212         }
213         
214         leaf duration_sec {
215             type uint32;
216         }
217
218         leaf packet_count {
219             type uint64;
220         }
221
222         leaf byte_count {
223             type uint64;
224         }
225                 
226         container match {
227             uses match:match;
228         }
229     }
230 }