Kiall Mac Innes | 25fb29e | 2016-04-07 08:07:04 +0100 | [diff] [blame] | 1 | # Copyright 2016 Hewlett Packard Enterprise Development Company, L.P. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | from tempest import clients |
| 15 | from tempest import config |
| 16 | |
Kiall Mac Innes | 8ae796c | 2016-04-21 13:47:25 +0100 | [diff] [blame] | 17 | from designate_tempest_plugin.services.dns.v1.json.domains_client import \ |
| 18 | DomainsClient |
| 19 | from designate_tempest_plugin.services.dns.v1.json.records_client import \ |
| 20 | RecordsClient |
| 21 | from designate_tempest_plugin.services.dns.v1.json.servers_client import \ |
| 22 | ServersClient |
Kiall Mac Innes | 25fb29e | 2016-04-07 08:07:04 +0100 | [diff] [blame] | 23 | from designate_tempest_plugin.services.dns.v2.json.zones_client import \ |
| 24 | ZonesClient |
sonu.kumar | aec952a | 2016-04-20 10:08:46 +0900 | [diff] [blame] | 25 | from designate_tempest_plugin.services.dns.v2.json.zone_imports_client import \ |
| 26 | ZoneImportsClient |
Paul Glass | 8abae33 | 2016-04-21 15:34:09 +0000 | [diff] [blame] | 27 | from designate_tempest_plugin.services.dns.v2.json.blacklists_client import \ |
| 28 | BlacklistsClient |
Paul Glass | 89edc11 | 2016-04-21 17:06:33 +0000 | [diff] [blame] | 29 | from designate_tempest_plugin.services.dns.admin.json.quotas_client import \ |
| 30 | QuotasClient |
sonu.kumar | c8f7a70 | 2016-04-29 21:07:16 +0900 | [diff] [blame] | 31 | from designate_tempest_plugin.services.dns.v2.json.zone_exports_client import \ |
| 32 | ZoneExportsClient |
sonu.kumar | de24d96 | 2016-05-05 00:28:00 +0900 | [diff] [blame] | 33 | from designate_tempest_plugin.services.dns.v2.json.recordset_client import \ |
| 34 | RecordsetClient |
sonu.kumar | 4beb93c | 2016-05-05 01:12:43 +0900 | [diff] [blame] | 35 | from designate_tempest_plugin.services.dns.v2.json.pool_client import \ |
| 36 | PoolClient |
sonu.kumar | 2de01be | 2016-05-05 10:07:28 +0900 | [diff] [blame] | 37 | from designate_tempest_plugin.services.dns.v2.json.tld_client import \ |
| 38 | TldClient |
Paul Glass | cf98c26 | 2016-05-13 19:34:37 +0000 | [diff] [blame] | 39 | from designate_tempest_plugin.services.dns.query.query_client import \ |
| 40 | QueryClient |
sonu.kumar | e9785c9 | 2016-05-17 10:56:47 +0900 | [diff] [blame] | 41 | from designate_tempest_plugin.services.dns.v2.json.transfer_request_client \ |
| 42 | import TransferRequestClient |
sonu.kumar | ea0ba08 | 2016-05-16 14:13:47 +0900 | [diff] [blame^] | 43 | from designate_tempest_plugin.services.dns.v2.json.transfer_accepts_client \ |
| 44 | import TransferAcceptClient |
Kiall Mac Innes | 25fb29e | 2016-04-07 08:07:04 +0100 | [diff] [blame] | 45 | |
| 46 | CONF = config.CONF |
| 47 | |
| 48 | |
Kiall Mac Innes | 8ae796c | 2016-04-21 13:47:25 +0100 | [diff] [blame] | 49 | class ManagerV1(clients.Manager): |
Kiall Mac Innes | 25fb29e | 2016-04-07 08:07:04 +0100 | [diff] [blame] | 50 | def __init__(self, credentials=None, service=None): |
Kiall Mac Innes | 8ae796c | 2016-04-21 13:47:25 +0100 | [diff] [blame] | 51 | super(ManagerV1, self).__init__(credentials, service) |
| 52 | |
| 53 | params = { |
| 54 | 'service': CONF.dns.catalog_type, |
| 55 | 'region': CONF.identity.region, |
| 56 | 'endpoint_type': CONF.dns.endpoint_type, |
| 57 | 'build_interval': CONF.dns.build_interval, |
| 58 | 'build_timeout': CONF.dns.build_timeout |
| 59 | } |
| 60 | params.update(self.default_params) |
| 61 | |
| 62 | self.domains_client = DomainsClient(self.auth_provider, **params) |
| 63 | self.records_client = RecordsClient(self.auth_provider, **params) |
| 64 | self.servers_client = ServersClient(self.auth_provider, **params) |
| 65 | |
| 66 | |
| 67 | class ManagerV2(clients.Manager): |
| 68 | def __init__(self, credentials=None, service=None): |
| 69 | super(ManagerV2, self).__init__(credentials, service) |
Kiall Mac Innes | 25fb29e | 2016-04-07 08:07:04 +0100 | [diff] [blame] | 70 | |
| 71 | params = { |
| 72 | 'service': CONF.dns.catalog_type, |
| 73 | 'region': CONF.identity.region, |
| 74 | 'endpoint_type': CONF.dns.endpoint_type, |
| 75 | 'build_interval': CONF.dns.build_interval, |
| 76 | 'build_timeout': CONF.dns.build_timeout |
| 77 | } |
| 78 | params.update(self.default_params) |
| 79 | |
| 80 | self.zones_client = ZonesClient(self.auth_provider, **params) |
sonu.kumar | aec952a | 2016-04-20 10:08:46 +0900 | [diff] [blame] | 81 | self.zone_imports_client = ZoneImportsClient(self.auth_provider, |
| 82 | **params) |
Paul Glass | 8abae33 | 2016-04-21 15:34:09 +0000 | [diff] [blame] | 83 | self.blacklists_client = BlacklistsClient(self.auth_provider, **params) |
Paul Glass | 89edc11 | 2016-04-21 17:06:33 +0000 | [diff] [blame] | 84 | self.quotas_client = QuotasClient(self.auth_provider, **params) |
sonu.kumar | c8f7a70 | 2016-04-29 21:07:16 +0900 | [diff] [blame] | 85 | self.zone_exports_client = ZoneExportsClient(self.auth_provider, |
| 86 | **params) |
sonu.kumar | de24d96 | 2016-05-05 00:28:00 +0900 | [diff] [blame] | 87 | self.recordset_client = RecordsetClient(self.auth_provider, |
| 88 | **params) |
sonu.kumar | 4beb93c | 2016-05-05 01:12:43 +0900 | [diff] [blame] | 89 | self.pool_client = PoolClient(self.auth_provider, |
| 90 | **params) |
sonu.kumar | 2de01be | 2016-05-05 10:07:28 +0900 | [diff] [blame] | 91 | self.tld_client = TldClient(self.auth_provider, |
| 92 | **params) |
Paul Glass | cf98c26 | 2016-05-13 19:34:37 +0000 | [diff] [blame] | 93 | self.query_client = QueryClient( |
| 94 | nameservers=CONF.dns.nameservers, |
| 95 | query_timeout=CONF.dns.query_timeout, |
| 96 | build_interval=CONF.dns.build_interval, |
| 97 | build_timeout=CONF.dns.build_timeout, |
| 98 | ) |
sonu.kumar | e9785c9 | 2016-05-17 10:56:47 +0900 | [diff] [blame] | 99 | self.transfer_request_client = TransferRequestClient( |
| 100 | self.auth_provider, **params) |
sonu.kumar | ea0ba08 | 2016-05-16 14:13:47 +0900 | [diff] [blame^] | 101 | self.transfer_accept_client = TransferAcceptClient( |
| 102 | self.auth_provider, **params) |