d0a9fb47e842f15c4b2320a516a369a26be97b3c
[ovsdb.git] / hwvtepsouthbound / hwvtepsouthbound-api / src / main / yang / hwvtep.yang
1 module hwvtep {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:ovsdb:hwvtep";
4     prefix "hwvtepsb";
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; revision-date 2010-09-24; }
9     import ietf-yang-types { prefix yang; revision-date "2013-07-15";}
10     import opendaylight-l2-types { prefix ethertype; revision-date "2013-08-27";}
11
12     revision "2015-09-01" {
13         description "1st revision of southbound model for hwvtep";
14     }
15
16     typedef hwvtep-physical-switch-ref {
17         description "A reference to a hwvtep based physical switch";
18         type instance-identifier;
19     }
20
21     typedef hwvtep-logical-switch-ref {
22         description "A reference to a logical switch in hwvtep based switches";
23         type instance-identifier;
24     }
25
26     typedef hwvtep-physical-locator-ref {
27         description "A reference to an endpoint to which logical switch traffic may be encapsulated and forwarded";
28         type instance-identifier;
29     }
30
31     typedef hwvtep-global-ref {
32         description "A reference to an hwvtep global node";
33         type instance-identifier;
34     }
35
36     typedef hwvtep-node-name {
37         type string;
38     }
39
40     typedef ietf-acl-entry-ref {
41         description "A reference to an ietf-acl-entry";
42         type instance-identifier;
43     }
44
45     typedef hwvtep-acl-ref {
46         description "A reference to an acl";
47         type instance-identifier;
48     }
49
50     typedef hwvtep-logical-binding-stats-ref {
51         description "A reference to a logical-binding-stats";
52         type instance-identifier;
53     }
54
55     grouping hwvtep-node-identification {
56         leaf hwvtep-node-name {
57             description "The name of the node";
58             type hwvtep-node-name;
59         }
60         leaf hwvtep-node-description {
61             description "The description of the node";
62             type string;
63         }
64     }
65
66     grouping hwvtep-mac-table-generic-attributes {
67         leaf mac-entry-key {
68             description "MAC address entry";
69             type yang:mac-address;
70         }
71         leaf mac-entry-uuid {
72             description "The unique identifier of the mac-entry";
73             type yang:uuid;
74         }
75         leaf logical-switch-ref {
76             description "The logical switch to which this mapping applies";
77             type hwvtep-logical-switch-ref;
78         }
79     }
80
81     grouping hwvtep-ucast-mac-table-attributes {
82         description "Unicast mac table attributes";
83         leaf ipaddr {
84             description "Optional IP address associated with the mac";
85             type inet:ip-address;
86         }
87         leaf locator-ref {
88             description "Reference to the physical locator to reach this entry";
89             type hwvtep-physical-locator-ref;
90         }
91     }
92
93     grouping hwvtep-mcast-mac-table-attributes {
94         description "Multicast mac table attributes";
95         leaf ipaddr {
96             description "Optional IP address associated with the mac";
97             type inet:ip-address;
98         }
99         uses hwvtep-physical-locator-set-attributes;
100     }
101
102     grouping hwvtep-tunnel-attributes {
103         leaf tunnel-uuid {
104             description "The unique identifier of the tunnel";
105             type yang:uuid;
106         }
107         leaf local-locator-ref {
108             description "Reference to the physical locator to reach this entry";
109             type hwvtep-physical-locator-ref;
110         }
111         leaf remote-locator-ref {
112             description "Reference to the physical locator to reach this entry";
113             type hwvtep-physical-locator-ref;
114         }
115         list bfd-local-configs {
116             description "Local configuation attributes for BFD";
117
118             key "bfd-local-config-key";
119             leaf bfd-local-config-key {
120                 description "bfd-local-config name/key";
121                 type string;
122             }
123             leaf bfd-local-config-value {
124                 description "bfd-local-config value";
125                 type string;
126             }
127         }
128         list bfd-remote-configs {
129             description "Remote configuration attributes for BFD";
130
131             key "bfd-remote-config-key";
132             leaf bfd-remote-config-key {
133                 description "bfd-remote-config name/key";
134                 type string;
135             }
136             leaf bfd-remote-config-value {
137                 description "bfd-remote-config value";
138                 type string;
139             }
140         }
141         list bfd-params {
142             description "Parameters to configure and enable BFD";
143
144             key "bfd-param-key";
145             leaf bfd-param-key {
146                 description "bfd-param name/key";
147                 type string;
148             }
149             leaf bfd-param-value {
150                 description "bfd-param value";
151                 type string;
152             }
153         }
154         list bfd-status {
155             description "runtime status of BFD on this tunnel";
156
157             config false;
158             key "bfd-status-key";
159             leaf bfd-status-key {
160                 description "bfd-status name/key";
161                 type string;
162             }
163             leaf bfd-status-value {
164                 description "bfd-status value";
165                 type string;
166             }
167         }
168     }
169
170     grouping hwvtep-physical-switch-attributes {
171         uses hwvtep-node-identification;
172         leaf physical-switch-uuid {
173             description "The unique identifier of the physical-switch";
174             type yang:uuid;
175         }
176         list management-ips {
177             key "management-ips-key";
178             leaf management-ips-key {
179                description "Management IP address of the switch";
180                type inet:ip-address;
181             }
182         }
183         leaf managed-by {
184             description "The hwvtep global node to which this physical switch belongs to";
185             type hwvtep-global-ref;
186         }
187         list tunnel-ips {
188             key "tunnel-ips-key";
189             leaf tunnel-ips-key {
190                description "Management IP address of the switch";
191                type inet:ip-address;
192             }
193         }
194         list tunnels {
195             key "local-locator-ref remote-locator-ref";
196             uses hwvtep-tunnel-attributes ;
197         }
198         list switch-fault-status {
199             config false;
200             key "switch-fault-status-key";
201             leaf switch-fault-status-key {
202                 description "switch-fault-status name/key";
203                 type string;
204             }
205             leaf switch-fault-status-value {
206                 description "switch-fault-status value";
207                 type string;
208             }
209         }
210     }
211
212     grouping hwvtep-connection-info-attributes {
213         leaf remote-ip {
214             type inet:ip-address;
215             description "Hwvtep Connection Remote IP";
216         }
217         leaf remote-port {
218             type inet:port-number;
219             description "Hwvtep Connection Remote Port Number";
220         }
221         leaf local-ip {
222             type inet:ip-address;
223             description "Hwvtep Connection Local IP";
224         }
225         leaf local-port {
226             type inet:port-number;
227             description "Hwvtep Connection Local Port Number IP";
228         }
229     }
230
231     grouping hwvtep-global-attributes {
232         description "global node for the hwvtep";
233         container connection-info {
234             uses hwvtep-connection-info-attributes;
235         }
236         list managers {
237             description "";
238             key "target";
239             leaf target {
240                 description "Uri indicating connection method to the Manager";
241                 type inet:uri;
242             }
243             leaf manager-uuid {
244                 description "The unique identifier of the manager";
245                 type yang:uuid;
246             }
247             leaf is-connected {
248                 type boolean;
249             }
250             list manager-other-configs {
251                 description "Key-value pairs for configuring rarely used features.
252                     other_config : dscp : optional string
253                     contains an integer, in the range 0 - 63. DSCP value to be used when establishing a connection to the switch. Default value of 48 if none specified.";
254                 key "other-config-key";
255                 leaf other-config-key {
256                     description "other-config name/key";
257                     type string;
258                 }
259                 leaf other-config-value {
260                     description "other-config value";
261                     type string;
262                 }
263             }
264         }
265         list switches {
266             description "List of physical switches managed by this node";
267             key "switch-ref";
268             leaf switch-ref {
269                 type hwvtep-physical-switch-ref;
270             }
271         }
272         list logical-switches {
273             key "hwvtep-node-name";
274             uses hwvtep-logical-switch-attributes;
275         }
276         list local-ucast-macs {
277             key "mac-entry-key logical-switch-ref";
278             uses hwvtep-mac-table-generic-attributes;
279             uses hwvtep-ucast-mac-table-attributes;
280         }
281         list remote-ucast-macs {
282             key "mac-entry-key logical-switch-ref";
283             uses hwvtep-mac-table-generic-attributes;
284             uses hwvtep-ucast-mac-table-attributes;
285         }
286         list local-mcast-macs {
287             key "mac-entry-key logical-switch-ref";
288             uses hwvtep-mac-table-generic-attributes;
289             uses hwvtep-mcast-mac-table-attributes;
290         }
291         list remote-mcast-macs{
292             key "mac-entry-key logical-switch-ref";
293             uses hwvtep-mac-table-generic-attributes;
294             uses hwvtep-mcast-mac-table-attributes;
295         }
296         list logical-routers {
297             key "hwvtep-node-name";
298             uses hwvtep-logical-router-attributes;
299         }
300         list local-arp-sources {
301             key "src-mac";
302             uses hwvtep-arp-sources-attributes;
303         }
304         list remote-arp-sources {
305             key "src-mac";
306             uses hwvtep-arp-sources-attributes;
307         }
308         list acls {
309             key "acl-name";
310             uses hwvtep-acl-attributes;
311         }
312         list logical-binding-stats {
313             config false;
314             key "logical-binding-stats-uuid";
315             uses hwvtep-logical-binding-stats-attributes;
316         }
317     }
318
319     identity encapsulation-type-base {
320         description "Base Encapsulation type";
321     }
322
323     identity encapsulation-type-vxlan-over-ipv4 {
324         base encapsulation-type-base;
325         description "Encapsulation type vxlan-over-ipv4";
326     }
327
328     typedef encapsulation-type {
329         type identityref {
330             base encapsulation-type-base;
331         }
332         description "This type is used to refer to an Encapsulation Type.";
333     }
334
335     grouping hwvtep-physical-locator-attributes {
336         leaf physical-locator-uuid {
337             description "The unique identifier of the physical-locator";
338             type yang:uuid;
339         }
340         leaf encapsulation-type {
341             type encapsulation-type;
342             description "Encapsulation type used by this locator";
343         }
344         leaf dst-ip {
345             type inet:ip-address;
346             description "IP address of the locator";
347         }
348     }
349
350     grouping hwvtep-physical-locator-set-attributes {
351         list locator-set {
352             leaf locator-ref {
353                 type hwvtep-physical-locator-ref;
354             }
355         }
356     }
357
358     grouping hwvtep-logical-switch-attributes {
359         uses hwvtep-node-identification;
360         leaf logical-switch-uuid {
361             description "A unique identifier of the logical switch";
362             type yang:uuid;
363         }
364         leaf tunnel-key {
365             description "Per Logical Switch tunnel key";
366             type string;
367         }
368     }
369
370     grouping hwvtep-physical-port-attributes {
371         uses hwvtep-node-identification;
372         leaf physical-port-uuid {
373             description "The unique identifier of the physical-port";
374             type yang:uuid;
375         }
376         list vlan-bindings {
377             description "A map of vlan ID to logical switch pairs";
378             key "vlan-id-key";
379             leaf vlan-id-key {
380                 description "vlan ids in the range 0 - 4095";
381                 type ethertype:vlan-id;
382             }
383             leaf logical-switch-ref {
384                 description "Reference to logical switch for the vlan";
385                 type hwvtep-logical-switch-ref;
386             }
387         }
388         list acl-bindings {
389             key "acl-binding-vlan-id";
390             leaf acl-binding-vlan-id {
391                 description "vlan ids in the range 0 - 4095";
392                 type ethertype:vlan-id;
393             }
394             leaf acl-ref {
395                 description "reference to ACL to be applied to this port";
396                 type hwvtep-acl-ref;
397             }
398         }
399         list vlan-stats {
400             key "vlan-stats-key";
401             leaf vlan-stats-key {
402                 description "vlan ids in the range 0 - 4095";
403                 type ethertype:vlan-id;
404             }
405             leaf vlan-stats-ref {
406                 description "reference to logical binding stats for this port";
407                 type hwvtep-logical-binding-stats-ref;
408             }
409         }
410         list port-fault-status {
411             config false;
412             key "port-fault-status-key";
413             leaf port-fault-status-key {
414                 description "port-fault-status name/key";
415                 type string;
416             }
417             leaf port-fault-status-value {
418                 description "port-fault-status value";
419                 type string;
420             }
421         }
422     }
423
424     grouping hwvtep-logical-router-attributes {
425         uses hwvtep-node-identification;
426         leaf logical-router-uuid {
427             description "A unique identifier of the logical router";
428             type yang:uuid;
429         }
430         list switch-bindings {
431             description "A map of IPv4 or IPv6 address prefix in CIDR
432                          notation to logical switch. Multiple prefixes
433                          may map to the same switch. By writing a 32-bit
434                          (or 128-bit for v6) address with a /N prefix
435                          length, both the router's interface address and the
436                          subnet  prefix  can be configured. For example,
437                          192.68.1.1/24 creates a /24 subnet for the logical
438                          switch  attached to the interface and assigns the
439                          address 192.68.1.1 to the router interface.";
440             leaf destination-address {
441                 description "IPv4 or IPv6 address prefix in CIDR notation";
442                 type inet:ip-prefix;
443             }
444             leaf logical-switch-ref {
445                 description "reference to logical switch";
446                 type hwvtep-logical-switch-ref;
447             }
448         }
449         list static-routes {
450             description "map of string-string pairs. One or more static routes,
451                          mapping IP prefixes to next hop IP addresses.";
452             leaf destination-address {
453                 description "IPv4 or IPv6 address prefix in CIDR notation";
454                 type inet:ip-prefix;
455             }
456             leaf nexthop-address {
457                 description "IP address of next hop";
458                 type inet:ip-address;
459             }
460         }
461         list acl-bindings {
462             description "map of string-ACL pairs. Maps ACLs to logical router
463                          interfaces. The router interfaces are indicated
464                          using IP address notation, and must be the same
465                          interfaces created in the switch_binding column.
466                          For example, an ACL could be associated with the
467                          logical router interface with an address of
468                          192.68.1.1 as defined in the example above.";
469             key "router-interface";
470             leaf router-interface {
471                 description "IPv4 or IPv6 address prefix in CIDR notation";
472                 type inet:ip-prefix;
473             }
474             leaf acl-ref {
475                 description "reference to ACL to be applied to this router";
476                 type hwvtep-acl-ref;
477             }
478         }
479     }
480
481     grouping hwvtep-arp-sources-attributes {
482         description "AP Sources table attributes";
483         leaf arp-sources-uuid {
484             description "The unique identifier of the arp-source";
485             type yang:uuid;
486         }
487         leaf src-mac {
488             description "Source mac to be used by given tep";
489             type inet:ip-address;
490         }
491         uses hwvtep-physical-locator-attributes;
492     }
493
494     grouping hwvtep-acl-entry-attributes {
495         description "ACL Entry attributes";
496         leaf sequence {
497             description "integer. Sequence number for ACL entry";
498             type uint32 {
499                 range "0..max";
500             }
501         }
502         leaf acl-entry-uuid {
503             description "The unique identifier of the acl-entry";
504             type yang:uuid;
505         }
506         leaf acl-entry-ref {
507             type ietf-acl-entry-ref;
508         }
509         list acle-fault-status {
510             config false;
511             key "acle-fault-status-key";
512             leaf acle-fault-status-key {
513                 description "acle-fault-status name/key";
514                 type string;
515             }
516             leaf acle-fault-status-value {
517                 description "acle-fault-status value: can be empty/None";
518                 type string;
519             }
520         }
521     }
522
523     grouping hwvtep-acl-attributes {
524         description "ACL attributes";
525         leaf acl-name {
526             description "Name of the ACL";
527             type string;
528         }
529         leaf acl-uuid {
530             description "The unique identifier of the acl";
531             type yang:uuid;
532         }
533         list acl-entries {
534             uses hwvtep-acl-entry-attributes;
535         }
536         list acl-fault-status {
537             config false;
538             key "acl-fault-status-key";
539             leaf acl-fault-status-key {
540                 description "acl-fault-status name/key";
541                 type string;
542             }
543             leaf acl-fault-status-value {
544                 description "acl-fault-status value: can be empty/None";
545                 type hwvtep-acl-ref;
546             }
547         }
548     }
549
550     grouping hwvtep-logical-binding-stats-attributes {
551         leaf logical-binding-stats-uuid {
552             description "A unique identifier of the logical binding stats";
553             type yang:uuid;
554         }
555         leaf packets-from-local {
556             description "integer";
557             type uint32;
558         }
559         leaf bytes-from-local {
560             description "integer";
561             type uint32;
562         }
563         leaf packets-to-local {
564             description "integer";
565             type uint32;
566         }
567         leaf bytes-to-local {
568             description "integer";
569             type uint32;
570         }
571     }
572
573     augment "/topo:network-topology/topo:topology/topo:node" {
574         description "Augmentation for physical switch nodes managed by hwvtep";
575         ext:augment-identifier "physical-switch-augmentation";
576         uses hwvtep-physical-switch-attributes;
577     }
578
579     augment "/topo:network-topology/topo:topology/topo:node" {
580         description "Augment topology node for a hwvtep node";
581         ext:augment-identifier "hwvtep-global-augmentation";
582         uses hwvtep-global-attributes;
583     }
584
585     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
586         description "Augment topology node termination-point for a hwvtep physical-locator";
587         ext:augment-identifier "hwvtep-physical-locator-augmentation";
588         uses hwvtep-physical-locator-attributes;
589     }
590
591     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
592         description "Augment topology node termination-point for a hwvtep physical-port";
593         ext:augment-identifier "hwvtep-physical-port-augmentation";
594         uses hwvtep-physical-port-attributes;
595     }
596 }