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