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