18a98aa45e31eac8260dec3a27d54799ecad301d
[ovsdb.git] / southbound / southbound-api / src / main / yang / overlay.yang
1 module overlay {
2     yang-version 1;
3     namespace "urn:opendaylight:params:xml:ns:yang:overlay";
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; revision-date 2010-09-24; }
9
10     revision "2015-01-05" {
11         description "Initial revision of overlay model";
12     }
13
14
15     identity tunnel-type-base {
16         description "Base identity for all tunnel-types";
17     }
18
19     identity tunnel-type-vxlan {
20         description "Tunnel type for vxlan tunnels";
21         base tunnel-type-base;
22     }
23
24     identity tunnel-type-vxlan-gpe {
25         description "Tunnel type for vxlan tunnels";
26         base tunnel-type-base;
27     }
28
29     identity tunnel-type-gre {
30         description "Tunnel type for gre tunnels";
31         base tunnel-type-base;
32     }
33
34     grouping ip-port-locator {
35       description
36         "Data plane-locator: IP address and L4 port";
37       leaf ip {
38         type inet:ip-address;
39         description "Data-plane IP address";
40       }
41       leaf port {
42         type inet:port-number;
43         description "Data-plane port number";
44       }
45     }
46
47     grouping tunnel-type-attributes {
48         description "Common leaf for expressing tunnel-type";
49         leaf tunnel-type {
50             type identityref {
51                 base tunnel-type-base;
52             }
53         }
54     }
55
56     augment "/topo:network-topology/topo:topology/topo:node" {
57         description "Augment topology node with a list of supported-tunnel-entries";
58         ext:augment-identifier "supported-tunnels";
59         list supported-tunnel-entry {
60             uses tunnel-type-attributes;
61         }
62     }
63
64     augment "/topo:network-topology/topo:topology/topo:node/supported-tunnel-entry" {
65         description "Augment additional tunnel-parameters into the supported-tunnel-entry list";
66         ext:augment-identifier "supported-tunnels-parameters";
67         when "./tunnel-type = 'tunnel-type-gre' or
68             ./tunnel-type = 'tunnel-type-vxlan' or 
69             ./tunnel-type = 'tunnel-type-vxlan-gre'" {
70             description "Augment tunnel types that use ip-port as tunnnel parameters";
71         }
72         list ip-port-locator-entry {
73             uses ip-port-locator;
74         }
75     }
76
77     augment "/topo:network-topology/topo:topology/topo:link" {
78         description "Type of link tunnel";
79         ext:augment-identifier "tunnel";
80         uses tunnel-type-attributes;
81     }
82  
83     augment "/topo:network-topology/topo:topology/topo:link/topo:source" {
84         description "ip-port-locator for the source end of a tunnel link";
85         ext:augment-identifier "tunnel-source-parameters";
86         when "../tunnel-type = 'tunnel-type-gre' or
87             ../tunnel-type = 'tunnel-type-vxlan' or 
88             ../tunnel-type = 'tunnel-type-vxlan-gre'" {
89             description "Augment tunnel types that use ip-port as tunnnel parameters";
90         }
91         uses ip-port-locator;
92     }
93
94     augment "/topo:network-topology/topo:topology/topo:link/topo:destination" {
95         description "ip-port-locator for the source end of a tunnel link";
96         ext:augment-identifier "tunnel-dest-parameters";
97         when "../tunnel-type = 'tunnel-type-gre' or
98             ../tunnel-type = 'tunnel-type-vxlan' or 
99             ../tunnel-type = 'tunnel-type-vxlan-gre'" {
100             description "Augment tunnel types that use ip-port as tunnnel parameters";
101         }
102         uses ip-port-locator;
103     }
104
105     identity topology-type-base {
106         description "Base identity for all topology-types";
107     }
108
109     identity topology-type-overlay {
110         description "Marker to indicate a topology is of type overlay";
111         base topology-type-base;
112     }
113
114     grouping topology-type-attributes {
115         description "Attributed to indicate the topology type";
116         leaf topology-type {
117             type identityref {
118                 base topology-type-base;
119             }
120         }
121     }
122
123     augment "/topo:network-topology/topo:topology/" {
124         description "Mark type of topology";
125         ext:augment-identifier "topology-type";
126         uses topology-type-attributes; 
127     }
128 }