0adaee9d21441c9b2aab5babebe2abbdcc957777
[osm/SO.git] / rwlaunchpad / plugins / yang / rw-launchpad.yang
1
2 /*
3  *
4  *   Copyright 2016 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   revision 2015-09-14 {
106     description
107       "Initial revision.";
108   }
109
110   container datacenters {
111     description "OpenMano data centers";
112
113     rwpb:msg-new DataCenters;
114     config false;
115
116     list ro-accounts {
117       description
118           "A list of OpenMano cloud accounts that have data centers associated
119           with them";
120
121       rwpb:msg-new ROAccount;
122       key "name";
123
124       leaf name {
125         description "The name of the cloud account";
126         type leafref {
127           path "/rw-launchpad:resource-orchestrator/rw-launchpad:name";
128         }
129       }
130
131       list datacenters {
132         rwpb:msg-new DataCenter;
133         leaf uuid {
134           description "The UUID of the data center";
135           type yang:uuid;
136         }
137
138         leaf name {
139           description "The name of the data center";
140           type string;
141         }
142       }
143     }
144   }
145
146   typedef resource-orchestrator-account-type {
147     description "RO account type";
148     type enumeration {
149       enum rift-ro;
150       enum openmano;
151     }
152   }
153
154   container resource-orchestrator {
155     rwpb:msg-new ResourceOrchestrator;
156
157     leaf name {
158        type string;
159     }
160
161     leaf account-type {
162       type resource-orchestrator-account-type;
163     }
164
165     choice resource-orchestrator {
166       description
167         "The resource orchestrator to use by the Launchpad";
168       default rift-ro;
169
170       case rift-ro {
171         description
172           "Use the RIFT.io resource orchestrator";
173
174         container rift-ro {
175           leaf rift-ro {
176             type empty;
177           }
178         }
179       }
180
181       case openmano {
182         description
183           "Use OpenMano as RO";
184
185         container openmano {
186           leaf host {
187             type string;
188             default "localhost";
189           }
190
191           leaf port {
192             type uint16;
193             default 9090;
194           }
195
196           leaf tenant-id {
197             type string {
198               length "36";
199             }
200             mandatory true;
201           }
202         }
203       }
204     }
205   }
206
207   container launchpad-config {
208     leaf public-ip {
209       description
210           "An IP address that can, at least, be reached by the host that the
211           launchpad is running on. This is not a mandatory but is required for
212           alarms to function correctly.";
213       type string;
214     }
215   }
216 }