4901f08f24462b891d594a64845439841796456e
[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         uses port:flow-capable-port;
244     }
245
246     grouping snapshot-gathering-status-grouping {
247         description "Basic info about snapshot gathering - timestamps of begin, end.";
248
249         container snapshot-gathering-status-start {
250             description "gathering start mark";
251             leaf begin {
252                 type yang:date-and-time;
253             }
254         }
255
256         container snapshot-gathering-status-end {
257             description "gathering end mark + result";
258             leaf end {
259                 type yang:date-and-time;
260             }
261             leaf succeeded {
262                 type boolean;
263             }
264         }
265     }
266
267     augment "/inv:nodes/inv:node" {
268         ext:augment-identifier "flow-capable-node";
269         description "Top attach point of openflow node into node inventory tree.";
270         uses flow-node;
271     }
272
273     augment "/inv:nodes/inv:node/inv:node-connector" {
274         ext:augment-identifier "flow-capable-node-connector";
275         description "Openflow port into inventory tree.";
276         uses flow-node-connector;
277     }
278
279     augment "/inv:node-updated" {
280         ext:augment-identifier "flow-capable-node-updated";
281         description "Openflow node into node notification.";
282         uses flow-node;
283     }
284
285     augment "/inv:node-updated/inv:node-connector" {
286         //ext:identical-augment "flow-capable-node-connector";
287         ext:augment-identifier "flow-capable-node-connector-update-fields";
288         description "Openflow port into node notification.";
289         uses flow-node-connector;
290     }
291
292     augment "/inv:node-connector-updated" {
293         ext:augment-identifier "flow-capable-node-connector-updated";
294         description "Openflow port into node-connector notification.";
295         uses flow-node-connector;
296     }
297
298     augment "/inv:nodes/inv:node/table" {
299         ext:augment-identifier "flow-hash-id-mapping";
300     description "Flow is identified by match and priority on device. So Operational/DS
301         has to simulate that behavior and contract between FlowId and match+priority
302         identification should represent Flow hashCode. Flow has to contain only
303         match priority and flowCookie for create a hashCode";
304         list flow-hash-id-map {
305             key "hash";
306             leaf hash {
307                 type string;
308             }
309             leaf flow-id {
310                 type flow-id;
311             }
312         }
313     }
314
315     augment "/inv:nodes/inv:node" {
316         ext:augment-identifier "flow-capable-statistics-gathering-status";
317         description "Placeholder for timestamp of device status snapshot.
318             This is contructed by asynchronous process.";
319         uses snapshot-gathering-status-grouping;
320     }
321
322     augment "/multipart:multipart-reply/multipart:multipart-reply-body" {
323         case multipart-reply-desc {
324             uses desc;
325         }
326     }
327 }