New feature: Model changes for project support
[osm/SO.git] / rwlaunchpad / plugins / yang / rw-launchpad.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
22
23 /**
24  * @file rw-launchpad.yang
25  * @author Joshua Downer
26  * @date 2015/09/14
27  * @brief Launchpad Yang
28  */
29
30 module rw-launchpad
31 {
32   namespace "http://riftio.com/ns/riftware-1.0/rw-launchpad";
33   prefix "rw-launchpad";
34
35   import ietf-yang-types {
36     prefix "yang";
37   }
38
39   import rw-pb-ext {
40     prefix "rwpb";
41   }
42
43   import ietf-inet-types {
44     prefix "inet";
45   }
46
47
48   import rw-cli-ext {
49     prefix "rwcli";
50   }
51
52   import rw-yang-types {
53     prefix "rwt";
54   }
55
56   import rwcal {
57     prefix "rwcal";
58   }
59
60   import rw-vnfd {
61     prefix "rw-vnfd";
62   }
63
64   import vld {
65     prefix "vld";
66   }
67
68   import rw-nsd {
69     prefix "rw-nsd";
70   }
71
72   import rw-cloud {
73     prefix "rw-cloud";
74   }
75
76   import rw-nsr {
77     prefix "rw-nsr";
78   }
79
80   import rw-conman {
81     prefix "rw-conman";
82   }
83
84   import rw-config-agent {
85     prefix "rw-config-agent";
86   }
87
88   import rw-monitor {
89     prefix "rw-monitor";
90   }
91
92   import rw-image-mgmt {
93     prefix "rw-image-mgmt";
94   }
95   
96   import rw-pkg-mgmt {
97     prefix "rw-pkg-mgmt";
98   }
99   
100
101   import mano-types {
102     prefix "manotypes";
103   }
104
105   import rw-project {
106     prefix "rw-project";
107   }
108
109   revision 2017-02-08 {
110     description
111       "Update model to support projects.";
112   }
113
114   revision 2015-09-14 {
115     description
116       "Initial revision.";
117   }
118
119   augment "/rw-project:project" {
120     container datacenters {
121       description "OpenMano data centers";
122
123       rwpb:msg-new DataCenters;
124       config false;
125
126       list ro-accounts {
127         description
128           "A list of OpenMano cloud accounts that have data centers associated
129           with them";
130
131         rwpb:msg-new ROAccount;
132         key "name";
133
134         leaf name {
135           description "The name of the cloud account";
136           type leafref {
137             path "../../../rw-launchpad:resource-orchestrator/rw-launchpad:name";
138           }
139         }
140
141         list datacenters {
142           rwpb:msg-new DataCenter;
143           leaf uuid {
144             description "The UUID of the data center";
145             type yang:uuid;
146           }
147
148           leaf name {
149             description "The name of the data center";
150             type string;
151           }
152         }
153       }
154     }
155   }
156
157   typedef resource-orchestrator-account-type {
158     description "RO account type";
159     type enumeration {
160       enum rift-ro;
161       enum openmano;
162     }
163   }
164
165   augment "/rw-project:project" {
166     container resource-orchestrator {
167       rwpb:msg-new ResourceOrchestrator;
168
169       leaf name {
170         type string;
171       }
172
173       leaf account-type {
174         type resource-orchestrator-account-type;
175       }
176
177       choice resource-orchestrator {
178         description
179           "The resource orchestrator to use by the Launchpad";
180         default rift-ro;
181
182         case rift-ro {
183           description
184             "Use the RIFT.io resource orchestrator";
185
186           container rift-ro {
187             leaf rift-ro {
188               type empty;
189             }
190           }
191         }
192
193         case openmano {
194           description
195             "Use OpenMano as RO";
196
197           container openmano {
198             leaf host {
199               type string;
200               default "localhost";
201             }
202
203             leaf port {
204               type uint16;
205               default 9090;
206             }
207
208             leaf tenant-id {
209               type string {
210                 length "36";
211               }
212               mandatory true;
213             }
214           }
215         }
216       }
217     }
218   }
219
220   augment "/rw-project:project" {
221     container launchpad-config {
222       leaf public-ip {
223         description
224           "An IP address that can, at least, be reached by the host that the
225           launchpad is running on. This is not a mandatory but is required for
226           alarms to function correctly.";
227         type string;
228       }
229     }
230   }
231 }