Add dpdkvhost interface type
[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
12     revision "2015-01-05" {
13         description "Initial revision of southbound model";
14     }
15
16     typedef ovsdb-bridge-ref {
17         description "A reference to an ovsdb bridge";
18         type instance-identifier;
19     }
20
21     typedef ovsdb-node-ref {
22         description "A reference to an ovsdb node";
23         type instance-identifier;
24     }
25
26     typedef flow-node-ref {
27         description "A reference to a flow node";
28         type instance-identifier;
29     }
30
31     typedef ovsdb-bridge-name {
32         type string;
33     }
34
35     typedef datapath-id {
36         type string {
37           pattern
38             '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}';
39         }
40         description
41           "The datapath-d type represents OpenFlow datapath-id .
42         The canonical representation uses lowercase characters.
43
44         In the value set and its semantics, this type is similar
45         to the MacAddress textual convention of the SMIv2, but with
46         16 extra bits";
47         reference
48           "Openflow 1.3.0 Spec
49            IEEE 802: IEEE Standard for Local and Metropolitan Area
50                 Networks: Overview and Architecture
51            RFC 2579: Textual Conventions for SMIv2";
52     }
53
54     identity datapath-type-base {
55         description "Base identity for all OVSDB datapath types";
56     }
57
58     identity datapath-type-system {
59         description "Datapath type for the kernel datapath";
60         base datapath-type-base;
61     }
62
63     identity datapath-type-netdev {
64         description "Datapath type for the userspace datapath";
65         base datapath-type-base;
66     }
67
68     identity ovsdb-bridge-protocol-base {
69         description "Base identity for all ovsdb-bridge-protocols";
70     }
71
72     identity ovsdb-bridge-protocol-openflow-10 {
73         description "Ovsdb bridge protocol OpenFlow 1.0";
74         base ovsdb-bridge-protocol-base;
75     }
76
77     identity ovsdb-bridge-protocol-openflow-11 {
78         description "Ovsdb bridge protocol OpenFlow 1.1";
79         base ovsdb-bridge-protocol-base;
80     }
81
82     identity ovsdb-bridge-protocol-openflow-12 {
83         description "Ovsdb bridge protocol OpenFlow 1.2";
84         base ovsdb-bridge-protocol-base;
85     }
86
87     identity ovsdb-bridge-protocol-openflow-13 {
88         description "Ovsdb bridge protocol OpenFlow 1.3";
89         base ovsdb-bridge-protocol-base;
90     }
91
92     identity ovsdb-bridge-protocol-openflow-14 {
93         description "Ovsdb bridge protocol OpenFlow 1.4";
94         base ovsdb-bridge-protocol-base;
95     }
96
97     identity ovsdb-bridge-protocol-openflow-15 {
98         description "Ovsdb bridge protocol OpenFlow 1.5";
99         base ovsdb-bridge-protocol-base;
100     }
101
102     identity ovsdb-fail-mode-base {
103         description "Base identity for ovsdb-failmode";
104     }
105
106     identity ovsdb-fail-mode-standalone {
107         description "Identity for ovsdb-failmode standalone";
108         base ovsdb-fail-mode-base;
109     }
110
111     identity ovsdb-fail-mode-secure {
112         definition "Identity for ovsdb-failmode standalone";
113         base ovsdb-fail-mode-base;
114     }
115
116     grouping ovsdb-bridge-attributes {
117         leaf bridge-uuid {
118             description "The unique identifier of the bridge";
119             type yang:uuid;
120         }
121
122         leaf bridge-name {
123             description "The name of the bridge";
124             type ovsdb-bridge-name;
125         }
126         list protocol-entry {
127             key "protocol";
128             leaf protocol {
129                 description "Protocol bridge should seek to speak to its controller";
130                 type identityref {
131                     base ovsdb-bridge-protocol-base;
132                 }
133             }
134         }
135
136         list controller-entry {
137             description "Bridge controller info";
138             key "target";
139             leaf target {
140                 description "Uri telling bridge how to connect to controller";
141                 type inet:uri;
142             }
143         }
144
145         leaf datapath-id {
146             description "Datapath-id of the bridge";
147             type datapath-id;
148         }
149
150         leaf datapath-type {
151             description "The datapath type of the bridge";
152             type identityref {
153                 base datapath-type-base;
154             }
155         }
156
157         leaf fail-mode {
158             description "Failmode of the bridge";
159             type identityref {
160                 base ovsdb-fail-mode-base;
161             }
162         }
163
164         leaf flow-node {
165             description "Flow node corresponding to this bridge";
166             type flow-node-ref;
167         }
168
169         leaf managed-by {
170             description "The OVSDB which this bridge belongs to";
171             type ovsdb-node-ref;
172         }
173     }
174
175     grouping ovsdb-node-attributes {
176         uses overlay:ip-port-locator;
177
178         list managed-node-entry {
179             key "bridge-ref";
180             leaf bridge-ref {
181                 type ovsdb-bridge-ref;
182             }
183         }
184
185         list datapath-type-entry {
186             key "datapath-type";
187             leaf datapath-type {
188                 description "Datapath types supported by OVSDB node";
189                 type identityref {
190                     base datapath-type-base;
191                 }
192             }
193         }
194
195         list interface-type-entry {
196             key "interface-type";
197             leaf interface-type {
198                 description "Interface types supported by OVSDB node";
199                 type identityref {
200                     base interface-type-base;
201                 }
202             }
203         }
204
205      }
206
207
208     identity interface-type-base {
209         description "Base identity for all OVSDB interface types";
210     }
211
212     identity interface-type-system {
213         description "Interface type for system interfaces";
214         base interface-type-base;
215     }
216
217     identity interface-type-internal {
218         description "Interface type for internal interfaces";
219         base interface-type-base;
220     }
221
222     identity interface-type-vxlan {
223         description "Interface type for vxlan interfaces";
224         base interface-type-base;
225     }
226
227     identity interface-type-patch {
228         description "Interface type for patch interfaces";
229         base interface-type-base;
230     }
231
232     identity interface-type-tap {
233         description "Interface type for tun/tap interfaces";
234         base interface-type-base;
235     }
236
237     identity interface-type-geneve {
238         description "Interface type for geneve interfaces";
239         base interface-type-base;
240     }
241
242     identity interface-type-gre {
243         description "Interface type for gre interfaces";
244         base interface-type-base;
245     }
246
247     identity interface-type-ipsec-gre {
248         description "Interface type for ipsec-gre interfaces";
249         base interface-type-base;
250     }
251
252     identity interface-type-gre64 {
253         description "Interface type for gre64 interfaces";
254         base interface-type-base;
255     }
256
257     identity interface-type-ipsec-gre64 {
258         description "Interface type for ipsec-gre64 interfaces";
259         base interface-type-base;
260     }
261
262     identity interface-type-lisp {
263         description "Interface type for lisp interfaces";
264         base interface-type-base;
265     }
266
267     identity interface-type-dpdk {
268         description "Interface type for dpdk interfaces";
269         base interface-type-base;
270     }
271
272     identity interface-type-dpdkr {
273         description "Interface type for dpdk ring interfaces";
274         base interface-type-base;
275     }
276
277     identity interface-type-dpdkvhost {
278         description "Interface type for dpdkvhost interfaces";
279         base interface-type-base;
280     }
281
282     grouping ovsdb-port-interface-attributes {
283         leaf port-uuid {
284             description "The unique identifier of the OVSDB port";
285             type yang:uuid;
286         }
287
288         leaf interface-uuid {
289             description "The unique identifier of the OVSDB interface";
290             type yang:uuid;
291         }
292
293         leaf name {
294             description "The name of the OVSDB port/interface";
295             type string;
296         }
297
298         leaf interface-type {
299             description "The type of the OVSDB interface";
300             type identityref {
301                 base interface-type-base;
302             }
303         }
304     }
305
306     augment "/topo:network-topology/topo:topology/topo:node" {
307         description "Augmentation for bridge nodes managed by ovsdb";
308         ext:augment-identifier "ovsdb-bridge-augmentation";
309         uses ovsdb-bridge-attributes;
310     }
311
312     augment "/topo:network-topology/topo:topology/topo:node" {
313         description "Augment topology node for an ovsdb node";
314         ext:augment-identifier "ovsdb-node-augmentation";
315         uses ovsdb-node-attributes;
316     }
317
318     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
319         description "Augment topology node termination-point for an ovsdb port/interface";
320         ext:augment-identifier "ovsdb-termination-point-augmentation";
321         uses ovsdb-port-interface-attributes;
322     }
323 }