blob: 22ed825e88c277a69f7f8dd8c5f03edc0cb0302d [file] [log] [blame]
Jay Pipes3f981df2012-03-27 18:59:44 -04001# vim: tabstop=4 shiftwidth=4 softtabstop=4
2
ZhiQiang Fan39f97222013-09-20 04:49:44 +08003# Copyright 2012 OpenStack Foundation
Jay Pipes3f981df2012-03-27 18:59:44 -04004# 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
ivan-zhud57f3cf2013-11-06 16:59:52 +080026from tempest.services.compute.json.certificates_client import \
27 CertificatesClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050028from tempest.services.compute.json.extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053029 ExtensionsClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040030from tempest.services.compute.json.fixed_ips_client import FixedIPsClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050031from tempest.services.compute.json.flavors_client import FlavorsClientJSON
32from tempest.services.compute.json.floating_ips_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053033 FloatingIPsClientJSON
Attila Fazekas8e99b992013-02-24 09:53:23 +010034from tempest.services.compute.json.hosts_client import HostsClientJSON
Tony Yang3d5f1632013-06-06 14:17:57 +080035from tempest.services.compute.json.hypervisor_client import \
36 HypervisorClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050037from tempest.services.compute.json.images_client import ImagesClientJSON
ivan-zhuef7a1bd2013-10-22 17:56:46 +080038from tempest.services.compute.json.instance_usage_audit_log_client import \
39 InstanceUsagesAuditLogClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040040from tempest.services.compute.json.interfaces_client import \
41 InterfacesClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010042from tempest.services.compute.json.keypairs_client import KeyPairsClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050043from tempest.services.compute.json.limits_client import LimitsClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010044from tempest.services.compute.json.quotas_client import QuotasClientJSON
Matthew Treinisha83a16e2012-12-07 13:44:02 -050045from tempest.services.compute.json.security_groups_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053046 SecurityGroupsClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010047from tempest.services.compute.json.servers_client import ServersClientJSON
Leo Toyoda3ae31e12013-04-19 11:19:57 +090048from tempest.services.compute.json.services_client import ServicesClientJSON
Leo Toyodad80b6a02013-05-08 12:15:13 +090049from tempest.services.compute.json.tenant_usages_client import \
50 TenantUsagesClientJSON
Matthew Treinisha83a16e2012-12-07 13:44:02 -050051from tempest.services.compute.json.volumes_extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053052 VolumesExtensionsClientJSON
ivan-zhuac7b3802013-08-21 16:03:53 +080053from tempest.services.compute.v3.json.availability_zone_client import \
54 AvailabilityZoneV3ClientJSON
ivan-zhu0e062922013-12-17 16:14:12 +080055from tempest.services.compute.v3.json.certificates_client import \
56 CertificatesV3ClientJSON
ivan-zhu31d98482013-08-22 10:51:48 +080057from tempest.services.compute.v3.json.extensions_client import \
58 ExtensionsV3ClientJSON
ivan-zhu6f5f9e92013-08-21 22:16:37 +080059from tempest.services.compute.v3.json.hypervisor_client import \
60 HypervisorV3ClientJSON
ivan-zhu91feab92013-08-15 18:25:33 +080061from tempest.services.compute.v3.json.interfaces_client import \
62 InterfacesV3ClientJSON
ivan-zhu8f992be2013-07-31 14:56:58 +080063from tempest.services.compute.v3.json.servers_client import \
64 ServersV3ClientJSON
ivan-zhu5c86ae62013-08-20 21:09:01 +080065from tempest.services.compute.v3.json.services_client import \
66 ServicesV3ClientJSON
ivan-zhubec84a32013-08-21 15:32:05 +080067from tempest.services.compute.v3.json.tenant_usages_client import \
68 TenantUsagesV3ClientJSON
ivan-zhuac7b3802013-08-21 16:03:53 +080069from tempest.services.compute.v3.xml.availability_zone_client import \
70 AvailabilityZoneV3ClientXML
ivan-zhu0e062922013-12-17 16:14:12 +080071from tempest.services.compute.v3.xml.certificates_client import \
72 CertificatesV3ClientXML
ivan-zhu31d98482013-08-22 10:51:48 +080073from tempest.services.compute.v3.xml.extensions_client import \
74 ExtensionsV3ClientXML
ivan-zhu6f5f9e92013-08-21 22:16:37 +080075from tempest.services.compute.v3.xml.hypervisor_client import \
76 HypervisorV3ClientXML
ivan-zhu91feab92013-08-15 18:25:33 +080077from tempest.services.compute.v3.xml.interfaces_client import \
78 InterfacesV3ClientXML
ivan-zhu8f992be2013-07-31 14:56:58 +080079from tempest.services.compute.v3.xml.servers_client import ServersV3ClientXML
ivan-zhu5c86ae62013-08-20 21:09:01 +080080from tempest.services.compute.v3.xml.services_client import \
81 ServicesV3ClientXML
ivan-zhubec84a32013-08-21 15:32:05 +080082from tempest.services.compute.v3.xml.tenant_usages_client import \
83 TenantUsagesV3ClientXML
Mitsuhiko Yamazakiae8fc532013-04-22 11:17:35 +090084from tempest.services.compute.xml.aggregates_client import AggregatesClientXML
Leo Toyodaa5278912013-04-16 15:40:12 +090085from tempest.services.compute.xml.availability_zone_client import \
86 AvailabilityZoneClientXML
ivan-zhud57f3cf2013-11-06 16:59:52 +080087from tempest.services.compute.xml.certificates_client import \
88 CertificatesClientXML
dwallecke62b9f02012-10-10 23:34:42 -050089from tempest.services.compute.xml.extensions_client import ExtensionsClientXML
Sean Dague2416cf32013-04-10 08:29:07 -040090from tempest.services.compute.xml.fixed_ips_client import FixedIPsClientXML
dwallecke62b9f02012-10-10 23:34:42 -050091from tempest.services.compute.xml.flavors_client import FlavorsClientXML
92from tempest.services.compute.xml.floating_ips_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053093 FloatingIPsClientXML
Tony Yang3d5f1632013-06-06 14:17:57 +080094from tempest.services.compute.xml.hypervisor_client import HypervisorClientXML
dwallecke62b9f02012-10-10 23:34:42 -050095from tempest.services.compute.xml.images_client import ImagesClientXML
ivan-zhuef7a1bd2013-10-22 17:56:46 +080096from tempest.services.compute.xml.instance_usage_audit_log_client import \
97 InstanceUsagesAuditLogClientXML
Sean Dague2416cf32013-04-10 08:29:07 -040098from tempest.services.compute.xml.interfaces_client import \
99 InterfacesClientXML
dwallecke62b9f02012-10-10 23:34:42 -0500100from tempest.services.compute.xml.keypairs_client import KeyPairsClientXML
101from tempest.services.compute.xml.limits_client import LimitsClientXML
rajalakshmi-ganesan1982c3c2013-01-10 14:56:45 +0530102from tempest.services.compute.xml.quotas_client import QuotasClientXML
dwallecke62b9f02012-10-10 23:34:42 -0500103from tempest.services.compute.xml.security_groups_client \
harika-vakadi1a9ad612012-12-14 19:12:08 +0530104 import SecurityGroupsClientXML
dwallecke62b9f02012-10-10 23:34:42 -0500105from tempest.services.compute.xml.servers_client import ServersClientXML
Leo Toyoda3ae31e12013-04-19 11:19:57 +0900106from tempest.services.compute.xml.services_client import ServicesClientXML
Leo Toyodad80b6a02013-05-08 12:15:13 +0900107from tempest.services.compute.xml.tenant_usages_client import \
108 TenantUsagesClientXML
Matthew Treinisha83a16e2012-12-07 13:44:02 -0500109from tempest.services.compute.xml.volumes_extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +0530110 VolumesExtensionsClientXML
Attila Fazekas407b6db2013-01-19 12:48:36 +0100111from tempest.services.identity.json.identity_client import IdentityClientJSON
112from tempest.services.identity.json.identity_client import TokenClientJSON
nayna-patel914b4712013-07-16 08:29:05 +0000113from tempest.services.identity.v3.json.credentials_client import \
114 CredentialsClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -0400115from tempest.services.identity.v3.json.endpoints_client import \
116 EndPointClientJSON
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +0530117from tempest.services.identity.v3.json.identity_client import \
118 IdentityV3ClientJSON
nayna-patelb35f7232013-06-28 07:08:44 +0000119from tempest.services.identity.v3.json.identity_client import V3TokenClientJSON
harika-vakadi40e10112013-02-08 14:38:09 +0530120from tempest.services.identity.v3.json.policy_client import PolicyClientJSON
harika-vakadia92dd742013-02-19 20:41:22 +0530121from tempest.services.identity.v3.json.service_client import \
122 ServiceClientJSON
nayna-patel914b4712013-07-16 08:29:05 +0000123from tempest.services.identity.v3.xml.credentials_client import \
124 CredentialsClientXML
rajalakshmi-ganesanab426722013-02-08 15:49:15 +0530125from tempest.services.identity.v3.xml.endpoints_client import EndPointClientXML
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +0530126from tempest.services.identity.v3.xml.identity_client import \
127 IdentityV3ClientXML
nayna-patelb35f7232013-06-28 07:08:44 +0000128from tempest.services.identity.v3.xml.identity_client import V3TokenClientXML
harika-vakadi40e10112013-02-08 14:38:09 +0530129from tempest.services.identity.v3.xml.policy_client import PolicyClientXML
harika-vakadia92dd742013-02-19 20:41:22 +0530130from tempest.services.identity.v3.xml.service_client import \
131 ServiceClientXML
Attila Fazekas407b6db2013-01-19 12:48:36 +0100132from tempest.services.identity.xml.identity_client import IdentityClientXML
133from tempest.services.identity.xml.identity_client import TokenClientXML
Matthew Treinish6d59c992013-03-01 16:20:04 -0500134from tempest.services.image.v1.json.image_client import ImageClientJSON
Matthew Treinisha62347f2013-03-01 16:37:30 -0500135from tempest.services.image.v2.json.image_client import ImageClientV2JSON
raiesmh0867698322013-08-20 13:09:01 +0530136from tempest.services.network.json.network_client import NetworkClientJSON
137from tempest.services.network.xml.network_client import NetworkClientXML
dwalleck5d734432012-10-04 01:11:47 -0500138from tempest.services.object_storage.account_client import AccountClient
harika-vakadi2daed0a2013-01-01 20:51:39 +0530139from tempest.services.object_storage.account_client import \
140 AccountClientCustomizedHeader
Attila Fazekas6968dd52013-02-15 17:05:53 +0100141from tempest.services.object_storage.container_client import ContainerClient
142from tempest.services.object_storage.object_client import ObjectClient
143from tempest.services.object_storage.object_client import \
144 ObjectClientCustomizedHeader
Steve Bakerc60e4e32013-05-06 15:22:41 +1200145from tempest.services.orchestration.json.orchestration_client import \
146 OrchestrationClient
Nayna Patel4a5024c2013-11-18 07:08:23 +0000147from tempest.services.volume.json.admin.volume_hosts_client import \
148 VolumeHostsClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +0100149from tempest.services.volume.json.admin.volume_types_client import \
150 VolumeTypesClientJSON
151from tempest.services.volume.json.snapshots_client import SnapshotsClientJSON
152from tempest.services.volume.json.volumes_client import VolumesClientJSON
Nayna Patel4a5024c2013-11-18 07:08:23 +0000153from tempest.services.volume.xml.admin.volume_hosts_client import \
154 VolumeHostsClientXML
Attila Fazekas6968dd52013-02-15 17:05:53 +0100155from tempest.services.volume.xml.admin.volume_types_client import \
156 VolumeTypesClientXML
157from tempest.services.volume.xml.snapshots_client import SnapshotsClientXML
158from tempest.services.volume.xml.volumes_client import VolumesClientXML
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800159
Jay Pipes3f981df2012-03-27 18:59:44 -0400160LOG = logging.getLogger(__name__)
161
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800162
Daryl Walleck1465d612011-11-02 02:22:15 -0500163class Manager(object):
164
Jay Pipes3f981df2012-03-27 18:59:44 -0400165 """
166 Top level manager for OpenStack Compute clients
167 """
168
James E. Blaire6d8ee12013-01-18 21:33:45 +0000169 def __init__(self, username=None, password=None, tenant_name=None,
170 interface='json'):
Jay Pipesff10d552012-04-06 14:18:50 -0400171 """
172 We allow overriding of the credentials used within the various
173 client classes managed by the Manager object. Left as None, the
174 standard username/password/tenant_name is used.
175
176 :param username: Override of the username
177 :param password: Override of the password
178 :param tenant_name: Override of the tenant name
179 """
Jay Pipesf38eaac2012-06-21 13:37:35 -0400180 self.config = config.TempestConfig()
Rohit Karajgie1b050d2011-12-02 16:13:18 -0800181
Jay Pipesf38eaac2012-06-21 13:37:35 -0400182 # If no creds are provided, we fall back on the defaults
183 # in the config file for the Compute API.
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100184 self.username = username or self.config.identity.username
185 self.password = password or self.config.identity.password
186 self.tenant_name = tenant_name or self.config.identity.tenant_name
Daryl Walleckced8eb82012-03-19 13:52:37 -0500187
Rohit Karajgidd47d7e2012-07-31 04:11:01 -0700188 if None in (self.username, self.password, self.tenant_name):
Jay Pipes3f981df2012-03-27 18:59:44 -0400189 msg = ("Missing required credentials. "
Sean Dague43cd9052013-07-19 12:20:04 -0400190 "username: %(u)s, password: %(p)s, "
191 "tenant_name: %(t)s" %
192 {'u': username, 'p': password, 't': tenant_name})
Jay Pipes3f981df2012-03-27 18:59:44 -0400193 raise exceptions.InvalidConfiguration(msg)
194
Jay Pipes7c88eb22013-01-16 21:32:43 -0500195 self.auth_url = self.config.identity.uri
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500196 self.auth_url_v3 = self.config.identity.uri_v3
Daryl Walleck587385b2012-03-03 13:00:26 -0600197
Li Ma216550f2013-06-12 11:26:08 -0700198 client_args = (self.config, self.username, self.password,
199 self.auth_url, self.tenant_name)
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500200
Li Ma216550f2013-06-12 11:26:08 -0700201 if self.auth_url_v3:
202 auth_version = 'v3'
203 client_args_v3_auth = (self.config, self.username,
204 self.password, self.auth_url_v3,
205 self.tenant_name, auth_version)
Daryl Walleck1465d612011-11-02 02:22:15 -0500206 else:
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500207 client_args_v3_auth = None
208
Attila Fazekas7e678de2013-07-13 14:13:28 +0200209 self.servers_client_v3_auth = None
210
211 if interface == 'xml':
ivan-zhud57f3cf2013-11-06 16:59:52 +0800212 self.certificates_client = CertificatesClientXML(*client_args)
ivan-zhu0e062922013-12-17 16:14:12 +0800213 self.certificates_v3_client = CertificatesV3ClientXML(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200214 self.servers_client = ServersClientXML(*client_args)
ivan-zhu8f992be2013-07-31 14:56:58 +0800215 self.servers_v3_client = ServersV3ClientXML(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200216 self.limits_client = LimitsClientXML(*client_args)
217 self.images_client = ImagesClientXML(*client_args)
218 self.keypairs_client = KeyPairsClientXML(*client_args)
219 self.quotas_client = QuotasClientXML(*client_args)
220 self.flavors_client = FlavorsClientXML(*client_args)
ivan-zhu31d98482013-08-22 10:51:48 +0800221 self.extensions_v3_client = ExtensionsV3ClientXML(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200222 self.extensions_client = ExtensionsClientXML(*client_args)
223 self.volumes_extensions_client = VolumesExtensionsClientXML(
224 *client_args)
225 self.floating_ips_client = FloatingIPsClientXML(*client_args)
226 self.snapshots_client = SnapshotsClientXML(*client_args)
227 self.volumes_client = VolumesClientXML(*client_args)
228 self.volume_types_client = VolumeTypesClientXML(*client_args)
229 self.identity_client = IdentityClientXML(*client_args)
230 self.identity_v3_client = IdentityV3ClientXML(*client_args)
231 self.token_client = TokenClientXML(self.config)
232 self.security_groups_client = SecurityGroupsClientXML(
233 *client_args)
ivan-zhu91feab92013-08-15 18:25:33 +0800234 self.interfaces_v3_client = InterfacesV3ClientXML(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200235 self.interfaces_client = InterfacesClientXML(*client_args)
236 self.endpoints_client = EndPointClientXML(*client_args)
237 self.fixed_ips_client = FixedIPsClientXML(*client_args)
ivan-zhuac7b3802013-08-21 16:03:53 +0800238 self.availability_zone_v3_client = AvailabilityZoneV3ClientXML(
239 *client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200240 self.availability_zone_client = AvailabilityZoneClientXML(
241 *client_args)
ivan-zhu5c86ae62013-08-20 21:09:01 +0800242 self.services_v3_client = ServicesV3ClientXML(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200243 self.service_client = ServiceClientXML(*client_args)
244 self.aggregates_client = AggregatesClientXML(*client_args)
245 self.services_client = ServicesClientXML(*client_args)
ivan-zhubec84a32013-08-21 15:32:05 +0800246 self.tenant_usages_v3_client = TenantUsagesV3ClientXML(
247 *client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200248 self.tenant_usages_client = TenantUsagesClientXML(*client_args)
249 self.policy_client = PolicyClientXML(*client_args)
ivan-zhu6f5f9e92013-08-21 22:16:37 +0800250 self.hypervisor_v3_client = HypervisorV3ClientXML(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200251 self.hypervisor_client = HypervisorClientXML(*client_args)
252 self.token_v3_client = V3TokenClientXML(*client_args)
253 self.network_client = NetworkClientXML(*client_args)
254 self.credentials_client = CredentialsClientXML(*client_args)
ivan-zhuef7a1bd2013-10-22 17:56:46 +0800255 self.instance_usages_audit_log_client = \
256 InstanceUsagesAuditLogClientXML(*client_args)
Nayna Patel4a5024c2013-11-18 07:08:23 +0000257 self.volume_hosts_client = VolumeHostsClientXML(*client_args)
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500258
259 if client_args_v3_auth:
Attila Fazekas7e678de2013-07-13 14:13:28 +0200260 self.servers_client_v3_auth = ServersClientXML(
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500261 *client_args_v3_auth)
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500262
Attila Fazekas7e678de2013-07-13 14:13:28 +0200263 elif interface == 'json':
ivan-zhud57f3cf2013-11-06 16:59:52 +0800264 self.certificates_client = CertificatesClientJSON(*client_args)
ivan-zhu0e062922013-12-17 16:14:12 +0800265 self.certificates_v3_client = CertificatesV3ClientJSON(
266 *client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200267 self.servers_client = ServersClientJSON(*client_args)
ivan-zhu8f992be2013-07-31 14:56:58 +0800268 self.servers_v3_client = ServersV3ClientJSON(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200269 self.limits_client = LimitsClientJSON(*client_args)
270 self.images_client = ImagesClientJSON(*client_args)
271 self.keypairs_client = KeyPairsClientJSON(*client_args)
272 self.quotas_client = QuotasClientJSON(*client_args)
273 self.flavors_client = FlavorsClientJSON(*client_args)
ivan-zhu31d98482013-08-22 10:51:48 +0800274 self.extensions_v3_client = ExtensionsV3ClientJSON(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200275 self.extensions_client = ExtensionsClientJSON(*client_args)
276 self.volumes_extensions_client = VolumesExtensionsClientJSON(
277 *client_args)
278 self.floating_ips_client = FloatingIPsClientJSON(*client_args)
279 self.snapshots_client = SnapshotsClientJSON(*client_args)
280 self.volumes_client = VolumesClientJSON(*client_args)
281 self.volume_types_client = VolumeTypesClientJSON(*client_args)
282 self.identity_client = IdentityClientJSON(*client_args)
283 self.identity_v3_client = IdentityV3ClientJSON(*client_args)
284 self.token_client = TokenClientJSON(self.config)
285 self.security_groups_client = SecurityGroupsClientJSON(
286 *client_args)
ivan-zhu91feab92013-08-15 18:25:33 +0800287 self.interfaces_v3_client = InterfacesV3ClientJSON(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200288 self.interfaces_client = InterfacesClientJSON(*client_args)
289 self.endpoints_client = EndPointClientJSON(*client_args)
290 self.fixed_ips_client = FixedIPsClientJSON(*client_args)
ivan-zhuac7b3802013-08-21 16:03:53 +0800291 self.availability_zone_v3_client = AvailabilityZoneV3ClientJSON(
292 *client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200293 self.availability_zone_client = AvailabilityZoneClientJSON(
294 *client_args)
ivan-zhu5c86ae62013-08-20 21:09:01 +0800295 self.services_v3_client = ServicesV3ClientJSON(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200296 self.service_client = ServiceClientJSON(*client_args)
297 self.aggregates_client = AggregatesClientJSON(*client_args)
298 self.services_client = ServicesClientJSON(*client_args)
ivan-zhubec84a32013-08-21 15:32:05 +0800299 self.tenant_usages_v3_client = TenantUsagesV3ClientJSON(
300 *client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200301 self.tenant_usages_client = TenantUsagesClientJSON(*client_args)
302 self.policy_client = PolicyClientJSON(*client_args)
ivan-zhu6f5f9e92013-08-21 22:16:37 +0800303 self.hypervisor_v3_client = HypervisorV3ClientJSON(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200304 self.hypervisor_client = HypervisorClientJSON(*client_args)
305 self.token_v3_client = V3TokenClientJSON(*client_args)
306 self.network_client = NetworkClientJSON(*client_args)
307 self.credentials_client = CredentialsClientJSON(*client_args)
ivan-zhuef7a1bd2013-10-22 17:56:46 +0800308 self.instance_usages_audit_log_client = \
309 InstanceUsagesAuditLogClientJSON(*client_args)
Nayna Patel4a5024c2013-11-18 07:08:23 +0000310 self.volume_hosts_client = VolumeHostsClientJSON(*client_args)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200311
312 if client_args_v3_auth:
313 self.servers_client_v3_auth = ServersClientJSON(
314 *client_args_v3_auth)
315 else:
Dan Smithcf8fab62012-08-14 08:03:48 -0700316 msg = "Unsupported interface type `%s'" % interface
317 raise exceptions.InvalidConfiguration(msg)
Attila Fazekas7e678de2013-07-13 14:13:28 +0200318
319 # common clients
Attila Fazekas8e99b992013-02-24 09:53:23 +0100320 self.hosts_client = HostsClientJSON(*client_args)
dwalleck5d734432012-10-04 01:11:47 -0500321 self.account_client = AccountClient(*client_args)
Frederic Lepiedcf1868b2013-07-28 18:07:15 -0400322 if self.config.service_available.glance:
323 self.image_client = ImageClientJSON(*client_args)
324 self.image_client_v2 = ImageClientV2JSON(*client_args)
dwalleck5d734432012-10-04 01:11:47 -0500325 self.container_client = ContainerClient(*client_args)
326 self.object_client = ObjectClient(*client_args)
Steve Bakerc60e4e32013-05-06 15:22:41 +1200327 self.orchestration_client = OrchestrationClient(*client_args)
Attila Fazekas1aed6202013-02-11 14:47:45 +0100328 self.ec2api_client = botoclients.APIClientEC2(*client_args)
329 self.s3_client = botoclients.ObjectClientS3(*client_args)
harika-vakadi1a9ad612012-12-14 19:12:08 +0530330 self.custom_object_client = ObjectClientCustomizedHeader(*client_args)
harika-vakadi2daed0a2013-01-01 20:51:39 +0530331 self.custom_account_client = \
332 AccountClientCustomizedHeader(*client_args)
Jay Pipes50677282012-01-06 15:39:20 -0500333
334
Jay Pipesff10d552012-04-06 14:18:50 -0400335class AltManager(Manager):
336
337 """
338 Manager object that uses the alt_XXX credentials for its
339 managed client objects
340 """
341
Ryan Hsucd525a22013-11-27 06:54:52 -0800342 def __init__(self, interface='json'):
Jay Pipesf38eaac2012-06-21 13:37:35 -0400343 conf = config.TempestConfig()
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100344 super(AltManager, self).__init__(conf.identity.alt_username,
345 conf.identity.alt_password,
Ryan Hsucd525a22013-11-27 06:54:52 -0800346 conf.identity.alt_tenant_name,
347 interface=interface)
Jay Pipesff10d552012-04-06 14:18:50 -0400348
349
350class AdminManager(Manager):
351
352 """
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100353 Manager object that uses the admin credentials for its
Jay Pipesff10d552012-04-06 14:18:50 -0400354 managed client objects
355 """
356
James E. Blaire6d8ee12013-01-18 21:33:45 +0000357 def __init__(self, interface='json'):
Jay Pipesf38eaac2012-06-21 13:37:35 -0400358 conf = config.TempestConfig()
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100359 super(AdminManager, self).__init__(conf.identity.admin_username,
360 conf.identity.admin_password,
361 conf.identity.admin_tenant_name,
James E. Blaire6d8ee12013-01-18 21:33:45 +0000362 interface=interface)
Jay Pipesff10d552012-04-06 14:18:50 -0400363
364
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100365class ComputeAdminManager(Manager):
366
367 """
368 Manager object that uses the compute_admin credentials for its
369 managed client objects
370 """
371
372 def __init__(self, interface='json'):
373 conf = config.TempestConfig()
374 base = super(ComputeAdminManager, self)
375 base.__init__(conf.compute_admin.username,
376 conf.compute_admin.password,
377 conf.compute_admin.tenant_name,
378 interface=interface)
Steve Bakerc60e4e32013-05-06 15:22:41 +1200379
380
381class OrchestrationManager(Manager):
382 """
383 Manager object that uses the admin credentials for its
384 so that heat templates can create users
385 """
386 def __init__(self, interface='json'):
387 conf = config.TempestConfig()
388 base = super(OrchestrationManager, self)
389 base.__init__(conf.identity.admin_username,
390 conf.identity.admin_password,
Steve Bakerfd86f3c2013-06-28 12:51:20 +1200391 conf.identity.tenant_name,
Steve Bakerc60e4e32013-05-06 15:22:41 +1200392 interface=interface)