ZhiQiang Fan | 39f9722 | 2013-09-20 04:49:44 +0800 | [diff] [blame] | 1 | # Copyright 2012 OpenStack Foundation |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 2 | # 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 Ohmichi | 4771cbc | 2015-01-19 23:45:23 +0000 | [diff] [blame] | 16 | import copy |
| 17 | |
Doug Hellmann | 583ce2c | 2015-03-11 14:55:46 +0000 | [diff] [blame] | 18 | from oslo_log import log as logging |
| 19 | |
Ken'ichi Ohmichi | 4266268 | 2015-01-05 05:00:04 +0000 | [diff] [blame] | 20 | from tempest.common import negative_rest_client |
Jay Pipes | f38eaac | 2012-06-21 13:37:35 -0400 | [diff] [blame] | 21 | from tempest import config |
Andrea Frittoli (andreaf) | 03e546f | 2015-05-13 12:44:47 +0100 | [diff] [blame] | 22 | from tempest import exceptions |
Andrea Frittoli (andreaf) | db9672e | 2016-02-23 14:07:24 -0500 | [diff] [blame] | 23 | from tempest.lib.services.compute.agents_client import AgentsClient |
| 24 | from tempest.lib.services.compute.aggregates_client import AggregatesClient |
| 25 | from tempest.lib.services.compute.availability_zone_client import \ |
| 26 | AvailabilityZoneClient |
| 27 | from tempest.lib.services.compute.baremetal_nodes_client import \ |
| 28 | BaremetalNodesClient |
| 29 | from tempest.lib.services.compute.certificates_client import \ |
| 30 | CertificatesClient |
| 31 | from tempest.lib.services.compute.extensions_client import \ |
| 32 | ExtensionsClient |
| 33 | from tempest.lib.services.compute.fixed_ips_client import FixedIPsClient |
| 34 | from tempest.lib.services.compute.flavors_client import FlavorsClient |
| 35 | from tempest.lib.services.compute.floating_ip_pools_client import \ |
| 36 | FloatingIPPoolsClient |
| 37 | from tempest.lib.services.compute.floating_ips_bulk_client import \ |
| 38 | FloatingIPsBulkClient |
| 39 | from tempest.lib.services.compute.floating_ips_client import \ |
| 40 | FloatingIPsClient as ComputeFloatingIPsClient |
| 41 | from tempest.lib.services.compute.hosts_client import HostsClient |
| 42 | from tempest.lib.services.compute.hypervisor_client import \ |
| 43 | HypervisorClient |
| 44 | from tempest.lib.services.compute.images_client import ImagesClient \ |
| 45 | as ComputeImagesClient |
| 46 | from tempest.lib.services.compute.instance_usage_audit_log_client import \ |
| 47 | InstanceUsagesAuditLogClient |
| 48 | from tempest.lib.services.compute.interfaces_client import InterfacesClient |
ghanshyam | 3e758ee | 2016-04-07 09:29:02 +0900 | [diff] [blame] | 49 | from tempest.lib.services.compute.keypairs_client import KeyPairsClient |
Andrea Frittoli (andreaf) | db9672e | 2016-02-23 14:07:24 -0500 | [diff] [blame] | 50 | from tempest.lib.services.compute.limits_client import LimitsClient |
| 51 | from tempest.lib.services.compute.migrations_client import MigrationsClient |
| 52 | from tempest.lib.services.compute.networks_client import NetworksClient \ |
| 53 | as ComputeNetworksClient |
| 54 | from tempest.lib.services.compute.quota_classes_client import \ |
| 55 | QuotaClassesClient |
| 56 | from tempest.lib.services.compute.quotas_client import QuotasClient |
| 57 | from tempest.lib.services.compute.security_group_default_rules_client import \ |
| 58 | SecurityGroupDefaultRulesClient |
| 59 | from tempest.lib.services.compute.security_group_rules_client import \ |
| 60 | SecurityGroupRulesClient as ComputeSecurityGroupRulesClient |
| 61 | from tempest.lib.services.compute.security_groups_client import \ |
| 62 | SecurityGroupsClient as ComputeSecurityGroupsClient |
| 63 | from tempest.lib.services.compute.server_groups_client import \ |
| 64 | ServerGroupsClient |
| 65 | from tempest.lib.services.compute.servers_client import ServersClient |
| 66 | from tempest.lib.services.compute.services_client import ServicesClient |
| 67 | from tempest.lib.services.compute.snapshots_client import \ |
| 68 | SnapshotsClient as ComputeSnapshotsClient |
| 69 | from tempest.lib.services.compute.tenant_networks_client import \ |
| 70 | TenantNetworksClient |
| 71 | from tempest.lib.services.compute.tenant_usages_client import \ |
| 72 | TenantUsagesClient |
| 73 | from tempest.lib.services.compute.versions_client import VersionsClient |
| 74 | from tempest.lib.services.compute.volumes_client import \ |
| 75 | VolumesClient as ComputeVolumesClient |
| 76 | from tempest.lib.services.identity.v2.token_client import TokenClient |
| 77 | from tempest.lib.services.identity.v3.token_client import V3TokenClient |
Ken'ichi Ohmichi | 04390ac | 2016-06-08 17:11:16 -0700 | [diff] [blame] | 78 | from tempest.lib.services.image.v2.image_members_client import \ |
| 79 | ImageMembersClient as ImageMembersClientV2 |
Ken'ichi Ohmichi | 41c51ae | 2016-06-07 13:16:07 -0700 | [diff] [blame] | 80 | from tempest.lib.services.image.v2.namespaces_client import NamespacesClient |
| 81 | from tempest.lib.services.image.v2.resource_types_client import \ |
| 82 | ResourceTypesClient |
| 83 | from tempest.lib.services.image.v2.schemas_client import SchemasClient |
Andrea Frittoli (andreaf) | db9672e | 2016-02-23 14:07:24 -0500 | [diff] [blame] | 84 | from tempest.lib.services.network.agents_client import AgentsClient \ |
| 85 | as NetworkAgentsClient |
| 86 | from tempest.lib.services.network.extensions_client import \ |
| 87 | ExtensionsClient as NetworkExtensionsClient |
| 88 | from tempest.lib.services.network.floating_ips_client import FloatingIPsClient |
| 89 | from tempest.lib.services.network.metering_label_rules_client import \ |
| 90 | MeteringLabelRulesClient |
| 91 | from tempest.lib.services.network.metering_labels_client import \ |
| 92 | MeteringLabelsClient |
| 93 | from tempest.lib.services.network.networks_client import NetworksClient |
| 94 | from tempest.lib.services.network.ports_client import PortsClient |
| 95 | from tempest.lib.services.network.quotas_client import QuotasClient \ |
| 96 | as NetworkQuotasClient |
Ken'ichi Ohmichi | 131799e | 2016-06-06 12:06:41 -0700 | [diff] [blame] | 97 | from tempest.lib.services.network.routers_client import RoutersClient |
Ken'ichi Ohmichi | d598d2f | 2016-03-25 15:57:08 -0700 | [diff] [blame] | 98 | from tempest.lib.services.network.security_group_rules_client import \ |
| 99 | SecurityGroupRulesClient |
Andrea Frittoli (andreaf) | db9672e | 2016-02-23 14:07:24 -0500 | [diff] [blame] | 100 | from tempest.lib.services.network.security_groups_client import \ |
| 101 | SecurityGroupsClient |
| 102 | from tempest.lib.services.network.subnetpools_client import SubnetpoolsClient |
| 103 | from tempest.lib.services.network.subnets_client import SubnetsClient |
Andrea Frittoli | f9cde7e | 2014-02-18 09:57:04 +0000 | [diff] [blame] | 104 | from tempest import manager |
Ken'ichi Ohmichi | 884d106 | 2015-01-23 03:24:41 +0000 | [diff] [blame] | 105 | from tempest.services.baremetal.v1.json.baremetal_client import \ |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 106 | BaremetalClient |
Ken'ichi Ohmichi | dc5fe44 | 2015-02-13 04:00:47 +0000 | [diff] [blame] | 107 | from tempest.services.data_processing.v1_1.data_processing_client import \ |
| 108 | DataProcessingClient |
Nikhil Manchanda | dd6886f | 2014-03-03 01:58:45 -0800 | [diff] [blame] | 109 | from tempest.services.database.json.flavors_client import \ |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 110 | DatabaseFlavorsClient |
ravikumar-venkatesan | 9e81b44 | 2014-12-08 09:57:56 +0000 | [diff] [blame] | 111 | from tempest.services.database.json.limits_client import \ |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 112 | DatabaseLimitsClient |
Peter Stachowski | 320f9c7 | 2014-04-21 16:13:23 -0400 | [diff] [blame] | 113 | from tempest.services.database.json.versions_client import \ |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 114 | DatabaseVersionsClient |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 115 | from tempest.services.identity.v2.json.endpoints_client import EndpointsClient |
| 116 | from tempest.services.identity.v2.json.identity_client import IdentityClient |
| 117 | from tempest.services.identity.v2.json.roles_client import RolesClient |
Daniel Mellado | 72f24ec | 2015-12-21 10:26:42 +0000 | [diff] [blame] | 118 | from tempest.services.identity.v2.json.services_client import \ |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 119 | ServicesClient as IdentityServicesClient |
| 120 | from tempest.services.identity.v2.json.tenants_client import TenantsClient |
| 121 | from tempest.services.identity.v2.json.users_client import UsersClient |
nayna-patel | 914b471 | 2013-07-16 08:29:05 +0000 | [diff] [blame] | 122 | from tempest.services.identity.v3.json.credentials_client import \ |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 123 | CredentialsClient |
Daniel Mellado | 91a26b6 | 2016-02-11 11:13:04 +0000 | [diff] [blame] | 124 | from tempest.services.identity.v3.json.domains_client import DomainsClient |
Sean Dague | 2416cf3 | 2013-04-10 08:29:07 -0400 | [diff] [blame] | 125 | from tempest.services.identity.v3.json.endpoints_client import \ |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 126 | EndPointsClient as EndPointsV3Client |
| 127 | from tempest.services.identity.v3.json.groups_client import GroupsClient |
Ghanshyam | 5b9b17e | 2016-02-23 01:56:22 +0900 | [diff] [blame] | 128 | from tempest.services.identity.v3.json.identity_client import \ |
| 129 | IdentityClient as IdentityV3Client |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 130 | from tempest.services.identity.v3.json.policies_client import PoliciesClient |
Yaroslav Lobankov | 47a93ab | 2016-02-07 16:32:49 -0600 | [diff] [blame] | 131 | from tempest.services.identity.v3.json.projects_client import ProjectsClient |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 132 | from tempest.services.identity.v3.json.regions_client import RegionsClient |
Arx Cruz | 24bcb88 | 2016-02-10 15:20:16 +0100 | [diff] [blame] | 133 | from tempest.services.identity.v3.json.roles_client import \ |
| 134 | RolesClient as RolesV3Client |
Yaroslav Lobankov | 69d9056 | 2015-12-18 12:06:40 +0300 | [diff] [blame] | 135 | from tempest.services.identity.v3.json.services_client import \ |
| 136 | ServicesClient as IdentityServicesV3Client |
Daniel Mellado | 7640539 | 2016-02-11 12:47:12 +0000 | [diff] [blame] | 137 | from tempest.services.identity.v3.json.trusts_client import TrustsClient |
Ghanshyam | 5b9b17e | 2016-02-23 01:56:22 +0900 | [diff] [blame] | 138 | from tempest.services.identity.v3.json.users_clients import \ |
| 139 | UsersClient as UsersV3Client |
Ken'ichi Ohmichi | 5be6472 | 2016-06-08 15:15:15 -0700 | [diff] [blame] | 140 | from tempest.services.image.v1.json.image_members_client import \ |
| 141 | ImageMembersClient |
Ken'ichi Ohmichi | 69dcf44 | 2015-11-30 11:48:01 +0000 | [diff] [blame] | 142 | from tempest.services.image.v1.json.images_client import ImagesClient |
Yaroslav Lobankov | 2fea405 | 2016-04-19 15:05:57 +0300 | [diff] [blame] | 143 | from tempest.services.image.v2.json.images_client import \ |
| 144 | ImagesClient as ImagesV2Client |
dwalleck | 5d73443 | 2012-10-04 01:11:47 -0500 | [diff] [blame] | 145 | from tempest.services.object_storage.account_client import AccountClient |
Attila Fazekas | 6968dd5 | 2013-02-15 17:05:53 +0100 | [diff] [blame] | 146 | from tempest.services.object_storage.container_client import ContainerClient |
| 147 | from tempest.services.object_storage.object_client import ObjectClient |
Steve Baker | c60e4e3 | 2013-05-06 15:22:41 +1200 | [diff] [blame] | 148 | from tempest.services.orchestration.json.orchestration_client import \ |
| 149 | OrchestrationClient |
Yaroslav Lobankov | aef0298 | 2015-12-02 17:42:32 +0300 | [diff] [blame] | 150 | from tempest.services.volume.v1.json.admin.hosts_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 151 | HostsClient as VolumeHostsClient |
Yaroslav Lobankov | aef0298 | 2015-12-02 17:42:32 +0300 | [diff] [blame] | 152 | from tempest.services.volume.v1.json.admin.quotas_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 153 | QuotasClient as VolumeQuotasClient |
Yaroslav Lobankov | aef0298 | 2015-12-02 17:42:32 +0300 | [diff] [blame] | 154 | from tempest.services.volume.v1.json.admin.services_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 155 | ServicesClient as VolumeServicesClient |
Yaroslav Lobankov | aef0298 | 2015-12-02 17:42:32 +0300 | [diff] [blame] | 156 | from tempest.services.volume.v1.json.admin.types_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 157 | TypesClient as VolumeTypesClient |
Yaroslav Lobankov | db4a2e1 | 2015-11-28 20:04:54 +0300 | [diff] [blame] | 158 | from tempest.services.volume.v1.json.availability_zone_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 159 | AvailabilityZoneClient as VolumeAvailabilityZoneClient |
Yaroslav Lobankov | db4a2e1 | 2015-11-28 20:04:54 +0300 | [diff] [blame] | 160 | from tempest.services.volume.v1.json.backups_client import BackupsClient |
| 161 | from tempest.services.volume.v1.json.extensions_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 162 | ExtensionsClient as VolumeExtensionsClient |
Yaroslav Lobankov | db4a2e1 | 2015-11-28 20:04:54 +0300 | [diff] [blame] | 163 | from tempest.services.volume.v1.json.qos_client import QosSpecsClient |
| 164 | from tempest.services.volume.v1.json.snapshots_client import SnapshotsClient |
| 165 | from tempest.services.volume.v1.json.volumes_client import VolumesClient |
Yaroslav Lobankov | aef0298 | 2015-12-02 17:42:32 +0300 | [diff] [blame] | 166 | from tempest.services.volume.v2.json.admin.hosts_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 167 | HostsClient as VolumeHostsV2Client |
Yaroslav Lobankov | aef0298 | 2015-12-02 17:42:32 +0300 | [diff] [blame] | 168 | from tempest.services.volume.v2.json.admin.quotas_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 169 | QuotasClient as VolumeQuotasV2Client |
Yaroslav Lobankov | aef0298 | 2015-12-02 17:42:32 +0300 | [diff] [blame] | 170 | from tempest.services.volume.v2.json.admin.services_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 171 | ServicesClient as VolumeServicesV2Client |
Yaroslav Lobankov | aef0298 | 2015-12-02 17:42:32 +0300 | [diff] [blame] | 172 | from tempest.services.volume.v2.json.admin.types_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 173 | TypesClient as VolumeTypesV2Client |
Zhi Kun Liu | 5339552 | 2014-07-18 16:05:52 +0800 | [diff] [blame] | 174 | from tempest.services.volume.v2.json.availability_zone_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 175 | AvailabilityZoneClient as VolumeAvailabilityZoneV2Client |
| 176 | from tempest.services.volume.v2.json.backups_client import \ |
| 177 | BackupsClient as BackupsV2Client |
Zhi Kun Liu | 5339552 | 2014-07-18 16:05:52 +0800 | [diff] [blame] | 178 | from tempest.services.volume.v2.json.extensions_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 179 | ExtensionsClient as VolumeExtensionsV2Client |
| 180 | from tempest.services.volume.v2.json.qos_client import \ |
| 181 | QosSpecsClient as QosSpecsV2Client |
Zhi Kun Liu | 38641c6 | 2014-07-10 20:12:48 +0800 | [diff] [blame] | 182 | from tempest.services.volume.v2.json.snapshots_client import \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 183 | SnapshotsClient as SnapshotsV2Client |
| 184 | from tempest.services.volume.v2.json.volumes_client import \ |
| 185 | VolumesClient as VolumesV2Client |
Vincent Hou | 6b8a7b7 | 2012-08-25 01:24:33 +0800 | [diff] [blame] | 186 | |
Sean Dague | 86bd842 | 2013-12-20 09:56:44 -0500 | [diff] [blame] | 187 | CONF = config.CONF |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 188 | LOG = logging.getLogger(__name__) |
| 189 | |
Vincent Hou | 6b8a7b7 | 2012-08-25 01:24:33 +0800 | [diff] [blame] | 190 | |
Andrea Frittoli | f9cde7e | 2014-02-18 09:57:04 +0000 | [diff] [blame] | 191 | class Manager(manager.Manager): |
Ken'ichi Ohmichi | 2e2ee19 | 2015-11-19 09:48:27 +0000 | [diff] [blame] | 192 | """Top level manager for OpenStack tempest clients""" |
Jay Pipes | 3f981df | 2012-03-27 18:59:44 -0400 | [diff] [blame] | 193 | |
Ken'ichi Ohmichi | c2b11ce | 2015-01-16 07:17:29 +0000 | [diff] [blame] | 194 | default_params = { |
| 195 | 'disable_ssl_certificate_validation': |
| 196 | CONF.identity.disable_ssl_certificate_validation, |
| 197 | 'ca_certs': CONF.identity.ca_certificates_file, |
| 198 | 'trace_requests': CONF.debug.trace_requests |
| 199 | } |
| 200 | |
Ken'ichi Ohmichi | 737a603 | 2015-01-21 07:04:42 +0000 | [diff] [blame] | 201 | # NOTE: Tempest uses timeout values of compute API if project specific |
| 202 | # timeout values don't exist. |
| 203 | default_params_with_timeout_values = { |
| 204 | 'build_interval': CONF.compute.build_interval, |
| 205 | 'build_timeout': CONF.compute.build_timeout |
| 206 | } |
| 207 | default_params_with_timeout_values.update(default_params) |
| 208 | |
Andrea Frittoli (andreaf) | 3e82af7 | 2016-05-05 22:53:38 +0100 | [diff] [blame] | 209 | def __init__(self, credentials, service=None, scope='project'): |
ghanshyam | 4e2be34 | 2015-11-27 18:07:46 +0900 | [diff] [blame] | 210 | """Initialization of Manager class. |
Brant Knudson | c7ca334 | 2013-03-28 21:08:50 -0500 | [diff] [blame] | 211 | |
ghanshyam | 4e2be34 | 2015-11-27 18:07:46 +0900 | [diff] [blame] | 212 | Setup all services clients and make them available for tests cases. |
| 213 | :param credentials: type Credentials or TestResources |
| 214 | :param service: Service name |
Andrea Frittoli (andreaf) | 3e82af7 | 2016-05-05 22:53:38 +0100 | [diff] [blame] | 215 | :param scope: default scope for tokens produced by the auth provider |
ghanshyam | 4e2be34 | 2015-11-27 18:07:46 +0900 | [diff] [blame] | 216 | """ |
Andrea Frittoli (andreaf) | 3e82af7 | 2016-05-05 22:53:38 +0100 | [diff] [blame] | 217 | super(Manager, self).__init__(credentials=credentials, scope=scope) |
Ken'ichi Ohmichi | 80ec0b9 | 2015-01-16 06:43:10 +0000 | [diff] [blame] | 218 | self._set_compute_clients() |
ravikumar-venkatesan | 9e81b44 | 2014-12-08 09:57:56 +0000 | [diff] [blame] | 219 | self._set_database_clients() |
Ken'ichi Ohmichi | 80ec0b9 | 2015-01-16 06:43:10 +0000 | [diff] [blame] | 220 | self._set_identity_clients() |
| 221 | self._set_volume_clients() |
Ken'ichi Ohmichi | c95eb85 | 2015-01-22 01:57:57 +0000 | [diff] [blame] | 222 | self._set_object_storage_clients() |
Andrea Frittoli (andreaf) | 591e854 | 2016-06-07 18:31:39 +0100 | [diff] [blame] | 223 | self._set_image_clients() |
Andrea Frittoli (andreaf) | 11e1e88 | 2016-06-07 18:35:58 +0100 | [diff] [blame^] | 224 | self._set_network_clients() |
Ken'ichi Ohmichi | cd4a51e | 2014-11-13 07:25:33 +0000 | [diff] [blame] | 225 | |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 226 | self.baremetal_client = BaremetalClient( |
Ken'ichi Ohmichi | 1f88ece | 2015-01-23 03:33:11 +0000 | [diff] [blame] | 227 | self.auth_provider, |
| 228 | CONF.baremetal.catalog_type, |
| 229 | CONF.identity.region, |
| 230 | endpoint_type=CONF.baremetal.endpoint_type, |
| 231 | **self.default_params_with_timeout_values) |
Andrea Frittoli | 8bbdb16 | 2014-01-06 11:06:13 +0000 | [diff] [blame] | 232 | self.orchestration_client = OrchestrationClient( |
Ken'ichi Ohmichi | c2b11ce | 2015-01-16 07:17:29 +0000 | [diff] [blame] | 233 | self.auth_provider, |
| 234 | CONF.orchestration.catalog_type, |
| 235 | CONF.orchestration.region or CONF.identity.region, |
| 236 | endpoint_type=CONF.orchestration.endpoint_type, |
| 237 | build_interval=CONF.orchestration.build_interval, |
| 238 | build_timeout=CONF.orchestration.build_timeout, |
| 239 | **self.default_params) |
Ken'ichi Ohmichi | 4e83b5e | 2015-02-13 04:07:34 +0000 | [diff] [blame] | 240 | self.data_processing_client = DataProcessingClient( |
| 241 | self.auth_provider, |
| 242 | CONF.data_processing.catalog_type, |
| 243 | CONF.identity.region, |
| 244 | endpoint_type=CONF.data_processing.endpoint_type, |
| 245 | **self.default_params_with_timeout_values) |
Ken'ichi Ohmichi | b38eb00 | 2015-01-23 02:35:01 +0000 | [diff] [blame] | 246 | self.negative_client = negative_rest_client.NegativeRestClient( |
David Kranz | 1e33e37 | 2015-03-20 09:42:56 -0400 | [diff] [blame] | 247 | self.auth_provider, service, **self.default_params) |
Ken'ichi Ohmichi | c2b11ce | 2015-01-16 07:17:29 +0000 | [diff] [blame] | 248 | |
Andrea Frittoli (andreaf) | 11e1e88 | 2016-06-07 18:35:58 +0100 | [diff] [blame^] | 249 | def _set_network_clients(self): |
| 250 | params = { |
| 251 | 'service': CONF.network.catalog_type, |
| 252 | 'region': CONF.network.region or CONF.identity.region, |
| 253 | 'endpoint_type': CONF.network.endpoint_type, |
| 254 | 'build_interval': CONF.network.build_interval, |
| 255 | 'build_timeout': CONF.network.build_timeout |
| 256 | } |
| 257 | params.update(self.default_params) |
| 258 | self.network_agents_client = NetworkAgentsClient( |
| 259 | self.auth_provider, **params) |
| 260 | self.network_extensions_client = NetworkExtensionsClient( |
| 261 | self.auth_provider, **params) |
| 262 | self.networks_client = NetworksClient( |
| 263 | self.auth_provider, **params) |
| 264 | self.subnetpools_client = SubnetpoolsClient( |
| 265 | self.auth_provider, **params) |
| 266 | self.subnets_client = SubnetsClient( |
| 267 | self.auth_provider, **params) |
| 268 | self.ports_client = PortsClient( |
| 269 | self.auth_provider, **params) |
| 270 | self.network_quotas_client = NetworkQuotasClient( |
| 271 | self.auth_provider, **params) |
| 272 | self.floating_ips_client = FloatingIPsClient( |
| 273 | self.auth_provider, **params) |
| 274 | self.metering_labels_client = MeteringLabelsClient( |
| 275 | self.auth_provider, **params) |
| 276 | self.metering_label_rules_client = MeteringLabelRulesClient( |
| 277 | self.auth_provider, **params) |
| 278 | self.routers_client = RoutersClient( |
| 279 | self.auth_provider, **params) |
| 280 | self.security_group_rules_client = SecurityGroupRulesClient( |
| 281 | self.auth_provider, **params) |
| 282 | self.security_groups_client = SecurityGroupsClient( |
| 283 | self.auth_provider, **params) |
| 284 | |
Andrea Frittoli (andreaf) | 591e854 | 2016-06-07 18:31:39 +0100 | [diff] [blame] | 285 | def _set_image_clients(self): |
| 286 | params = { |
| 287 | 'service': CONF.image.catalog_type, |
| 288 | 'region': CONF.image.region or CONF.identity.region, |
| 289 | 'endpoint_type': CONF.image.endpoint_type, |
| 290 | 'build_interval': CONF.image.build_interval, |
| 291 | 'build_timeout': CONF.image.build_timeout |
| 292 | } |
| 293 | params.update(self.default_params) |
| 294 | |
| 295 | if CONF.service_available.glance: |
| 296 | self.image_client = ImagesClient( |
| 297 | self.auth_provider, **params) |
| 298 | self.image_member_client = ImageMembersClient( |
| 299 | self.auth_provider, **params) |
| 300 | self.image_client_v2 = ImagesV2Client( |
| 301 | self.auth_provider, **params) |
| 302 | self.image_member_client_v2 = ImageMembersClientV2( |
| 303 | self.auth_provider, **params) |
| 304 | self.namespaces_client = NamespacesClient( |
| 305 | self.auth_provider, **params) |
| 306 | self.resource_types_client = ResourceTypesClient( |
| 307 | self.auth_provider, **params) |
| 308 | self.schemas_client = SchemasClient( |
| 309 | self.auth_provider, **params) |
| 310 | |
Ken'ichi Ohmichi | 80ec0b9 | 2015-01-16 06:43:10 +0000 | [diff] [blame] | 311 | def _set_compute_clients(self): |
Ken'ichi Ohmichi | 4771cbc | 2015-01-19 23:45:23 +0000 | [diff] [blame] | 312 | params = { |
| 313 | 'service': CONF.compute.catalog_type, |
| 314 | 'region': CONF.compute.region or CONF.identity.region, |
| 315 | 'endpoint_type': CONF.compute.endpoint_type, |
| 316 | 'build_interval': CONF.compute.build_interval, |
| 317 | 'build_timeout': CONF.compute.build_timeout |
| 318 | } |
| 319 | params.update(self.default_params) |
| 320 | |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 321 | self.agents_client = AgentsClient(self.auth_provider, **params) |
John Warren | 9487a18 | 2015-09-14 18:12:56 -0400 | [diff] [blame] | 322 | self.compute_networks_client = ComputeNetworksClient( |
| 323 | self.auth_provider, **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 324 | self.migrations_client = MigrationsClient(self.auth_provider, |
| 325 | **params) |
Ken'ichi Ohmichi | 65225ef | 2014-11-19 01:06:25 +0000 | [diff] [blame] | 326 | self.security_group_default_rules_client = ( |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 327 | SecurityGroupDefaultRulesClient(self.auth_provider, **params)) |
| 328 | self.certificates_client = CertificatesClient(self.auth_provider, |
| 329 | **params) |
| 330 | self.servers_client = ServersClient( |
Masayuki Igawa | 8f9c0c8 | 2015-03-03 09:38:08 +0900 | [diff] [blame] | 331 | self.auth_provider, |
| 332 | enable_instance_password=CONF.compute_feature_enabled |
| 333 | .enable_instance_password, |
| 334 | **params) |
Ken'ichi Ohmichi | 7ca54b8 | 2015-07-07 01:10:26 +0000 | [diff] [blame] | 335 | self.server_groups_client = ServerGroupsClient( |
| 336 | self.auth_provider, **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 337 | self.limits_client = LimitsClient(self.auth_provider, **params) |
Ghanshyam | ae76c12 | 2015-12-22 13:41:35 +0900 | [diff] [blame] | 338 | self.compute_images_client = ComputeImagesClient(self.auth_provider, |
| 339 | **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 340 | self.keypairs_client = KeyPairsClient(self.auth_provider, **params) |
| 341 | self.quotas_client = QuotasClient(self.auth_provider, **params) |
| 342 | self.quota_classes_client = QuotaClassesClient(self.auth_provider, |
| 343 | **params) |
| 344 | self.flavors_client = FlavorsClient(self.auth_provider, **params) |
| 345 | self.extensions_client = ExtensionsClient(self.auth_provider, |
| 346 | **params) |
Ken'ichi Ohmichi | f576770 | 2015-07-29 23:39:10 +0000 | [diff] [blame] | 347 | self.floating_ip_pools_client = FloatingIPPoolsClient( |
Ken'ichi Ohmichi | 03af1c5 | 2015-07-13 00:28:05 +0000 | [diff] [blame] | 348 | self.auth_provider, **params) |
Ken'ichi Ohmichi | f576770 | 2015-07-29 23:39:10 +0000 | [diff] [blame] | 349 | self.floating_ips_bulk_client = FloatingIPsBulkClient( |
Ken'ichi Ohmichi | 2b26e75 | 2015-07-13 00:44:36 +0000 | [diff] [blame] | 350 | self.auth_provider, **params) |
John Warren | e74890a | 2015-11-11 15:18:01 -0500 | [diff] [blame] | 351 | self.compute_floating_ips_client = ComputeFloatingIPsClient( |
| 352 | self.auth_provider, **params) |
John Warren | 5cdbf42 | 2016-01-05 12:42:43 -0500 | [diff] [blame] | 353 | self.compute_security_group_rules_client = \ |
| 354 | ComputeSecurityGroupRulesClient(self.auth_provider, **params) |
John Warren | f234551 | 2015-12-10 13:39:30 -0500 | [diff] [blame] | 355 | self.compute_security_groups_client = ComputeSecurityGroupsClient( |
Ken'ichi Ohmichi | 4771cbc | 2015-01-19 23:45:23 +0000 | [diff] [blame] | 356 | self.auth_provider, **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 357 | self.interfaces_client = InterfacesClient(self.auth_provider, |
| 358 | **params) |
| 359 | self.fixed_ips_client = FixedIPsClient(self.auth_provider, |
| 360 | **params) |
| 361 | self.availability_zone_client = AvailabilityZoneClient( |
Ken'ichi Ohmichi | 4771cbc | 2015-01-19 23:45:23 +0000 | [diff] [blame] | 362 | self.auth_provider, **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 363 | self.aggregates_client = AggregatesClient(self.auth_provider, |
| 364 | **params) |
| 365 | self.services_client = ServicesClient(self.auth_provider, **params) |
| 366 | self.tenant_usages_client = TenantUsagesClient(self.auth_provider, |
| 367 | **params) |
| 368 | self.hosts_client = HostsClient(self.auth_provider, **params) |
| 369 | self.hypervisor_client = HypervisorClient(self.auth_provider, |
| 370 | **params) |
Ken'ichi Ohmichi | cd4a51e | 2014-11-13 07:25:33 +0000 | [diff] [blame] | 371 | self.instance_usages_audit_log_client = \ |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 372 | InstanceUsagesAuditLogClient(self.auth_provider, **params) |
Ken'ichi Ohmichi | c3dfdb2 | 2015-01-22 04:39:58 +0000 | [diff] [blame] | 373 | self.tenant_networks_client = \ |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 374 | TenantNetworksClient(self.auth_provider, **params) |
| 375 | self.baremetal_nodes_client = BaremetalNodesClient( |
YuikoTakada | ac0879a | 2015-01-22 02:40:03 +0000 | [diff] [blame] | 376 | self.auth_provider, **params) |
Ken'ichi Ohmichi | 4771cbc | 2015-01-19 23:45:23 +0000 | [diff] [blame] | 377 | |
| 378 | # NOTE: The following client needs special timeout values because |
| 379 | # the API is a proxy for the other component. |
| 380 | params_volume = copy.deepcopy(params) |
| 381 | params_volume.update({ |
| 382 | 'build_interval': CONF.volume.build_interval, |
| 383 | 'build_timeout': CONF.volume.build_timeout |
| 384 | }) |
Ken'ichi Ohmichi | ea3f26a | 2015-09-29 00:18:39 +0000 | [diff] [blame] | 385 | self.volumes_extensions_client = ComputeVolumesClient( |
Ken'ichi Ohmichi | c492178 | 2015-08-05 08:14:42 +0000 | [diff] [blame] | 386 | self.auth_provider, **params_volume) |
Ken'ichi Ohmichi | 2b6012b | 2015-09-03 01:56:19 +0000 | [diff] [blame] | 387 | self.compute_versions_client = VersionsClient(self.auth_provider, |
| 388 | **params_volume) |
Ken'ichi Ohmichi | b7e2730 | 2015-09-29 00:11:20 +0000 | [diff] [blame] | 389 | self.snapshots_extensions_client = ComputeSnapshotsClient( |
Gaozexu | b9c9d6e | 2015-09-10 17:08:04 +0800 | [diff] [blame] | 390 | self.auth_provider, **params_volume) |
Ken'ichi Ohmichi | cd4a51e | 2014-11-13 07:25:33 +0000 | [diff] [blame] | 391 | |
ravikumar-venkatesan | 9e81b44 | 2014-12-08 09:57:56 +0000 | [diff] [blame] | 392 | def _set_database_clients(self): |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 393 | self.database_flavors_client = DatabaseFlavorsClient( |
ravikumar-venkatesan | 9e81b44 | 2014-12-08 09:57:56 +0000 | [diff] [blame] | 394 | self.auth_provider, |
| 395 | CONF.database.catalog_type, |
| 396 | CONF.identity.region, |
| 397 | **self.default_params_with_timeout_values) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 398 | self.database_limits_client = DatabaseLimitsClient( |
ravikumar-venkatesan | 9e81b44 | 2014-12-08 09:57:56 +0000 | [diff] [blame] | 399 | self.auth_provider, |
| 400 | CONF.database.catalog_type, |
| 401 | CONF.identity.region, |
| 402 | **self.default_params_with_timeout_values) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 403 | self.database_versions_client = DatabaseVersionsClient( |
ravikumar-venkatesan | 9e81b44 | 2014-12-08 09:57:56 +0000 | [diff] [blame] | 404 | self.auth_provider, |
| 405 | CONF.database.catalog_type, |
| 406 | CONF.identity.region, |
| 407 | **self.default_params_with_timeout_values) |
| 408 | |
Ken'ichi Ohmichi | 80ec0b9 | 2015-01-16 06:43:10 +0000 | [diff] [blame] | 409 | def _set_identity_clients(self): |
ghanshyam | d26b5cd | 2015-02-09 14:48:58 +0900 | [diff] [blame] | 410 | params = { |
| 411 | 'service': CONF.identity.catalog_type, |
Jane Zadorozhna | c786213 | 2015-07-10 14:34:50 +0300 | [diff] [blame] | 412 | 'region': CONF.identity.region |
ghanshyam | d26b5cd | 2015-02-09 14:48:58 +0900 | [diff] [blame] | 413 | } |
| 414 | params.update(self.default_params_with_timeout_values) |
Yaroslav Lobankov | cd97fea | 2016-01-13 19:59:52 +0300 | [diff] [blame] | 415 | |
| 416 | # Clients below use the admin endpoint type of Keystone API v2 |
Jane Zadorozhna | c786213 | 2015-07-10 14:34:50 +0300 | [diff] [blame] | 417 | params_v2_admin = params.copy() |
| 418 | params_v2_admin['endpoint_type'] = CONF.identity.v2_admin_endpoint_type |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 419 | self.endpoints_client = EndpointsClient(self.auth_provider, |
| 420 | **params_v2_admin) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 421 | self.identity_client = IdentityClient(self.auth_provider, |
Jane Zadorozhna | c786213 | 2015-07-10 14:34:50 +0300 | [diff] [blame] | 422 | **params_v2_admin) |
Daniel Mellado | b04da90 | 2015-11-20 17:43:12 +0100 | [diff] [blame] | 423 | self.tenants_client = TenantsClient(self.auth_provider, |
| 424 | **params_v2_admin) |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 425 | self.roles_client = RolesClient(self.auth_provider, **params_v2_admin) |
| 426 | self.users_client = UsersClient(self.auth_provider, **params_v2_admin) |
| 427 | self.identity_services_client = IdentityServicesClient( |
| 428 | self.auth_provider, **params_v2_admin) |
Yaroslav Lobankov | cd97fea | 2016-01-13 19:59:52 +0300 | [diff] [blame] | 429 | |
| 430 | # Clients below use the public endpoint type of Keystone API v2 |
Jane Zadorozhna | c786213 | 2015-07-10 14:34:50 +0300 | [diff] [blame] | 431 | params_v2_public = params.copy() |
| 432 | params_v2_public['endpoint_type'] = ( |
| 433 | CONF.identity.v2_public_endpoint_type) |
Jane Zadorozhna | c786213 | 2015-07-10 14:34:50 +0300 | [diff] [blame] | 434 | self.identity_public_client = IdentityClient(self.auth_provider, |
| 435 | **params_v2_public) |
Daniel Mellado | b04da90 | 2015-11-20 17:43:12 +0100 | [diff] [blame] | 436 | self.tenants_public_client = TenantsClient(self.auth_provider, |
| 437 | **params_v2_public) |
Daniel Mellado | 82c83a5 | 2015-12-09 15:16:49 +0000 | [diff] [blame] | 438 | self.users_public_client = UsersClient(self.auth_provider, |
| 439 | **params_v2_public) |
Yaroslav Lobankov | cd97fea | 2016-01-13 19:59:52 +0300 | [diff] [blame] | 440 | |
| 441 | # Clients below use the endpoint type of Keystone API v3 |
Jane Zadorozhna | c786213 | 2015-07-10 14:34:50 +0300 | [diff] [blame] | 442 | params_v3 = params.copy() |
| 443 | params_v3['endpoint_type'] = CONF.identity.v3_endpoint_type |
Daniel Mellado | 91a26b6 | 2016-02-11 11:13:04 +0000 | [diff] [blame] | 444 | self.domains_client = DomainsClient(self.auth_provider, |
| 445 | **params_v3) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 446 | self.identity_v3_client = IdentityV3Client(self.auth_provider, |
Jane Zadorozhna | c786213 | 2015-07-10 14:34:50 +0300 | [diff] [blame] | 447 | **params_v3) |
Daniel Mellado | 7640539 | 2016-02-11 12:47:12 +0000 | [diff] [blame] | 448 | self.trusts_client = TrustsClient(self.auth_provider, **params_v3) |
Daniel Mellado | 7aea534 | 2016-02-09 09:10:12 +0000 | [diff] [blame] | 449 | self.users_v3_client = UsersV3Client(self.auth_provider, **params_v3) |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 450 | self.endpoints_v3_client = EndPointsV3Client(self.auth_provider, |
| 451 | **params_v3) |
Arx Cruz | 24bcb88 | 2016-02-10 15:20:16 +0100 | [diff] [blame] | 452 | self.roles_v3_client = RolesV3Client(self.auth_provider, **params_v3) |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 453 | self.identity_services_v3_client = IdentityServicesV3Client( |
Yaroslav Lobankov | 69d9056 | 2015-12-18 12:06:40 +0300 | [diff] [blame] | 454 | self.auth_provider, **params_v3) |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 455 | self.policies_client = PoliciesClient(self.auth_provider, **params_v3) |
Yaroslav Lobankov | 47a93ab | 2016-02-07 16:32:49 -0600 | [diff] [blame] | 456 | self.projects_client = ProjectsClient(self.auth_provider, **params_v3) |
Yaroslav Lobankov | f6906e1 | 2016-02-26 19:44:53 -0600 | [diff] [blame] | 457 | self.regions_client = RegionsClient(self.auth_provider, **params_v3) |
| 458 | self.credentials_client = CredentialsClient(self.auth_provider, |
| 459 | **params_v3) |
| 460 | self.groups_client = GroupsClient(self.auth_provider, **params_v3) |
Yaroslav Lobankov | cd97fea | 2016-01-13 19:59:52 +0300 | [diff] [blame] | 461 | |
Andrea Frittoli | 9001235 | 2015-02-25 21:58:02 +0000 | [diff] [blame] | 462 | # Token clients do not use the catalog. They only need default_params. |
Andrea Frittoli (andreaf) | 03e546f | 2015-05-13 12:44:47 +0100 | [diff] [blame] | 463 | # They read auth_url, so they should only be set if the corresponding |
| 464 | # API version is marked as enabled |
| 465 | if CONF.identity_feature_enabled.api_v2: |
| 466 | if CONF.identity.uri: |
Ken'ichi Ohmichi | 5f80ce3 | 2015-09-10 23:51:14 +0000 | [diff] [blame] | 467 | self.token_client = TokenClient( |
Andrea Frittoli (andreaf) | 03e546f | 2015-05-13 12:44:47 +0100 | [diff] [blame] | 468 | CONF.identity.uri, **self.default_params) |
| 469 | else: |
| 470 | msg = 'Identity v2 API enabled, but no identity.uri set' |
| 471 | raise exceptions.InvalidConfiguration(msg) |
Ken'ichi Ohmichi | 41951b0 | 2014-11-19 01:57:43 +0000 | [diff] [blame] | 472 | if CONF.identity_feature_enabled.api_v3: |
Andrea Frittoli (andreaf) | 03e546f | 2015-05-13 12:44:47 +0100 | [diff] [blame] | 473 | if CONF.identity.uri_v3: |
Ken'ichi Ohmichi | 5f80ce3 | 2015-09-10 23:51:14 +0000 | [diff] [blame] | 474 | self.token_v3_client = V3TokenClient( |
Andrea Frittoli (andreaf) | 03e546f | 2015-05-13 12:44:47 +0100 | [diff] [blame] | 475 | CONF.identity.uri_v3, **self.default_params) |
| 476 | else: |
| 477 | msg = 'Identity v3 API enabled, but no identity.uri_v3 set' |
| 478 | raise exceptions.InvalidConfiguration(msg) |
Ken'ichi Ohmichi | 41951b0 | 2014-11-19 01:57:43 +0000 | [diff] [blame] | 479 | |
Ken'ichi Ohmichi | 80ec0b9 | 2015-01-16 06:43:10 +0000 | [diff] [blame] | 480 | def _set_volume_clients(self): |
Ken'ichi Ohmichi | f85e9bd | 2015-01-27 12:51:47 +0000 | [diff] [blame] | 481 | params = { |
| 482 | 'service': CONF.volume.catalog_type, |
| 483 | 'region': CONF.volume.region or CONF.identity.region, |
| 484 | 'endpoint_type': CONF.volume.endpoint_type, |
| 485 | 'build_interval': CONF.volume.build_interval, |
| 486 | 'build_timeout': CONF.volume.build_timeout |
| 487 | } |
| 488 | params.update(self.default_params) |
| 489 | |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 490 | self.volume_qos_client = QosSpecsClient(self.auth_provider, |
| 491 | **params) |
| 492 | self.volume_qos_v2_client = QosSpecsV2Client( |
Ken'ichi Ohmichi | f85e9bd | 2015-01-27 12:51:47 +0000 | [diff] [blame] | 493 | self.auth_provider, **params) |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 494 | self.volume_services_client = VolumeServicesClient( |
| 495 | self.auth_provider, **params) |
| 496 | self.volume_services_v2_client = VolumeServicesV2Client( |
Ken'ichi Ohmichi | f85e9bd | 2015-01-27 12:51:47 +0000 | [diff] [blame] | 497 | self.auth_provider, **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 498 | self.backups_client = BackupsClient(self.auth_provider, **params) |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 499 | self.backups_v2_client = BackupsV2Client(self.auth_provider, |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 500 | **params) |
| 501 | self.snapshots_client = SnapshotsClient(self.auth_provider, |
| 502 | **params) |
| 503 | self.snapshots_v2_client = SnapshotsV2Client(self.auth_provider, |
Ken'ichi Ohmichi | f85e9bd | 2015-01-27 12:51:47 +0000 | [diff] [blame] | 504 | **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 505 | self.volumes_client = VolumesClient( |
Ken'ichi Ohmichi | 234da80 | 2015-02-13 04:48:06 +0000 | [diff] [blame] | 506 | self.auth_provider, default_volume_size=CONF.volume.volume_size, |
| 507 | **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 508 | self.volumes_v2_client = VolumesV2Client( |
Ken'ichi Ohmichi | 234da80 | 2015-02-13 04:48:06 +0000 | [diff] [blame] | 509 | self.auth_provider, default_volume_size=CONF.volume.volume_size, |
| 510 | **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 511 | self.volume_types_client = VolumeTypesClient(self.auth_provider, |
| 512 | **params) |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 513 | self.volume_types_v2_client = VolumeTypesV2Client( |
Ken'ichi Ohmichi | f85e9bd | 2015-01-27 12:51:47 +0000 | [diff] [blame] | 514 | self.auth_provider, **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 515 | self.volume_hosts_client = VolumeHostsClient(self.auth_provider, |
| 516 | **params) |
| 517 | self.volume_hosts_v2_client = VolumeHostsV2Client( |
Ken'ichi Ohmichi | f85e9bd | 2015-01-27 12:51:47 +0000 | [diff] [blame] | 518 | self.auth_provider, **params) |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 519 | self.volume_quotas_client = VolumeQuotasClient(self.auth_provider, |
| 520 | **params) |
Ken'ichi Ohmichi | f85e9bd | 2015-01-27 12:51:47 +0000 | [diff] [blame] | 521 | self.volume_quotas_v2_client = VolumeQuotasV2Client(self.auth_provider, |
| 522 | **params) |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 523 | self.volumes_extension_client = VolumeExtensionsClient( |
Ken'ichi Ohmichi | f85e9bd | 2015-01-27 12:51:47 +0000 | [diff] [blame] | 524 | self.auth_provider, **params) |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 525 | self.volumes_v2_extension_client = VolumeExtensionsV2Client( |
Ken'ichi Ohmichi | f85e9bd | 2015-01-27 12:51:47 +0000 | [diff] [blame] | 526 | self.auth_provider, **params) |
Ken'ichi Ohmichi | 532ae92 | 2014-11-19 01:37:15 +0000 | [diff] [blame] | 527 | self.volume_availability_zone_client = \ |
Ken'ichi Ohmichi | a628707 | 2015-07-02 02:43:15 +0000 | [diff] [blame] | 528 | VolumeAvailabilityZoneClient(self.auth_provider, **params) |
Ken'ichi Ohmichi | 532ae92 | 2014-11-19 01:37:15 +0000 | [diff] [blame] | 529 | self.volume_v2_availability_zone_client = \ |
Yaroslav Lobankov | 4c23779 | 2015-12-02 18:43:48 +0300 | [diff] [blame] | 530 | VolumeAvailabilityZoneV2Client(self.auth_provider, **params) |
Ken'ichi Ohmichi | 532ae92 | 2014-11-19 01:37:15 +0000 | [diff] [blame] | 531 | |
Ken'ichi Ohmichi | c95eb85 | 2015-01-22 01:57:57 +0000 | [diff] [blame] | 532 | def _set_object_storage_clients(self): |
Ken'ichi Ohmichi | 564b2ad | 2015-01-22 02:08:59 +0000 | [diff] [blame] | 533 | params = { |
| 534 | 'service': CONF.object_storage.catalog_type, |
| 535 | 'region': CONF.object_storage.region or CONF.identity.region, |
| 536 | 'endpoint_type': CONF.object_storage.endpoint_type |
| 537 | } |
| 538 | params.update(self.default_params_with_timeout_values) |
| 539 | |
| 540 | self.account_client = AccountClient(self.auth_provider, **params) |
| 541 | self.container_client = ContainerClient(self.auth_provider, **params) |
| 542 | self.object_client = ObjectClient(self.auth_provider, **params) |