Eliminate blueprint for southbound-cli commands
[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     import opendaylight-multipart-types { prefix multipart; revision-date "2017-01-12"; }
15
16     description "Flow Capable Node extensions to the Inventory model";
17
18     revision "2013-08-19" {
19         description "added descriptions";
20     }
21
22     identity feature-capability {
23     }
24
25     identity flow-feature-capability-flow-stats {
26         description "Flow statistics";
27         base feature-capability;
28     }
29
30     identity flow-feature-capability-table-stats {
31         description "Table statistics";
32         base feature-capability;
33     }
34
35     identity flow-feature-capability-port-stats {
36         description "Port statistics";
37         base feature-capability;
38     }
39
40     identity flow-feature-capability-stp {
41         description "802.1d spanning tree";
42         base feature-capability;
43     }
44
45     identity flow-feature-capability-reserved {
46         description "Reserved, must be zero";
47         base feature-capability;
48     }
49
50     identity flow-feature-capability-ip-reasm {
51         description "Can reassemble IP fragments";
52         base feature-capability;
53     }
54
55     identity flow-feature-capability-queue-stats {
56         description "Queue statistics";
57         base feature-capability;
58     }
59
60     identity flow-feature-capability-arp-match-ip {
61         description "Match IP addresses in ARP pkts";
62         base feature-capability;
63     }
64
65     identity flow-feature-capability-group-stats {
66         description "Group statistics";
67         base feature-capability;
68     }
69
70     identity flow-feature-capability-port-blocked {
71         description "Switch will block looping ports";
72         base feature-capability;
73     }
74
75     grouping feature {
76         description "Features supported by openflow device.";
77         leaf support-state {
78             type inv:support-type;
79         }
80     }
81
82     grouping queue {
83         leaf queue-id {
84             type uint32;
85             description "id for the specific queue";
86             mandatory true;
87         }
88         container properties {
89             leaf minimum-rate {
90                 type uint32;
91             }
92             leaf maximum-rate{
93                 type uint32;
94             }
95         }
96     }
97
98     typedef flow-id {
99         description "MD-SAL identifier of openflow flow. ";
100         type inet:uri;
101     }
102
103     grouping tables {
104         description "Openflow table structure. Here flows are contained.";
105         list table {
106             key "id";
107
108             leaf id {
109                     type uint8;
110             }
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 desc {
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
180     grouping flow-node {
181         description "Openflow node structure = device";
182         uses desc;
183         uses tables;
184         uses table:table-features;
185         uses group:groups;
186         uses meters;
187         uses ip-address-grouping;
188         uses port-number-grouping;
189
190         container supported-match-types {
191             list match-type {
192                 key "match";
193                 uses feature;
194                 leaf match {
195                     type string; // FIXME: Add identity
196                 }
197
198             }
199         }
200
201         container supported-instructions {
202             list instruction-type {
203                 key "instruction";
204                 uses feature;
205                 leaf instruction {
206                     type string; // FIXME: Add identity
207                 }
208             }
209         }
210
211         container supported-actions {
212             list action-type {
213                 key "action";
214                 uses feature;
215
216                 leaf action {
217                     type string; // FIXME: Add identity
218                 }
219             }
220         }
221
222         container switch-features {
223
224             leaf max_buffers {
225                 type uint32;
226             }
227
228             leaf max_tables {
229                 type uint8;
230             }
231
232             leaf-list capabilities {
233                 type identityref {
234                     base feature-capability;
235                 }
236             }
237
238         }
239     }
240
241     grouping flow-node-connector {
242         description "Wrapper of openflow port. TODO::simplify/rename";
243         leaf reason {
244             type port:port-reason;
245         }
246         uses port:flow-capable-port;
247     }
248
249     grouping snapshot-gathering-status-grouping {
250         description "Basic info about snapshot gathering - timestamps of begin, end.";
251
252         container snapshot-gathering-status-start {
253             description "gathering start mark";
254             leaf begin {
255                 type yang:date-and-time;
256             }
257         }
258
259         container snapshot-gathering-status-end {
260             description "gathering end mark + result";
261             leaf end {
262                 type yang:date-and-time;
263             }
264             leaf succeeded {
265                 type boolean;
266             }
267         }
268     }
269
270     augment "/inv:nodes/inv:node" {
271         ext:augment-identifier "flow-capable-node";
272         description "Top attach point of openflow node into node inventory tree.";
273         uses flow-node;
274     }
275
276     augment "/inv:nodes/inv:node/inv:node-connector" {
277         ext:augment-identifier "flow-capable-node-connector";
278         description "Openflow port into inventory tree.";
279         uses flow-node-connector;
280     }
281
282     augment "/inv:node-updated" {
283         ext:augment-identifier "flow-capable-node-updated";
284         description "Openflow node into node notification.";
285         uses flow-node;
286     }
287
288     augment "/inv:node-updated/inv:node-connector" {
289         //ext:identical-augment "flow-capable-node-connector";
290         ext:augment-identifier "flow-capable-node-connector-update-fields";
291         description "Openflow port into node notification.";
292         uses flow-node-connector;
293     }
294
295     augment "/inv:node-connector-updated" {
296         ext:augment-identifier "flow-capable-node-connector-updated";
297         description "Openflow port into node-connector notification.";
298         uses flow-node-connector;
299     }
300
301     augment "/inv:nodes/inv:node/table" {
302         ext:augment-identifier "flow-hash-id-mapping";
303     description "Flow is identified by match and priority on device. So Operational/DS
304         has to simulate that behavior and contract between FlowId and match+priority
305         identification should represent Flow hashCode. Flow has to contain only
306         match priority and flowCookie for create a hashCode";
307         list flow-hash-id-map {
308             key "hash";
309             leaf hash {
310                 type string;
311             }
312             leaf flow-id {
313                 type flow-id;
314             }
315         }
316     }
317
318     augment "/inv:nodes/inv:node" {
319         ext:augment-identifier "flow-capable-statistics-gathering-status";
320         description "Placeholder for timestamp of device status snapshot.
321             This is contructed by asynchronous process.";
322         uses snapshot-gathering-status-grouping;
323     }
324
325     augment "/multipart:multipart-reply/multipart:multipart-reply-body" {
326         case multipart-reply-desc {
327             uses desc;
328         }
329     }
330
331     augment "/multipart:multipart-request/multipart:multipart-request-body" {
332         case multipart-request-desc {
333             // Empty request case
334         }
335     }
336 }