Minor yang changes in neutronvpn.yang
[netvirt.git] / vpnservice / neutronvpn / 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-list port-list {
59                 type yang:uuid;
60             }
61
62             leaf-list direct-port-list{
63                 type yang:uuid;
64             }
65         }
66     }
67
68     container networkMaps{
69         list networkMap {
70             key network-id;
71
72             leaf network-id {
73                 type    yang:uuid;
74                 description "UUID representing the network";
75             }
76
77             leaf-list subnet-id-list {
78                 type    yang:uuid;
79                 description "List of UUIDs representing the subnets associated to the network";
80             }
81         }
82     }
83
84     grouping vpn-instance{
85
86         leaf id {
87             mandatory "true";
88             type    yang:uuid;
89             description "vpn-id";
90         }
91
92         leaf name {
93           type    string;
94           description "VPN name";
95         }
96
97         leaf tenant-id {
98             type    yang:uuid;
99             description "The UUID of the tenant that will own the subnet.";
100         }
101
102         leaf-list route-distinguisher {
103             type string;
104             description
105             "configures a route distinguisher (RD) for the VPN instance.
106              Format is ASN:nn or IP-address:nn.";
107         }
108
109         leaf-list import-RT {
110             type string;
111             description
112             "configures a list of import route target.
113              Format is ASN:nn or IP-address:nn.";
114         }
115
116         leaf-list export-RT{
117             type string;
118             description
119             "configures a list of export route targets.
120              Format is ASN:nn or IP-address:nn.";
121         }
122
123         leaf router-id {
124           type    yang:uuid;
125           description "UUID of router ";
126         }
127
128         leaf-list network-ids {
129           type    yang:uuid;
130           description "UUID representing the network ";
131         }
132
133         leaf l3vni {
134            type uint32;
135         }
136     }
137
138     grouping network-attributes {
139         leaf network-id {
140             type    yang:uuid;
141             description "UUID representing the network";
142         }
143         leaf network-type {
144             type enumeration {
145                 enum "FLAT";
146                 enum "VLAN";
147                 enum "VXLAN";
148                 enum "GRE";
149             }
150         }
151         leaf segmentation-id {
152             type uint32;
153             description "Optional. Isolated segment on the physical network.
154                 If segment-type is vlan, this ID is a vlan identifier.
155                 If segment-type is vxlan, this ID is a vni.
156                 If segment-type is flat/gre, this ID is set to 0";
157         }
158     }
159
160     container vpnMaps {
161         list vpnMap {
162             key vpn-id;
163             leaf vpn-id {
164                 type    yang:uuid;
165                 description "vpn-id";
166             }
167             leaf name {
168                 type  string;
169                 description "vpn name";
170             }
171             leaf tenant-id {
172                 type    yang:uuid;
173                 description "The UUID of the tenant that will own the subnet.";
174             }
175
176             leaf router-id {
177               type    yang:uuid;
178               description "UUID of router ";
179             }
180             leaf-list network_ids {
181               type    yang:uuid;
182               description "UUID representing the network ";
183             }
184         }
185     }
186
187     /* Data models to adhere to restart requirements */
188     container neutron-vpn-portip-port-data {
189         config true;
190         list vpn-portip-to-port {
191             key "vpn-name port-fixedip";
192             leaf vpn-name { type string;}
193             leaf port-fixedip { type string;}
194             leaf port-name { type string;}
195             leaf mac-address { type string;}
196             leaf subnet-ip { type boolean;}
197         }
198     }
199
200     container router-interfaces-map {
201         list router-interfaces {
202             key router-id;
203             leaf router-id { type yang:uuid; }
204             list interfaces {
205                 key interface-id;
206                 leaf interface-id { type string; }
207             }
208         }
209     }
210
211     /* container for DHCP Configuration */
212     container dhcp-config {
213         list configs {
214             leaf lease-duration {
215                 type    int32;
216                 description "default lease duration for dhcp lease.
217                              -1 means infinite";
218             }
219             leaf default-domain {
220                 type string;
221                 description "default domain-name. used in dhcp reply";
222             }
223         }
224     }
225
226     rpc createL3VPN{
227         description "Create one or more L3VPN(s)";
228         input {
229             list l3vpn {
230                 uses vpn-instance;
231             }
232         }
233         output {
234             leaf-list response {
235                 type    string;
236                 description "Status response for createVPN RPC";
237             }
238         }
239     }
240
241     rpc createEVPN {
242         description "Create one or more EVPN(s)";
243         input {
244             list evpn {
245                 uses evpn-instance;
246             }
247         }
248         output {
249             leaf-list response {
250                 type    string;
251                 description "Status response for createEVPN RPC";
252             }
253         }
254     }
255
256     grouping evpn-instance {
257
258         leaf id {
259             mandatory "true";
260             type    yang:uuid;
261             description "evpn-id";
262         }
263
264         leaf name {
265           type    string;
266           description "EVPN name";
267         }
268
269         leaf tenant-id {
270             type    yang:uuid;
271             description "The UUID of the tenant that will own the subnet.";
272         }
273
274         leaf-list route-distinguisher {
275             type string;
276             description
277             "configures a route distinguisher (RD) for the EVPN instance.
278              Format is ASN:nn or IP-address:nn.";
279         }
280
281         leaf-list import-RT {
282             type string;
283             description
284             "configures a list of import route target.
285              Format is ASN:nn or IP-address:nn.";
286         }
287
288         leaf-list export-RT{
289             type string;
290             description
291             "configures a list of export route targets.
292              Format is ASN:nn or IP-address:nn.";
293         }
294     }
295
296     rpc associateRouter {
297         description "associates a router with L3VPN";
298         input {
299             leaf vpn-id {
300                 type    yang:uuid;
301                 mandatory "true";
302                 description "vpn-id";
303             }
304             leaf router-id {
305                 type    yang:uuid;
306                 mandatory "true";
307                 description "vpn-id";
308             }
309         }
310     }
311
312     rpc dissociateRouter {
313         description "dissociates a router with L3VPN";
314         input {
315             leaf vpn-id {
316                 type    yang:uuid;
317                 mandatory "true";
318                 description "vpn-id";
319             }
320             leaf router-id {
321                 type    yang:uuid;
322                 mandatory "true";
323                 description "router-id";
324             }
325         }
326     }
327
328     rpc associateNetworks {
329         description "associates a list of networks with L3VPN";
330         input {
331             leaf vpn-id {
332                 type    yang:uuid;
333                 mandatory "true";
334                 description "vpn-id";
335             }
336             leaf-list network-id {
337                 type    yang:uuid;
338                 description "network-id";
339             }
340         }
341         output {
342             leaf response {
343                 type    string;
344                 description "Status response for associateNetworks RPC";
345             }
346         }
347     }
348
349     rpc dissociateNetworks{
350         description "dissociates a list of networks with L3VPN";
351         input {
352             leaf vpn-id {
353                 type    yang:uuid;
354                 mandatory "true";
355                 description "vpn-id";
356             }
357             leaf-list network-id {
358                 type    yang:uuid;
359                 description "network-id";
360             }
361         }
362         output {
363             leaf response {
364                 type    string;
365                 description "Status response for dissociateNetworks RPC";
366             }
367         }
368     }
369
370     rpc getEVPN{
371         description "returns EVPN configuration";
372         input {
373             leaf id {
374                 type    yang:uuid;
375                 description "evpn-id";
376             }
377         }
378         output {
379             list evpn-instances {
380                 uses evpn-instance;
381             }
382         }
383     }
384
385     rpc deleteEVPN{
386         description "delete EVPNs for specified Id list";
387         input {
388             leaf-list id {
389                 type    yang:uuid;
390                 description "evpn-id";
391             }
392         }
393         output {
394             leaf-list response {
395                 type    string;
396                 description "Status response for deleteEVPN RPC";
397             }
398         }
399     }
400
401     rpc deleteL3VPN{
402         description "delete VPNs for specified Id list";
403         input {
404             leaf-list id {
405                 type    yang:uuid;
406                 description "vpn-id";
407             }
408         }
409         output {
410             leaf-list response {
411                 type    string;
412                 description "Status response for deleteL3VPN RPC";
413             }
414         }
415     }
416
417     rpc getL3VPN{
418         description "returns VPN configuration";
419         input {
420             leaf id {
421                 type    yang:uuid;
422                 description "vpn-id";
423             }
424         }
425         output {
426             list l3vpn-instances {
427                 uses vpn-instance;
428             }
429         }
430     }
431
432     rpc get-fixedIPs-for-neutron-port {
433     description "returns neutron port fixed IPs";
434         input {
435             leaf port-id {
436                 type yang:uuid;
437             }
438         }
439         output {
440             leaf-list fixedIPs {
441                 type    string;
442                 description "The neutron port fixedIPs list corresponding to the port uuid";
443             }
444         }
445     }
446
447     notification subnet-added-to-vpn{
448             description "new subnet added to vpn";
449             leaf subnet-id {
450                 type yang:uuid;
451             }
452             leaf subnet-ip {
453                 type string;
454             }
455             leaf vpn-name {
456                 type string;
457             }
458             leaf bgp-vpn {
459                 type boolean;
460             }
461             leaf elan-tag {
462                 type uint32;
463             }
464             uses network-attributes;
465     }
466
467     notification subnet-deleted-from-vpn{
468             description "subnet deleted from vpn";
469             leaf subnet-id {
470                 type yang:uuid;
471             }
472             leaf subnet-ip {
473                 type string;
474             }
475             leaf vpn-name {
476                 type string;
477             }
478             leaf bgp-vpn {
479                 type boolean;
480             }
481             leaf elan-tag {
482                 type uint32;
483             }
484     }
485
486     notification subnet-updated-in-vpn{
487             description "subnet updated in vpn";
488             leaf subnet-id {
489                  type yang:uuid;
490             }
491             leaf subnet-ip {
492                  type string;
493             }
494             leaf vpn-name {
495                  type string;
496             }
497             leaf bgp-vpn {
498                  type boolean;
499             }
500             leaf elan-tag {
501                 type uint32;
502             }
503     }
504
505     notification port-added-to-subnet{
506             description "port added to subnet";
507             leaf subnet-id{
508                 type yang:uuid;
509             }
510             leaf subnet-ip{
511                 type string;
512             }
513             leaf port-id{
514                 type yang:uuid;
515             }
516             leaf elan-tag {
517                 type uint32;
518             }
519     }
520
521     notification port-removed-from-subnet{
522             description "port removed from subnet";
523             leaf subnet-id{
524                 type yang:uuid;
525             }
526             leaf subnet-ip{
527                 type string;
528             }
529             leaf port-id{
530                 type yang:uuid;
531             }
532             leaf elan-tag {
533                 type uint32;
534             }
535     }
536
537     notification router-associated-to-vpn {
538             description "router association to vpn";
539             leaf router-id{
540                 type yang:uuid;
541             }
542             leaf vpn-id{
543                 type yang:uuid;
544             }
545     }
546
547     notification router-disassociated-from-vpn {
548             description "router disassociation from vpn";
549             leaf router-id{
550                 type yang:uuid;
551             }
552             leaf vpn-id{
553                 type yang:uuid;
554             }
555     }
556
557 }