NETVIRT-1519: MIP entry duplicated in FIB
[netvirt.git] / neutronvpn / api / src / main / yang / neutronvpn.yang
1
2 module neutronvpn {
3
4     namespace "urn:opendaylight:netvirt:neutronvpn";
5     prefix neutronvpn;
6
7     import ietf-yang-types { prefix yang; revision-date "2013-07-15";}
8
9     revision "2015-06-02" {
10         description "Neutron based L3Service Module, provides integration of ODL VPN service with Neutron NSF";
11     }
12
13     container subnetmaps{
14         list subnetmap {
15             key id;
16             leaf id {
17                 type    yang:uuid;
18                 description "UUID representing the subnet ";
19             }
20
21             leaf subnet-ip {
22                 type    string;
23                 description "Specifies the subnet IP in CIDR format";
24             }
25
26             uses network-attributes;
27
28             leaf tenant-id {
29                 type    yang:uuid;
30                 description "The UUID of the tenant that will own the subnet.";
31             }
32
33             leaf router-id {
34                 type    yang:uuid;
35                 description "router to which this subnet belongs";
36             }
37
38             leaf router-interface-port-id {
39                 type    yang:uuid;
40                 description "port corresponding to router interface on this subnet";
41             }
42
43             leaf router-intf-mac-address {
44                 type    string;
45                 description "router interface mac address on this subnet";
46             }
47
48             leaf router-interface-fixed-ip {
49                 type    string;
50                 description "fixed ip of the router interface port on this subnet";
51             }
52
53             leaf vpn-id {
54                 type    yang:uuid;
55                 description "VPN to which this subnet belongs";
56             }
57
58             leaf internet-vpn-id {
59                 type    yang:uuid;
60                 description "internet VPN to which this IPv6 subnet belongs";
61             }
62
63             leaf-list port-list {
64                 type yang:uuid;
65             }
66
67             leaf-list direct-port-list{
68                 type yang:uuid;
69             }
70         }
71     }
72
73     container networkMaps{
74         list networkMap {
75             key network-id;
76
77             leaf network-id {
78                 type    yang:uuid;
79                 description "UUID representing the network";
80             }
81
82             leaf-list subnet-id-list {
83                 type    yang:uuid;
84                 description "List of UUIDs representing the subnets associated to the network";
85             }
86         }
87     }
88
89     grouping vpn-instance{
90
91         leaf id {
92             mandatory "true";
93             type    yang:uuid;
94             description "vpn-id";
95         }
96
97         leaf name {
98           type    string;
99           description "VPN name";
100         }
101
102         leaf tenant-id {
103             type    yang:uuid;
104             description "The UUID of the tenant that will own the subnet.";
105         }
106
107         leaf-list route-distinguisher {
108             type string;
109             description
110             "configures a route distinguisher (RD) for the VPN instance.
111              Format is ASN:nn or IP-address:nn.";
112         }
113
114         leaf-list import-RT {
115             type string;
116             description
117             "configures a list of import route target.
118              Format is ASN:nn or IP-address:nn.";
119         }
120
121         leaf-list export-RT{
122             type string;
123             description
124             "configures a list of export route targets.
125              Format is ASN:nn or IP-address:nn.";
126         }
127
128         list router-ids {
129            key "router-id";
130            leaf router-id {
131                type yang:uuid;
132                description "UUID of router ";
133           }
134         }
135
136         leaf-list network-ids {
137           type    yang:uuid;
138           description "UUID representing the network ";
139         }
140
141         leaf l3vni {
142            type uint32;
143         }
144     }
145
146     grouping network-attributes {
147         leaf network-id {
148             type    yang:uuid;
149             description "UUID representing the network";
150         }
151         leaf network-type {
152             type enumeration {
153                 enum "FLAT";
154                 enum "VLAN";
155                 enum "VXLAN";
156                 enum "GRE";
157             }
158         }
159         leaf segmentation-id {
160             type uint32;
161             description "Optional. Isolated segment on the physical network.
162                 If segment-type is vlan, this ID is a vlan identifier.
163                 If segment-type is vxlan, this ID is a vni.
164                 If segment-type is flat/gre, this ID is set to 0";
165         }
166     }
167
168     container vpnMaps {
169         list vpnMap {
170             key vpn-id;
171             leaf vpn-id {
172                 type    yang:uuid;
173                 description "vpn-id";
174             }
175             leaf name {
176                 type  string;
177                 description "vpn name";
178             }
179             leaf tenant-id {
180                 type    yang:uuid;
181                 description "The UUID of the tenant that will own the subnet.";
182             }
183
184             list router-ids {
185                key "router-id";
186                leaf router-id {
187                    type yang:uuid;
188                    description "UUID of router ";
189               }
190             }
191             leaf-list network_ids {
192               type    yang:uuid;
193               description "UUID representing the network ";
194             }
195         }
196     }
197
198     /* Data models to adhere to restart requirements */
199     container neutron-vpn-portip-port-data {
200         config true;
201         list vpn-portip-to-port {
202             key "vpn-name port-fixedip";
203             leaf vpn-name { type string;}
204             leaf port-fixedip { type string;}
205             leaf port-name { type string;}
206             leaf mac-address { type string;}
207             leaf subnet-ip { type boolean;}
208             leaf learnt-ip { type boolean; default false;}
209         }
210     }
211
212     container router-interfaces-map {
213         list router-interfaces {
214             key router-id;
215             leaf router-id { type yang:uuid; }
216             list interfaces {
217                 key interface-id;
218                 leaf interface-id { type string; }
219             }
220         }
221     }
222
223     /* container for DHCP Configuration */
224     container dhcp-config {
225         list configs {
226             leaf lease-duration {
227                 type    int32;
228                 description "default lease duration for dhcp lease.
229                              -1 means infinite";
230             }
231             leaf default-domain {
232                 type string;
233                 description "default domain-name. used in dhcp reply";
234             }
235         }
236     }
237
238     rpc createL3VPN{
239         description "Create one or more L3VPN(s)";
240         input {
241             list l3vpn {
242                 uses vpn-instance;
243             }
244         }
245         output {
246             leaf-list response {
247                 type    string;
248                 description "Status response for createVPN RPC";
249             }
250         }
251     }
252
253     rpc createEVPN {
254         description "Create one or more EVPN(s)";
255         input {
256             list evpn {
257                 uses evpn-instance;
258             }
259         }
260         output {
261             leaf-list response {
262                 type    string;
263                 description "Status response for createEVPN RPC";
264             }
265         }
266     }
267
268     grouping evpn-instance {
269
270         leaf id {
271             mandatory "true";
272             type    yang:uuid;
273             description "evpn-id";
274         }
275
276         leaf name {
277           type    string;
278           description "EVPN name";
279         }
280
281         leaf tenant-id {
282             type    yang:uuid;
283             description "The UUID of the tenant that will own the subnet.";
284         }
285
286         leaf-list route-distinguisher {
287             type string;
288             description
289             "configures a route distinguisher (RD) for the EVPN instance.
290              Format is ASN:nn or IP-address:nn.";
291         }
292
293         leaf-list import-RT {
294             type string;
295             description
296             "configures a list of import route target.
297              Format is ASN:nn or IP-address:nn.";
298         }
299
300         leaf-list export-RT{
301             type string;
302             description
303             "configures a list of export route targets.
304              Format is ASN:nn or IP-address:nn.";
305         }
306     }
307
308     rpc associateRouter {
309         description "associates a router with L3VPN";
310         input {
311             leaf vpn-id {
312                 type    yang:uuid;
313                 mandatory "true";
314                 description "vpn-id";
315             }
316             list router-ids {
317                key "router-id";
318                min-elements "1";
319                description "list of router-ids to be associated with the vpn";
320                leaf router-id {
321                    type yang:uuid;
322               }
323             }
324         }
325     }
326
327     rpc dissociateRouter {
328         description "dissociates a router with L3VPN";
329         input {
330             leaf vpn-id {
331                 type    yang:uuid;
332                 mandatory "true";
333                 description "vpn-id";
334             }
335             list router-ids {
336                key "router-id";
337                min-elements "1";
338                description "list of router-ids to be dissociated from the vpn";
339                leaf router-id {
340                    type yang:uuid;
341               }
342             }
343         }
344     }
345
346     rpc associateNetworks {
347         description "associates a list of networks with L3VPN";
348         input {
349             leaf vpn-id {
350                 type    yang:uuid;
351                 mandatory "true";
352                 description "vpn-id";
353             }
354             leaf-list network-id {
355                 type    yang:uuid;
356                 description "network-id";
357             }
358         }
359         output {
360             leaf response {
361                 type    string;
362                 description "Status response for associateNetworks RPC";
363             }
364         }
365     }
366
367     rpc dissociateNetworks{
368         description "dissociates a list of networks with L3VPN";
369         input {
370             leaf vpn-id {
371                 type    yang:uuid;
372                 mandatory "true";
373                 description "vpn-id";
374             }
375             leaf-list network-id {
376                 type    yang:uuid;
377                 description "network-id";
378             }
379         }
380         output {
381             leaf response {
382                 type    string;
383                 description "Status response for dissociateNetworks RPC";
384             }
385         }
386     }
387
388     rpc getEVPN{
389         description "returns EVPN configuration";
390         input {
391             leaf id {
392                 type    yang:uuid;
393                 description "evpn-id";
394             }
395         }
396         output {
397             list evpn-instances {
398                 uses evpn-instance;
399             }
400         }
401     }
402
403     rpc deleteEVPN{
404         description "delete EVPNs for specified Id list";
405         input {
406             leaf-list id {
407                 type    yang:uuid;
408                 description "evpn-id";
409             }
410         }
411         output {
412             leaf-list response {
413                 type    string;
414                 description "Status response for deleteEVPN RPC";
415             }
416         }
417     }
418
419     rpc deleteL3VPN{
420         description "delete VPNs for specified Id list";
421         input {
422             leaf-list id {
423                 type    yang:uuid;
424                 description "vpn-id";
425             }
426         }
427         output {
428             leaf-list response {
429                 type    string;
430                 description "Status response for deleteL3VPN RPC";
431             }
432         }
433     }
434
435     rpc getL3VPN{
436         description "returns VPN configuration";
437         input {
438             leaf id {
439                 type    yang:uuid;
440                 description "vpn-id";
441             }
442         }
443         output {
444             list l3vpn-instances {
445                 uses vpn-instance;
446             }
447         }
448     }
449
450     rpc get-fixedIPs-for-neutron-port {
451     description "returns neutron port fixed IPs";
452         input {
453             leaf port-id {
454                 type yang:uuid;
455             }
456         }
457         output {
458             leaf-list fixedIPs {
459                 type    string;
460                 description "The neutron port fixedIPs list corresponding to the port uuid";
461             }
462         }
463     }
464 }