Merge from OSM SO master
[osm/SO.git] / models / plugins / yang / rw-vnfd-base.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 rw-vnfd-base
22 {
23   namespace "http://riftio.com/ns/riftware-1.0/rw-vnfd-base";
24   prefix "rw-vnfd-base";
25
26   import vnfd {
27     prefix "vnfd";
28   }
29
30   import rwvcs-types {
31     prefix "rwvcstypes";
32   }
33
34   import rw-pb-ext { prefix "rwpb"; }
35
36   import ietf-yang-types {
37     prefix "yang";
38   }
39
40   import mano-types {
41     prefix "manotypes";
42   }
43
44   revision 2017-02-28 {
45     description
46       "Initial revision. This YANG file defines
47        common structs for extending MANO VNFD";
48     reference
49       "Derived from earlier versions of base YANG files";
50   }
51
52   grouping rw-vnfd-ext {
53     uses manotypes:control-param;
54     uses manotypes:action-param;
55
56     leaf meta {
57       description
58         "Any meta-data needed by the UI";
59       type string;
60     }
61
62     list component {
63       description
64           "This section defines the RIFT.ware
65            virtual components";
66       key "component-name";
67       rwpb:msg-new VcsComponent;
68       rwpb:application-request-point;
69
70       leaf component-name {
71         description "";
72         type string;
73       }
74
75       leaf component-type {
76         description "";
77         type rwvcstypes:component_type;
78         mandatory true;
79       }
80
81       choice component {
82         case rwvcs-rwcollection {
83           uses rwvcstypes:rwvcs-rwcollection;
84         }
85         case rwvcs-rwvm {
86           uses rwvcstypes:rwvcs-rwvm;
87         }
88         case rwvcs-rwproc {
89           uses rwvcstypes:rwvcs-rwproc;
90         }
91         case native-proc {
92           uses rwvcstypes:native-proc;
93         }
94         case rwvcs-rwtasklet {
95           uses rwvcstypes:rwvcs-rwtasklet;
96         }
97       }
98     } // list component
99   }
100
101   grouping vcs-component-ref {
102     leaf vcs-component-ref {
103       description
104           "This defines the software components using the
105            RIFT.ware Virtual Component System (VCS). This
106            also allows specifying a state machine during
107            the VM startup.
108            NOTE: This is an significant addition to MANO,
109            since MANO doesn't clearly specify a method to
110            identify various software components in a VM.
111            Also using a state machine is not something that
112            is well described in MANO.";
113       type leafref {
114         path "../../component/component-name";
115       }
116     }
117   }
118 }
119 // vim: sw=2