Bump versions by 0.1.0 for next dev cycle
[vpnservice.git] / neutronvpn / neutronvpn-api / src / main / yang / neutronvpn.yang
1
2 module neutronvpn {
3
4     namespace "urn:opendaylight:vpnservice: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
167     /* container for DHCP Configuration */
168     container dhcp-config {
169         list configs {
170             leaf lease-duration {
171                 type    int32;
172                 description "default lease duration for dhcp lease.
173                              -1 means infinite";
174             }
175             leaf default-domain {
176                 type string;
177                 description "default domain-name. used in dhcp reply";
178             }
179         }
180     }
181
182     rpc createL3VPN{
183         description "Create one or more L3 VPN";
184         input {
185             list l3vpn {
186                 uses l3vpn-instance;
187             }
188         }
189         output {
190             leaf-list response {
191                 type    string;
192                 description "Status response for createVPN RPC";
193             }
194         }
195     }
196
197     rpc associateRouter {
198         description "associates a router with L3VPN";
199         input {
200             leaf vpn-id {
201                 type    yang:uuid;
202                 mandatory "true";
203                 description "vpn-id";
204             }
205             leaf router-id {
206                 type    yang:uuid;
207                 mandatory "true";
208                 description "vpn-id";
209             }
210         }
211     }
212
213     rpc dissociateRouter {
214         description "dissociates a router with L3VPN";
215         input {
216             leaf vpn-id {
217                 type    yang:uuid;
218                 mandatory "true";
219                 description "vpn-id";
220             }
221             leaf router-id {
222                 type    yang:uuid;
223                 mandatory "true";
224                 description "router-id";
225             }
226         }
227     }
228
229     rpc associateNetworks {
230         description "associates a list of networks with L3VPN";
231         input {
232             leaf vpn-id {
233                 type    yang:uuid;
234                 mandatory "true";
235                 description "vpn-id";
236             }
237             leaf-list network-id {
238                 type    yang:uuid;
239                 description "network-id";
240             }
241         }
242         output {
243             leaf response {
244                 type    string;
245                 description "Status response for associateNetworks RPC";
246             }
247         }
248     }
249
250     rpc dissociateNetworks{
251         description "dissociates a list of networks with L3VPN";
252         input {
253             leaf vpn-id {
254                 type    yang:uuid;
255                 mandatory "true";
256                 description "vpn-id";
257             }
258             leaf-list network-id {
259                 type    yang:uuid;
260                 description "network-id";
261             }
262         }
263         output {
264             leaf response {
265                 type    string;
266                 description "Status response for dissociateNetworks RPC";
267             }
268         }
269     }
270
271     rpc deleteL3VPN{
272         description "delete VPNs for specified Id list";
273         input {
274             leaf-list id {
275                 type    yang:uuid;
276                 description "vpn-id";
277             }
278         }
279         output {
280             leaf-list response {
281                 type    string;
282                 description "Status response for deleteL3VPN RPC";
283             }
284         }
285     }
286
287     rpc getL3VPN{
288         description "returns VPN configuration";
289         input {
290             leaf id {
291                 type    yang:uuid;
292                 description "vpn-id";
293             }
294         }
295         output {
296             list l3vpn-instances {
297                 uses l3vpn-instance;
298             }
299         }
300     }
301
302     rpc get-fixedIPs-for-neutron-port {
303     description "returns neutron port fixed IPs";
304         input {
305             leaf port-id {
306                 type yang:uuid;
307             }
308         }
309         output {
310             leaf-list fixedIPs {
311                 type    string;
312                 description "The neutron port fixedIPs list corresponding to the port uuid";
313             }
314         }
315     }
316
317     notification subnet-added-to-vpn{
318             description "new subnet added to vpn";
319             leaf subnet-id {
320                 type yang:uuid;
321             }
322             leaf subnet-ip {
323                 type string;
324             }
325             leaf vpn-name {
326                 type string;
327             }
328             leaf external-vpn {
329                 type boolean;
330             }
331             leaf elan-tag {
332                 type uint32;
333             }
334     }
335
336     notification subnet-deleted-from-vpn{
337             description "subnet deleted from vpn";
338             leaf subnet-id {
339                 type yang:uuid;
340             }
341             leaf subnet-ip {
342                 type string;
343             }
344             leaf vpn-name {
345                 type string;
346             }
347             leaf external-vpn {
348                 type boolean;
349             }
350             leaf elan-tag {
351                 type uint32;
352             }
353     }
354
355     notification subnet-updated-in-vpn{
356             description "subnet updated in vpn";
357             leaf subnet-id {
358                  type yang:uuid;
359             }
360             leaf subnet-ip {
361                  type string;
362             }
363             leaf vpn-name {
364                  type string;
365             }
366             leaf external-vpn {
367                  type boolean;
368             }
369             leaf elan-tag {
370                 type uint32;
371             }
372     }
373
374     notification port-added-to-subnet{
375             description "new port added to subnet";
376             leaf subnet-id{
377                 type yang:uuid;
378             }
379             leaf subnet-ip{
380                 type string;
381             }
382             leaf port-id{
383                 type yang:uuid;
384             }
385             leaf elan-tag {
386                 type uint32;
387             }
388     }
389
390     notification port-removed-from-subnet{
391             description "port removed from subnet";
392             leaf subnet-id{
393                 type yang:uuid;
394             }
395             leaf subnet-ip{
396                 type string;
397             }
398             leaf port-id{
399                 type yang:uuid;
400             }
401             leaf elan-tag {
402                 type uint32;
403             }
404     }
405
406     notification router-associated-to-vpn {
407                 description "router association to vpn";
408                 leaf router-id{
409                     type yang:uuid;
410                 }
411                 leaf vpn-id{
412                     type yang:uuid;
413                 }
414         }
415
416         notification router-disassociated-from-vpn {
417                 description "router disassociation from vpn";
418                 leaf router-id{
419                     type yang:uuid;
420                 }
421                 leaf vpn-id{
422                     type yang:uuid;
423                 }
424         }
425
426 }