Yang changes and cleanup
[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 hwvtep-node-name;
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-physical-locator-set-ref {
32         description "A reference to a set of endpoints to which logical switch traffic may be encapsulated and forwarded via replication";
33         type instance-identifier;
34     }
35
36     typedef hwvtep-global-ref {
37         description "A reference to an hwvtep global node";
38         type instance-identifier;
39     }
40
41     typedef hwvtep-node-name {
42         type string;
43     }
44
45     grouping hwvtep-node-identification {
46         leaf hwvtep-node-name {
47             description "The name of the node";
48             type hwvtep-node-name;
49         }
50         leaf hwvtep-node-description {
51             description "The description of the node";
52             type string;
53         }
54     }
55
56     grouping hwvtep-mac-table-generic-attributes {
57         leaf mac-entry-key {
58             description "MAC address entry";
59             type yang:mac-address;
60         }
61         leaf logical-switch-ref {
62             description "The logical switch to which this mapping applies";
63             type hwvtep-logical-switch-ref;
64         }
65     }
66
67     grouping hwvtep-ucast-mac-table-attributes {
68         description "Unicast mac table attributes";
69         leaf ipaddr {
70             description "Optional IP address associated with the mac";
71             type inet:ip-address;
72         }
73         leaf locator-ref {
74             description "Reference to the physical locator to reach this entry";
75             type hwvtep-physical-locator-ref;
76         }
77     }
78
79     grouping hwvtep-mcast-mac-table-attributes {
80         description "Multicast mac table attributes";
81         leaf ipaddr {
82             description "Optional IP address associated with the mac";
83             type inet:ip-address;
84         }
85         uses hwvtep-physical-locator-set-attributes;
86     }
87
88     grouping hwvtep-tunnel-attributes {
89         leaf tunnel-uuid {
90             description "The unique identifier of the tunnel";
91             type yang:uuid;
92         }
93         leaf local-locator-ref {
94             description "Reference to the physical locator to reach this entry";
95             type hwvtep-physical-locator-ref;
96         }
97         leaf remote-locator-ref {
98             description "Reference to the physical locator to reach this entry";
99             type hwvtep-physical-locator-ref;
100         }
101         leaf bfd-config-local {
102             type string;
103         }
104         leaf bfd-config-remote {
105             type string;
106         }
107         leaf bfd-params {
108             type string;
109         }
110     }
111
112     grouping hwvtep-physical-switch-attributes {
113         uses hwvtep-node-identification;
114
115         leaf physical-switch-uuid {
116             description "The unique identifier of the physical-switch";
117             type yang:uuid;
118         }
119         list management-ips {
120             key "management-ips-key";
121             leaf management-ips-key {
122                description "Management IP address of the switch";
123                type inet:ip-address;
124             }
125         }
126         leaf managed-by {
127             description "The hwvtep global node to which this physical switch belongs to";
128             type hwvtep-global-ref;
129         }
130         list tunnel-ips {
131             key "tunnel-ips-key";
132             leaf tunnel-ips-key {
133                description "Management IP address of the switch";
134                type inet:ip-address;
135             }
136         }
137         list tunnels {
138             uses hwvtep-tunnel-attributes ;
139         }
140     }
141
142     grouping hwvtep-connection-info-attributes {
143         leaf remote-ip {
144             type inet:ip-address;
145             description "Hwvtep Connection Remote IP";
146         }
147         leaf remote-port {
148             type inet:port-number;
149             description "Hwvtep Connection Remote Port Number";
150         }
151         leaf local-ip {
152             type inet:ip-address;
153             description "Hwvtep Connection Local IP";
154         }
155         leaf local-port {
156             type inet:port-number;
157             description "Hwvtep Connection Local Port Number IP";
158         }
159     }
160
161     grouping hwvtep-global-attributes {
162         description "global node for the hwvtep";
163         container connection-info {
164             uses hwvtep-connection-info-attributes;
165         }
166         list managers {
167             description "";
168             key "target";
169             leaf target {
170                 description "Uri indicating connection method to the Manager";
171                 type inet:uri;
172             }
173             leaf manager-uuid {
174                 description "The unique identifier of the manager";
175                 type yang:uuid;
176             }
177             leaf is-connected {
178                 type boolean;
179             }
180             list manager-other-configs {
181                 description "Key-value pairs for configuring rarely used features.
182                     other_config : dscp : optional string
183                     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.";
184                 key "other-config-key";
185                 leaf other-config-key {
186                     description "other-config name/key";
187                     type string;
188                 }
189                 leaf other-config-value {
190                     description "other-config value";
191                     type string;
192                 }
193             }
194         }
195         list switches {
196             description "List of physical switches managed by this node";
197             key "switch-ref";
198             leaf switch-ref {
199                 type hwvtep-physical-switch-ref;
200             }
201         }
202         list logical-switches {
203             key "hwvtep-node-name";
204             uses hwvtep-logical-switch-attributes;
205         }
206         list local-ucast-macs {
207             key "mac-entry-key";
208             uses hwvtep-mac-table-generic-attributes;
209             uses hwvtep-ucast-mac-table-attributes;
210         }
211         list remote-ucast-macs {
212             key "mac-entry-key";
213             uses hwvtep-mac-table-generic-attributes;
214             uses hwvtep-ucast-mac-table-attributes;
215         }
216         list local-mcast-macs {
217             key "mac-entry-key";
218             uses hwvtep-mac-table-generic-attributes;
219             uses hwvtep-mcast-mac-table-attributes;
220         }
221         list remote-mcast-macs{
222             key "mac-entry-key";
223             uses hwvtep-mac-table-generic-attributes;
224             uses hwvtep-mcast-mac-table-attributes;
225         }
226     }
227
228     identity encapsulation-type-base {
229         description "Base Encapsulation type";
230     }
231
232     identity encapsulation-type-vxlan-over-ipv4 {
233         base encapsulation-type-base;
234         description "Encapsulation type vxlan-over-ipv4";
235     }
236
237     typedef encapsulation-type {
238         type identityref {
239             base encapsulation-type-base;
240         }
241         description "This type is used to refer to an Encapsulation Type.";
242     }
243
244     grouping hwvtep-physical-locator-attributes {
245         leaf physical-locator-uuid {
246             description "The unique identifier of the physical-locator";
247             type yang:uuid;
248         }
249         leaf encapsulation-type {
250             type encapsulation-type;
251             description "Encapsulation type used by this locator";
252         }
253         leaf dst-ip {
254             type inet:ip-address;
255             description "IP address of the locator";
256         }
257     }
258
259     grouping hwvtep-physical-locator-set-attributes {
260         list locator-set {
261             leaf locator-ref {
262                 type hwvtep-physical-locator-ref;
263             }
264         }
265     }
266
267     grouping hwvtep-logical-switch-attributes {
268         uses hwvtep-node-identification;
269         leaf logical-switch-uuid {
270             description "A unique identifier of the logical switch";
271             type yang:uuid;
272         }
273         leaf tunnel-key {
274             description "Per Logical Switch tunnel key";
275             type string;
276         }
277     }
278
279     grouping hwvtep-physical-port-attributes {
280         uses hwvtep-node-identification;
281         list vlan-bindings {
282             description "A map of vlan ID to logical switch pairs";
283             key "vlan-id-key";
284             leaf vlan-id-key {
285                 description "vlan ids in the range 0 - 4095";
286                 type ethertype:vlan-id;
287             }
288             leaf logical-switch-ref {
289                 description "Reference to logical switch for the vlan";
290                 type hwvtep-logical-switch-ref;
291             }
292             leaf physical-port-uuid {
293                 description "The unique identifier of the physical-port";
294                 type yang:uuid;
295             }
296         }
297     }
298
299     augment "/topo:network-topology/topo:topology/topo:node" {
300         description "Augmentation for physical switch nodes managed by hwvtep";
301         ext:augment-identifier "physical-switch-augmentation";
302         uses hwvtep-physical-switch-attributes;
303     }
304
305     augment "/topo:network-topology/topo:topology/topo:node" {
306         description "Augment topology node for a hwvtep node";
307         ext:augment-identifier "hwvtep-global-augmentation";
308         uses hwvtep-global-attributes;
309     }
310
311     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
312         description "Augment topology node termination-point for a hwvtep physical-locator";
313         ext:augment-identifier "hwvtep-physical-locator-augmentation";
314         uses hwvtep-physical-locator-attributes;
315     }
316
317     augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
318         description "Augment topology node termination-point for a hwvtep physical-port";
319         ext:augment-identifier "hwvtep-physical-port-augmentation";
320         uses hwvtep-physical-port-attributes;
321     }
322 }