Merge "Changed the constant name logger to LOGGER to comply with the naming convention"
[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
186
187     identity interface-type-base {
188         description "Base identity for all OVSDB interface types";
189     }
190
191     identity interface-type-system {
192         description "Interface type for system interfaces";
193         base interface-type-base;
194     }
195
196     identity interface-type-internal {
197         description "Interface type for internal interfaces";
198         base interface-type-base;
199     }
200
201     identity interface-type-vxlan {
202         description "Interface type for vxlan interfaces";
203         base interface-type-base;
204     }
205
206     identity interface-type-patch {
207         description "Interface type for patch interfaces";
208         base interface-type-base;
209     }
210
211     identity interface-type-tap {
212         description "Interface type for tun/tap interfaces";
213         base interface-type-base;
214     }
215
216     identity interface-type-geneve {
217         description "Interface type for geneve interfaces";
218         base interface-type-base;
219     }
220
221     identity interface-type-gre {
222         description "Interface type for gre interfaces";
223         base interface-type-base;
224     }
225
226     identity interface-type-ipsec-gre {
227         description "Interface type for ipsec-gre interfaces";
228         base interface-type-base;
229     }
230
231     identity interface-type-gre64 {
232         description "Interface type for gre64 interfaces";
233         base interface-type-base;
234     }
235
236     identity interface-type-ipsec-gre64 {
237         description "Interface type for ipsec-gre64 interfaces";
238         base interface-type-base;
239     }
240
241     identity interface-type-lisp {
242         description "Interface type for lisp interfaces";
243         base interface-type-base;
244     }
245
246     identity interface-type-dpdk {
247         description "Interface type for dpdk interfaces";
248         base interface-type-base;
249     }
250
251     identity interface-type-dpdkr {
252         description "Interface type for dpdk ring interfaces";
253         base interface-type-base;
254     }
255
256     grouping ovsdb-port-interface-attributes {
257         leaf port-uuid {
258             description "The unique identifier of the OVSDB port";
259             type yang:uuid;
260         }
261
262         leaf interface-uuid {
263             description "The unique identifier of the OVSDB interface";
264             type yang:uuid;
265         }
266
267         leaf name {
268             description "The name of the OVSDB port/interface";
269             type string;
270         }
271
272         leaf interface-type {
273             description "The type of the OVSDB interface";
274             type identityref {
275                 base interface-type-base;
276             }
277         }
278     }
279
280     augment "/topo:network-topology/topo:topology/topo:node" {
281         description "Augmentation for bridge nodes managed by ovsdb";
282         ext:augment-identifier "ovsdb-bridge-augmentation";
283         uses ovsdb-bridge-attributes;
284     }
285
286     augment "/topo:network-topology/topo:topology/topo:node" {
287         description "Augment topology node for an ovsdb node";
288         ext:augment-identifier "ovsdb-node-augmentation";
289         uses ovsdb-node-attributes;
290     }
291
292     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
293         description "Augment topology node termination-point for an ovsdb port/interface";
294         ext:augment-identifier "ovsdb-termination-point-augmentation";
295         uses ovsdb-port-interface-attributes;
296     }
297 }