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