Merge changes If902096e,I5a639b30
[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         }
122     }
123     
124     grouping meters {
125         description "Openflow meter list.";
126         list meter {
127             key "meter-id";
128             uses meter:meter;
129         }
130     }
131
132     grouping ip-address-grouping {
133         description "Additional ip address info referring to device interface which connects to controller";
134         leaf ip-address {
135             description "IP address of a flow capable node.";
136             type inet:ip-address;
137         }
138     }
139
140     grouping port-number-grouping {
141         leaf port-number {
142             description "Port number of a flow capable node.";
143             type inet:port-number;
144         }
145     }
146
147     grouping flow-node {
148         description "Openflow node structure = device";
149         leaf manufacturer {
150             type string;
151         }
152         leaf hardware {
153             type string;
154         }
155         leaf software {
156             type string;
157         }
158         leaf serial-number {
159             type string;
160         }
161         leaf description {
162             type string;
163         }
164
165         uses tables;
166         uses group:groups;
167         uses meters;
168         uses ip-address-grouping;
169         uses port-number-grouping;
170
171         container supported-match-types {
172             list match-type {
173                 key "match";
174                 uses feature;
175                 leaf match {
176                     type string; // FIXME: Add identity
177                 }
178                 
179             }
180         }
181         
182         container supported-instructions {
183             list instruction-type {
184                 key "instruction";
185                 uses feature;
186                 leaf instruction {
187                     type string; // FIXME: Add identity
188                 }
189             }
190         }
191
192         container supported-actions {
193             list action-type {
194                 key "action";
195                 uses feature;
196
197                 leaf action {
198                     type string; // FIXME: Add identity
199                 }
200             }
201         }
202         
203         container switch-features {
204             
205             leaf max_buffers {
206                 type uint32;
207             }
208             
209             leaf max_tables {
210                 type uint8;
211             }
212             
213             leaf-list capabilities {
214                 type identityref {
215                     base feature-capability;
216                 }
217             }
218             
219         }
220     }
221
222     grouping flow-node-connector {
223         description "Wrapper of openflow port. TODO::simplify/rename";
224         uses port:flow-capable-port;
225     }
226
227     augment "/inv:nodes/inv:node" {
228         ext:augment-identifier "flow-capable-node";
229         description "Top attach point of openflow node into node inventory tree.";
230         uses flow-node;
231     }
232
233     augment "/inv:nodes/inv:node/inv:node-connector" {
234         ext:augment-identifier "flow-capable-node-connector";
235         description "Openflow port into inventory tree.";
236         uses flow-node-connector;
237     }
238
239     augment "/inv:node-updated" {
240         ext:augment-identifier "flow-capable-node-updated";
241         description "Openflow node into node notification.";
242         uses flow-node;
243     }
244
245     augment "/inv:node-updated/inv:node-connector" {
246         //ext:identical-augment "flow-capable-node-connector";
247         ext:augment-identifier "flow-capable-node-connector-update-fields";
248         description "Openflow port into node notification.";
249         uses flow-node-connector;
250     }
251     
252     augment "/inv:node-connector-updated" {
253         ext:augment-identifier "flow-capable-node-connector-updated";
254         description "Openflow port into node-connector notification.";
255         uses flow-node-connector;
256     }
257
258     augment "/inv:nodes/inv:node/table" {
259         ext:augment-identifier "flow-hash-id-mapping";
260     description "Flow is identified by match and priority on device. So Operational/DS
261         has to simulate that behavior and contract between FlowId and match+priority
262         identification should represent Flow hashCode. Flow has to contain only
263         match priority and flowCookie for create a hashCode";
264         list flow-hash-id-map {
265             key "hash";
266             leaf hash {
267                 type string;
268             }
269             leaf flow-id {
270                 type flow-id;
271             }
272         }
273     }
274 }