Fix build faliures due to OFPlugin checktyle fixes
[netvirt.git] / 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 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         leaf router-id {
129           type    yang:uuid;
130           description "UUID of router ";
131         }
132
133         leaf-list network-ids {
134           type    yang:uuid;
135           description "UUID representing the network ";
136         }
137
138         leaf l3vni {
139            type uint32;
140         }
141     }
142
143     grouping network-attributes {
144         leaf network-id {
145             type    yang:uuid;
146             description "UUID representing the network";
147         }
148         leaf network-type {
149             type enumeration {
150                 enum "FLAT";
151                 enum "VLAN";
152                 enum "VXLAN";
153                 enum "GRE";
154             }
155         }
156         leaf segmentation-id {
157             type uint32;
158             description "Optional. Isolated segment on the physical network.
159                 If segment-type is vlan, this ID is a vlan identifier.
160                 If segment-type is vxlan, this ID is a vni.
161                 If segment-type is flat/gre, this ID is set to 0";
162         }
163     }
164
165     container vpnMaps {
166         list vpnMap {
167             key vpn-id;
168             leaf vpn-id {
169                 type    yang:uuid;
170                 description "vpn-id";
171             }
172             leaf name {
173                 type  string;
174                 description "vpn name";
175             }
176             leaf tenant-id {
177                 type    yang:uuid;
178                 description "The UUID of the tenant that will own the subnet.";
179             }
180
181             leaf router-id {
182               type    yang:uuid;
183               description "UUID of router ";
184             }
185             leaf-list network_ids {
186               type    yang:uuid;
187               description "UUID representing the network ";
188             }
189         }
190     }
191
192     /* Data models to adhere to restart requirements */
193     container neutron-vpn-portip-port-data {
194         config true;
195         list vpn-portip-to-port {
196             key "vpn-name port-fixedip";
197             leaf vpn-name { type string;}
198             leaf port-fixedip { type string;}
199             leaf port-name { type string;}
200             leaf mac-address { type string;}
201             leaf subnet-ip { type boolean;}
202         }
203     }
204
205     container router-interfaces-map {
206         list router-interfaces {
207             key router-id;
208             leaf router-id { type yang:uuid; }
209             list interfaces {
210                 key interface-id;
211                 leaf interface-id { type string; }
212             }
213         }
214     }
215
216     /* container for DHCP Configuration */
217     container dhcp-config {
218         list configs {
219             leaf lease-duration {
220                 type    int32;
221                 description "default lease duration for dhcp lease.
222                              -1 means infinite";
223             }
224             leaf default-domain {
225                 type string;
226                 description "default domain-name. used in dhcp reply";
227             }
228         }
229     }
230
231     rpc createL3VPN{
232         description "Create one or more L3VPN(s)";
233         input {
234             list l3vpn {
235                 uses vpn-instance;
236             }
237         }
238         output {
239             leaf-list response {
240                 type    string;
241                 description "Status response for createVPN RPC";
242             }
243         }
244     }
245
246     rpc createEVPN {
247         description "Create one or more EVPN(s)";
248         input {
249             list evpn {
250                 uses evpn-instance;
251             }
252         }
253         output {
254             leaf-list response {
255                 type    string;
256                 description "Status response for createEVPN RPC";
257             }
258         }
259     }
260
261     grouping evpn-instance {
262
263         leaf id {
264             mandatory "true";
265             type    yang:uuid;
266             description "evpn-id";
267         }
268
269         leaf name {
270           type    string;
271           description "EVPN name";
272         }
273
274         leaf tenant-id {
275             type    yang:uuid;
276             description "The UUID of the tenant that will own the subnet.";
277         }
278
279         leaf-list route-distinguisher {
280             type string;
281             description
282             "configures a route distinguisher (RD) for the EVPN instance.
283              Format is ASN:nn or IP-address:nn.";
284         }
285
286         leaf-list import-RT {
287             type string;
288             description
289             "configures a list of import route target.
290              Format is ASN:nn or IP-address:nn.";
291         }
292
293         leaf-list export-RT{
294             type string;
295             description
296             "configures a list of export route targets.
297              Format is ASN:nn or IP-address:nn.";
298         }
299     }
300
301     rpc associateRouter {
302         description "associates a router with L3VPN";
303         input {
304             leaf vpn-id {
305                 type    yang:uuid;
306                 mandatory "true";
307                 description "vpn-id";
308             }
309             leaf router-id {
310                 type    yang:uuid;
311                 mandatory "true";
312                 description "vpn-id";
313             }
314         }
315     }
316
317     rpc dissociateRouter {
318         description "dissociates a router with L3VPN";
319         input {
320             leaf vpn-id {
321                 type    yang:uuid;
322                 mandatory "true";
323                 description "vpn-id";
324             }
325             leaf router-id {
326                 type    yang:uuid;
327                 mandatory "true";
328                 description "router-id";
329             }
330         }
331     }
332
333     rpc associateNetworks {
334         description "associates a list of networks with L3VPN";
335         input {
336             leaf vpn-id {
337                 type    yang:uuid;
338                 mandatory "true";
339                 description "vpn-id";
340             }
341             leaf-list network-id {
342                 type    yang:uuid;
343                 description "network-id";
344             }
345         }
346         output {
347             leaf response {
348                 type    string;
349                 description "Status response for associateNetworks RPC";
350             }
351         }
352     }
353
354     rpc dissociateNetworks{
355         description "dissociates a list of networks with L3VPN";
356         input {
357             leaf vpn-id {
358                 type    yang:uuid;
359                 mandatory "true";
360                 description "vpn-id";
361             }
362             leaf-list network-id {
363                 type    yang:uuid;
364                 description "network-id";
365             }
366         }
367         output {
368             leaf response {
369                 type    string;
370                 description "Status response for dissociateNetworks RPC";
371             }
372         }
373     }
374
375     rpc getEVPN{
376         description "returns EVPN configuration";
377         input {
378             leaf id {
379                 type    yang:uuid;
380                 description "evpn-id";
381             }
382         }
383         output {
384             list evpn-instances {
385                 uses evpn-instance;
386             }
387         }
388     }
389
390     rpc deleteEVPN{
391         description "delete EVPNs for specified Id list";
392         input {
393             leaf-list id {
394                 type    yang:uuid;
395                 description "evpn-id";
396             }
397         }
398         output {
399             leaf-list response {
400                 type    string;
401                 description "Status response for deleteEVPN RPC";
402             }
403         }
404     }
405
406     rpc deleteL3VPN{
407         description "delete VPNs for specified Id list";
408         input {
409             leaf-list id {
410                 type    yang:uuid;
411                 description "vpn-id";
412             }
413         }
414         output {
415             leaf-list response {
416                 type    string;
417                 description "Status response for deleteL3VPN RPC";
418             }
419         }
420     }
421
422     rpc getL3VPN{
423         description "returns VPN configuration";
424         input {
425             leaf id {
426                 type    yang:uuid;
427                 description "vpn-id";
428             }
429         }
430         output {
431             list l3vpn-instances {
432                 uses vpn-instance;
433             }
434         }
435     }
436
437     rpc get-fixedIPs-for-neutron-port {
438     description "returns neutron port fixed IPs";
439         input {
440             leaf port-id {
441                 type yang:uuid;
442             }
443         }
444         output {
445             leaf-list fixedIPs {
446                 type    string;
447                 description "The neutron port fixedIPs list corresponding to the port uuid";
448             }
449         }
450     }
451
452     notification router-associated-to-vpn {
453             description "router association to vpn";
454             leaf router-id{
455                 type yang:uuid;
456             }
457             leaf vpn-id{
458                 type yang:uuid;
459             }
460     }
461
462     notification router-disassociated-from-vpn {
463             description "router disassociation from vpn";
464             leaf router-id{
465                 type yang:uuid;
466             }
467             leaf vpn-id{
468                 type yang:uuid;
469             }
470     }
471
472 }