diff options
Diffstat (limited to 'designateclient/cli')
-rw-r--r-- | designateclient/cli/__init__.py | 0 | ||||
-rw-r--r-- | designateclient/cli/base.py | 143 | ||||
-rw-r--r-- | designateclient/cli/diagnostics.py | 38 | ||||
-rw-r--r-- | designateclient/cli/domains.py | 144 | ||||
-rw-r--r-- | designateclient/cli/quotas.py | 83 | ||||
-rw-r--r-- | designateclient/cli/records.py | 187 | ||||
-rw-r--r-- | designateclient/cli/reports.py | 71 | ||||
-rw-r--r-- | designateclient/cli/servers.py | 98 | ||||
-rw-r--r-- | designateclient/cli/sync.py | 63 | ||||
-rw-r--r-- | designateclient/cli/touch.py | 37 |
10 files changed, 0 insertions, 864 deletions
diff --git a/designateclient/cli/__init__.py b/designateclient/cli/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/designateclient/cli/__init__.py +++ /dev/null diff --git a/designateclient/cli/base.py b/designateclient/cli/base.py deleted file mode 100644 index af4f2de..0000000 --- a/designateclient/cli/base.py +++ /dev/null @@ -1,143 +0,0 @@ -# Copyright 2012 Managed I.T. -# -# Author: Kiall Mac Innes <kiall@managedit.ie> -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -import abc -import warnings - -from keystoneauth1 import exceptions as ks_exceptions -from osc_lib.command import command -import six - -from designateclient import exceptions -from designateclient import utils -from designateclient.v1 import Client - - -@six.add_metaclass(abc.ABCMeta) -class Command(command.Command): - def run(self, parsed_args): - - warnings.simplefilter('once', category=DeprecationWarning) - warnings.warn( - 'The "designate" CLI is being deprecated in favour of the ' - '"openstack" CLI plugin. All designate API v2 commands are ' - 'implemented there. When the v1 API is removed this CLI will ' - 'stop functioning', - DeprecationWarning) - warnings.resetwarnings() - warnings.simplefilter('ignore', category=DeprecationWarning) - - self.client = Client( - region_name=self.app.options.os_region_name, - service_type=self.app.options.os_service_type, - endpoint_type=self.app.options.os_endpoint_type, - session=self.app.session, - all_tenants=self.app.options.all_tenants, - edit_managed=self.app.options.edit_managed, - endpoint=self.app.options.os_endpoint) - warnings.resetwarnings() - try: - return super(Command, self).run(parsed_args) - except exceptions.RemoteError as e: - columns = ['Code', 'Type'] - values = [e.code, e.type] - - if e.message: - columns.append('Message') - values.append(e.message) - - if e.errors: - columns.append('Errors') - values.append(e.errors) - - self.error_output(parsed_args, columns, values) - except ks_exceptions.EndpointNotFound as e: - self.app.log.error('No endpoint was found. You must provide a ' - 'username or user id via --os-username, ' - '--os-user-id, env[OS_USERNAME] or ' - 'env[OS_USER_ID]. You may also be using a ' - 'cloud that does not have the V1 API enabled. ' - 'If your cloud does not have the V1 DNS API ' - 'use the openstack CLI to interact with the ' - 'DNS Service.') - - return 1 - - def error_output(self, parsed_args, column_names, data): - self.formatter.emit_one(column_names, - data, - self.app.stdout, - parsed_args) - self.app.log.error('The requested action did not complete ' - 'successfully') - - @abc.abstractmethod - def execute(self, parsed_args): - """ - Execute something, this is since we overload self.take_action() - in order to format the data - - This method __NEEDS__ to be overloaded! - - :param parsed_args: The parsed args that are given by take_action() - """ - - def post_execute(self, data): - """ - Format the results locally if needed, by default we just return data - - :param data: Whatever is returned by self.execute() - """ - return data - - def take_action(self, parsed_args): - results = self.execute(parsed_args) - return self.post_execute(results) - - def find_resourceid_by_name_or_id(self, resource_plural, name_or_id): - resource_client = getattr(self.client, resource_plural) - return utils.find_resourceid_by_name_or_id(resource_client, name_or_id) - - -class ListCommand(Command, command.Lister): - columns = None - - def post_execute(self, results): - if len(results) > 0: - columns = self.columns or utils.get_columns(results) - data = [utils.get_item_properties(i, columns) for i in results] - return columns, data - else: - return [], () - - -class GetCommand(Command, command.ShowOne): - def post_execute(self, results): - return results.keys(), results.values() - - -class CreateCommand(Command, command.ShowOne): - def post_execute(self, results): - return results.keys(), results.values() - - -class UpdateCommand(Command, command.ShowOne): - def post_execute(self, results): - return results.keys(), results.values() - - -class DeleteCommand(Command, command.ShowOne): - def post_execute(self, results): - return [], [] diff --git a/designateclient/cli/diagnostics.py b/designateclient/cli/diagnostics.py deleted file mode 100644 index e621616..0000000 --- a/designateclient/cli/diagnostics.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright 2012 Managed I.T. -# -# Author: Kiall Mac Innes <kiall@managedit.ie> -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging - -from designateclient.cli import base - -LOG = logging.getLogger(__name__) - - -class PingCommand(base.GetCommand): - """Ping a service on a given host""" - - def get_parser(self, prog_name): - parser = super(PingCommand, self).get_parser(prog_name) - - parser.add_argument('--service', help="Service name (e.g. central)", - required=True) - parser.add_argument('--host', help="Hostname", required=True) - - return parser - - def execute(self, parsed_args): - return self.client.diagnostics.ping(parsed_args.service, - parsed_args.host) diff --git a/designateclient/cli/domains.py b/designateclient/cli/domains.py deleted file mode 100644 index 25ccd31..0000000 --- a/designateclient/cli/domains.py +++ /dev/null @@ -1,144 +0,0 @@ -# Copyright 2012 Managed I.T. -# -# Author: Kiall Mac Innes <kiall@managedit.ie> -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging - -from designateclient.cli import base -from designateclient.v1.domains import Domain - -LOG = logging.getLogger(__name__) - - -class ListDomainsCommand(base.ListCommand): - """List Domains""" - - columns = ['id', 'name', 'serial'] - - def execute(self, parsed_args): - return self.client.domains.list() - - -class GetDomainCommand(base.GetCommand): - """Get Domain""" - - def get_parser(self, prog_name): - parser = super(GetDomainCommand, self).get_parser(prog_name) - - parser.add_argument('id', help="Domain ID or name.") - - return parser - - def execute(self, parsed_args): - id = self.find_resourceid_by_name_or_id('domains', parsed_args.id) - return self.client.domains.get(id) - - -class CreateDomainCommand(base.CreateCommand): - """Create Domain""" - - def get_parser(self, prog_name): - parser = super(CreateDomainCommand, self).get_parser(prog_name) - - parser.add_argument('--name', help="Domain name.", required=True) - parser.add_argument('--email', help="Domain email.", required=True) - parser.add_argument('--ttl', type=int, help="Time to live (seconds).") - parser.add_argument('--description', help="Description.") - - return parser - - def execute(self, parsed_args): - domain = Domain( - name=parsed_args.name, - email=parsed_args.email, - ) - - if parsed_args.description: - domain.description = parsed_args.description - - if parsed_args.ttl is not None: - domain.ttl = parsed_args.ttl - - return self.client.domains.create(domain) - - -class UpdateDomainCommand(base.UpdateCommand): - """Update Domain""" - - def get_parser(self, prog_name): - parser = super(UpdateDomainCommand, self).get_parser(prog_name) - - parser.add_argument('id', help="Domain ID or name.") - parser.add_argument('--name', help="Domain name.") - parser.add_argument('--email', help="Domain email.") - parser.add_argument('--ttl', type=int, help="Time to live (seconds).") - description_group = parser.add_mutually_exclusive_group() - description_group.add_argument('--description', help="Description.") - description_group.add_argument('--no-description', action='store_true') - - return parser - - def execute(self, parsed_args): - # TODO(kiall): API needs updating.. this get is silly - id = self.find_resourceid_by_name_or_id('domains', parsed_args.id) - domain = self.client.domains.get(id) - - if parsed_args.name: - domain.name = parsed_args.name - - if parsed_args.email: - domain.email = parsed_args.email - - if parsed_args.ttl is not None: - domain.ttl = parsed_args.ttl - - if parsed_args.no_description: - domain.description = None - elif parsed_args.description: - domain.description = parsed_args.description - - return self.client.domains.update(domain) - - -class DeleteDomainCommand(base.DeleteCommand): - """Delete Domain""" - - def get_parser(self, prog_name): - parser = super(DeleteDomainCommand, self).get_parser(prog_name) - - parser.add_argument('id', help="Domain ID or name.") - - return parser - - def execute(self, parsed_args): - id = self.find_resourceid_by_name_or_id('domains', parsed_args.id) - return self.client.domains.delete(id) - - -class ListDomainServersCommand(base.ListCommand): - """List Domain Servers""" - - columns = ['name'] - - def get_parser(self, prog_name): - parser = super(ListDomainServersCommand, self).get_parser(prog_name) - - parser.add_argument('id', help="Domain ID or name.") - - return parser - - def execute(self, parsed_args): - id = self.find_resourceid_by_name_or_id('domains', parsed_args.id) - return self.client.domains.list_domain_servers(id) diff --git a/designateclient/cli/quotas.py b/designateclient/cli/quotas.py deleted file mode 100644 index ae41690..0000000 --- a/designateclient/cli/quotas.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 2014 Hewlett-Packard Development Company, L.P. -# -# Author: Endre Karlson <endre.karlson@hp.com> -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging - -from designateclient.cli import base - - -LOG = logging.getLogger(__name__) - - -class GetQuotaCommand(base.GetCommand): - """Get Quota""" - - def get_parser(self, prog_name): - parser = super(GetQuotaCommand, self).get_parser(prog_name) - - parser.add_argument('tenant_id', help="Tenant ID") - - return parser - - def execute(self, parsed_args): - return self.client.quotas.get(parsed_args.tenant_id) - - -class UpdateQuotaCommand(base.UpdateCommand): - """Update Quota""" - - def get_parser(self, prog_name): - parser = super(UpdateQuotaCommand, self).get_parser(prog_name) - - parser.add_argument('tenant_id', help="Tenant ID.") - parser.add_argument('--domains', help="Allowed domains.", type=int) - parser.add_argument('--domain-recordsets', - help="Allowed domain records.", - type=int) - parser.add_argument('--recordset-records', - help="Allowed recordset records.", - type=int) - parser.add_argument('--domain-records', - help="Allowed domain records.", - type=int) - parser.add_argument('--api-export-size', - help="Allowed zone export recordsets.", - type=int) - return parser - - def execute(self, parsed_args): - # TODO(kiall): API needs updating.. this get is silly - quota = self.client.quotas.get(parsed_args.tenant_id) - - for key, old in quota.items(): - new = getattr(parsed_args, key) - if new is not None and new != old: - quota[key] = new - return self.client.quotas.update(parsed_args.tenant_id, quota) - - -class ResetQuotaCommand(base.DeleteCommand): - """Reset Quota""" - - def get_parser(self, prog_name): - parser = super(ResetQuotaCommand, self).get_parser(prog_name) - - parser.add_argument('tenant_id', help="Tenant ID.") - - return parser - - def execute(self, parsed_args): - self.client.quotas.reset(parsed_args.tenant_id) diff --git a/designateclient/cli/records.py b/designateclient/cli/records.py deleted file mode 100644 index 6e276ca..0000000 --- a/designateclient/cli/records.py +++ /dev/null @@ -1,187 +0,0 @@ -# Copyright 2012 Managed I.T. -# -# Author: Kiall Mac Innes <kiall@managedit.ie> -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging - -from designateclient.cli import base -from designateclient.v1.records import Record - -LOG = logging.getLogger(__name__) - - -class ListRecordsCommand(base.ListCommand): - """List Records""" - - columns = ['id', 'type', 'name', 'data'] - - def get_parser(self, prog_name): - parser = super(ListRecordsCommand, self).get_parser(prog_name) - - parser.add_argument('domain_id', help="Domain ID or name.") - - return parser - - def execute(self, parsed_args): - domain_id = self.find_resourceid_by_name_or_id( - 'domains', parsed_args.domain_id) - return self.client.records.list(domain_id) - - -class GetRecordCommand(base.GetCommand): - """Get Record""" - - def get_parser(self, prog_name): - parser = super(GetRecordCommand, self).get_parser(prog_name) - - parser.add_argument('domain_id', help="Domain ID or name.") - parser.add_argument('id', help="Record ID.") - - return parser - - def execute(self, parsed_args): - domain_id = self.find_resourceid_by_name_or_id( - 'domains', parsed_args.domain_id) - return self.client.records.get(domain_id, parsed_args.id) - - -class CreateRecordCommand(base.CreateCommand): - """Create Record""" - - def get_parser(self, prog_name): - parser = super(CreateRecordCommand, self).get_parser(prog_name) - - parser.add_argument('domain_id', help="Domain ID or name.") - parser.add_argument( - '--name', help="Record (relative|absolute) name.", required=True) - parser.add_argument('--type', help="Record type.", required=True) - parser.add_argument('--data', help="Record data.", required=True) - parser.add_argument('--ttl', type=int, help="Record TTL.") - parser.add_argument('--priority', type=int, help="Record priority.") - parser.add_argument('--description', help="Description.") - - return parser - - def execute(self, parsed_args): - domain_id = self.find_resourceid_by_name_or_id( - 'domains', parsed_args.domain_id) - - if not parsed_args.name.endswith('.'): - # Relative name? - domain_name = self.client.domains.get(domain_id)['name'] - absolute = parsed_args.name + '.' - relative = absolute + domain_name - if absolute.endswith('.' + domain_name): - # Relative name or absolute name missing final period? - msg = ('"%s" is a relative name but looks like an absolute ' - 'name, use --name "%s" or "%s"' - % (parsed_args.name, absolute, relative)) - raise ValueError(msg) - parsed_args.name = relative - - record = Record( - name=parsed_args.name, - type=parsed_args.type, - data=parsed_args.data, - ) - - if parsed_args.ttl is not None: - record.ttl = parsed_args.ttl - - if parsed_args.priority is not None: - record.priority = parsed_args.priority - - if parsed_args.description: - record.description = parsed_args.description - - return self.client.records.create(domain_id, record) - - -class UpdateRecordCommand(base.UpdateCommand): - """Update Record""" - - def get_parser(self, prog_name): - parser = super(UpdateRecordCommand, self).get_parser(prog_name) - - parser.add_argument('domain_id', help="Domain ID or name.") - parser.add_argument('id', help="Record ID.") - parser.add_argument('--name', help="Record name.") - parser.add_argument('--type', help="Record type.") - parser.add_argument('--data', help="Record data.") - - description_group = parser.add_mutually_exclusive_group() - description_group.add_argument('--description', help="Description.") - description_group.add_argument('--no-description', action='store_true') - - ttl_group = parser.add_mutually_exclusive_group() - ttl_group.add_argument('--ttl', type=int, - help="Record time to live (seconds).") - ttl_group.add_argument('--no-ttl', action='store_true') - - priotity_group = parser.add_mutually_exclusive_group() - priotity_group.add_argument('--priority', type=int, - help="Record priority.") - priotity_group.add_argument('--no-priority', action='store_true') - - return parser - - def execute(self, parsed_args): - # TODO(kiall): API needs updating.. this get is silly - record = self.client.records.get(parsed_args.domain_id, parsed_args.id) - - if parsed_args.name: - record.name = parsed_args.name - - if parsed_args.type: - record.type = parsed_args.type - - if parsed_args.data: - record.data = parsed_args.data - - if parsed_args.no_ttl: - record.ttl = None - elif parsed_args.ttl is not None: - record.ttl = parsed_args.ttl - - if parsed_args.no_priority: - record.priority = None - elif parsed_args.priority is not None: - record.priority = parsed_args.priority - - if parsed_args.no_description: - record.description = None - elif parsed_args.description: - record.description = parsed_args.description - - domain_id = self.find_resourceid_by_name_or_id( - 'domains', parsed_args.domain_id) - return self.client.records.update(domain_id, record) - - -class DeleteRecordCommand(base.DeleteCommand): - """Delete Record""" - - def get_parser(self, prog_name): - parser = super(DeleteRecordCommand, self).get_parser(prog_name) - - parser.add_argument('domain_id', help="Domain ID or name.") - parser.add_argument('id', help="Record ID.") - - return parser - - def execute(self, parsed_args): - domain_id = self.find_resourceid_by_name_or_id( - 'domains', parsed_args.domain_id) - return self.client.records.delete(domain_id, parsed_args.id) diff --git a/designateclient/cli/reports.py b/designateclient/cli/reports.py deleted file mode 100644 index 6ecfc2e..0000000 --- a/designateclient/cli/reports.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2013 Hewlett-Packard Development Company, L.P. All Rights Reserved. -# -# Author: Patrick Galbraith <patg@patg.net> -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -from designateclient.cli import base - - -class DomainCountCommand(base.GetCommand): - """Get counts for total domains""" - - def execute(self, parsed_args): - return self.client.reports.count_domains() - - -class RecordCountCommand(base.GetCommand): - """Get counts for total records""" - - def execute(self, parsed_args): - return self.client.reports.count_records() - - -class TenantCountCommand(base.GetCommand): - """Get counts for total tenants""" - - def execute(self, parsed_args): - return self.client.reports.count_tenants() - - -class CountsCommand(base.GetCommand): - """Get count totals for all tenants, domains and records""" - - def execute(self, parsed_args): - return self.client.reports.count_all() - - -class TenantsCommand(base.ListCommand): - """Get list of tenants and domain count for each""" - - columns = ['domain_count', 'id'] - - def execute(self, parsed_args): - return self.client.reports.tenants_all() - - -class TenantCommand(base.ListCommand): - """Get a list of domains for given tenant""" - - columns = ['domain'] - - def get_parser(self, prog_name): - parser = super(TenantCommand, self).get_parser(prog_name) - - parser.add_argument('--report-tenant-id', - help="The tenant_id being reported on.", - required=True) - - return parser - - def execute(self, parsed_args): - return self.client.reports.tenant_domains(parsed_args.report_tenant_id) diff --git a/designateclient/cli/servers.py b/designateclient/cli/servers.py deleted file mode 100644 index 184271b..0000000 --- a/designateclient/cli/servers.py +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright 2012 Managed I.T. -# -# Author: Kiall Mac Innes <kiall@managedit.ie> -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging - -from designateclient.cli import base -from designateclient.v1.servers import Server - -LOG = logging.getLogger(__name__) - - -class ListServersCommand(base.ListCommand): - """List Servers""" - - columns = ['id', 'name'] - - def execute(self, parsed_args): - return self.client.servers.list() - - -class GetServerCommand(base.GetCommand): - """Get Server""" - - def get_parser(self, prog_name): - parser = super(GetServerCommand, self).get_parser(prog_name) - - parser.add_argument('id', help="Server ID.") - - return parser - - def execute(self, parsed_args): - return self.client.servers.get(parsed_args.id) - - -class CreateServerCommand(base.CreateCommand): - """Create Server""" - - def get_parser(self, prog_name): - parser = super(CreateServerCommand, self).get_parser(prog_name) - - parser.add_argument('--name', help="Server name.", required=True) - - return parser - - def execute(self, parsed_args): - server = Server( - name=parsed_args.name, - ) - - return self.client.servers.create(server) - - -class UpdateServerCommand(base.UpdateCommand): - """Update Server""" - - def get_parser(self, prog_name): - parser = super(UpdateServerCommand, self).get_parser(prog_name) - - parser.add_argument('id', help="Server ID.") - parser.add_argument('--name', help="Server name.") - - return parser - - def execute(self, parsed_args): - # TODO(kiall): API needs updating.. this get is silly - server = self.client.servers.get(parsed_args.id) - - if parsed_args.name: - server.name = parsed_args.name - - return self.client.servers.update(server) - - -class DeleteServerCommand(base.DeleteCommand): - """Delete Server""" - - def get_parser(self, prog_name): - parser = super(DeleteServerCommand, self).get_parser(prog_name) - - parser.add_argument('id', help="Server ID.") - - return parser - - def execute(self, parsed_args): - return self.client.servers.delete(parsed_args.id) diff --git a/designateclient/cli/sync.py b/designateclient/cli/sync.py deleted file mode 100644 index 18e2852..0000000 --- a/designateclient/cli/sync.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2012 Managed I.T. -# -# Author: Kiall Mac Innes <kiall@managedit.ie> -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -import logging - -from designateclient.cli import base - -LOG = logging.getLogger(__name__) - - -class SyncAllCommand(base.DeleteCommand): - """Sync Everything""" - - def execute(self, parsed_args): - self.client.sync.sync_all() - - LOG.info('Synchronization of all domains scheduled') - - -class SyncDomainCommand(base.DeleteCommand): - """Sync a single Domain""" - - def get_parser(self, prog_name): - parser = super(SyncDomainCommand, self).get_parser(prog_name) - - parser.add_argument('domain_id', help="Domain ID") - - return parser - - def execute(self, parsed_args): - self.client.sync.sync_domain(parsed_args.domain_id) - - LOG.info('Synchronization of domain scheduled') - - -class SyncRecordCommand(base.DeleteCommand): - """Sync a single Record""" - - def get_parser(self, prog_name): - parser = super(SyncRecordCommand, self).get_parser(prog_name) - - parser.add_argument('domain_id', help="Domain ID") - parser.add_argument('record_id', help="Record ID") - - return parser - - def execute(self, parsed_args): - self.client.sync.sync_record(parsed_args.domain_id, - parsed_args.record_id) - - LOG.info('Synchronization of record scheduled') diff --git a/designateclient/cli/touch.py b/designateclient/cli/touch.py deleted file mode 100644 index a9713f0..0000000 --- a/designateclient/cli/touch.py +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2012 Managed I.T. -# -# Author: Kiall Mac Innes <kiall@managedit.ie> -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging - -from designateclient.cli import base - -LOG = logging.getLogger(__name__) - - -class TouchDomainCommand(base.DeleteCommand): - """Touch a single Domain""" - - def get_parser(self, prog_name): - parser = super(TouchDomainCommand, self).get_parser(prog_name) - - parser.add_argument('domain_id', help="Domain ID") - - return parser - - def execute(self, parsed_args): - self.client.touch.domain(parsed_args.domain_id) - - LOG.info('Domain touched successfully') |