3 # Copyright 2016 RIFT.IO Inc
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 from gi
import require_version
20 require_version('RwCal', '1.0')
22 from gi
.repository
import (
31 logger
= logging
.getLogger('rwcal.vsphere')
33 class UnknownAccountError(Exception):
37 class MissingFileError(Exception):
41 class ImageLocationError(Exception):
45 rwstatus
= rw_status
.rwstatus_from_exc_map({
46 IndexError: RwTypes
.RwStatus
.NOTFOUND
,
47 KeyError: RwTypes
.RwStatus
.NOTFOUND
,
48 UnknownAccountError
: RwTypes
.RwStatus
.NOTFOUND
,
49 MissingFileError
: RwTypes
.RwStatus
.NOTFOUND
,
53 class RwcalVspherePlugin(GObject
.Object
, RwCal
.Cloud
):
54 """This class implements the CAL VALA methods for Vsphere.
58 GObject
.Object
.__init
__(self
)
61 def do_init(self
, rwlog_ctx
):
62 if not any(isinstance(h
, rwlogger
.RwLogger
) for h
in logger
.handlers
):
65 category
="rw-cal-log",
66 subcategory
="vsphere",
71 @rwstatus(ret_on_failure
=[None])
72 def do_get_management_network(self
, account
):
73 raise NotImplementedError()
76 def do_create_tenant(self
, account
, name
):
77 raise NotImplementedError()
80 def do_delete_tenant(self
, account
, tenant_id
):
81 raise NotImplementedError()
83 @rwstatus(ret_on_failure
=[[]])
84 def do_get_tenant_list(self
, account
):
85 raise NotImplementedError()
88 def do_create_role(self
, account
, name
):
89 raise NotImplementedError()
92 def do_delete_role(self
, account
, role_id
):
93 raise NotImplementedError()
95 @rwstatus(ret_on_failure
=[[]])
96 def do_get_role_list(self
, account
):
97 raise NotImplementedError()
99 @rwstatus(ret_on_failure
=[None])
100 def do_create_image(self
, account
, image
):
101 raise NotImplementedError()
105 def do_delete_image(self
, account
, image_id
):
106 raise NotImplementedError()
108 @rwstatus(ret_on_failure
=[None])
109 def do_get_image(self
, account
, image_id
):
110 raise NotImplementedError()
112 @rwstatus(ret_on_failure
=[[]])
113 def do_get_image_list(self
, account
):
114 raise NotImplementedError()
117 def do_create_vm(self
, account
, vm
):
118 raise NotImplementedError()
121 def do_start_vm(self
, account
, vm_id
):
122 raise NotImplementedError()
125 def do_stop_vm(self
, account
, vm_id
):
126 raise NotImplementedError()
129 def do_delete_vm(self
, account
, vm_id
):
130 raise NotImplementedError()
133 def do_reboot_vm(self
, account
, vm_id
):
134 raise NotImplementedError()
136 @rwstatus(ret_on_failure
=[[]])
137 def do_get_vm_list(self
, account
):
138 raise NotImplementedError()
141 def do_create_flavor(self
, account
, flavor
):
142 raise NotImplementedError()
145 def do_delete_flavor(self
, account
, flavor_id
):
146 raise NotImplementedError()
148 @rwstatus(ret_on_failure
=[None])
149 def do_get_flavor(self
, account
, flavor_id
):
150 raise NotImplementedError()
152 @rwstatus(ret_on_failure
=[[]])
153 def do_get_flavor_list(self
, account
):
154 raise NotImplementedError()
157 def do_add_host(self
, account
, host
):
158 raise NotImplementedError()
161 def do_remove_host(self
, account
, host_id
):
162 raise NotImplementedError()
164 @rwstatus(ret_on_failure
=[None])
165 def do_get_host(self
, account
, host_id
):
166 raise NotImplementedError()
168 @rwstatus(ret_on_failure
=[[]])
169 def do_get_host_list(self
, account
):
170 raise NotImplementedError()
173 def do_create_port(self
, account
, port
):
174 raise NotImplementedError()
177 def do_delete_port(self
, account
, port_id
):
178 raise NotImplementedError()
180 @rwstatus(ret_on_failure
=[None])
181 def do_get_port(self
, account
, port_id
):
182 raise NotImplementedError()
184 @rwstatus(ret_on_failure
=[[]])
185 def do_get_port_list(self
, account
):
186 raise NotImplementedError()
189 def do_create_network(self
, account
, network
):
190 raise NotImplementedError()
193 def do_delete_network(self
, account
, network_id
):
194 raise NotImplementedError()
196 @rwstatus(ret_on_failure
=[None])
197 def do_get_network(self
, account
, network_id
):
198 raise NotImplementedError()
200 @rwstatus(ret_on_failure
=[[]])
201 def do_get_network_list(self
, account
):
202 raise NotImplementedError()
204 @rwstatus(ret_on_failure
=[""])
205 def do_create_virtual_link(self
, account
, link_params
):
206 raise NotImplementedError()
209 def do_delete_virtual_link(self
, account
, link_id
):
210 raise NotImplementedError()
212 @rwstatus(ret_on_failure
=[None])
213 def do_get_virtual_link(self
, account
, link_id
):
214 raise NotImplementedError()
216 @rwstatus(ret_on_failure
=[""])
217 def do_get_virtual_link_list(self
, account
):
218 raise NotImplementedError()
220 @rwstatus(ret_on_failure
=[""])
221 def do_create_vdu(self
, account
, vdu_init
):
222 raise NotImplementedError()
225 def do_modify_vdu(self
, account
, vdu_modify
):
226 raise NotImplementedError()
229 def do_delete_vdu(self
, account
, vdu_id
):
230 raise NotImplementedError()
232 @rwstatus(ret_on_failure
=[None])
233 def do_get_vdu(self
, account
, vdu_id
):
234 raise NotImplementedError()
236 @rwstatus(ret_on_failure
=[""])
237 def do_get_vdu_list(self
, account
):
238 raise NotImplementedError()