remove unnecessary @Override close()
[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"; }
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             leaf tenant-id {
27                 type    yang:uuid;
28                 description "The UUID of the tenant that will own the subnet.";
29             }
30
31             leaf network-id {
32               type    yang:uuid;
33               description "UUID representing the network ";
34             }
35
36             leaf router-id {
37               type    yang:uuid;
38               description "router to which this subnet belongs";
39             }
40
41             leaf vpn-id {
42               type    yang:uuid;
43               description "VPN to which this subnet belongs";
44             }
45
46             leaf-list port-list {
47               type yang:uuid;
48             }
49         }
50     }
51
52     container networkMaps{
53         list networkMap {
54             key network-id;
55
56             leaf network-id {
57                 type    yang:uuid;
58                 description "UUID representing the network";
59             }
60
61             leaf-list subnet-id-list {
62                 type    yang:uuid;
63                 description "List of UUIDs representing the subnets associated to the network";
64             }
65         }
66     }
67
68     grouping l3vpn-instance{
69
70         leaf id {
71             mandatory "true";
72             type    yang:uuid;
73             description "vpn-id";
74         }
75
76         leaf name {
77           type    string;
78           description "VPN name";
79         }
80
81         leaf tenant-id {
82             type    yang:uuid;
83             description "The UUID of the tenant that will own the subnet.";
84         }
85
86         leaf-list route-distinguisher {
87             type string;
88             description
89             "configures a route distinguisher (RD) for the VPN instance.
90              Format is ASN:nn or IP-address:nn.";
91         }
92
93         leaf-list import-RT {
94             type string;
95             description
96             "configures a list of import route target.
97              Format is ASN:nn or IP-address:nn.";
98         }
99
100         leaf-list export-RT{
101             type string;
102             description
103             "configures a list of export route targets.
104              Format is ASN:nn or IP-address:nn.";
105         }
106
107         leaf router-id {
108           type    yang:uuid;
109           description "UUID of router ";
110         }
111
112         leaf-list network-ids {
113           type    yang:uuid;
114           description "UUID representing the network ";
115         }
116     }
117
118     container vpnMaps {
119         list vpnMap {
120             key vpn-id;
121             leaf vpn-id {
122                 type    yang:uuid;
123                 description "vpn-id";
124             }
125             leaf name {
126                 type  string;
127                 description "vpn name";
128             }
129             leaf tenant-id {
130                 type    yang:uuid;
131                 description "The UUID of the tenant that will own the subnet.";
132             }
133
134             leaf router-id {
135               type    yang:uuid;
136               description "UUID of router ";
137             }
138             leaf-list network_ids {
139               type    yang:uuid;
140               description "UUID representing the network ";
141             }
142         }
143     }
144
145     /* Data models to adhere to restart requirements */
146     container neutron-port-data {
147         list port-fixedip-to-port-name {
148             key port-fixedip;
149             leaf port-name { type string;}
150             leaf port-fixedip { type string;}
151         }
152     }
153
154
155     container router-interfaces-map {
156         list router-interfaces {
157             key router-id;
158             leaf router-id { type yang:uuid; }
159             list interfaces {
160                 key interface-id;
161                 leaf interface-id { type string; }
162             }
163         }
164     }
165
166     /* container to maintain mapping between neutron router and DPN(s) on which vpn-interfaces for router are present
167     container neutron-router-dpns {
168         list router-dpn-list {
169             key router-id;
170             leaf router-id { type yang:uuid;}
171             list dpn-vpninterfaces-list {
172                 key dpn-id;
173                 leaf dpn-id { type uint64;}
174                 leaf-list vpninterfaces-list { type yang:uuid;}
175             }
176         }
177     }
178
179     /* container for DHCP Configuration */
180     container dhcp-config {
181         list configs {
182             leaf lease-duration {
183                 type    int32;
184                 description "default lease duration for dhcp lease.
185                              -1 means infinite";
186             }
187             leaf default-domain {
188                 type string;
189                 description "default domain-name. used in dhcp reply";
190             }
191         }
192     }
193
194     rpc createL3VPN{
195         description "Create one or more L3 VPN";
196         input {
197             list l3vpn {
198                 uses l3vpn-instance;
199             }
200         }
201         output {
202             leaf-list response {
203                 type    string;
204                 description "Status response for createVPN RPC";
205             }
206         }
207     }
208
209     rpc associateRouter {
210         description "associates a router with L3VPN";
211         input {
212             leaf vpn-id {
213                 type    yang:uuid;
214                 mandatory "true";
215                 description "vpn-id";
216             }
217             leaf router-id {
218                 type    yang:uuid;
219                 mandatory "true";
220                 description "vpn-id";
221             }
222         }
223     }
224
225     rpc dissociateRouter {
226         description "dissociates a router with L3VPN";
227         input {
228             leaf vpn-id {
229                 type    yang:uuid;
230                 mandatory "true";
231                 description "vpn-id";
232             }
233             leaf router-id {
234                 type    yang:uuid;
235                 mandatory "true";
236                 description "router-id";
237             }
238         }
239     }
240
241     rpc associateNetworks {
242         description "associates a list of networks with L3VPN";
243         input {
244             leaf vpn-id {
245                 type    yang:uuid;
246                 mandatory "true";
247                 description "vpn-id";
248             }
249             leaf-list network-id {
250                 type    yang:uuid;
251                 description "network-id";
252             }
253         }
254         output {
255             leaf response {
256                 type    string;
257                 description "Status response for associateNetworks RPC";
258             }
259         }
260     }
261
262     rpc dissociateNetworks{
263         description "dissociates a list of networks with L3VPN";
264         input {
265             leaf vpn-id {
266                 type    yang:uuid;
267                 mandatory "true";
268                 description "vpn-id";
269             }
270             leaf-list network-id {
271                 type    yang:uuid;
272                 description "network-id";
273             }
274         }
275         output {
276             leaf response {
277                 type    string;
278                 description "Status response for dissociateNetworks RPC";
279             }
280         }
281     }
282
283     rpc deleteL3VPN{
284         description "delete VPNs for specified Id list";
285         input {
286             leaf-list id {
287                 type    yang:uuid;
288                 description "vpn-id";
289             }
290         }
291         output {
292             leaf-list response {
293                 type    string;
294                 description "Status response for deleteL3VPN RPC";
295             }
296         }
297     }
298
299     rpc getL3VPN{
300         description "returns VPN configuration";
301         input {
302             leaf id {
303                 type    yang:uuid;
304                 description "vpn-id";
305             }
306         }
307         output {
308             list l3vpn-instances {
309                 uses l3vpn-instance;
310             }
311         }
312     }
313
314     rpc get-fixedIPs-for-neutron-port {
315     description "returns neutron port fixed IPs";
316         input {
317             leaf port-id {
318                 type yang:uuid;
319             }
320         }
321         output {
322             leaf-list fixedIPs {
323                 type    string;
324                 description "The neutron port fixedIPs list corresponding to the port uuid";
325             }
326         }
327     }
328
329     notification subnet-added-to-vpn{
330             description "new subnet added to vpn";
331             leaf subnet-id {
332                 type yang:uuid;
333             }
334             leaf subnet-ip {
335                 type string;
336             }
337             leaf vpn-name {
338                 type string;
339             }
340             leaf external-vpn {
341                 type boolean;
342             }
343             leaf elan-tag {
344                 type uint32;
345             }
346     }
347
348     notification subnet-deleted-from-vpn{
349             description "subnet deleted from vpn";
350             leaf subnet-id {
351                 type yang:uuid;
352             }
353             leaf subnet-ip {
354                 type string;
355             }
356             leaf vpn-name {
357                 type string;
358             }
359             leaf external-vpn {
360                 type boolean;
361             }
362             leaf elan-tag {
363                 type uint32;
364             }
365     }
366
367     notification subnet-updated-in-vpn{
368             description "subnet updated in vpn";
369             leaf subnet-id {
370                  type yang:uuid;
371             }
372             leaf subnet-ip {
373                  type string;
374             }
375             leaf vpn-name {
376                  type string;
377             }
378             leaf external-vpn {
379                  type boolean;
380             }
381             leaf elan-tag {
382                 type uint32;
383             }
384     }
385
386     notification port-added-to-subnet{
387             description "new port added to subnet";
388             leaf subnet-id{
389                 type yang:uuid;
390             }
391             leaf subnet-ip{
392                 type string;
393             }
394             leaf port-id{
395                 type yang:uuid;
396             }
397             leaf elan-tag {
398                 type uint32;
399             }
400     }
401
402     notification port-removed-from-subnet{
403             description "port removed from subnet";
404             leaf subnet-id{
405                 type yang:uuid;
406             }
407             leaf subnet-ip{
408                 type string;
409             }
410             leaf port-id{
411                 type yang:uuid;
412             }
413             leaf elan-tag {
414                 type uint32;
415             }
416     }
417
418     notification router-associated-to-vpn {
419             description "router association to vpn";
420             leaf router-id{
421                 type yang:uuid;
422             }
423             leaf vpn-id{
424                 type yang:uuid;
425             }
426     }
427
428     notification router-disassociated-from-vpn {
429             description "router disassociation from vpn";
430             leaf router-id{
431                 type yang:uuid;
432             }
433             leaf vpn-id{
434                 type yang:uuid;
435             }
436     }
437
438 }