8ebc3aba43e2a3edfb1a33641941f6ebf4650bc5
[osm/SO.git] / rwlaunchpad / plugins / rwvns / yang / rwsdnal.yang
1
2 /*
3  * 
4  *   Copyright 2016-2017 RIFT.IO Inc
5  *
6  *   Licensed under the Apache License, Version 2.0 (the "License");
7  *   you may not use this file except in compliance with the License.
8  *   You may obtain a copy of the License at
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *   Unless required by applicable law or agreed to in writing, software
13  *   distributed under the License is distributed on an "AS IS" BASIS,
14  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *   See the License for the specific language governing permissions and
16  *   limitations under the License.
17  *
18  *
19  */
20
21 module rwsdnal
22 {
23   namespace "http://riftio.com/ns/riftware-1.0/rwsdnal";
24   prefix "rwsdnal";
25
26   import rw-base {
27     prefix rwbase;
28   }
29
30   import rw-yang-types {
31     prefix "rwt";
32   }
33
34   import rw-log {
35     prefix "rwlog";
36   }
37
38   import mano-types {
39     prefix "manotypes";
40   }
41
42   import ietf-inet-types {
43     prefix "inet";
44   }
45
46   import ietf-yang-types {
47     prefix "yang";
48   }
49
50   import rw-project {
51     prefix "rw-project";
52   }
53
54   revision 2017-02-08 {
55     description
56       "Update model to support projects.";
57   }
58
59   revision 2014-12-30 {
60     description
61         "Initial revision.";
62     reference
63         "RIFT RWSDN cloud data";
64   }
65
66   typedef sdn-connection-status-enum {
67     description "Connection status for the sdn account";
68     type enumeration {
69       enum unknown;
70       enum validating;
71       enum success;
72       enum failure;
73     }
74   }
75
76   grouping connection-status {
77     container connection-status {
78       config false;
79       leaf status {
80         type sdn-connection-status-enum;
81       }
82       leaf details {
83         type string;
84       }
85     }
86   }
87
88   // uses connection-status;
89
90   typedef sdn-account-type {
91     description "SDN account type";
92     type enumeration {
93       enum odl;
94       enum mock;
95       enum sdnsim;
96       enum openstack;
97     }
98   }
99
100   grouping sdn-provider-auth {
101     leaf account-type {
102       type sdn-account-type;
103     }
104
105     choice provider-specific-info {
106       container odl {
107         leaf username {
108           type string {
109             length "1..255";
110           }
111         }
112
113         leaf password {
114           type string {
115             length "1..32";
116           }
117         }
118
119         leaf url {
120           type string {
121             length "1..255";
122           }
123         }
124         leaf plugin-name {
125           type string;
126           default "rwsdn_odl";
127         }
128       }
129       container mock {
130         leaf username {
131           type string;
132         }
133         leaf plugin-name {
134           type string;
135           default "rwsdn_mock";
136         }
137       }
138
139       container sdnsim {
140         leaf username {
141           type string;
142         }
143         leaf topology-source {
144           type string;
145         }
146         leaf plugin-name {
147           type string;
148           default "rwsdn_sim";
149         }
150       }
151
152       container openstack {
153         leaf key {
154           type string;
155           mandatory true;
156         }
157
158         leaf secret {
159           type string;
160           mandatory true;
161         }
162
163         leaf auth_url {
164           type string;
165           mandatory true;
166         }
167
168         leaf tenant {
169           type string;
170           mandatory true;
171         }
172
173         leaf admin {
174           type boolean;
175           default false;
176         }
177
178         leaf user-domain {
179           type string;
180           default "Default";
181           description "Domain of the OpenStack user";
182         }
183
184         leaf project-domain {
185           type string;
186           default "Default";
187           description "Domain of the OpenStack project";
188         }
189
190         leaf region {
191           type string;
192           default "RegionOne";
193         }
194
195         leaf plugin-name {
196           type string;
197           default "rwsdn_openstack";
198         }
199
200         leaf cert-validate {
201           type boolean;
202           default false;
203           description "Certificate validatation policy in case of SSL/TLS connection";
204         }
205       }
206
207     }
208   }
209
210   augment "/rw-project:project" {
211     container sdn-accounts {
212       list sdn-account-list {
213         key "name";
214
215         leaf name {
216           type string;
217         }
218
219         uses sdn-provider-auth;
220         uses connection-status;
221       }
222     }
223   }
224
225   augment "/rw-project:project" {
226     container vnffgs {
227       list vnffg-chain {
228         key "name";
229         
230         leaf name {
231           type string;
232         }
233
234         list vnf-chain-path {
235           key "order";
236           leaf order {
237             type uint32;
238             description " Order of the VNF in VNFFG chain";
239           }
240           leaf service-function-type {
241             type string;
242           }
243           leaf nsh-aware {
244             type boolean;
245           }
246           leaf transport-type {
247             type string;
248           }
249           list vnfr-ids {
250             key "vnfr-id";
251             leaf vnfr-id {
252               type yang:uuid;
253             }
254             leaf vnfr-name {
255               type string;
256             }
257             leaf mgmt-address {
258               type inet:ip-address;
259             }
260             leaf mgmt-port {
261               type inet:port-number;
262             }
263             list vdu-list {
264               key "vm-id port-id";
265               leaf port-id {
266                 type string;
267               }
268               leaf vm-id {
269                 type string;
270               }
271               leaf name {
272                 type string;
273               }
274               leaf address {
275                 type inet:ip-address;
276               }
277               leaf port {
278                 type inet:port-number;
279               }
280             }
281             leaf sff-name {
282               description "SFF name useful for non OVS based SFF";
283               type string;
284             }
285           }
286         }
287         list sff {
288           key "name";
289           leaf name {
290             type string;
291           }
292           leaf function-type {
293             type string;
294           }
295           leaf mgmt-address {
296             type inet:ip-address;
297           }
298           leaf mgmt-port {
299             type inet:port-number;
300           }
301           list dp-endpoints {
302             key "name";
303             leaf name {
304               type string;
305             }
306             leaf address {
307               type inet:ip-address;
308             }
309             leaf port {
310               type inet:port-number;
311             }
312           }
313           list vnfr-list {
314             key "vnfr-name";
315             leaf vnfr-name {
316               type string;
317             }
318           }
319         }
320         leaf classifier-name {
321           type string;
322         }
323       }
324     }
325   }
326
327   augment "/rw-project:project" {
328     container vnffg-rendered-paths {
329       list vnffg-rendered-path {
330         key "name";
331         config false;
332         leaf name {
333           type string;
334         }
335         leaf path-id {
336           description
337             "Unique Identifier for the service path";
338           type uint32;
339         }
340         list rendered-path-hop {
341           key "hop-number";
342           leaf hop-number {
343             type uint8;
344           }
345           leaf service-index {
346             description
347               "Location within the service path";
348             type uint8;
349           }
350           leaf vnfr-name {
351             type string;
352           }
353           container service-function-forwarder {
354             leaf name {
355               description
356                 "Service Function Forwarder name";
357               type string;
358             }
359             leaf ip-address {
360               description
361                 "Service Function Forwarder Data Plane IP address";
362               type inet:ip-address;
363             }
364             leaf port {
365               description
366                 "Service Function Forwarder Data Plane port";
367               type inet:port-number;
368             }
369           }
370         }
371       }
372     }
373   }
374
375   augment "/rw-project:project" {
376     container vnffg-classifiers {
377       list vnffg-classifier {
378         key "name";
379         
380         leaf name {
381           type string;
382         }
383         leaf rsp-name {
384           type string;
385         }
386         leaf rsp-id {
387           type yang:uuid;
388         }
389         leaf port-id {
390           type string;
391         }
392         leaf vm-id {
393           type string;
394         }
395         leaf sff-name {
396           type string;
397         }
398         container vnffg-metadata {
399           leaf ctx1 {
400             type string;
401           }
402           leaf ctx2 {
403             type string;
404           }
405           leaf ctx3 {
406             type string;
407           }
408           leaf ctx4 {
409             type string;
410           }
411         }
412         list match-attributes {
413           description
414             "List of match attributes.";
415           key "name";
416           leaf name {
417             description
418               "Name for the Access list";
419             type string;
420           }
421
422           leaf ip-proto {
423             description
424               "IP Protocol.";
425             type uint8;
426           }
427
428           leaf source-ip-address {
429             description
430               "Source IP address.";
431             type inet:ip-prefix;
432           }
433
434           leaf destination-ip-address {
435             description
436               "Destination IP address.";
437             type inet:ip-prefix;
438           }
439
440           leaf source-port {
441             description
442               "Source port number.";
443             type inet:port-number;
444           }
445
446           leaf destination-port {
447             description
448               "Destination port number.";
449             type inet:port-number;
450           }
451         } //match-attributes
452       }
453     }
454   }
455
456 }
457
458 /* vim: set ts=2:sw=2: */