blob: 48e4939ae65e8d8e117fb957a9307e78097b47f4 [file] [log] [blame]
Jay Pipes3f981df2012-03-27 18:59:44 -04001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
3# Copyright 2012 OpenStack, LLC
4# All Rights Reserved.
5#
6# Licensed under the Apache License, Version 2.0 (the "License"); you may
7# not use this file except in compliance with the License. You may obtain
8# 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, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15# License for the specific language governing permissions and limitations
16# under the License.
17
Jay Pipesf38eaac2012-06-21 13:37:35 -040018from tempest import config
Daryl Walleck587385b2012-03-03 13:00:26 -060019from tempest import exceptions
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -040020from tempest.openstack.common import log as logging
Attila Fazekas1aed6202013-02-11 14:47:45 +010021from tempest.services import botoclients
Mitsuhiko Yamazaki74f07072013-04-02 11:52:31 +090022from tempest.services.compute.json.aggregates_client import \
23 AggregatesClientJSON
Leo Toyodaa5278912013-04-16 15:40:12 +090024from tempest.services.compute.json.availability_zone_client import \
25 AvailabilityZoneClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050026from tempest.services.compute.json.extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053027 ExtensionsClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040028from tempest.services.compute.json.fixed_ips_client import FixedIPsClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050029from tempest.services.compute.json.flavors_client import FlavorsClientJSON
30from tempest.services.compute.json.floating_ips_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053031 FloatingIPsClientJSON
Attila Fazekas8e99b992013-02-24 09:53:23 +010032from tempest.services.compute.json.hosts_client import HostsClientJSON
Tony Yang3d5f1632013-06-06 14:17:57 +080033from tempest.services.compute.json.hypervisor_client import \
34 HypervisorClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050035from tempest.services.compute.json.images_client import ImagesClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040036from tempest.services.compute.json.interfaces_client import \
37 InterfacesClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010038from tempest.services.compute.json.keypairs_client import KeyPairsClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050039from tempest.services.compute.json.limits_client import LimitsClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010040from tempest.services.compute.json.quotas_client import QuotasClientJSON
Matthew Treinisha83a16e2012-12-07 13:44:02 -050041from tempest.services.compute.json.security_groups_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053042 SecurityGroupsClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010043from tempest.services.compute.json.servers_client import ServersClientJSON
Leo Toyoda3ae31e12013-04-19 11:19:57 +090044from tempest.services.compute.json.services_client import ServicesClientJSON
Leo Toyodad80b6a02013-05-08 12:15:13 +090045from tempest.services.compute.json.tenant_usages_client import \
46 TenantUsagesClientJSON
Matthew Treinisha83a16e2012-12-07 13:44:02 -050047from tempest.services.compute.json.volumes_extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053048 VolumesExtensionsClientJSON
Mitsuhiko Yamazakiae8fc532013-04-22 11:17:35 +090049from tempest.services.compute.xml.aggregates_client import AggregatesClientXML
Leo Toyodaa5278912013-04-16 15:40:12 +090050from tempest.services.compute.xml.availability_zone_client import \
51 AvailabilityZoneClientXML
dwallecke62b9f02012-10-10 23:34:42 -050052from tempest.services.compute.xml.extensions_client import ExtensionsClientXML
Sean Dague2416cf32013-04-10 08:29:07 -040053from tempest.services.compute.xml.fixed_ips_client import FixedIPsClientXML
dwallecke62b9f02012-10-10 23:34:42 -050054from tempest.services.compute.xml.flavors_client import FlavorsClientXML
55from tempest.services.compute.xml.floating_ips_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053056 FloatingIPsClientXML
Tony Yang3d5f1632013-06-06 14:17:57 +080057from tempest.services.compute.xml.hypervisor_client import HypervisorClientXML
dwallecke62b9f02012-10-10 23:34:42 -050058from tempest.services.compute.xml.images_client import ImagesClientXML
Sean Dague2416cf32013-04-10 08:29:07 -040059from tempest.services.compute.xml.interfaces_client import \
60 InterfacesClientXML
dwallecke62b9f02012-10-10 23:34:42 -050061from tempest.services.compute.xml.keypairs_client import KeyPairsClientXML
62from tempest.services.compute.xml.limits_client import LimitsClientXML
rajalakshmi-ganesan1982c3c2013-01-10 14:56:45 +053063from tempest.services.compute.xml.quotas_client import QuotasClientXML
dwallecke62b9f02012-10-10 23:34:42 -050064from tempest.services.compute.xml.security_groups_client \
harika-vakadi1a9ad612012-12-14 19:12:08 +053065 import SecurityGroupsClientXML
dwallecke62b9f02012-10-10 23:34:42 -050066from tempest.services.compute.xml.servers_client import ServersClientXML
Leo Toyoda3ae31e12013-04-19 11:19:57 +090067from tempest.services.compute.xml.services_client import ServicesClientXML
Leo Toyodad80b6a02013-05-08 12:15:13 +090068from tempest.services.compute.xml.tenant_usages_client import \
69 TenantUsagesClientXML
Matthew Treinisha83a16e2012-12-07 13:44:02 -050070from tempest.services.compute.xml.volumes_extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053071 VolumesExtensionsClientXML
Attila Fazekas407b6db2013-01-19 12:48:36 +010072from tempest.services.identity.json.identity_client import IdentityClientJSON
73from tempest.services.identity.json.identity_client import TokenClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040074from tempest.services.identity.v3.json.endpoints_client import \
75 EndPointClientJSON
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +053076from tempest.services.identity.v3.json.identity_client import \
77 IdentityV3ClientJSON
nayna-patelb35f7232013-06-28 07:08:44 +000078from tempest.services.identity.v3.json.identity_client import V3TokenClientJSON
harika-vakadi40e10112013-02-08 14:38:09 +053079from tempest.services.identity.v3.json.policy_client import PolicyClientJSON
harika-vakadia92dd742013-02-19 20:41:22 +053080from tempest.services.identity.v3.json.service_client import \
81 ServiceClientJSON
rajalakshmi-ganesanab426722013-02-08 15:49:15 +053082from tempest.services.identity.v3.xml.endpoints_client import EndPointClientXML
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +053083from tempest.services.identity.v3.xml.identity_client import \
84 IdentityV3ClientXML
nayna-patelb35f7232013-06-28 07:08:44 +000085from tempest.services.identity.v3.xml.identity_client import V3TokenClientXML
harika-vakadi40e10112013-02-08 14:38:09 +053086from tempest.services.identity.v3.xml.policy_client import PolicyClientXML
harika-vakadia92dd742013-02-19 20:41:22 +053087from tempest.services.identity.v3.xml.service_client import \
88 ServiceClientXML
Attila Fazekas407b6db2013-01-19 12:48:36 +010089from tempest.services.identity.xml.identity_client import IdentityClientXML
90from tempest.services.identity.xml.identity_client import TokenClientXML
Matthew Treinish6d59c992013-03-01 16:20:04 -050091from tempest.services.image.v1.json.image_client import ImageClientJSON
Matthew Treinisha62347f2013-03-01 16:37:30 -050092from tempest.services.image.v2.json.image_client import ImageClientV2JSON
raiesmh0867698322013-08-20 13:09:01 +053093from tempest.services.network.json.network_client import NetworkClientJSON
94from tempest.services.network.xml.network_client import NetworkClientXML
dwalleck5d734432012-10-04 01:11:47 -050095from tempest.services.object_storage.account_client import AccountClient
harika-vakadi2daed0a2013-01-01 20:51:39 +053096from tempest.services.object_storage.account_client import \
97 AccountClientCustomizedHeader
Attila Fazekas6968dd52013-02-15 17:05:53 +010098from tempest.services.object_storage.container_client import ContainerClient
99from tempest.services.object_storage.object_client import ObjectClient
100from tempest.services.object_storage.object_client import \
101 ObjectClientCustomizedHeader
Steve Bakerc60e4e32013-05-06 15:22:41 +1200102from tempest.services.orchestration.json.orchestration_client import \
103 OrchestrationClient
Attila Fazekas6968dd52013-02-15 17:05:53 +0100104from tempest.services.volume.json.admin.volume_types_client import \
105 VolumeTypesClientJSON
106from tempest.services.volume.json.snapshots_client import SnapshotsClientJSON
107from tempest.services.volume.json.volumes_client import VolumesClientJSON
108from tempest.services.volume.xml.admin.volume_types_client import \
109 VolumeTypesClientXML
110from tempest.services.volume.xml.snapshots_client import SnapshotsClientXML
111from tempest.services.volume.xml.volumes_client import VolumesClientXML
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800112
Jay Pipes3f981df2012-03-27 18:59:44 -0400113LOG = logging.getLogger(__name__)
114
Mauro S. M. Rodrigues6e373242012-08-27 18:59:19 -0400115IMAGES_CLIENTS = {
116 "json": ImagesClientJSON,
117 "xml": ImagesClientXML,
118}
119
raiesmh0867698322013-08-20 13:09:01 +0530120NETWORKS_CLIENTS = {
121 "json": NetworkClientJSON,
122 "xml": NetworkClientXML,
123}
124
Mauro S. M. Rodriguesa636f532012-08-21 11:07:53 -0400125KEYPAIRS_CLIENTS = {
126 "json": KeyPairsClientJSON,
127 "xml": KeyPairsClientXML,
128}
129
rajalakshmi-ganesan1982c3c2013-01-10 14:56:45 +0530130QUOTAS_CLIENTS = {
131 "json": QuotasClientJSON,
132 "xml": QuotasClientXML,
133}
134
Dan Smithcf8fab62012-08-14 08:03:48 -0700135SERVERS_CLIENTS = {
136 "json": ServersClientJSON,
137 "xml": ServersClientXML,
138}
139
Matthew Treinish33634462012-08-16 16:51:23 -0400140LIMITS_CLIENTS = {
141 "json": LimitsClientJSON,
142 "xml": LimitsClientXML,
143}
144
Tiago Melloeda03b52012-08-22 23:47:29 -0300145FLAVORS_CLIENTS = {
146 "json": FlavorsClientJSON,
147 "xml": FlavorsClientXML
148}
149
Tiago Mello89126c32012-08-27 11:14:03 -0300150EXTENSIONS_CLIENTS = {
151 "json": ExtensionsClientJSON,
152 "xml": ExtensionsClientXML
153}
154
Matthew Treinish4e086902012-08-17 17:52:22 -0400155VOLUMES_EXTENSIONS_CLIENTS = {
156 "json": VolumesExtensionsClientJSON,
157 "xml": VolumesExtensionsClientXML,
158}
159
Vincent Hou22f03c72012-08-24 17:55:13 +0800160FLOAT_CLIENTS = {
161 "json": FloatingIPsClientJSON,
162 "xml": FloatingIPsClientXML,
163}
164
Attila Fazekas36b1fcf2013-01-31 16:41:04 +0100165SNAPSHOTS_CLIENTS = {
166 "json": SnapshotsClientJSON,
167 "xml": SnapshotsClientXML,
168}
169
Matthew Treinish9854d5b2012-09-20 10:22:13 -0400170VOLUMES_CLIENTS = {
171 "json": VolumesClientJSON,
172 "xml": VolumesClientXML,
173}
174
Attila Fazekas3dcdae12013-02-14 12:50:04 +0100175VOLUME_TYPES_CLIENTS = {
176 "json": VolumeTypesClientJSON,
177 "xml": VolumeTypesClientXML,
178}
179
Attila Fazekas407b6db2013-01-19 12:48:36 +0100180IDENTITY_CLIENT = {
181 "json": IdentityClientJSON,
182 "xml": IdentityClientXML,
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800183}
184
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +0530185IDENTITY_V3_CLIENT = {
186 "json": IdentityV3ClientJSON,
187 "xml": IdentityV3ClientXML,
188}
189
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800190TOKEN_CLIENT = {
191 "json": TokenClientJSON,
192 "xml": TokenClientXML,
193}
194
Vincent Houead03dc2012-08-24 21:35:11 +0800195SECURITY_GROUPS_CLIENT = {
196 "json": SecurityGroupsClientJSON,
197 "xml": SecurityGroupsClientXML,
198}
199
Dan Smith8ad1c472013-02-26 13:03:16 -0500200INTERFACES_CLIENT = {
201 "json": InterfacesClientJSON,
202 "xml": InterfacesClientXML,
203}
204
rajalakshmi-ganesanab426722013-02-08 15:49:15 +0530205ENDPOINT_CLIENT = {
206 "json": EndPointClientJSON,
207 "xml": EndPointClientXML,
208}
209
Mauro S. M. Rodriguesf5166402013-04-01 10:25:26 -0400210FIXED_IPS_CLIENT = {
211 "json": FixedIPsClientJSON,
212 "xml": FixedIPsClientXML
213}
214
Leo Toyodaa5278912013-04-16 15:40:12 +0900215AVAILABILITY_ZONE_CLIENT = {
216 "json": AvailabilityZoneClientJSON,
217 "xml": AvailabilityZoneClientXML,
218}
219
harika-vakadia92dd742013-02-19 20:41:22 +0530220SERVICE_CLIENT = {
221 "json": ServiceClientJSON,
222 "xml": ServiceClientXML,
223}
224
Mitsuhiko Yamazakiae8fc532013-04-22 11:17:35 +0900225AGGREGATES_CLIENT = {
226 "json": AggregatesClientJSON,
227 "xml": AggregatesClientXML,
228}
229
Leo Toyoda3ae31e12013-04-19 11:19:57 +0900230SERVICES_CLIENT = {
231 "json": ServicesClientJSON,
232 "xml": ServicesClientXML,
233}
234
Leo Toyodad80b6a02013-05-08 12:15:13 +0900235TENANT_USAGES_CLIENT = {
236 "json": TenantUsagesClientJSON,
237 "xml": TenantUsagesClientXML,
238}
239
harika-vakadi40e10112013-02-08 14:38:09 +0530240POLICY_CLIENT = {
241 "json": PolicyClientJSON,
242 "xml": PolicyClientXML,
243}
244
Tony Yang3d5f1632013-06-06 14:17:57 +0800245HYPERVISOR_CLIENT = {
246 "json": HypervisorClientJSON,
247 "xml": HypervisorClientXML,
248}
249
nayna-patelb35f7232013-06-28 07:08:44 +0000250V3_TOKEN_CLIENT = {
251 "json": V3TokenClientJSON,
252 "xml": V3TokenClientXML,
253}
254
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800255
Daryl Walleck1465d612011-11-02 02:22:15 -0500256class Manager(object):
257
Jay Pipes3f981df2012-03-27 18:59:44 -0400258 """
259 Top level manager for OpenStack Compute clients
260 """
261
James E. Blaire6d8ee12013-01-18 21:33:45 +0000262 def __init__(self, username=None, password=None, tenant_name=None,
263 interface='json'):
Jay Pipesff10d552012-04-06 14:18:50 -0400264 """
265 We allow overriding of the credentials used within the various
266 client classes managed by the Manager object. Left as None, the
267 standard username/password/tenant_name is used.
268
269 :param username: Override of the username
270 :param password: Override of the password
271 :param tenant_name: Override of the tenant name
272 """
Jay Pipesf38eaac2012-06-21 13:37:35 -0400273 self.config = config.TempestConfig()
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800274
Jay Pipesf38eaac2012-06-21 13:37:35 -0400275 # If no creds are provided, we fall back on the defaults
276 # in the config file for the Compute API.
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100277 self.username = username or self.config.identity.username
278 self.password = password or self.config.identity.password
279 self.tenant_name = tenant_name or self.config.identity.tenant_name
Daryl Walleckced8eb82012-03-19 13:52:37 -0500280
Rohit Karajgidd47d7e2012-07-31 04:11:01 -0700281 if None in (self.username, self.password, self.tenant_name):
Jay Pipes3f981df2012-03-27 18:59:44 -0400282 msg = ("Missing required credentials. "
Sean Dague43cd9052013-07-19 12:20:04 -0400283 "username: %(u)s, password: %(p)s, "
284 "tenant_name: %(t)s" %
285 {'u': username, 'p': password, 't': tenant_name})
Jay Pipes3f981df2012-03-27 18:59:44 -0400286 raise exceptions.InvalidConfiguration(msg)
287
Jay Pipes7c88eb22013-01-16 21:32:43 -0500288 self.auth_url = self.config.identity.uri
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500289 self.auth_url_v3 = self.config.identity.uri_v3
Daryl Walleck587385b2012-03-03 13:00:26 -0600290
Li Ma216550f2013-06-12 11:26:08 -0700291 client_args = (self.config, self.username, self.password,
292 self.auth_url, self.tenant_name)
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500293
Li Ma216550f2013-06-12 11:26:08 -0700294 if self.auth_url_v3:
295 auth_version = 'v3'
296 client_args_v3_auth = (self.config, self.username,
297 self.password, self.auth_url_v3,
298 self.tenant_name, auth_version)
Daryl Walleck1465d612011-11-02 02:22:15 -0500299 else:
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500300 client_args_v3_auth = None
301
Dan Smithcf8fab62012-08-14 08:03:48 -0700302 try:
303 self.servers_client = SERVERS_CLIENTS[interface](*client_args)
raiesmh0867698322013-08-20 13:09:01 +0530304 self.network_client = NETWORKS_CLIENTS[interface](*client_args)
Matthew Treinish33634462012-08-16 16:51:23 -0400305 self.limits_client = LIMITS_CLIENTS[interface](*client_args)
Frederic Lepiedcf1868b2013-07-28 18:07:15 -0400306 if self.config.service_available.glance:
307 self.images_client = IMAGES_CLIENTS[interface](*client_args)
Mauro S. M. Rodriguesa636f532012-08-21 11:07:53 -0400308 self.keypairs_client = KEYPAIRS_CLIENTS[interface](*client_args)
rajalakshmi-ganesan1982c3c2013-01-10 14:56:45 +0530309 self.quotas_client = QUOTAS_CLIENTS[interface](*client_args)
Tiago Melloeda03b52012-08-22 23:47:29 -0300310 self.flavors_client = FLAVORS_CLIENTS[interface](*client_args)
Zhongyue Luoe0884a32012-09-25 17:24:17 +0800311 ext_cli = EXTENSIONS_CLIENTS[interface](*client_args)
312 self.extensions_client = ext_cli
313 vol_ext_cli = VOLUMES_EXTENSIONS_CLIENTS[interface](*client_args)
314 self.volumes_extensions_client = vol_ext_cli
Vincent Hou22f03c72012-08-24 17:55:13 +0800315 self.floating_ips_client = FLOAT_CLIENTS[interface](*client_args)
Attila Fazekas36b1fcf2013-01-31 16:41:04 +0100316 self.snapshots_client = SNAPSHOTS_CLIENTS[interface](*client_args)
Matthew Treinish9854d5b2012-09-20 10:22:13 -0400317 self.volumes_client = VOLUMES_CLIENTS[interface](*client_args)
Attila Fazekas3dcdae12013-02-14 12:50:04 +0100318 self.volume_types_client = \
319 VOLUME_TYPES_CLIENTS[interface](*client_args)
Attila Fazekas407b6db2013-01-19 12:48:36 +0100320 self.identity_client = IDENTITY_CLIENT[interface](*client_args)
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +0530321 self.identity_v3_client = \
322 IDENTITY_V3_CLIENT[interface](*client_args)
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800323 self.token_client = TOKEN_CLIENT[interface](self.config)
Vincent Houead03dc2012-08-24 21:35:11 +0800324 self.security_groups_client = \
325 SECURITY_GROUPS_CLIENT[interface](*client_args)
Dan Smith8ad1c472013-02-26 13:03:16 -0500326 self.interfaces_client = INTERFACES_CLIENT[interface](*client_args)
rajalakshmi-ganesanab426722013-02-08 15:49:15 +0530327 self.endpoints_client = ENDPOINT_CLIENT[interface](*client_args)
Mauro S. M. Rodriguesf5166402013-04-01 10:25:26 -0400328 self.fixed_ips_client = FIXED_IPS_CLIENT[interface](*client_args)
Leo Toyodaa5278912013-04-16 15:40:12 +0900329 self.availability_zone_client = \
330 AVAILABILITY_ZONE_CLIENT[interface](*client_args)
harika-vakadia92dd742013-02-19 20:41:22 +0530331 self.service_client = SERVICE_CLIENT[interface](*client_args)
Mitsuhiko Yamazakiae8fc532013-04-22 11:17:35 +0900332 self.aggregates_client = AGGREGATES_CLIENT[interface](*client_args)
Leo Toyoda3ae31e12013-04-19 11:19:57 +0900333 self.services_client = SERVICES_CLIENT[interface](*client_args)
Leo Toyodad80b6a02013-05-08 12:15:13 +0900334 self.tenant_usages_client = \
335 TENANT_USAGES_CLIENT[interface](*client_args)
harika-vakadi40e10112013-02-08 14:38:09 +0530336 self.policy_client = POLICY_CLIENT[interface](*client_args)
Tony Yang3d5f1632013-06-06 14:17:57 +0800337 self.hypervisor_client = HYPERVISOR_CLIENT[interface](*client_args)
nayna-patelb35f7232013-06-28 07:08:44 +0000338 self.token_v3_client = V3_TOKEN_CLIENT[interface](*client_args)
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500339
340 if client_args_v3_auth:
341 self.servers_client_v3_auth = SERVERS_CLIENTS[interface](
342 *client_args_v3_auth)
343 else:
344 self.servers_client_v3_auth = None
345
Dan Smithcf8fab62012-08-14 08:03:48 -0700346 except KeyError:
347 msg = "Unsupported interface type `%s'" % interface
348 raise exceptions.InvalidConfiguration(msg)
Attila Fazekas8e99b992013-02-24 09:53:23 +0100349 self.hosts_client = HostsClientJSON(*client_args)
dwalleck5d734432012-10-04 01:11:47 -0500350 self.account_client = AccountClient(*client_args)
Frederic Lepiedcf1868b2013-07-28 18:07:15 -0400351 if self.config.service_available.glance:
352 self.image_client = ImageClientJSON(*client_args)
353 self.image_client_v2 = ImageClientV2JSON(*client_args)
dwalleck5d734432012-10-04 01:11:47 -0500354 self.container_client = ContainerClient(*client_args)
355 self.object_client = ObjectClient(*client_args)
Steve Bakerc60e4e32013-05-06 15:22:41 +1200356 self.orchestration_client = OrchestrationClient(*client_args)
Attila Fazekas1aed6202013-02-11 14:47:45 +0100357 self.ec2api_client = botoclients.APIClientEC2(*client_args)
358 self.s3_client = botoclients.ObjectClientS3(*client_args)
harika-vakadi1a9ad612012-12-14 19:12:08 +0530359 self.custom_object_client = ObjectClientCustomizedHeader(*client_args)
harika-vakadi2daed0a2013-01-01 20:51:39 +0530360 self.custom_account_client = \
361 AccountClientCustomizedHeader(*client_args)
Jay Pipes50677282012-01-06 15:39:20 -0500362
363
Jay Pipesff10d552012-04-06 14:18:50 -0400364class AltManager(Manager):
365
366 """
367 Manager object that uses the alt_XXX credentials for its
368 managed client objects
369 """
370
371 def __init__(self):
Jay Pipesf38eaac2012-06-21 13:37:35 -0400372 conf = config.TempestConfig()
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100373 super(AltManager, self).__init__(conf.identity.alt_username,
374 conf.identity.alt_password,
375 conf.identity.alt_tenant_name)
Jay Pipesff10d552012-04-06 14:18:50 -0400376
377
378class AdminManager(Manager):
379
380 """
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100381 Manager object that uses the admin credentials for its
Jay Pipesff10d552012-04-06 14:18:50 -0400382 managed client objects
383 """
384
James E. Blaire6d8ee12013-01-18 21:33:45 +0000385 def __init__(self, interface='json'):
Jay Pipesf38eaac2012-06-21 13:37:35 -0400386 conf = config.TempestConfig()
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100387 super(AdminManager, self).__init__(conf.identity.admin_username,
388 conf.identity.admin_password,
389 conf.identity.admin_tenant_name,
James E. Blaire6d8ee12013-01-18 21:33:45 +0000390 interface=interface)
Jay Pipesff10d552012-04-06 14:18:50 -0400391
392
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100393class ComputeAdminManager(Manager):
394
395 """
396 Manager object that uses the compute_admin credentials for its
397 managed client objects
398 """
399
400 def __init__(self, interface='json'):
401 conf = config.TempestConfig()
402 base = super(ComputeAdminManager, self)
403 base.__init__(conf.compute_admin.username,
404 conf.compute_admin.password,
405 conf.compute_admin.tenant_name,
406 interface=interface)
Steve Bakerc60e4e32013-05-06 15:22:41 +1200407
408
409class OrchestrationManager(Manager):
410 """
411 Manager object that uses the admin credentials for its
412 so that heat templates can create users
413 """
414 def __init__(self, interface='json'):
415 conf = config.TempestConfig()
416 base = super(OrchestrationManager, self)
417 base.__init__(conf.identity.admin_username,
418 conf.identity.admin_password,
Steve Bakerfd86f3c2013-06-28 12:51:20 +1200419 conf.identity.tenant_name,
Steve Bakerc60e4e32013-05-06 15:22:41 +1200420 interface=interface)