Merge "BUG-4117: initial commit for new App Old-Notification-Supplier"
[openflowplugin.git] / model / model-flow-service / src / main / yang / flow-node-inventory.yang
1 module flow-node-inventory {
2     namespace "urn:opendaylight:flow:inventory";
3     prefix flownode;
4
5     import yang-ext {prefix ext; revision-date "2013-07-09";}
6     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
7     import opendaylight-port-types {prefix port;revision-date "2013-09-25";}
8     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
9     import opendaylight-table-types {prefix table;revision-date "2013-10-26";}
10     import opendaylight-flow-types {prefix flow;revision-date "2013-10-26";}
11     import opendaylight-group-types {prefix group;revision-date "2013-10-18";}
12     import opendaylight-meter-types {prefix meter;revision-date "2013-09-18";}
13     
14     description "Flow Capable Node extensions to the Inventory model";
15
16     revision "2013-08-19" {
17         description "added descriptions";
18     }
19     
20     identity feature-capability {
21     }
22     
23     identity flow-feature-capability-flow-stats {
24         description "Flow statistics"; 
25         base feature-capability;      
26     }
27     
28     identity flow-feature-capability-table-stats {
29         description "Table statistics";
30         base feature-capability;        
31     }
32     
33     identity flow-feature-capability-port-stats {
34         description "Port statistics";
35         base feature-capability;        
36     }
37     
38     identity flow-feature-capability-stp {
39         description "802.1d spanning tree";
40         base feature-capability;        
41     }
42     
43     identity flow-feature-capability-reserved {
44         description "Reserved, must be zero";
45         base feature-capability;        
46     }
47     
48     identity flow-feature-capability-ip-reasm {
49         description "Can reassemble IP fragments";
50         base feature-capability;        
51     }
52     
53     identity flow-feature-capability-queue-stats {
54         description "Queue statistics";
55         base feature-capability;        
56     }
57     
58     identity flow-feature-capability-arp-match-ip {
59         description "Match IP addresses in ARP pkts";
60         base feature-capability;        
61     }
62     
63     identity flow-feature-capability-group-stats {
64         description "Group statistics";
65         base feature-capability;        
66     }
67     
68     identity flow-feature-capability-port-blocked {
69         description "Switch will block looping ports";
70         base feature-capability;        
71     }
72     
73     grouping feature {
74         description "Features supported by openflow device.";
75         leaf support-state {
76             type inv:support-type;
77         }
78     }
79
80     grouping queue {
81         leaf queue-id {
82             type uint32;
83             description "id for the specific queue";
84             mandatory true; 
85         }
86         container properties {
87             leaf minimum-rate {
88                 type uint32;
89             }
90             leaf maximum-rate{
91                 type uint32;
92             }
93         }
94     }
95
96     typedef flow-id {
97         description "MD-SAL identifier of openflow flow. ";
98         type inet:uri;
99     }
100
101     grouping tables {
102         description "Openflow table structure. Here flows are contained.";
103         list table {
104             key "id"; 
105     
106             leaf id {
107                     type uint8;
108             }            
109     
110             uses table:table-features;
111     
112             list flow {
113                 key "id"; 
114     
115                 leaf id {
116                     type flow-id;
117                 }           
118     
119                 uses flow:flow;
120             }
121             // BE-RECON: Modification for including stale-flow for Reconciliation
122             list stale-flow {
123                 key "id";
124
125                 leaf id {
126                     type flow-id;
127                 }
128
129                 uses flow:flow;
130             }
131         }
132     }
133     
134     grouping meters {
135         description "Openflow meter list.";
136         list meter {
137             key "meter-id";
138             uses meter:meter;
139         }
140         // BE-RECON: Modification for including stale-flow for Reconciliation
141         list stale-meter {
142             key "meter-id";
143             uses meter:meter;
144         }
145     }
146
147     grouping ip-address-grouping {
148         description "Additional ip address info referring to device interface which connects to controller";
149         leaf ip-address {
150             description "IP address of a flow capable node.";
151             type inet:ip-address;
152         }
153     }
154
155     grouping port-number-grouping {
156         leaf port-number {
157             description "Port number of a flow capable node.";
158             type inet:port-number;
159         }
160     }
161
162     grouping flow-node {
163         description "Openflow node structure = device";
164         leaf manufacturer {
165             type string;
166         }
167         leaf hardware {
168             type string;
169         }
170         leaf software {
171             type string;
172         }
173         leaf serial-number {
174             type string;
175         }
176         leaf description {
177             type string;
178         }
179
180         uses tables;
181         uses group:groups;
182         uses meters;
183         uses ip-address-grouping;
184         uses port-number-grouping;
185
186         container supported-match-types {
187             list match-type {
188                 key "match";
189                 uses feature;
190                 leaf match {
191                     type string; // FIXME: Add identity
192                 }
193                 
194             }
195         }
196         
197         container supported-instructions {
198             list instruction-type {
199                 key "instruction";
200                 uses feature;
201                 leaf instruction {
202                     type string; // FIXME: Add identity
203                 }
204             }
205         }
206
207         container supported-actions {
208             list action-type {
209                 key "action";
210                 uses feature;
211
212                 leaf action {
213                     type string; // FIXME: Add identity
214                 }
215             }
216         }
217         
218         container switch-features {
219             
220             leaf max_buffers {
221                 type uint32;
222             }
223             
224             leaf max_tables {
225                 type uint8;
226             }
227             
228             leaf-list capabilities {
229                 type identityref {
230                     base feature-capability;
231                 }
232             }
233             
234         }
235     }
236
237     grouping flow-node-connector {
238         description "Wrapper of openflow port. TODO::simplify/rename";
239         uses port:flow-capable-port;
240     }
241
242     augment "/inv:nodes/inv:node" {
243         ext:augment-identifier "flow-capable-node";
244         description "Top attach point of openflow node into node inventory tree.";
245         uses flow-node;
246     }
247
248     augment "/inv:nodes/inv:node/inv:node-connector" {
249         ext:augment-identifier "flow-capable-node-connector";
250         description "Openflow port into inventory tree.";
251         uses flow-node-connector;
252     }
253
254     augment "/inv:node-updated" {
255         ext:augment-identifier "flow-capable-node-updated";
256         description "Openflow node into node notification.";
257         uses flow-node;
258     }
259
260     augment "/inv:node-updated/inv:node-connector" {
261         //ext:identical-augment "flow-capable-node-connector";
262         ext:augment-identifier "flow-capable-node-connector-update-fields";
263         description "Openflow port into node notification.";
264         uses flow-node-connector;
265     }
266     
267     augment "/inv:node-connector-updated" {
268         ext:augment-identifier "flow-capable-node-connector-updated";
269         description "Openflow port into node-connector notification.";
270         uses flow-node-connector;
271     }
272
273     augment "/inv:nodes/inv:node/table" {
274         ext:augment-identifier "flow-hash-id-mapping";
275     description "Flow is identified by match and priority on device. So Operational/DS
276         has to simulate that behavior and contract between FlowId and match+priority
277         identification should represent Flow hashCode. Flow has to contain only
278         match priority and flowCookie for create a hashCode";
279         list flow-hash-id-map {
280             key "hash";
281             leaf hash {
282                 type string;
283             }
284             leaf flow-id {
285                 type flow-id;
286             }
287         }
288     }
289 }