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