Remove redundant moniker-manage commands.

These should have never been here..

Change-Id: I0c0eb4f4c022f3848d1c4ab83c17fdb7ee7d973a
This commit is contained in:
Kiall Mac Innes 2013-03-31 15:00:59 +01:00
parent 544002ab5c
commit 38681ad86d
4 changed files with 0 additions and 273 deletions

View File

@ -1,93 +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.
from moniker.openstack.common import log as logging
from moniker.manage import base
from moniker.central import api as central_api
LOG = logging.getLogger(__name__)
class ListServersCommand(base.ListCommand):
""" List Servers """
def execute(self, parsed_args):
return central_api.get_servers(self.context)
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 central_api.get_server(self.context, 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 = dict(
name=parsed_args.name,
)
return central_api.create_server(self.context, 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):
server = {}
if parsed_args.name:
server['name'] = parsed_args.name
return central_api.update_server(self.context, parsed_args.id, 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 central_api.delete_server(self.context, parsed_args.id)

View File

@ -1,57 +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.
from moniker.openstack.common import log as logging
from moniker.manage import base
from moniker.central import api as central_api
LOG = logging.getLogger(__name__)
class SyncDomainsCommand(base.Command):
""" Sync All Domains """
def execute(self, parsed_args):
return central_api.sync_domains(self.context)
class SyncDomainCommand(base.Command):
""" Sync A Single Domain """
def get_parser(self, prog_name):
parser = super(SyncDomainCommand, self).get_parser(prog_name)
parser.add_argument('id', help="Domain ID")
return parser
def execute(self, parsed_args):
return central_api.sync_domain(self.context, parsed_args.id)
class SyncRecordCommand(base.Command):
""" Sync A Single Record """
def get_parser(self, prog_name):
parser = super(SyncDomainCommand, self).get_parser(prog_name)
parser.add_argument('domain_id', help="Domain ID")
parser.add_argument('id', help="Record ID")
return parser
def execute(self, parsed_args):
return central_api.sync_record(self.context, parsed_args.domain_id,
parsed_args.id)

View File

@ -1,107 +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.
from moniker.openstack.common import log as logging
from moniker.manage import base
from moniker.central import api as central_api
LOG = logging.getLogger(__name__)
class ListTsigKeysCommand(base.ListCommand):
""" List TsigKeys """
def execute(self, parsed_args):
return central_api.get_tsigkeys(self.context)
class GetTsigKeyCommand(base.GetCommand):
""" Get TsigKey """
def get_parser(self, prog_name):
parser = super(GetTsigKeyCommand, self).get_parser(prog_name)
parser.add_argument('id', help="TSIG Key ID")
return parser
def execute(self, parsed_args):
return central_api.get_tsigkey(self.context, parsed_args.id)
class CreateTsigKeyCommand(base.CreateCommand):
""" Create TsigKey """
def get_parser(self, prog_name):
parser = super(CreateTsigKeyCommand, self).get_parser(prog_name)
parser.add_argument('--name', help="TSIG Key Name", required=True)
parser.add_argument('--algorithm', help="TSIG Key Algorithm",
required=True)
parser.add_argument('--secret', help="TSIG Key Secret", required=True)
return parser
def execute(self, parsed_args):
tsigkey = dict(
name=parsed_args.name,
algorithm=parsed_args.algorithm,
secret=parsed_args.secret,
)
return central_api.create_tsigkey(self.context, tsigkey)
class UpdateTsigKeyCommand(base.UpdateCommand):
""" Update TsigKey """
def get_parser(self, prog_name):
parser = super(UpdateTsigKeyCommand, self).get_parser(prog_name)
parser.add_argument('id', help="TSIG Key ID")
parser.add_argument('--name', help="TSIG Key Name")
parser.add_argument('--algorithm', help="TSIG Key Algorithm")
parser.add_argument('--secret', help="TSIG Key Secret")
return parser
def execute(self, parsed_args):
tsigkey = {}
if parsed_args.name:
tsigkey['name'] = parsed_args.name
if parsed_args.algorithm:
tsigkey['algorithm'] = parsed_args.algorithm
if parsed_args.secret:
tsigkey['secret'] = parsed_args.secret
return central_api.update_tsigkey(self.context, parsed_args.id,
tsigkey)
class DeleteTsigKeyCommand(base.DeleteCommand):
""" Delete TsigKey """
def get_parser(self, prog_name):
parser = super(DeleteTsigKeyCommand, self).get_parser(prog_name)
parser.add_argument('id', help="TSIG Key ID")
return parser
def execute(self, parsed_args):
return central_api.delete_tsigkey(self.context, parsed_args.id)

View File

@ -89,22 +89,6 @@ setup(
database-sync = moniker.manage.database:SyncCommand
powerdns database-init = moniker.manage.powerdns:DatabaseInitCommand
powerdns database-sync = moniker.manage.powerdns:DatabaseSyncCommand
server-list = moniker.manage.servers:ListServersCommand
server-get = moniker.manage.servers:GetServerCommand
server-create = moniker.manage.servers:CreateServerCommand
server-update = moniker.manage.servers:UpdateServerCommand
server-delete = moniker.manage.servers:DeleteServerCommand
tsigkey-list = moniker.manage.tsigkeys:ListTsigKeysCommand
tsigkey-get = moniker.manage.tsigkeys:GetTsigKeyCommand
tsigkey-create = moniker.manage.tsigkeys:CreateTsigKeyCommand
tsigkey-update = moniker.manage.tsigkeys:UpdateTsigKeyCommand
tsigkey-delete = moniker.manage.tsigkeys:DeleteTsigKeyCommand
sync-domains = moniker.manage.sync:SyncDomainsCommand
sync-domain = moniker.manage.sync:SyncDomainCommand
sync-record = moniker.manage.sync:SyncRecordCommand
"""),
classifiers=[
'Development Status :: 3 - Alpha',