itm and mdsal porting
[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-name-to-port-uuid {
148             key port-name;
149             leaf port-id { type yang:uuid;}
150             leaf port-name { type string;}
151         }
152         list port-fixedip-to-port-name {
153             key port-fixedip;
154             leaf port-name { type string;}
155             leaf port-fixedip { type string;}
156         }
157     }
158
159     /* container for DHCP Configuration */
160     container dhcp-config {
161         list configs {
162             leaf lease-duration {
163                 type    int32;
164                 description "default lease duration for dhcp lease.
165                              -1 means infinite";
166             }
167             leaf default-domain {
168                 type string;
169                 description "default domain-name. used in dhcp reply";
170             }
171         }
172     }
173
174     rpc createL3VPN{
175         description "Create one or more L3 VPN";
176         input {
177             list l3vpn {
178                 uses l3vpn-instance;
179             }
180         }
181         output {
182             leaf-list response {
183                 type    string;
184                 description "Status response for createVPN RPC";
185             }
186         }
187     }
188
189     rpc associateRouter {
190         description "associates a router with L3VPN";
191         input {
192             leaf vpn-id {
193                 type    yang:uuid;
194                 mandatory "true";
195                 description "vpn-id";
196             }
197             leaf router-id {
198                 type    yang:uuid;
199                 mandatory "true";
200                 description "vpn-id";
201             }
202         }
203     }
204
205     rpc dissociateRouter {
206         description "dissociates a router with L3VPN";
207         input {
208             leaf vpn-id {
209                 type    yang:uuid;
210                 mandatory "true";
211                 description "vpn-id";
212             }
213             leaf router-id {
214                 type    yang:uuid;
215                 mandatory "true";
216                 description "router-id";
217             }
218         }
219     }
220
221     rpc associateNetworks {
222         description "associates a list of networks with L3VPN";
223         input {
224             leaf vpn-id {
225                 type    yang:uuid;
226                 mandatory "true";
227                 description "vpn-id";
228             }
229             leaf-list network-id {
230                 type    yang:uuid;
231                 description "network-id";
232             }
233         }
234         output {
235             leaf response {
236                 type    string;
237                 description "Status response for associateNetworks RPC";
238             }
239         }
240     }
241
242     rpc dissociateNetworks{
243         description "dissociates a list of networks with L3VPN";
244         input {
245             leaf vpn-id {
246                 type    yang:uuid;
247                 mandatory "true";
248                 description "vpn-id";
249             }
250             leaf-list network-id {
251                 type    yang:uuid;
252                 description "network-id";
253             }
254         }
255         output {
256             leaf response {
257                 type    string;
258                 description "Status response for dissociateNetworks RPC";
259             }
260         }
261     }
262
263     rpc deleteL3VPN{
264         description "delete VPNs for specified Id list";
265         input {
266             leaf-list id {
267                 type    yang:uuid;
268                 description "vpn-id";
269             }
270         }
271         output {
272             leaf-list response {
273                 type    string;
274                 description "Status response for deleteL3VPN RPC";
275             }
276         }
277     }
278
279     rpc getL3VPN{
280         description "returns VPN configuration";
281         input {
282             leaf id {
283                 type    yang:uuid;
284                 description "vpn-id";
285             }
286         }
287         output {
288             list l3vpn-instances {
289                 uses l3vpn-instance;
290             }
291         }
292     }
293
294     rpc get-fixedIPs-for-neutron-port {
295     description "returns neutron port fixed IPs";
296         input {
297             leaf port-id {
298                 type yang:uuid;
299             }
300         }
301         output {
302             leaf-list fixedIPs {
303                 type    string;
304                 description "The neutron port fixedIPs list corresponding to the port uuid";
305             }
306         }
307     }
308
309 }