summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/result_collection_api.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2016-05-26 18:07:35 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2016-05-26 18:17:41 +0800
commit00355a8df9949edc12c41d5a8475fc17efbb03d3 (patch)
tree55a3d1a807882e8d1294f66ef248f923b3ffe6ae /utils/test/result_collection_api/result_collection_api.py
parenta7d4197cef093a5eae141efa34c0833c76a1f183 (diff)
swagger-ize pod-apis of testAPI
JIRA: FUNCTEST-263 Change-Id: I293e05f565f882ea39bbf6368405f10241269716 Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'utils/test/result_collection_api/result_collection_api.py')
-rw-r--r--utils/test/result_collection_api/result_collection_api.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/utils/test/result_collection_api/result_collection_api.py b/utils/test/result_collection_api/result_collection_api.py
index 97aa58c77..afd66f3fc 100644
--- a/utils/test/result_collection_api/result_collection_api.py
+++ b/utils/test/result_collection_api/result_collection_api.py
@@ -29,14 +29,16 @@ TODOs :
"""
+import argparse
+
import tornado.ioloop
import motor
-import argparse
-from resources.handlers import VersionHandler, PodHandler, \
+from resources.handlers import VersionHandler, \
ProjectHandler, TestcaseHandler, TestResultsHandler, DashboardHandler
+from resources.pod_handler import PodCLHandler, PodGURHandler
from common.config import APIConfig
-
+from tornado_swagger_ui.tornado_swagger import swagger
# optionally get config file from command line
parser = argparse.ArgumentParser()
@@ -51,16 +53,16 @@ db = client[CONF.mongo_dbname]
def make_app():
- return tornado.web.Application(
+ return swagger.Application(
[
# GET /version => GET API version
(r"/versions", VersionHandler),
# few examples:
- # GET /pods => Get all pods
- # GET /pods/1 => Get details on POD 1
- (r"/api/v1/pods", PodHandler),
- (r"/api/v1/pods/([^/]+)", PodHandler),
+ # GET /api/v1/pods => Get all pods
+ # GET /api/v1/pods/1 => Get details on POD 1
+ (r"/api/v1/pods", PodCLHandler),
+ (r"/api/v1/pods/([^/]+)", PodGURHandler),
# few examples:
# GET /projects
@@ -70,10 +72,8 @@ def make_app():
# few examples
# GET /projects/qtip/cases => Get cases for qtip
- #
(r"/api/v1/projects/([^/]+)/cases", TestcaseHandler),
(r"/api/v1/projects/([^/]+)/cases/([^/]+)", TestcaseHandler),
- # (r"/test_cases/([^/]+)", TestCasesHandler),
# new path to avoid a long depth
# GET /results?project=functest&case=keystone.catalog&pod=1