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