c178534066d44407ceefa838123d8594aa6f7bbf
[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     rpc createL3VPN{
155         description "Create one or more L3 VPN";
156         input {
157             list l3vpn {
158                 uses l3vpn-instance;
159             }
160         }
161         output {
162             leaf-list response {
163                 type    string;
164                 description "Status response for createVPN RPC";
165             }
166         }
167     }
168
169     rpc associateRouter {
170         description "associates a router with L3VPN";
171         input {
172             leaf vpn-id {
173                 type    yang:uuid;
174                 mandatory "true";
175                 description "vpn-id";
176             }
177             leaf router-id {
178                 type    yang:uuid;
179                 mandatory "true";
180                 description "vpn-id";
181             }
182         }
183     }
184
185     rpc dissociateRouter {
186         description "dissociates a router with L3VPN";
187         input {
188             leaf vpn-id {
189                 type    yang:uuid;
190                 mandatory "true";
191                 description "vpn-id";
192             }
193             leaf router-id {
194                 type    yang:uuid;
195                 mandatory "true";
196                 description "router-id";
197             }
198         }
199     }
200
201     rpc associateNetworks {
202         description "associates a list of networks with L3VPN";
203         input {
204             leaf vpn-id {
205                 type    yang:uuid;
206                 mandatory "true";
207                 description "vpn-id";
208             }
209             leaf-list network-id {
210                 type    yang:uuid;
211                 description "network-id";
212             }
213         }
214         output {
215             leaf response {
216                 type    string;
217                 description "Status response for associateNetworks RPC";
218             }
219         }
220     }
221
222     rpc dissociateNetworks{
223         description "dissociates a list of networks with L3VPN";
224         input {
225             leaf vpn-id {
226                 type    yang:uuid;
227                 mandatory "true";
228                 description "vpn-id";
229             }
230             leaf-list network-id {
231                 type    yang:uuid;
232                 description "network-id";
233             }
234         }
235         output {
236             leaf response {
237                 type    string;
238                 description "Status response for dissociateNetworks RPC";
239             }
240         }
241     }
242
243     rpc deleteL3VPN{
244         description "delete VPNs for specified Id list";
245         input {
246             leaf-list id {
247                 type    yang:uuid;
248                 description "vpn-id";
249             }
250         }
251         output {
252             leaf-list response {
253                 type    string;
254                 description "Status response for deleteL3VPN RPC";
255             }
256         }
257     }
258
259     rpc getL3VPN{
260         description "returns VPN configuration";
261         input {
262             leaf id {
263                 type    yang:uuid;
264                 description "vpn-id";
265             }
266         }
267         output {
268             list l3vpn-instances {
269                 uses l3vpn-instance;
270             }
271         }
272     }
273
274 }