ELAN FT Support for BE
[vpnservice.git] / elanmanager / elanmanager-api / src / main / yang / elan.yang
1 module elan {
2
3     namespace "urn:opendaylight:vpnservice:elan";
4     prefix elan;
5
6     import ietf-interfaces {
7         prefix if;
8     }
9
10     import ietf-yang-types {
11         prefix yang;
12     }
13
14
15     revision "2015-06-02" {
16         description "elan module";
17     }
18
19   /*
20    * elan instance view.
21    */
22   container elan-instances {
23     description
24       "elan instances configuration parameters.
25        elan instances support both the VLAN and VNI based elans.";
26
27     list elan-instance {
28         max-elements "unbounded";
29         min-elements "0";
30         key "elan-instance-name";
31         description
32             "Specifies the name of the elan instance. It is a string of 1 to 31
33              case-sensitive characters.";
34         leaf elan-instance-name {
35             type string;
36             description
37               "The name of the elan-instance.";
38         }
39         leaf elan-tag {
40             type    uint32;
41             description "ELAN unique identifier which is unique across all the tenants. This will be created internally and if provided, the value will be discarded.";
42         }
43         leaf mac-timeout {
44             type uint32 {
45               range "0..65535";
46             }
47             description "MAC Table entry ageing time in seconds. A value of 0 will indicate that the MAC will never expire.";
48         }
49         leaf description {
50             description
51                 "A textual description of elan instance, the elan instance description
52                 helps users memorize the elan instance.";
53
54             type string {
55                 length "1..254";
56             }
57         }
58     }
59   }
60
61   /*
62    * Binding Interfaces to a elan Instance.
63    */
64   container elan-interfaces {
65     description
66         "elan is enabled on interfaces.";
67
68     list elan-interface  {
69         key "name";
70         max-elements "unbounded";
71         min-elements "0";
72         leaf name {
73             type leafref {
74                 path "/if:interfaces/if:interface/if:name";
75             }
76         }
77         leaf elan-instance-name {
78             mandatory true;
79             type string;
80         }
81         leaf-list static-mac-entries {
82             type yang:phys-address;
83         }
84         leaf description {
85             description
86                 "A textual description of elan port, the elan port description
87                 helps users memorize the elan port.";
88
89             type string {
90                  length "1..254";
91             }
92         }
93     }
94   }
95
96     /* operational data stores */
97   container elan-state {
98     config false;
99     description
100       "operational state of elans.";
101
102     list elan {
103         key "name";
104         description "The list of interfaces on the device.";
105         max-elements "unbounded";
106         min-elements "0";
107         leaf name {
108             type string;
109             description
110               "The name of the elan-instance.";
111         }
112         leaf-list elan-interfaces{
113             type leafref {
114                 path "/if:interfaces/if:interface/if:name";
115             }
116             description "Interfaces connected to this elan instance.";
117         }
118     }
119   }
120
121   grouping forwarding-entries {
122     description "Details of the MAC entries";
123
124     list mac-entry {
125       key "mac-address";
126       description "Details of a MAC address";
127       max-elements "unbounded";
128       min-elements "0";
129
130       leaf mac-address {
131           type yang:phys-address;
132       }
133
134       leaf interface {
135          type leafref {
136              path "/if:interfaces/if:interface/if:name";
137          }
138       }
139
140       leaf controllerLearnedForwardingEntryTimestamp {
141         type uint64;
142       }
143
144       leaf isStaticAddress {
145         type boolean;
146       }
147     }
148   }
149
150   container elan-forwarding-tables {
151     config false;
152     description
153       "MAC tables for each elan instance";
154
155     list mac-table {
156         max-elements "unbounded";
157         min-elements "0";
158         key "elan-instance-name";
159         description
160             "Specifies the name of the elan instance. It is a string of 1 to 31
161              case-sensitive characters.";
162
163         leaf elan-instance-name {
164             type string;
165             description
166               "The name of the elan-instance.";
167         }
168
169         uses forwarding-entries;
170     }
171   }
172
173     container elan-interface-forwarding-entries {
174         config false;
175
176         list elan-interface-mac {
177             key "elan-interface";
178             description "All the MAC addresses learned on a particular elan interface";
179             max-elements "unbounded";
180             min-elements "0";
181             leaf elan-interface {
182                 type leafref {
183                     path "/if:interfaces/if:interface/if:name";
184                 }
185             }
186
187             uses forwarding-entries;
188         }
189     }
190
191     container elan-dpn-interfaces {
192         config false;
193
194         list elan-dpn-interfaces-list {
195             key "elan-instance-name";
196             description "All the dpns of this elan and all the ports of the corresponding dpns";
197             max-elements "unbounded";
198             min-elements "0";
199
200             leaf elan-instance-name {
201                 type string;
202                 description "The name of the elan-instance.";
203             }
204
205             list dpn-interfaces {
206                 key "dp-id";
207                 description "A DPN in which the elan spans across";
208                 max-elements "unbounded";
209                 min-elements "0";
210
211                 leaf dp-id {
212                     type uint64;
213                 }
214
215                 leaf-list interfaces {
216                     type leafref {
217                         path "/if:interfaces/if:interface/if:name";
218                     }
219                 }
220             }
221         }
222     }
223
224     container elan-tag-name-map {
225         config false;
226
227         list elan-tag-name {
228             key elan-tag;
229             leaf elan-tag {
230                 type uint32;
231             }
232
233             leaf name {
234                 type string;
235                 description
236                 "The name of the elan-instance.";
237             }
238         }
239     }
240 }