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