Bug 5747 Introduced snapshot gathering marks
[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 ietf-yang-types {prefix yang; revision-date "2010-09-24";}
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             uses table:table-features;
112
113             list flow {
114                 key "id";
115
116                 leaf id {
117                     type flow-id;
118                 }
119
120                 uses flow:flow;
121             }
122             // BE-RECON: Modification for including stale-flow for Reconciliation
123             list stale-flow {
124                 key "id";
125
126                 leaf id {
127                     type flow-id;
128                 }
129
130                 uses flow:flow;
131             }
132         }
133     }
134
135     grouping meters {
136         description "Openflow meter list.";
137         list meter {
138             key "meter-id";
139             uses meter:meter;
140         }
141         // BE-RECON: Modification for including stale-flow for Reconciliation
142         list stale-meter {
143             key "meter-id";
144             uses meter:meter;
145         }
146     }
147
148     grouping ip-address-grouping {
149         description "Additional ip address info referring to device interface which connects to controller";
150         leaf ip-address {
151             description "IP address of a flow capable node.";
152             type inet:ip-address;
153         }
154     }
155
156     grouping port-number-grouping {
157         leaf port-number {
158             description "Port number of a flow capable node.";
159             type inet:port-number;
160         }
161     }
162
163     grouping flow-node {
164         description "Openflow node structure = device";
165         leaf manufacturer {
166             type string;
167         }
168         leaf hardware {
169             type string;
170         }
171         leaf software {
172             type string;
173         }
174         leaf serial-number {
175             type string;
176         }
177         leaf description {
178             type string;
179         }
180
181         uses tables;
182         uses group:groups;
183         uses meters;
184         uses ip-address-grouping;
185         uses port-number-grouping;
186
187         container supported-match-types {
188             list match-type {
189                 key "match";
190                 uses feature;
191                 leaf match {
192                     type string; // FIXME: Add identity
193                 }
194
195             }
196         }
197
198         container supported-instructions {
199             list instruction-type {
200                 key "instruction";
201                 uses feature;
202                 leaf instruction {
203                     type string; // FIXME: Add identity
204                 }
205             }
206         }
207
208         container supported-actions {
209             list action-type {
210                 key "action";
211                 uses feature;
212
213                 leaf action {
214                     type string; // FIXME: Add identity
215                 }
216             }
217         }
218
219         container switch-features {
220
221             leaf max_buffers {
222                 type uint32;
223             }
224
225             leaf max_tables {
226                 type uint8;
227             }
228
229             leaf-list capabilities {
230                 type identityref {
231                     base feature-capability;
232                 }
233             }
234
235         }
236     }
237
238     grouping flow-node-connector {
239         description "Wrapper of openflow port. TODO::simplify/rename";
240         uses port:flow-capable-port;
241     }
242
243     grouping snapshot-gathering-status-grouping {
244         description "Basic info about snapshot gathering - timestamps of begin, end.";
245
246         container snapshot-gathering-status-start {
247             description "gathering start mark";
248             leaf begin {
249                 type yang:date-and-time;
250             }
251         }
252
253         container snapshot-gathering-status-end {
254             description "gathering end mark + result";
255             leaf end {
256                 type yang:date-and-time;
257             }
258             leaf succeeded {
259                 type boolean;
260             }
261         }
262     }
263
264     augment "/inv:nodes/inv:node" {
265         ext:augment-identifier "flow-capable-node";
266         description "Top attach point of openflow node into node inventory tree.";
267         uses flow-node;
268     }
269
270     augment "/inv:nodes/inv:node/inv:node-connector" {
271         ext:augment-identifier "flow-capable-node-connector";
272         description "Openflow port into inventory tree.";
273         uses flow-node-connector;
274     }
275
276     augment "/inv:node-updated" {
277         ext:augment-identifier "flow-capable-node-updated";
278         description "Openflow node into node notification.";
279         uses flow-node;
280     }
281
282     augment "/inv:node-updated/inv:node-connector" {
283         //ext:identical-augment "flow-capable-node-connector";
284         ext:augment-identifier "flow-capable-node-connector-update-fields";
285         description "Openflow port into node notification.";
286         uses flow-node-connector;
287     }
288
289     augment "/inv:node-connector-updated" {
290         ext:augment-identifier "flow-capable-node-connector-updated";
291         description "Openflow port into node-connector notification.";
292         uses flow-node-connector;
293     }
294
295     augment "/inv:nodes/inv:node/table" {
296         ext:augment-identifier "flow-hash-id-mapping";
297     description "Flow is identified by match and priority on device. So Operational/DS
298         has to simulate that behavior and contract between FlowId and match+priority
299         identification should represent Flow hashCode. Flow has to contain only
300         match priority and flowCookie for create a hashCode";
301         list flow-hash-id-map {
302             key "hash";
303             leaf hash {
304                 type string;
305             }
306             leaf flow-id {
307                 type flow-id;
308             }
309         }
310     }
311
312     augment "/inv:nodes/inv:node" {
313         ext:augment-identifier "flow-capable-statistics-gathering-status";
314         description "Placeholder for timestamp of device status snapshot.
315             This is contructed by asynchronous process.";
316         uses snapshot-gathering-status-grouping;
317     }
318 }