Revert "Full Juju Charm support"
[osm/SO.git] / rwcal / plugins / vala / rwcal_cloudsim / rift / rwcal / cloudsim / core.py
1
2 #
3 # Copyright 2016 RIFT.IO Inc
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17
18 import functools
19
20 from . import exceptions
21
22
23 def unsupported(f):
24 @functools.wraps(f)
25 def impl(*args, **kwargs):
26 msg = '{} not supported'.format(f.__name__)
27 raise exceptions.RWErrorNotSupported(msg)
28
29 return impl
30
31
32 class Cloud(object):
33 """
34 Cloud defines a base class for cloud driver implementations. Note that
35 not all drivers will support the complete set of functionality presented
36 here.
37 """
38
39 @unsupported
40 def get_management_network(self, account):
41 """
42 Returns the management network associated with the specified account.
43
44 @param account - a cloud account
45
46 @return a management network
47 """
48 pass
49
50 @unsupported
51 def create_tenant(self, account, name):
52 """
53 Create a new tenant.
54
55 @param account - a cloud account
56 @param name - name to assign to the tenant.
57 """
58 pass
59
60 @unsupported
61 def delete_tenant(self, account, tenant_id):
62 """
63 delete a tenant.
64
65 @param account - a cloud account
66 @param tenant_id - id of tenant to be deleted.
67 """
68 pass
69
70 @unsupported
71 def get_tenant_list(self, account):
72 """
73 List tenants.
74
75 @param account - a cloud account
76 """
77 pass
78
79 @unsupported
80 def create_role(self, account, name):
81 """
82 Create a new role.
83
84 @param account - a cloud account
85 @param name - name to assign to the role.
86 """
87 pass
88
89 @unsupported
90 def delete_role(self, account, role_id):
91 """
92 delete a role.
93
94 @param account - a cloud account
95 @param role_id - id of role to be deleted.
96 """
97 pass
98
99 @unsupported
100 def get_role_list(self, account):
101 """
102 List roles.
103
104 @param account - a cloud account
105 """
106 pass
107
108 @unsupported
109 def create_image(self, account, image):
110 """
111 Create an image
112
113 @param account - a cloud account
114 @param image - a description of the image to create
115 """
116 pass
117
118 @unsupported
119 def delete_image(self, account, image_id):
120 """
121 delete a vm image.
122
123 @param account - a cloud account
124 @param image_id - Instance id of VM image to be deleted.
125 """
126 pass
127
128 @unsupported
129 def get_image_list(self, account):
130 """
131 Return a list of the names of all available images.
132
133 @param account - a cloud account
134 """
135 pass
136
137 @unsupported
138 def get_image(self, account, image_id):
139 """
140 Returns image information.
141
142 @param account - a cloud account
143 """
144 pass
145
146 @unsupported
147 def create_vm(self, account, vm):
148 """
149 Create a new virtual machine.
150
151 @param account - a cloud account
152 @param vm - The info required to create a VM
153 """
154 pass
155
156 @unsupported
157 def start_vm(self, account, vm_id):
158 """
159 start an existing virtual machine.
160
161 @param account - a cloud account
162 @param vm_id - The id of the VM to start
163 """
164 pass
165
166 @unsupported
167 def stop_vm(self, account, vm_id):
168 """
169 Stop a running virtual machine.
170
171 @param account - a cloud account
172 @param vm_id - The id of the VM to stop
173 """
174 pass
175
176 @unsupported
177 def delete_vm(self, account, vm_id):
178 """
179 delete a virtual machine.
180
181 @param account - a cloud account
182 @param vm_id - Instance id of VM to be deleted.
183 """
184 pass
185
186 @unsupported
187 def reboot_vm(self, account, vm_id):
188 """
189 reboot a virtual machine.
190
191 @param account - a cloud account
192 @param vm_id - Instance id of VM to be deleted.
193 """
194 pass
195
196 @unsupported
197 def get_vm_list(self, account):
198 """
199 Return a list of vms.
200
201 @param account - a cloud account
202 """
203 pass
204
205 @unsupported
206 def get_vm(self, account):
207 """
208 Return vm information.
209
210 @param account - a cloud account
211 """
212 pass
213
214 @unsupported
215 def create_flavor(self, account, flavor):
216 """
217 create new flavor.
218
219 @param account - a cloud account
220 @param flavor - Flavor object
221 """
222 pass
223
224 @unsupported
225 def delete_flavor(self, account, flavor_id):
226 """
227 Delete flavor.
228
229 @param account - a cloud account
230 @param flavor_id - Flavor id to be deleted.
231 """
232 pass
233
234 @unsupported
235 def get_flavor_list(self, account):
236 """
237 Return a list of flavors.
238
239 @param account - a cloud account
240 """
241 pass
242
243 @unsupported
244 def get_flavor(self, account):
245 """
246 Return flavor information.
247
248 @param account - a cloud account
249 """
250 pass
251
252 @unsupported
253 def get_network(self, account, network_id):
254 """
255 Return a network
256
257 @param account - a cloud account
258 @param network_id - unique network identifier
259 """
260 pass
261
262 @unsupported
263 def get_network_list(self, account):
264 """
265 Return a list of networks
266
267 @param account - a cloud account
268 """
269 pass
270
271 @unsupported
272 def create_network(self, account, network):
273 """
274 Create a new network
275
276 @param account - a cloud account
277 @param network - Network object
278 """
279 pass
280
281 @unsupported
282 def delete_network(self, account, network_id):
283 """
284 Delete a network
285
286 @param account - a cloud account
287 @param network_id - unique network identifier
288 """
289 pass
290
291 @unsupported
292 def get_port(self, account, port_id):
293 """
294 Return a port
295
296 @param account - a cloud account
297 @param port_id - unique port identifier
298 """
299 pass
300
301 @unsupported
302 def get_port_list(self, account):
303 """
304 Return a list of ports
305
306 @param account - a cloud account
307 """
308 pass
309
310 @unsupported
311 def create_port(self, account, port):
312 """
313 Create a new port
314
315 @param account - a cloud account
316 @param port - port object
317 """
318 pass
319
320 @unsupported
321 def delete_port(self, account, port_id):
322 """
323 Delete a port
324
325 @param account - a cloud account
326 @param port_id - unique port identifier
327 """
328 pass
329
330 @unsupported
331 def add_host(self, account, host):
332 """
333 Add a new host
334
335 @param account - a cloud account
336 @param host - a host object
337 """
338 pass
339
340 @unsupported
341 def remove_host(self, account, host_id):
342 """
343 Remove a host
344
345 @param account - a cloud account
346 @param host_id - unique host identifier
347 """
348 pass
349
350 @unsupported
351 def get_host(self, account, host_id):
352 """
353 Return a host
354
355 @param account - a cloud account
356 @param host_id - unique host identifier
357 """
358 pass
359
360 @unsupported
361 def get_host_list(self, account):
362 """
363 Return a list of hosts
364
365 @param account - a cloud account
366 """
367 pass