Support other_config for OVSDB Nodes
[ovsdb.git] / southbound / southbound-api / src / main / yang / ovsdb.yang
1 module ovsdb {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:ovsdb";
4     prefix "southbound";
5
6     import network-topology {prefix "topo"; revision-date "2013-10-21"; }
7     import yang-ext { prefix "ext"; }
8     import ietf-inet-types { prefix inet; }
9     import overlay { prefix overlay; }
10     import ietf-yang-types { prefix yang; revision-date "2013-07-15";}
11     import opendaylight-l2-types { prefix ethertype; revision-date "2013-08-27";}
12
13     revision "2015-01-05" {
14         description "Initial revision of southbound model";
15     }
16
17     typedef ovsdb-termination-point-ref {
18         description "A reference to an ovsdb termination point";
19         type instance-identifier;
20     }
21
22     typedef ovsdb-bridge-ref {
23         description "A reference to an ovsdb bridge";
24         type instance-identifier;
25     }
26
27     typedef ovsdb-node-ref {
28         description "A reference to an ovsdb node";
29         type instance-identifier;
30     }
31
32     typedef flow-node-ref {
33         description "A reference to a flow node";
34         type instance-identifier;
35     }
36
37     typedef ovsdb-bridge-name {
38         type string;
39     }
40
41     typedef datapath-id {
42         type string {
43           pattern
44             '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}';
45         }
46         description
47           "The datapath-d type represents OpenFlow datapath-id .
48         The canonical representation uses lowercase characters.
49
50         In the value set and its semantics, this type is similar
51         to the MacAddress textual convention of the SMIv2, but with
52         16 extra bits";
53         reference
54           "Openflow 1.3.0 Spec
55            IEEE 802: IEEE Standard for Local and Metropolitan Area
56                 Networks: Overview and Architecture
57            RFC 2579: Textual Conventions for SMIv2";
58     }
59
60     identity datapath-type-base {
61         description "Base identity for all OVSDB datapath types";
62     }
63
64     identity datapath-type-system {
65         description "Datapath type for the kernel datapath";
66         base datapath-type-base;
67     }
68
69     identity datapath-type-netdev {
70         description "Datapath type for the userspace datapath";
71         base datapath-type-base;
72     }
73
74     identity ovsdb-bridge-protocol-base {
75         description "Base identity for all ovsdb-bridge-protocols";
76     }
77
78     identity ovsdb-bridge-protocol-openflow-10 {
79         description "Ovsdb bridge protocol OpenFlow 1.0";
80         base ovsdb-bridge-protocol-base;
81     }
82
83     identity ovsdb-bridge-protocol-openflow-11 {
84         description "Ovsdb bridge protocol OpenFlow 1.1";
85         base ovsdb-bridge-protocol-base;
86     }
87
88     identity ovsdb-bridge-protocol-openflow-12 {
89         description "Ovsdb bridge protocol OpenFlow 1.2";
90         base ovsdb-bridge-protocol-base;
91     }
92
93     identity ovsdb-bridge-protocol-openflow-13 {
94         description "Ovsdb bridge protocol OpenFlow 1.3";
95         base ovsdb-bridge-protocol-base;
96     }
97
98     identity ovsdb-bridge-protocol-openflow-14 {
99         description "Ovsdb bridge protocol OpenFlow 1.4";
100         base ovsdb-bridge-protocol-base;
101     }
102
103     identity ovsdb-bridge-protocol-openflow-15 {
104         description "Ovsdb bridge protocol OpenFlow 1.5";
105         base ovsdb-bridge-protocol-base;
106     }
107
108     identity ovsdb-fail-mode-base {
109         description "Base identity for ovsdb-failmode";
110     }
111
112     identity ovsdb-fail-mode-standalone {
113         description "Identity for ovsdb-failmode standalone";
114         base ovsdb-fail-mode-base;
115     }
116
117     identity ovsdb-fail-mode-secure {
118         description "Identity for ovsdb-failmode standalone";
119         base ovsdb-fail-mode-base;
120     }
121
122     grouping ovsdb-bridge-attributes {
123         leaf bridge-uuid {
124             description "The unique identifier of the bridge";
125             type yang:uuid;
126         }
127
128         leaf bridge-name {
129             description "The name of the bridge";
130             type ovsdb-bridge-name;
131         }
132         list protocol-entry {
133             key "protocol";
134             leaf protocol {
135                 description "Protocol bridge should seek to speak to its controller";
136                 type identityref {
137                     base ovsdb-bridge-protocol-base;
138                 }
139             }
140         }
141
142         list controller-entry {
143             description "Bridge controller info";
144             key "target";
145             leaf target {
146                 description "Uri telling bridge how to connect to controller";
147                 type inet:uri;
148             }
149         }
150
151         leaf datapath-id {
152             description "Datapath-id of the bridge";
153             type datapath-id;
154         }
155
156         leaf datapath-type {
157             description "The datapath type of the bridge";
158             type identityref {
159                 base datapath-type-base;
160             }
161         }
162
163         leaf fail-mode {
164             description "Failmode of the bridge";
165             type identityref {
166                 base ovsdb-fail-mode-base;
167             }
168         }
169
170         leaf flow-node {
171             description "Flow node corresponding to this bridge";
172             type flow-node-ref;
173         }
174
175         leaf managed-by {
176             description "The OVSDB which this bridge belongs to";
177             type ovsdb-node-ref;
178         }
179
180         list bridge-external-ids {
181             description "Bridge external id";
182             key "bridge-external-id-key";
183             leaf bridge-external-id-key {
184                 description "external-id name/key";
185                 type string;
186                 mandatory true;
187             }
188             leaf bridge-external-id-value {
189                 description "bridge-external-id value";
190                 type string;
191                 mandatory true;
192             }
193          }
194     }
195
196     grouping ovsdb-node-attributes {
197         uses overlay:ip-port-locator;
198
199         leaf ovs-version {
200             type string;
201         }
202
203         list managed-node-entry {
204             key "bridge-ref";
205             leaf bridge-ref {
206                 type ovsdb-bridge-ref;
207             }
208         }
209
210         list datapath-type-entry {
211             key "datapath-type";
212             leaf datapath-type {
213                 description "Datapath types supported by OVSDB node";
214                 type identityref {
215                     base datapath-type-base;
216                 }
217             }
218         }
219
220         list interface-type-entry {
221             key "interface-type";
222             leaf interface-type {
223                 description "Interface types supported by OVSDB node";
224                 type identityref {
225                     base interface-type-base;
226                 }
227             }
228         }
229
230         list openvswitch-external-ids {
231             description "Open_vSwitch table external ids";
232             key "external-id-key";
233             leaf external-id-key {
234                 description "external-id name/key";
235                 type string;
236                 mandatory true;
237             }
238             leaf external-id-value {
239                 description "external-id value";
240                 type string;
241                 mandatory true;
242             }
243         }
244
245         list openvswitch-other-configs {
246             description "Open_vSwitch table other configs";
247             key "other-config-key";
248             leaf other-config-key {
249                 description "other-config name/key";
250                 type string;
251             }
252             leaf other-config-value {
253                 description "other-config value";
254                 type string;
255             }
256          }
257
258      }
259
260     identity interface-type-base {
261         description "Base identity for all OVSDB interface types";
262     }
263
264     identity interface-type-system {
265         description "Interface type for system interfaces";
266         base interface-type-base;
267     }
268
269     identity interface-type-internal {
270         description "Interface type for internal interfaces";
271         base interface-type-base;
272     }
273
274     identity interface-type-vxlan {
275         description "Interface type for vxlan interfaces";
276         base interface-type-base;
277     }
278
279     identity interface-type-patch {
280         description "Interface type for patch interfaces";
281         base interface-type-base;
282     }
283
284     identity interface-type-tap {
285         description "Interface type for tun/tap interfaces";
286         base interface-type-base;
287     }
288
289     identity interface-type-geneve {
290         description "Interface type for geneve interfaces";
291         base interface-type-base;
292     }
293
294     identity interface-type-gre {
295         description "Interface type for gre interfaces";
296         base interface-type-base;
297     }
298
299     identity interface-type-ipsec-gre {
300         description "Interface type for ipsec-gre interfaces";
301         base interface-type-base;
302     }
303
304     identity interface-type-gre64 {
305         description "Interface type for gre64 interfaces";
306         base interface-type-base;
307     }
308
309     identity interface-type-ipsec-gre64 {
310         description "Interface type for ipsec-gre64 interfaces";
311         base interface-type-base;
312     }
313
314     identity interface-type-lisp {
315         description "Interface type for lisp interfaces";
316         base interface-type-base;
317     }
318
319     identity interface-type-dpdk {
320         description "Interface type for dpdk interfaces";
321         base interface-type-base;
322     }
323
324     identity interface-type-dpdkr {
325         description "Interface type for dpdk ring interfaces";
326         base interface-type-base;
327     }
328
329     identity interface-type-dpdkvhost {
330         description "Interface type for dpdkvhost interfaces";
331         base interface-type-base;
332     }
333
334     identity interface-type-dpdkvhostuser {
335         description "Interface type for dpdkvhostuser interfaces";
336         base interface-type-base;
337     }
338
339     grouping ovsdb-port-interface-attributes {
340         leaf port-uuid {
341             description "The unique identifier of the OVSDB port";
342             type yang:uuid;
343         }
344
345         leaf interface-uuid {
346             description "The unique identifier of the OVSDB interface";
347             type yang:uuid;
348         }
349
350         leaf name {
351             description "The name of the OVSDB port/interface";
352             type string;
353         }
354
355         leaf interface-type {
356             description "The type of the OVSDB interface";
357             type identityref {
358                 base interface-type-base;
359             }
360         }
361
362         list options {
363             description "Port/Interface related optional input values";
364             key "option";
365             leaf option {
366                 description "Option name";
367                 type string;
368             }
369             leaf value {
370                 description "Option value";
371                 type string;
372             }
373         }
374
375         leaf ofport {
376             description "Port/Interface related optional ofport";
377             type uint32;
378         }
379
380         leaf ofport_request {
381             description "Port/Interface related optional ofport_request, in range 1 to 65279";
382             type uint16 {
383                 range "1..65279";
384             }
385         }
386
387         leaf vlan-tag {
388             description "The VLAN tag of the termination point.";
389             type ethertype:vlan-id;
390         }
391
392         list trunks {
393             description "Represents the trunks of a termination point.";
394             leaf trunk {
395                 type ethertype:vlan-id;
396             }
397         }
398
399         leaf vlan-mode {
400             description "The VLAN mode of the termination point.";
401             type enumeration {
402                 enum "access" {
403                     value 1;
404                     description
405                         "The VLAN mode access.";
406                 }
407                 enum "native-tagged" {
408                     value 2;
409                     description
410                         "The VLAN mode native-tagged.";
411                 }
412                 enum "native-untagged" {
413                     value 3;
414                     description
415                         "The VLAN mode native-untagged.";
416                 }
417                 enum "trunk" {
418                     value 4;
419                     description
420                         "The VLAN mode trunk.";
421                 }
422             }
423         }
424
425         list port-external-ids {
426             description "Port external ids";
427             key "external-id-key";
428             leaf external-id-key {
429                 description "external-id name/key";
430                 type string;
431                 mandatory true;
432             }
433             leaf external-id-value {
434                 description "external-id value";
435                 type string;
436                 mandatory true;
437             }
438         }
439
440         list interface-external-ids {
441             description "Interface external ids";
442             key "external-id-key";
443             leaf external-id-key {
444                 description "external-id name/key";
445                 type string;
446                 mandatory true;
447             }
448             leaf external-id-value {
449                 description "external-id value";
450                 type string;
451                 mandatory true;
452             }
453         }
454     }
455
456     augment "/topo:network-topology/topo:topology/topo:node" {
457         description "Augmentation for bridge nodes managed by ovsdb";
458         ext:augment-identifier "ovsdb-bridge-augmentation";
459         uses ovsdb-bridge-attributes;
460     }
461
462     augment "/topo:network-topology/topo:topology/topo:node" {
463         description "Augment topology node for an ovsdb node";
464         ext:augment-identifier "ovsdb-node-augmentation";
465         uses ovsdb-node-attributes;
466     }
467
468     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
469         description "Augment topology node termination-point for an ovsdb port/interface";
470         ext:augment-identifier "ovsdb-termination-point-augmentation";
471         uses ovsdb-port-interface-attributes;
472     }
473 }