blob: 66db3deaf34084beb698768df6b702796b6e1559 [file] [log] [blame]
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +01001# 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.
14from tempest import clients
15from tempest import config
16
Kiall Mac Innes8ae796c2016-04-21 13:47:25 +010017from designate_tempest_plugin.services.dns.v1.json.domains_client import \
18 DomainsClient
19from designate_tempest_plugin.services.dns.v1.json.records_client import \
20 RecordsClient
21from designate_tempest_plugin.services.dns.v1.json.servers_client import \
22 ServersClient
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010023from designate_tempest_plugin.services.dns.v2.json.zones_client import \
24 ZonesClient
sonu.kumaraec952a2016-04-20 10:08:46 +090025from designate_tempest_plugin.services.dns.v2.json.zone_imports_client import \
26 ZoneImportsClient
Paul Glass8abae332016-04-21 15:34:09 +000027from designate_tempest_plugin.services.dns.v2.json.blacklists_client import \
28 BlacklistsClient
Paul Glass89edc112016-04-21 17:06:33 +000029from designate_tempest_plugin.services.dns.admin.json.quotas_client import \
30 QuotasClient
sonu.kumarc8f7a702016-04-29 21:07:16 +090031from designate_tempest_plugin.services.dns.v2.json.zone_exports_client import \
32 ZoneExportsClient
sonu.kumarde24d962016-05-05 00:28:00 +090033from designate_tempest_plugin.services.dns.v2.json.recordset_client import \
34 RecordsetClient
sonu.kumar4beb93c2016-05-05 01:12:43 +090035from designate_tempest_plugin.services.dns.v2.json.pool_client import \
36 PoolClient
sonu.kumar2de01be2016-05-05 10:07:28 +090037from designate_tempest_plugin.services.dns.v2.json.tld_client import \
38 TldClient
Paul Glasscf98c262016-05-13 19:34:37 +000039from designate_tempest_plugin.services.dns.query.query_client import \
40 QueryClient
sonu.kumare9785c92016-05-17 10:56:47 +090041from designate_tempest_plugin.services.dns.v2.json.transfer_request_client \
42 import TransferRequestClient
sonu.kumarea0ba082016-05-16 14:13:47 +090043from designate_tempest_plugin.services.dns.v2.json.transfer_accepts_client \
44 import TransferAcceptClient
sonu.kumarc3110862016-05-27 14:48:04 +090045from designate_tempest_plugin.services.dns.v2.json.tsigkey_client \
46 import TsigkeyClient
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010047
48CONF = config.CONF
49
50
Kiall Mac Innes8ae796c2016-04-21 13:47:25 +010051class ManagerV1(clients.Manager):
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010052 def __init__(self, credentials=None, service=None):
Kiall Mac Innes8ae796c2016-04-21 13:47:25 +010053 super(ManagerV1, self).__init__(credentials, service)
54
55 params = {
56 'service': CONF.dns.catalog_type,
57 'region': CONF.identity.region,
58 'endpoint_type': CONF.dns.endpoint_type,
59 'build_interval': CONF.dns.build_interval,
60 'build_timeout': CONF.dns.build_timeout
61 }
62 params.update(self.default_params)
63
64 self.domains_client = DomainsClient(self.auth_provider, **params)
65 self.records_client = RecordsClient(self.auth_provider, **params)
66 self.servers_client = ServersClient(self.auth_provider, **params)
67
68
69class ManagerV2(clients.Manager):
70 def __init__(self, credentials=None, service=None):
71 super(ManagerV2, self).__init__(credentials, service)
Kiall Mac Innes25fb29e2016-04-07 08:07:04 +010072
73 params = {
74 'service': CONF.dns.catalog_type,
75 'region': CONF.identity.region,
76 'endpoint_type': CONF.dns.endpoint_type,
77 'build_interval': CONF.dns.build_interval,
78 'build_timeout': CONF.dns.build_timeout
79 }
80 params.update(self.default_params)
81
82 self.zones_client = ZonesClient(self.auth_provider, **params)
sonu.kumaraec952a2016-04-20 10:08:46 +090083 self.zone_imports_client = ZoneImportsClient(self.auth_provider,
84 **params)
Paul Glass8abae332016-04-21 15:34:09 +000085 self.blacklists_client = BlacklistsClient(self.auth_provider, **params)
Paul Glass89edc112016-04-21 17:06:33 +000086 self.quotas_client = QuotasClient(self.auth_provider, **params)
sonu.kumarc8f7a702016-04-29 21:07:16 +090087 self.zone_exports_client = ZoneExportsClient(self.auth_provider,
88 **params)
sonu.kumarde24d962016-05-05 00:28:00 +090089 self.recordset_client = RecordsetClient(self.auth_provider,
90 **params)
sonu.kumar4beb93c2016-05-05 01:12:43 +090091 self.pool_client = PoolClient(self.auth_provider,
92 **params)
sonu.kumar2de01be2016-05-05 10:07:28 +090093 self.tld_client = TldClient(self.auth_provider,
94 **params)
Paul Glasscf98c262016-05-13 19:34:37 +000095 self.query_client = QueryClient(
96 nameservers=CONF.dns.nameservers,
97 query_timeout=CONF.dns.query_timeout,
98 build_interval=CONF.dns.build_interval,
99 build_timeout=CONF.dns.build_timeout,
100 )
sonu.kumare9785c92016-05-17 10:56:47 +0900101 self.transfer_request_client = TransferRequestClient(
102 self.auth_provider, **params)
sonu.kumarea0ba082016-05-16 14:13:47 +0900103 self.transfer_accept_client = TransferAcceptClient(
104 self.auth_provider, **params)
sonu.kumarc3110862016-05-27 14:48:04 +0900105 self.tsigkey_client = TsigkeyClient(
106 self.auth_provider, **params)