Merge from OSM SO master
[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-project-vnfd {
61     prefix "rw-project-vnfd";
62   }
63
64   import vld {
65     prefix "vld";
66   }
67
68   import rw-project-nsd {
69     prefix "rw-project-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   import rw-project-mano {
110     prefix "rw-project-mano";
111   }
112
113   revision 2017-02-08 {
114     description
115       "Update model to support projects.";
116   }
117
118   revision 2015-09-14 {
119     description
120       "Initial revision.";
121   }
122
123   augment "/rw-project:project" {
124     container datacenters {
125       description "OpenMano data centers";
126
127       rwpb:msg-new DataCenters;
128       config false;
129
130       list ro-accounts {
131         description
132           "A list of OpenMano cloud accounts that have data centers associated
133           with them";
134
135         rwpb:msg-new ROAccount;
136         key "name";
137
138         leaf name {
139           description "The name of the cloud account";
140           type leafref {
141             path "../../../rw-launchpad:resource-orchestrator/rw-launchpad:name";
142           }
143         }
144
145         list datacenters {
146           rwpb:msg-new DataCenter;
147           leaf uuid {
148             description "The UUID of the data center";
149             type yang:uuid;
150           }
151
152           leaf name {
153             description "The name of the data center";
154             type string;
155           }
156         }
157       }
158     }
159   }
160
161   typedef resource-orchestrator-account-type {
162     description "RO account type";
163     type enumeration {
164       enum rift-ro;
165       enum openmano;
166     }
167   }
168
169   augment "/rw-project:project" {
170     container resource-orchestrator {
171       rwpb:msg-new ResourceOrchestrator;
172
173       leaf name {
174         type string;
175       }
176
177       leaf account-type {
178         type resource-orchestrator-account-type;
179       }
180
181       choice resource-orchestrator {
182         description
183           "The resource orchestrator to use by the Launchpad";
184         default rift-ro;
185
186         case rift-ro {
187           description
188             "Use the RIFT.io resource orchestrator";
189
190           container rift-ro {
191             leaf rift-ro {
192               type empty;
193             }
194           }
195         }
196
197         case openmano {
198           description
199             "Use OpenMano as RO";
200
201           container openmano {
202             leaf host {
203               type string;
204               default "localhost";
205             }
206
207             leaf port {
208               type uint16;
209               default 9090;
210             }
211
212             leaf tenant-id {
213               type string {
214                 length "36";
215               }
216               mandatory true;
217             }
218           }
219         }
220       }
221     }
222   }
223
224   augment "/rw-project:project" {
225     container launchpad-config {
226       leaf public-ip {
227         description
228           "An IP address that can, at least, be reached by the host that the
229           launchpad is running on. This is not a mandatory but is required for
230           alarms to function correctly.";
231         type string;
232       }
233     }
234   }
235 }