summaryrefslogtreecommitdiffstats
path: root/testapi/testapi-client/testapiclient/command.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2018-03-09 16:35:22 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2018-03-09 18:06:09 +0800
commit1a95c1e6b33d9b3efcfd92e1de64feee7e9b5c68 (patch)
tree61488ece232657c6693425eabc07ad6ca4b3af8e /testapi/testapi-client/testapiclient/command.py
parentcc29ae1cd41d1f403511730d5ba44dded967fb12 (diff)
restructure testapiclient project
Change-Id: I13d24ce7b436f203a66fe14f4930e58b3ab1193c Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/testapi-client/testapiclient/command.py')
-rw-r--r--testapi/testapi-client/testapiclient/command.py38
1 files changed, 0 insertions, 38 deletions
diff --git a/testapi/testapi-client/testapiclient/command.py b/testapi/testapi-client/testapiclient/command.py
deleted file mode 100644
index 62a8b86..0000000
--- a/testapi/testapi-client/testapiclient/command.py
+++ /dev/null
@@ -1,38 +0,0 @@
-from cliff import command
-from testapiclient import url_parse
-
-
-class Command(command.Command):
- def get_parser(self, prog_name):
- parser = super(Command, self).get_parser(prog_name)
- parser.add_argument('-u',
- type=str,
- help='Username for authentication')
- parser.add_argument('-p',
- type=str,
- help='Password for authentication')
-
- return parser
-
- def show(self, request, response):
- print ' '.join([request,
- 'success' if response.status_code < 300
- else 'failed: {}'.format(response.text)])
-
-
-class Lister(command.Command):
-
- @staticmethod
- def filter_by_name(url, parsed_args):
- def query_url():
- return url_parse.query_join(url, name=parsed_args.name)
-
- return query_url() if parsed_args.name else url
-
- def show(self, response):
- print response.json() if response.status_code < 300 else response.text
-
-
-class ShowOne(command.Command):
- def show(self, response):
- print response.json() if response.status_code < 300 else response.text