blob: bb08d87e63979ce3304ef8a7f707c19a66ea61eb [file] [log] [blame]
ZhiQiang Fan39f97222013-09-20 04:49:44 +08001# Copyright 2012 OpenStack Foundation
Jay Pipes3f981df2012-03-27 18:59:44 -04002# All Rights Reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
Ken'ichi Ohmichi4771cbc2015-01-19 23:45:23 +000016import copy
17
Andrea Frittoli9efbe952015-01-29 12:43:09 +000018from tempest.common import cred_provider
Ken'ichi Ohmichi42662682015-01-05 05:00:04 +000019from tempest.common import negative_rest_client
Jay Pipesf38eaac2012-06-21 13:37:35 -040020from tempest import config
Andrea Frittolif9cde7e2014-02-18 09:57:04 +000021from tempest import manager
Matthew Treinishf4a9b0f2013-07-26 16:58:26 -040022from tempest.openstack.common import log as logging
Ken'ichi Ohmichi884d1062015-01-23 03:24:41 +000023from tempest.services.baremetal.v1.json.baremetal_client import \
24 BaremetalClientJSON
Attila Fazekas1aed6202013-02-11 14:47:45 +010025from tempest.services import botoclients
Yuiko Takada420f2eb2014-04-02 19:53:38 +090026from tempest.services.compute.json.agents_client import \
27 AgentsClientJSON
Mitsuhiko Yamazaki74f07072013-04-02 11:52:31 +090028from tempest.services.compute.json.aggregates_client import \
29 AggregatesClientJSON
Leo Toyodaa5278912013-04-16 15:40:12 +090030from tempest.services.compute.json.availability_zone_client import \
31 AvailabilityZoneClientJSON
YuikoTakadaac0879a2015-01-22 02:40:03 +000032from tempest.services.compute.json.baremetal_nodes_client import \
33 BaremetalNodesClientJSON
ivan-zhud57f3cf2013-11-06 16:59:52 +080034from tempest.services.compute.json.certificates_client import \
35 CertificatesClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050036from tempest.services.compute.json.extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053037 ExtensionsClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040038from tempest.services.compute.json.fixed_ips_client import FixedIPsClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050039from tempest.services.compute.json.flavors_client import FlavorsClientJSON
40from tempest.services.compute.json.floating_ips_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053041 FloatingIPsClientJSON
Attila Fazekas8e99b992013-02-24 09:53:23 +010042from tempest.services.compute.json.hosts_client import HostsClientJSON
Tony Yang3d5f1632013-06-06 14:17:57 +080043from tempest.services.compute.json.hypervisor_client import \
44 HypervisorClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050045from tempest.services.compute.json.images_client import ImagesClientJSON
ivan-zhuef7a1bd2013-10-22 17:56:46 +080046from tempest.services.compute.json.instance_usage_audit_log_client import \
47 InstanceUsagesAuditLogClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040048from tempest.services.compute.json.interfaces_client import \
49 InterfacesClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010050from tempest.services.compute.json.keypairs_client import KeyPairsClientJSON
dwallecke62b9f02012-10-10 23:34:42 -050051from tempest.services.compute.json.limits_client import LimitsClientJSON
Ken'ichi Ohmichi2fdc1822014-03-18 09:10:57 +090052from tempest.services.compute.json.migrations_client import \
53 MigrationsClientJSON
Andrea Frittolie258cd72014-07-17 04:47:26 +010054from tempest.services.compute.json.networks_client import NetworksClientJSON
Matt Riedemann848805f2014-06-16 13:23:51 -070055from tempest.services.compute.json.quotas_client import QuotaClassesClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010056from tempest.services.compute.json.quotas_client import QuotasClientJSON
Ghanshyam9d9201d2014-04-16 19:28:09 +090057from tempest.services.compute.json.security_group_default_rules_client import \
58 SecurityGroupDefaultRulesClientJSON
Matthew Treinisha83a16e2012-12-07 13:44:02 -050059from tempest.services.compute.json.security_groups_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053060 SecurityGroupsClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +010061from tempest.services.compute.json.servers_client import ServersClientJSON
Leo Toyoda3ae31e12013-04-19 11:19:57 +090062from tempest.services.compute.json.services_client import ServicesClientJSON
Ken'ichi Ohmichic3dfdb22015-01-22 04:39:58 +000063from tempest.services.compute.json.tenant_networks_client import \
64 TenantNetworksClientJSON
Leo Toyodad80b6a02013-05-08 12:15:13 +090065from tempest.services.compute.json.tenant_usages_client import \
66 TenantUsagesClientJSON
Matthew Treinisha83a16e2012-12-07 13:44:02 -050067from tempest.services.compute.json.volumes_extensions_client import \
harika-vakadi1a9ad612012-12-14 19:12:08 +053068 VolumesExtensionsClientJSON
Ken'ichi Ohmichidc5fe442015-02-13 04:00:47 +000069from tempest.services.data_processing.v1_1.data_processing_client import \
70 DataProcessingClient
Nikhil Manchandadd6886f2014-03-03 01:58:45 -080071from tempest.services.database.json.flavors_client import \
72 DatabaseFlavorsClientJSON
ravikumar-venkatesan9e81b442014-12-08 09:57:56 +000073from tempest.services.database.json.limits_client import \
74 DatabaseLimitsClientJSON
Peter Stachowski320f9c72014-04-21 16:13:23 -040075from tempest.services.database.json.versions_client import \
76 DatabaseVersionsClientJSON
Attila Fazekas407b6db2013-01-19 12:48:36 +010077from tempest.services.identity.json.identity_client import IdentityClientJSON
ghanshyamc0edda02015-02-06 15:51:40 +090078from tempest.services.identity.json.token_client import TokenClientJSON
nayna-patel914b4712013-07-16 08:29:05 +000079from tempest.services.identity.v3.json.credentials_client import \
80 CredentialsClientJSON
Sean Dague2416cf32013-04-10 08:29:07 -040081from tempest.services.identity.v3.json.endpoints_client import \
82 EndPointClientJSON
rajalakshmi-ganesan7312bb52013-01-29 20:03:42 +053083from tempest.services.identity.v3.json.identity_client import \
84 IdentityV3ClientJSON
harika-vakadi40e10112013-02-08 14:38:09 +053085from tempest.services.identity.v3.json.policy_client import PolicyClientJSON
ravikumar-venkatesan3052e942014-05-12 18:25:17 +000086from tempest.services.identity.v3.json.region_client import RegionClientJSON
harika-vakadia92dd742013-02-19 20:41:22 +053087from tempest.services.identity.v3.json.service_client import \
88 ServiceClientJSON
ghanshyamc0edda02015-02-06 15:51:40 +090089from tempest.services.identity.v3.json.token_client import V3TokenClientJSON
Matthew Treinish6d59c992013-03-01 16:20:04 -050090from tempest.services.image.v1.json.image_client import ImageClientJSON
Matthew Treinisha62347f2013-03-01 16:37:30 -050091from tempest.services.image.v2.json.image_client import ImageClientV2JSON
Victoria Martínez de la Cruz1173b6e2014-09-22 18:32:13 -030092from tempest.services.messaging.json.messaging_client import \
93 MessagingClientJSON
raiesmh0867698322013-08-20 13:09:01 +053094from tempest.services.network.json.network_client import NetworkClientJSON
dwalleck5d734432012-10-04 01:11:47 -050095from tempest.services.object_storage.account_client import AccountClient
Attila Fazekas6968dd52013-02-15 17:05:53 +010096from tempest.services.object_storage.container_client import ContainerClient
97from tempest.services.object_storage.object_client import ObjectClient
Steve Bakerc60e4e32013-05-06 15:22:41 +120098from tempest.services.orchestration.json.orchestration_client import \
99 OrchestrationClient
Nikolay Pliashechnikovb053aab2013-11-05 06:06:44 -0800100from tempest.services.telemetry.json.telemetry_client import \
101 TelemetryClientJSON
Nayna Patel4a5024c2013-11-18 07:08:23 +0000102from tempest.services.volume.json.admin.volume_hosts_client import \
103 VolumeHostsClientJSON
Sylvain Baubeaufdd34592014-02-20 18:40:10 +0100104from tempest.services.volume.json.admin.volume_quotas_client import \
105 VolumeQuotasClientJSON
Abhijeet.Jain0056b072014-04-15 09:32:29 +0530106from tempest.services.volume.json.admin.volume_services_client import \
107 VolumesServicesClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +0100108from tempest.services.volume.json.admin.volume_types_client import \
109 VolumeTypesClientJSON
Abhijeet.Jain6109bb82014-05-01 10:29:15 +0530110from tempest.services.volume.json.availability_zone_client import \
111 VolumeAvailabilityZoneClientJSON
Giulio Fidente74b08ad2014-01-18 04:02:51 +0100112from tempest.services.volume.json.backups_client import BackupsClientJSON
Matthew Treinish2324e6b2013-10-21 20:25:17 +0000113from tempest.services.volume.json.extensions_client import \
114 ExtensionsClientJSON as VolumeExtensionClientJSON
Swapnil Kulkarni7dba3e62014-08-14 09:05:07 +0000115from tempest.services.volume.json.qos_client import QosSpecsClientJSON
Attila Fazekas6968dd52013-02-15 17:05:53 +0100116from tempest.services.volume.json.snapshots_client import SnapshotsClientJSON
117from tempest.services.volume.json.volumes_client import VolumesClientJSON
Chandan Kumar65eb8592014-11-12 18:32:32 +0530118from tempest.services.volume.v2.json.admin.volume_hosts_client import \
119 VolumeHostsV2ClientJSON
Chandan Kumardd23f632014-11-17 15:27:48 +0530120from tempest.services.volume.v2.json.admin.volume_quotas_client import \
121 VolumeQuotasV2Client
jun xie9f123822014-11-20 14:21:23 +0800122from tempest.services.volume.v2.json.admin.volume_services_client import \
123 VolumesServicesV2ClientJSON
Chandan Kumar449e4c02014-09-12 07:26:19 -0400124from tempest.services.volume.v2.json.admin.volume_types_client import \
125 VolumeTypesV2ClientJSON
Zhi Kun Liu53395522014-07-18 16:05:52 +0800126from tempest.services.volume.v2.json.availability_zone_client import \
127 VolumeV2AvailabilityZoneClientJSON
jun xieebc3da32014-11-18 14:34:56 +0800128from tempest.services.volume.v2.json.backups_client import BackupsClientV2JSON
Zhi Kun Liu53395522014-07-18 16:05:52 +0800129from tempest.services.volume.v2.json.extensions_client import \
130 ExtensionsV2ClientJSON as VolumeV2ExtensionClientJSON
Swapnil Kulkarni7dba3e62014-08-14 09:05:07 +0000131from tempest.services.volume.v2.json.qos_client import QosSpecsV2ClientJSON
Zhi Kun Liu38641c62014-07-10 20:12:48 +0800132from tempest.services.volume.v2.json.snapshots_client import \
133 SnapshotsV2ClientJSON
Zhi Kun Liu8cc3c842014-01-07 10:44:34 +0800134from tempest.services.volume.v2.json.volumes_client import VolumesV2ClientJSON
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800135
Sean Dague86bd8422013-12-20 09:56:44 -0500136CONF = config.CONF
Jay Pipes3f981df2012-03-27 18:59:44 -0400137LOG = logging.getLogger(__name__)
138
Vincent Hou6b8a7b72012-08-25 01:24:33 +0800139
Andrea Frittolif9cde7e2014-02-18 09:57:04 +0000140class Manager(manager.Manager):
Daryl Walleck1465d612011-11-02 02:22:15 -0500141
Jay Pipes3f981df2012-03-27 18:59:44 -0400142 """
Andrea Frittolif9cde7e2014-02-18 09:57:04 +0000143 Top level manager for OpenStack tempest clients
Jay Pipes3f981df2012-03-27 18:59:44 -0400144 """
145
Ken'ichi Ohmichic2b11ce2015-01-16 07:17:29 +0000146 default_params = {
147 'disable_ssl_certificate_validation':
148 CONF.identity.disable_ssl_certificate_validation,
149 'ca_certs': CONF.identity.ca_certificates_file,
150 'trace_requests': CONF.debug.trace_requests
151 }
152
Ken'ichi Ohmichi737a6032015-01-21 07:04:42 +0000153 # NOTE: Tempest uses timeout values of compute API if project specific
154 # timeout values don't exist.
155 default_params_with_timeout_values = {
156 'build_interval': CONF.compute.build_interval,
157 'build_timeout': CONF.compute.build_timeout
158 }
159 default_params_with_timeout_values.update(default_params)
160
Andrea Frittolic0978352015-02-06 15:57:40 +0000161 def __init__(self, credentials=None, service=None):
Andrea Frittoli422fbdf2014-03-20 10:05:18 +0000162 super(Manager, self).__init__(credentials=credentials)
Brant Knudsonc7ca3342013-03-28 21:08:50 -0500163
Ken'ichi Ohmichi80ec0b92015-01-16 06:43:10 +0000164 self._set_compute_clients()
ravikumar-venkatesan9e81b442014-12-08 09:57:56 +0000165 self._set_database_clients()
Ken'ichi Ohmichi80ec0b92015-01-16 06:43:10 +0000166 self._set_identity_clients()
167 self._set_volume_clients()
Ken'ichi Ohmichic95eb852015-01-22 01:57:57 +0000168 self._set_object_storage_clients()
Ken'ichi Ohmichicd4a51e2014-11-13 07:25:33 +0000169
Ken'ichi Ohmichi1f88ece2015-01-23 03:33:11 +0000170 self.baremetal_client = BaremetalClientJSON(
171 self.auth_provider,
172 CONF.baremetal.catalog_type,
173 CONF.identity.region,
174 endpoint_type=CONF.baremetal.endpoint_type,
175 **self.default_params_with_timeout_values)
Ken'ichi Ohmichia182e862015-01-21 01:16:37 +0000176 self.network_client = NetworkClientJSON(
177 self.auth_provider,
178 CONF.network.catalog_type,
179 CONF.network.region or CONF.identity.region,
180 endpoint_type=CONF.network.endpoint_type,
181 build_interval=CONF.network.build_interval,
182 build_timeout=CONF.network.build_timeout,
183 **self.default_params)
Ken'ichi Ohmichi2183a652015-01-22 05:00:20 +0000184 self.messaging_client = MessagingClientJSON(
185 self.auth_provider,
186 CONF.messaging.catalog_type,
187 CONF.identity.region,
188 **self.default_params_with_timeout_values)
Sean Daguef3c75912014-11-24 11:45:11 -0500189 if CONF.service_available.ceilometer:
190 self.telemetry_client = TelemetryClientJSON(
Ken'ichi Ohmichid5dba1c2015-01-23 02:23:22 +0000191 self.auth_provider,
192 CONF.telemetry.catalog_type,
193 CONF.identity.region,
194 endpoint_type=CONF.telemetry.endpoint_type,
195 **self.default_params_with_timeout_values)
Sean Dague86bd8422013-12-20 09:56:44 -0500196 if CONF.service_available.glance:
Andrea Frittolif9cde7e2014-02-18 09:57:04 +0000197 self.image_client = ImageClientJSON(self.auth_provider)
198 self.image_client_v2 = ImageClientV2JSON(self.auth_provider)
Andrea Frittoli8bbdb162014-01-06 11:06:13 +0000199 self.orchestration_client = OrchestrationClient(
Ken'ichi Ohmichic2b11ce2015-01-16 07:17:29 +0000200 self.auth_provider,
201 CONF.orchestration.catalog_type,
202 CONF.orchestration.region or CONF.identity.region,
203 endpoint_type=CONF.orchestration.endpoint_type,
204 build_interval=CONF.orchestration.build_interval,
205 build_timeout=CONF.orchestration.build_timeout,
206 **self.default_params)
Ken'ichi Ohmichi4e83b5e2015-02-13 04:07:34 +0000207 self.data_processing_client = DataProcessingClient(
208 self.auth_provider,
209 CONF.data_processing.catalog_type,
210 CONF.identity.region,
211 endpoint_type=CONF.data_processing.endpoint_type,
212 **self.default_params_with_timeout_values)
Ken'ichi Ohmichib38eb002015-01-23 02:35:01 +0000213 self.negative_client = negative_rest_client.NegativeRestClient(
214 self.auth_provider, service)
Ken'ichi Ohmichic2b11ce2015-01-16 07:17:29 +0000215
Ken'ichi Ohmichib38eb002015-01-23 02:35:01 +0000216 # TODO(andreaf) EC2 client still do their auth, v2 only
217 ec2_client_args = (self.credentials.username,
218 self.credentials.password,
219 CONF.identity.uri,
220 self.credentials.tenant_name)
Andrea Frittoli8bbdb162014-01-06 11:06:13 +0000221 self.ec2api_client = botoclients.APIClientEC2(*ec2_client_args)
222 self.s3_client = botoclients.ObjectClientS3(*ec2_client_args)
Jay Pipes50677282012-01-06 15:39:20 -0500223
Ken'ichi Ohmichi80ec0b92015-01-16 06:43:10 +0000224 def _set_compute_clients(self):
Ken'ichi Ohmichi4771cbc2015-01-19 23:45:23 +0000225 params = {
226 'service': CONF.compute.catalog_type,
227 'region': CONF.compute.region or CONF.identity.region,
228 'endpoint_type': CONF.compute.endpoint_type,
229 'build_interval': CONF.compute.build_interval,
230 'build_timeout': CONF.compute.build_timeout
231 }
232 params.update(self.default_params)
233
234 self.agents_client = AgentsClientJSON(self.auth_provider, **params)
235 self.networks_client = NetworksClientJSON(self.auth_provider, **params)
236 self.migrations_client = MigrationsClientJSON(self.auth_provider,
237 **params)
Ken'ichi Ohmichi65225ef2014-11-19 01:06:25 +0000238 self.security_group_default_rules_client = (
Ken'ichi Ohmichi4771cbc2015-01-19 23:45:23 +0000239 SecurityGroupDefaultRulesClientJSON(self.auth_provider, **params))
240 self.certificates_client = CertificatesClientJSON(self.auth_provider,
241 **params)
242 self.servers_client = ServersClientJSON(self.auth_provider, **params)
243 self.limits_client = LimitsClientJSON(self.auth_provider, **params)
244 self.images_client = ImagesClientJSON(self.auth_provider, **params)
245 self.keypairs_client = KeyPairsClientJSON(self.auth_provider, **params)
246 self.quotas_client = QuotasClientJSON(self.auth_provider, **params)
247 self.quota_classes_client = QuotaClassesClientJSON(self.auth_provider,
248 **params)
249 self.flavors_client = FlavorsClientJSON(self.auth_provider, **params)
250 self.extensions_client = ExtensionsClientJSON(self.auth_provider,
251 **params)
252 self.floating_ips_client = FloatingIPsClientJSON(self.auth_provider,
253 **params)
Ken'ichi Ohmichicd4a51e2014-11-13 07:25:33 +0000254 self.security_groups_client = SecurityGroupsClientJSON(
Ken'ichi Ohmichi4771cbc2015-01-19 23:45:23 +0000255 self.auth_provider, **params)
256 self.interfaces_client = InterfacesClientJSON(self.auth_provider,
257 **params)
258 self.fixed_ips_client = FixedIPsClientJSON(self.auth_provider,
259 **params)
Ken'ichi Ohmichicd4a51e2014-11-13 07:25:33 +0000260 self.availability_zone_client = AvailabilityZoneClientJSON(
Ken'ichi Ohmichi4771cbc2015-01-19 23:45:23 +0000261 self.auth_provider, **params)
262 self.aggregates_client = AggregatesClientJSON(self.auth_provider,
263 **params)
264 self.services_client = ServicesClientJSON(self.auth_provider, **params)
265 self.tenant_usages_client = TenantUsagesClientJSON(self.auth_provider,
266 **params)
267 self.hosts_client = HostsClientJSON(self.auth_provider, **params)
268 self.hypervisor_client = HypervisorClientJSON(self.auth_provider,
269 **params)
Ken'ichi Ohmichicd4a51e2014-11-13 07:25:33 +0000270 self.instance_usages_audit_log_client = \
Ken'ichi Ohmichi4771cbc2015-01-19 23:45:23 +0000271 InstanceUsagesAuditLogClientJSON(self.auth_provider, **params)
Ken'ichi Ohmichic3dfdb22015-01-22 04:39:58 +0000272 self.tenant_networks_client = \
273 TenantNetworksClientJSON(self.auth_provider, **params)
YuikoTakadaac0879a2015-01-22 02:40:03 +0000274 self.baremetal_nodes_client = BaremetalNodesClientJSON(
275 self.auth_provider, **params)
Ken'ichi Ohmichi4771cbc2015-01-19 23:45:23 +0000276
277 # NOTE: The following client needs special timeout values because
278 # the API is a proxy for the other component.
279 params_volume = copy.deepcopy(params)
280 params_volume.update({
281 'build_interval': CONF.volume.build_interval,
282 'build_timeout': CONF.volume.build_timeout
283 })
284 self.volumes_extensions_client = VolumesExtensionsClientJSON(
285 self.auth_provider, **params_volume)
Ken'ichi Ohmichicd4a51e2014-11-13 07:25:33 +0000286
ravikumar-venkatesan9e81b442014-12-08 09:57:56 +0000287 def _set_database_clients(self):
288 self.database_flavors_client = DatabaseFlavorsClientJSON(
289 self.auth_provider,
290 CONF.database.catalog_type,
291 CONF.identity.region,
292 **self.default_params_with_timeout_values)
293 self.database_limits_client = DatabaseLimitsClientJSON(
294 self.auth_provider,
295 CONF.database.catalog_type,
296 CONF.identity.region,
297 **self.default_params_with_timeout_values)
298 self.database_versions_client = DatabaseVersionsClientJSON(
299 self.auth_provider,
300 CONF.database.catalog_type,
301 CONF.identity.region,
302 **self.default_params_with_timeout_values)
303
Ken'ichi Ohmichi80ec0b92015-01-16 06:43:10 +0000304 def _set_identity_clients(self):
ghanshyamd26b5cd2015-02-09 14:48:58 +0900305 params = {
306 'service': CONF.identity.catalog_type,
307 'region': CONF.identity.region,
308 'endpoint_type': 'adminURL'
309 }
310 params.update(self.default_params_with_timeout_values)
311
312 self.identity_client = IdentityClientJSON(self.auth_provider,
313 **params)
314 self.identity_v3_client = IdentityV3ClientJSON(self.auth_provider,
315 **params)
316 self.endpoints_client = EndPointClientJSON(self.auth_provider,
317 **params)
318 self.service_client = ServiceClientJSON(self.auth_provider, **params)
319 self.policy_client = PolicyClientJSON(self.auth_provider, **params)
320 self.region_client = RegionClientJSON(self.auth_provider, **params)
321 self.credentials_client = CredentialsClientJSON(self.auth_provider,
322 **params)
Ken'ichi Ohmichi41951b02014-11-19 01:57:43 +0000323 self.token_client = TokenClientJSON()
324 if CONF.identity_feature_enabled.api_v3:
325 self.token_v3_client = V3TokenClientJSON()
Ken'ichi Ohmichi41951b02014-11-19 01:57:43 +0000326
Ken'ichi Ohmichi80ec0b92015-01-16 06:43:10 +0000327 def _set_volume_clients(self):
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000328 params = {
329 'service': CONF.volume.catalog_type,
330 'region': CONF.volume.region or CONF.identity.region,
331 'endpoint_type': CONF.volume.endpoint_type,
332 'build_interval': CONF.volume.build_interval,
333 'build_timeout': CONF.volume.build_timeout
334 }
335 params.update(self.default_params)
336
337 self.volume_qos_client = QosSpecsClientJSON(self.auth_provider,
338 **params)
Ken'ichi Ohmichi532ae922014-11-19 01:37:15 +0000339 self.volume_qos_v2_client = QosSpecsV2ClientJSON(
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000340 self.auth_provider, **params)
jun xie9f123822014-11-20 14:21:23 +0800341 self.volume_services_v2_client = VolumesServicesV2ClientJSON(
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000342 self.auth_provider, **params)
343 self.backups_client = BackupsClientJSON(self.auth_provider, **params)
344 self.backups_v2_client = BackupsClientV2JSON(self.auth_provider,
345 **params)
346 self.snapshots_client = SnapshotsClientJSON(self.auth_provider,
347 **params)
348 self.snapshots_v2_client = SnapshotsV2ClientJSON(self.auth_provider,
349 **params)
Ken'ichi Ohmichi234da802015-02-13 04:48:06 +0000350 self.volumes_client = VolumesClientJSON(
351 self.auth_provider, default_volume_size=CONF.volume.volume_size,
352 **params)
353 self.volumes_v2_client = VolumesV2ClientJSON(
354 self.auth_provider, default_volume_size=CONF.volume.volume_size,
355 **params)
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000356 self.volume_types_client = VolumeTypesClientJSON(self.auth_provider,
357 **params)
Ken'ichi Ohmichi532ae922014-11-19 01:37:15 +0000358 self.volume_services_client = VolumesServicesClientJSON(
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000359 self.auth_provider, **params)
360 self.volume_hosts_client = VolumeHostsClientJSON(self.auth_provider,
361 **params)
Ken'ichi Ohmichi532ae922014-11-19 01:37:15 +0000362 self.volume_hosts_v2_client = VolumeHostsV2ClientJSON(
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000363 self.auth_provider, **params)
364 self.volume_quotas_client = VolumeQuotasClientJSON(self.auth_provider,
365 **params)
366 self.volume_quotas_v2_client = VolumeQuotasV2Client(self.auth_provider,
367 **params)
Ken'ichi Ohmichi532ae922014-11-19 01:37:15 +0000368 self.volumes_extension_client = VolumeExtensionClientJSON(
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000369 self.auth_provider, **params)
Ken'ichi Ohmichi532ae922014-11-19 01:37:15 +0000370 self.volumes_v2_extension_client = VolumeV2ExtensionClientJSON(
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000371 self.auth_provider, **params)
Ken'ichi Ohmichi532ae922014-11-19 01:37:15 +0000372 self.volume_availability_zone_client = \
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000373 VolumeAvailabilityZoneClientJSON(self.auth_provider, **params)
Ken'ichi Ohmichi532ae922014-11-19 01:37:15 +0000374 self.volume_v2_availability_zone_client = \
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000375 VolumeV2AvailabilityZoneClientJSON(self.auth_provider, **params)
Ken'ichi Ohmichi532ae922014-11-19 01:37:15 +0000376 self.volume_types_v2_client = VolumeTypesV2ClientJSON(
Ken'ichi Ohmichif85e9bd2015-01-27 12:51:47 +0000377 self.auth_provider, **params)
Ken'ichi Ohmichi532ae922014-11-19 01:37:15 +0000378
Ken'ichi Ohmichic95eb852015-01-22 01:57:57 +0000379 def _set_object_storage_clients(self):
Ken'ichi Ohmichi564b2ad2015-01-22 02:08:59 +0000380 params = {
381 'service': CONF.object_storage.catalog_type,
382 'region': CONF.object_storage.region or CONF.identity.region,
383 'endpoint_type': CONF.object_storage.endpoint_type
384 }
385 params.update(self.default_params_with_timeout_values)
386
387 self.account_client = AccountClient(self.auth_provider, **params)
388 self.container_client = ContainerClient(self.auth_provider, **params)
389 self.object_client = ObjectClient(self.auth_provider, **params)
Ken'ichi Ohmichic95eb852015-01-22 01:57:57 +0000390
Jay Pipes50677282012-01-06 15:39:20 -0500391
Jay Pipesff10d552012-04-06 14:18:50 -0400392class AdminManager(Manager):
393
394 """
Attila Fazekascadcb1f2013-01-21 23:10:53 +0100395 Manager object that uses the admin credentials for its
Jay Pipesff10d552012-04-06 14:18:50 -0400396 managed client objects
397 """
398
Andrea Frittolic0978352015-02-06 15:57:40 +0000399 def __init__(self, service=None):
Andrea Frittoli422fbdf2014-03-20 10:05:18 +0000400 super(AdminManager, self).__init__(
Andrea Frittoli9efbe952015-01-29 12:43:09 +0000401 credentials=cred_provider.get_configured_credentials(
402 'identity_admin'),
Andrea Frittoli422fbdf2014-03-20 10:05:18 +0000403 service=service)