Merge "ITM changes - namespace change in config xml. - Tunnel interface name is trunc...
[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 tenant-id {
22                 type    yang:uuid;
23                 description "The UUID of the tenant that will own the subnet.";
24             }
25
26             leaf network-id {
27               type    yang:uuid;
28               description "UUID representing the network ";
29             }
30
31             leaf router-id {
32               type    yang:uuid;
33               description "router to which this subnet belongs";
34             }
35
36             leaf vpn-id {
37               type    yang:uuid;
38               description "VPN to which this subnet belongs";
39             }
40
41             leaf-list port-list {
42               type yang:uuid;
43             }
44         }
45     }
46
47     container networkMaps{
48         list networkMap {
49             key network-id;
50
51             leaf network-id {
52                 type    yang:uuid;
53                 description "UUID representing the network";
54             }
55
56             leaf-list subnet-id-list {
57                 type    yang:uuid;
58                 description "List of UUIDs representing the subnets associated to the network";
59             }
60         }
61     }
62
63     grouping l3vpn-instance{
64
65         leaf id {
66             mandatory "true";
67             type    yang:uuid;
68             description "vpn-id";
69         }
70
71         leaf name {
72           type    string;
73           description "VPN name";
74         }
75
76         leaf tenant-id {
77             type    yang:uuid;
78             description "The UUID of the tenant that will own the subnet.";
79         }
80
81         leaf-list route-distinguisher {
82             type string;
83             description
84             "configures a route distinguisher (RD) for the VPN instance.
85              Format is ASN:nn or IP-address:nn.";
86         }
87
88         leaf-list import-RT {
89             type string;
90             description
91             "configures a list of import route target.
92              Format is ASN:nn or IP-address:nn.";
93         }
94
95         leaf-list export-RT{
96             type string;
97             description
98             "configures a list of export route targets.
99              Format is ASN:nn or IP-address:nn.";
100         }
101
102         leaf router-id {
103           type    yang:uuid;
104           description "UUID of router ";
105         }
106
107         leaf-list network-ids {
108           type    yang:uuid;
109           description "UUID representing the network ";
110         }
111     }
112
113     container vpnMaps {
114         list vpnMap {
115             key vpn-id;
116             leaf vpn-id {
117                 type    yang:uuid;
118                 description "vpn-id";
119             }
120             leaf name {
121                 type  string;
122                 description "vpn name";
123             }
124             leaf tenant-id {
125                 type    yang:uuid;
126                 description "The UUID of the tenant that will own the subnet.";
127             }
128
129             leaf router-id {
130               type    yang:uuid;
131               description "UUID of router ";
132             }
133             leaf-list network_ids {
134               type    yang:uuid;
135               description "UUID representing the network ";
136             }
137         }
138     }
139
140     /* Data models to adhere to restart requirements */
141     container neutron-port-data {
142         list port-name-to-port-uuid {
143             key port-name;
144             leaf port-id { type yang:uuid;}
145             leaf port-name { type string;}
146         }
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 }