BUG-9223:Remove hardcoded value of lldp interval
[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 "2013-07-15";}
7     import ietf-yang-types {prefix yang; revision-date "2013-07-15";}
8     import opendaylight-port-types {prefix port;revision-date "2013-09-25";}
9     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
10     import opendaylight-table-types {prefix table;revision-date "2013-10-26";}
11     import opendaylight-flow-types {prefix flow;revision-date "2013-10-26";}
12     import opendaylight-group-types {prefix group;revision-date "2013-10-18";}
13     import opendaylight-meter-types {prefix meter;revision-date "2013-09-18";}
14
15     description "Flow Capable Node extensions to the Inventory model";
16
17     revision "2013-08-19" {
18         description "added descriptions";
19     }
20
21     identity feature-capability {
22     }
23
24     identity flow-feature-capability-flow-stats {
25         description "Flow statistics";
26         base feature-capability;
27     }
28
29     identity flow-feature-capability-table-stats {
30         description "Table statistics";
31         base feature-capability;
32     }
33
34     identity flow-feature-capability-port-stats {
35         description "Port statistics";
36         base feature-capability;
37     }
38
39     identity flow-feature-capability-stp {
40         description "802.1d spanning tree";
41         base feature-capability;
42     }
43
44     identity flow-feature-capability-reserved {
45         description "Reserved, must be zero";
46         base feature-capability;
47     }
48
49     identity flow-feature-capability-ip-reasm {
50         description "Can reassemble IP fragments";
51         base feature-capability;
52     }
53
54     identity flow-feature-capability-queue-stats {
55         description "Queue statistics";
56         base feature-capability;
57     }
58
59     identity flow-feature-capability-arp-match-ip {
60         description "Match IP addresses in ARP pkts";
61         base feature-capability;
62     }
63
64     identity flow-feature-capability-group-stats {
65         description "Group statistics";
66         base feature-capability;
67     }
68
69     identity flow-feature-capability-port-blocked {
70         description "Switch will block looping ports";
71         base feature-capability;
72     }
73
74     grouping feature {
75         description "Features supported by openflow device.";
76         leaf support-state {
77             type inv:support-type;
78         }
79     }
80
81     grouping queue {
82         leaf queue-id {
83             type uint32;
84             description "id for the specific queue";
85             mandatory true;
86         }
87         container properties {
88             leaf minimum-rate {
89                 type uint32;
90             }
91             leaf maximum-rate{
92                 type uint32;
93             }
94         }
95     }
96
97     typedef flow-id {
98         description "MD-SAL identifier of openflow flow. ";
99         type inet:uri;
100     }
101
102     grouping tables {
103         description "Openflow table structure. Here flows are contained.";
104         list table {
105             key "id";
106
107             leaf id {
108                     type uint8;
109             }
110
111             list flow {
112                 key "id";
113
114                 leaf id {
115                     type flow-id;
116                 }
117
118                 uses flow:flow;
119             }
120             // BE-RECON: Modification for including stale-flow for Reconciliation
121             list stale-flow {
122                 key "id";
123
124                 leaf id {
125                     type flow-id;
126                 }
127
128                 uses flow:flow;
129             }
130         }
131     }
132
133     grouping meters {
134         description "Openflow meter list.";
135         list meter {
136             key "meter-id";
137             uses meter:meter;
138         }
139         // BE-RECON: Modification for including stale-flow for Reconciliation
140         list stale-meter {
141             key "meter-id";
142             uses meter:meter;
143         }
144     }
145
146     grouping ip-address-grouping {
147         description "Additional ip address info referring to device interface which connects to controller";
148         leaf ip-address {
149             description "IP address of a flow capable node.";
150             type inet:ip-address;
151         }
152     }
153
154     grouping port-number-grouping {
155         leaf port-number {
156             description "Port number of a flow capable node.";
157             type inet:port-number;
158         }
159     }
160
161     grouping flow-node {
162         description "Openflow node structure = device";
163         leaf manufacturer {
164             type string;
165         }
166         leaf hardware {
167             type string;
168         }
169         leaf software {
170             type string;
171         }
172         leaf serial-number {
173             type string;
174         }
175         leaf description {
176             type string;
177         }
178
179         uses tables;
180         uses table:table-features;
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     grouping snapshot-gathering-status-grouping {
243         description "Basic info about snapshot gathering - timestamps of begin, end.";
244
245         container snapshot-gathering-status-start {
246             description "gathering start mark";
247             leaf begin {
248                 type yang:date-and-time;
249             }
250         }
251
252         container snapshot-gathering-status-end {
253             description "gathering end mark + result";
254             leaf end {
255                 type yang:date-and-time;
256             }
257             leaf succeeded {
258                 type boolean;
259             }
260         }
261     }
262
263     augment "/inv:nodes/inv:node" {
264         ext:augment-identifier "flow-capable-node";
265         description "Top attach point of openflow node into node inventory tree.";
266         uses flow-node;
267     }
268
269     augment "/inv:nodes/inv:node/inv:node-connector" {
270         ext:augment-identifier "flow-capable-node-connector";
271         description "Openflow port into inventory tree.";
272         uses flow-node-connector;
273     }
274
275     augment "/inv:node-updated" {
276         ext:augment-identifier "flow-capable-node-updated";
277         description "Openflow node into node notification.";
278         uses flow-node;
279     }
280
281     augment "/inv:node-updated/inv:node-connector" {
282         //ext:identical-augment "flow-capable-node-connector";
283         ext:augment-identifier "flow-capable-node-connector-update-fields";
284         description "Openflow port into node notification.";
285         uses flow-node-connector;
286     }
287
288     augment "/inv:node-connector-updated" {
289         ext:augment-identifier "flow-capable-node-connector-updated";
290         description "Openflow port into node-connector notification.";
291         uses flow-node-connector;
292     }
293
294     augment "/inv:nodes/inv:node/table" {
295         ext:augment-identifier "flow-hash-id-mapping";
296     description "Flow is identified by match and priority on device. So Operational/DS
297         has to simulate that behavior and contract between FlowId and match+priority
298         identification should represent Flow hashCode. Flow has to contain only
299         match priority and flowCookie for create a hashCode";
300         list flow-hash-id-map {
301             key "hash";
302             leaf hash {
303                 type string;
304             }
305             leaf flow-id {
306                 type flow-id;
307             }
308         }
309     }
310
311     augment "/inv:nodes/inv:node" {
312         ext:augment-identifier "flow-capable-statistics-gathering-status";
313         description "Placeholder for timestamp of device status snapshot.
314             This is contructed by asynchronous process.";
315         uses snapshot-gathering-status-grouping;
316     }
317 }