move vpnservice and cleanup poms
[netvirt.git] / elanmanager / elanmanager-api / src / main / yang / elan.yang
1 module elan {
2
3     namespace "urn:opendaylight:netvirt:elan";
4     prefix elan;
5
6     import yang-ext {prefix ext; revision-date "2013-07-09";}
7
8     import ietf-interfaces {
9         prefix if;
10     }
11     import ietf-inet-types {
12         prefix inet;
13         revision-date "2013-07-15";
14     }
15     import ietf-yang-types {
16         prefix yang;
17     }
18
19
20     revision "2015-06-02" {
21         description "elan module";
22     }
23
24     /*
25     * elan instance view.
26     */
27     container elan-instances {
28         description
29            "elan instances configuration parameters. Elan instances support both the VLAN and VNI based elans.";
30
31         list elan-instance {
32             max-elements "unbounded";
33             min-elements "0";
34             key "elan-instance-name";
35             description
36                 "Specifies the name of the elan instance. It is a string of 1 to 31
37                  case-sensitive characters.";
38             leaf elan-instance-name {
39                 type string;
40                 description "The name of the elan-instance.";
41             }
42             leaf elan-tag {
43                 type    uint32;
44                 description "ELAN unique identifier which is unique across all the tenants.
45                              This will be created internally and if provided, the value will be discarded.";
46             }
47             leaf segment-type {
48                 description "Optional. Network segment type. It's mandatory when there are external
49                                 devices participating in the ELAN";
50                 type identityref {
51                     base segment-type-base;
52                 }
53             }
54             leaf segmentation-id {
55                 type uint32;
56                 description "Optional. Isolated segment on the physical network. For example,
57                                 if segment-type is vlan, this ID is a vlan identifier. If segment-type
58                                 is vxlan, this ID is a vni";
59             }
60             leaf physical-network-name {
61                 type string;
62                 description "Optional. The name of the physical network attached to the ELAN.";
63             }
64             leaf external {
65                 description "indicates whether this is an external network";
66                 type boolean;
67                 default false;
68             }
69             leaf mac-timeout {
70                 type uint32 {
71                     range "0..65535";
72                 }
73                 description "MAC Table entry ageing time in seconds.
74                              A value of 0 will indicate that the MAC will never expire.";
75             }
76             leaf description {
77                 description
78                     "A textual description of elan instance, the elan instance description
79                     helps users memorize the elan instance.";
80
81                 type string {
82                     length "1..254";
83                 }
84             }
85             list elan-segments {
86                 description "List of provider network(s) associated with this ELAN.";
87                 key segmentation-index;
88                 leaf segmentation-index {
89                     description "A hidden counter to act as a key, because segmentation id
90                     is not required.";
91                     type uint32;
92                 }
93                 leaf physical-network-name {
94                     description "Optional. The name of the physical network attached to the ELAN.";
95                     type string;
96                 }
97                 leaf segment-type {
98                     description "Optional. Network segment type. It's mandatory when there are external
99                                 devices participating in the ELAN";
100                     type identityref {
101                         base segment-type-base;
102                     }
103                 }
104                 leaf segmentation-id {
105                     description "Optional. Isolated segment on the physical network. For example,
106                                 if segment-type is vlan, this ID is a vlan identifier. If segment-type
107                                 is vxlan, this ID is a vni";
108                     type uint32;
109                 }
110             }
111             list external-teps {
112                 description "Optional. The external tep ips of the nodes where this elan is present";
113                 key tep-ip;
114                 leaf tep-ip {
115                     type inet:ip-address;
116                 }
117             }
118         }
119     }
120
121   /*
122    * Binding Interfaces to a elan Instance.
123    */
124   container elan-interfaces {
125     description
126         "elan is enabled on interfaces.";
127
128     list elan-interface  {
129         key "name";
130         max-elements "unbounded";
131         min-elements "0";
132         leaf name {
133             type leafref {
134                 path "/if:interfaces/if:interface/if:name";
135             }
136         }
137         leaf elan-instance-name {
138             mandatory true;
139             type string;
140         }
141
142         list static-mac-entries {
143             key "mac-address";
144             leaf mac-address {
145                 type yang:phys-address;
146             }
147             leaf ip-prefix {
148                 type inet:ip-address;
149             }
150         }
151
152         leaf description {
153             description
154                 "A textual description of elan port, the elan port description
155                 helps users memorize the elan port.";
156
157             type string {
158                  length "1..254";
159             }
160         }
161     }
162   }
163
164     /* operational data stores */
165   container elan-state {
166     config false;
167     description
168       "operational state of elans.";
169
170     list elan {
171         key "name";
172         description "The list of interfaces on the device.";
173         max-elements "unbounded";
174         min-elements "0";
175         leaf name {
176             type string;
177             description
178               "The name of the elan-instance.";
179         }
180         leaf-list elan-interfaces{
181             type leafref {
182                 path "/if:interfaces/if:interface/if:name";
183             }
184             description "Interfaces connected to this elan instance.";
185         }
186     }
187   }
188
189   grouping forwarding-entries {
190     description "Details of the MAC entries";
191
192     list mac-entry {
193       key "mac-address";
194       description "Details of a MAC address";
195       max-elements "unbounded";
196       min-elements "0";
197
198       leaf mac-address {
199           type yang:phys-address;
200       }
201
202       leaf interface {
203          type leafref {
204              path "/if:interfaces/if:interface/if:name";
205          }
206       }
207
208       leaf controllerLearnedForwardingEntryTimestamp {
209         type uint64;
210       }
211
212       leaf isStaticAddress {
213         type boolean;
214       }
215
216       leaf ip-prefix {
217         type inet:ip-address;
218       }
219     }
220   }
221
222   container elan-forwarding-tables {
223     config false;
224     description
225       "MAC tables for each elan instance";
226
227     list mac-table {
228         max-elements "unbounded";
229         min-elements "0";
230         key "elan-instance-name";
231         description
232             "Specifies the name of the elan instance. It is a string of 1 to 31
233              case-sensitive characters.";
234
235         leaf elan-instance-name {
236             type string;
237             description
238               "The name of the elan-instance.";
239         }
240
241         uses forwarding-entries;
242     }
243   }
244
245     container elan-interface-forwarding-entries {
246         config false;
247
248         list elan-interface-mac {
249             key "elan-interface";
250             description "All the MAC addresses learned on a particular elan interface";
251             max-elements "unbounded";
252             min-elements "0";
253             leaf elan-interface {
254                 type leafref {
255                     path "/if:interfaces/if:interface/if:name";
256                 }
257             }
258
259             uses forwarding-entries;
260         }
261     }
262
263     container elan-dpn-interfaces {
264         config false;
265
266         list elan-dpn-interfaces-list {
267             key "elan-instance-name";
268             description "All the dpns of this elan and all the ports of the corresponding dpns";
269             max-elements "unbounded";
270             min-elements "0";
271
272             leaf elan-instance-name {
273                 type string;
274                 description "The name of the elan-instance.";
275             }
276
277             list dpn-interfaces {
278                 key "dp-id";
279                 description "A DPN in which the elan spans across";
280                 max-elements "unbounded";
281                 min-elements "0";
282
283                 leaf dp-id {
284                     type uint64;
285                 }
286
287                 leaf-list interfaces {
288                     type leafref {
289                         path "/if:interfaces/if:interface/if:name";
290                     }
291                 }
292             }
293         }
294     }
295
296     container elan-tag-name-map {
297         config false;
298
299         list elan-tag-name {
300             key elan-tag;
301             leaf elan-tag {
302                 type uint32;
303             }
304
305             leaf name {
306                 type string;
307                 description
308                 "The name of the elan-instance.";
309             }
310         }
311     }
312
313     augment "/elan:elan-instances/elan:elan-instance" {
314         ext:augment-identifier "evpn-augmentation";
315         leaf evpn-name {
316             type string;
317         }
318
319         leaf l3vpn-name {
320             type string;
321         }
322     }
323
324     identity segment-type-base {
325         description "Base entity for all network segment types";
326     }
327
328     identity segment-type-flat {
329         description "Flat network segment type";
330         base segment-type-base;
331     }
332
333     identity segment-type-vlan {
334         description "VLAN network segment type";
335         base segment-type-base;
336     }
337
338     identity segment-type-vxlan {
339         description "VxLAN network segment type";
340         base segment-type-base;
341     }
342
343     identity segment-type-gre {
344         description "GRE network segment type";
345         base segment-type-base;
346     }
347
348 }