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