5ea2eb0ec8ab36f6e22bc71471a8a90853b000bd
[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     }
94   }
95
96   grouping sdn-provider-auth {
97     leaf account-type {
98       type sdn-account-type;
99     }
100
101     choice provider-specific-info {
102       container odl {
103         leaf username {
104           type string {
105             length "1..255";
106           }
107         }
108
109         leaf password {
110           type string {
111             length "1..32";
112           }
113         }
114
115         leaf url {
116           type string {
117             length "1..255";
118           }
119         }
120         leaf plugin-name {
121           type string;
122           default "rwsdn_odl";
123         }
124       }
125       container mock {
126         leaf username {
127           type string;
128         }
129         leaf plugin-name {
130           type string;
131           default "rwsdn_mock";
132         }
133       }
134
135       container sdnsim {
136         leaf username {
137           type string;
138         }
139         leaf topology-source {
140           type string;
141         }
142         leaf plugin-name {
143           type string;
144           default "rwsdn_sim";
145         }
146       }
147     }
148   }
149
150   container sdn-accounts {
151     list sdn-account-list {
152       rwpb:msg-new SDNAccount;
153       key "name";
154
155       leaf name {
156         type string;
157       }
158
159       uses sdn-provider-auth;
160       uses connection-status;
161     }
162   }
163
164   container vnffgs {
165     list vnffg-chain {
166       key "name";
167       rwpb:msg-new VNFFGChain;
168
169       leaf name {
170         type string;
171       }
172
173       list vnf-chain-path {
174         key "order";
175         leaf order {
176           type uint32;
177           description " Order of the VNF in VNFFG chain";
178         }
179         leaf service-function-type {
180           type string;
181         }
182         leaf nsh-aware {
183           type boolean;
184         }
185         leaf transport-type {
186           type string;
187         }
188         list vnfr-ids {
189           key "vnfr-id";
190           leaf vnfr-id {
191             type yang:uuid;
192           }
193           leaf vnfr-name {
194             type string;
195           }
196           leaf mgmt-address {
197             type inet:ip-address;
198           }
199           leaf mgmt-port {
200               type inet:port-number;
201           }
202           list vdu-list {
203             key "vm-id port-id";
204             leaf port-id {
205               rwpb:field-inline "true";
206               rwpb:field-string-max 64;
207               type string;
208             }
209             leaf vm-id {
210               rwpb:field-inline "true";
211               rwpb:field-string-max 64;
212               type string;
213             }
214             leaf name {
215               type string;
216             }
217             leaf address {
218               type inet:ip-address;
219             }
220             leaf port {
221               type inet:port-number;
222             }
223           }
224           leaf sff-name {
225             description "SFF name useful for non OVS based SFF";
226             type string;
227           } 
228         }
229       }
230       list sff {
231         rwpb:msg-new VNFFGSff;
232         key "name"; 
233         leaf name {
234           type string;
235         }
236         leaf function-type {
237           type string;
238         }
239         leaf mgmt-address {
240           type inet:ip-address;
241         }
242         leaf mgmt-port {
243           type inet:port-number;
244         }
245         list dp-endpoints {
246           key "name";
247           leaf name {
248            type string;
249           } 
250           leaf address {
251             type inet:ip-address;
252           }
253           leaf port {
254             type inet:port-number;
255           }
256         }
257         list vnfr-list {
258           key "vnfr-name";
259           leaf vnfr-name {
260             type string;
261           }
262         }
263       }
264       leaf classifier-name {
265         type string;
266       }
267     }
268   }
269
270   container vnffg-rendered-paths {
271     rwpb:msg-new VNFFGRenderedPaths;
272     list vnffg-rendered-path {
273       key "name";
274       rwpb:msg-new VNFFGRenderedPath;
275       config false;
276       leaf name {
277         type string;
278       }
279       leaf path-id {
280           description
281               "Unique Identifier for the service path";
282         type uint32;
283       }
284       list rendered-path-hop {
285         key "hop-number";
286         leaf hop-number {
287           type uint8;
288         }
289         leaf service-index {
290             description
291                 "Location within the service path";
292           type uint8;
293         }
294         leaf vnfr-name {
295           type string;
296         }
297         container service-function-forwarder {
298           leaf name { 
299             description
300                 "Service Function Forwarder name";
301             type string;
302           }
303           leaf ip-address {
304             description
305                 "Service Function Forwarder Data Plane IP address";
306             type inet:ip-address;
307           }  
308           leaf port {
309             description
310                 "Service Function Forwarder Data Plane port";
311             type inet:port-number;
312           }  
313         }
314       }
315     }
316   }
317
318
319   container vnffg-classifiers {
320     list vnffg-classifier {
321       key "name";
322       rwpb:msg-new VNFFGClassifier;
323
324       leaf name {
325         type string;
326       }
327       leaf rsp-name {
328         type string;
329       }
330       leaf port-id {
331         rwpb:field-inline "true";
332         rwpb:field-string-max 64;
333         type string;
334       }
335       leaf vm-id {
336         rwpb:field-inline "true";
337         rwpb:field-string-max 64;
338         type string;
339       }
340       leaf sff-name {
341         type string;
342       }
343       container vnffg-metadata {
344         leaf ctx1 {
345           type string;
346         }
347         leaf ctx2 {
348           type string;
349         }
350         leaf ctx3 {
351           type string;
352         }
353         leaf ctx4 {
354           type string;
355         }
356       }
357       list match-attributes {
358         description
359             "List of match attributes.";
360         key "name";
361         leaf name {
362           description
363               "Name for the Access list";
364           type string;  
365         }
366
367         leaf ip-proto {
368           description
369               "IP Protocol.";
370           type uint8;
371         }
372
373         leaf source-ip-address {
374           description
375               "Source IP address.";
376           type inet:ip-prefix;
377         }
378
379         leaf destination-ip-address {
380           description
381               "Destination IP address.";
382           type inet:ip-prefix;
383         }
384
385         leaf source-port {
386           description
387               "Source port number.";
388           type inet:port-number;
389         }
390
391         leaf destination-port {
392           description
393               "Destination port number.";
394           type inet:port-number;
395         }
396       } //match-attributes
397     }
398   }
399
400 }
401
402 /* vim: set ts=2:sw=2: */