summaryrefslogtreecommitdiffstats
path: root/api/resources/case_docs.py
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-07-07 03:13:36 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-07-11 09:47:30 +0000
commit0d18f9d3299480cb43e6b335180e5cbdb58505c3 (patch)
treea35aa6373a88eddb3d13f4fdb7cd3db9bad1a4ee /api/resources/case_docs.py
parent41136dafb30d0c410e92f9f7a7c19eae60f224e2 (diff)
Yardstick API architecture improvement
JIRA: YARDSTICK-710 Since we have the plan to upload api v2 and gui. We need to add put and delete method. So the architecture need to be improved. Change-Id: Ie20a79c26ef6c581897ce4e63980fa2895b162d2 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'api/resources/case_docs.py')
-rw-r--r--api/resources/case_docs.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/api/resources/case_docs.py b/api/resources/case_docs.py
deleted file mode 100644
index 289410d2d..000000000
--- a/api/resources/case_docs.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import os
-import logging
-
-from api.utils.common import result_handler
-from yardstick.common import constants as consts
-
-LOG = logging.getLogger(__name__)
-LOG.setLevel(logging.DEBUG)
-
-
-def default(args):
- return get_case_docs(args)
-
-
-def get_case_docs(args):
- try:
- case_name = args['case_name']
- except KeyError:
- return result_handler(consts.API_ERROR, 'case_name must be provided')
-
- docs_path = os.path.join(consts.DOCS_DIR, '{}.rst'.format(case_name))
-
- if not os.path.exists(docs_path):
- return result_handler(consts.API_ERROR, 'case not exists')
-
- LOG.info('Reading %s', case_name)
- with open(docs_path) as f:
- content = f.read()
-
- return result_handler(consts.API_SUCCESS, {'docs': content})