From 119faa49c41ab093aaa9767e906b448198e5c6c4 Mon Sep 17 00:00:00 2001 From: SerenaFeng Date: Wed, 25 May 2016 22:56:11 +0800 Subject: attach version number to url in testAPI version - /versions api - /api/v1/pods(projects/results) dashboard - /dashboard/v1/results I tried to make the code smart, but in vain, sad...... JIRA: FUNCTEST-261 Change-Id: I3e9e3ad7180a6c6349fd743e24eafea07bdefd1d Signed-off-by: SerenaFeng --- .../result_collection_api/result_collection_api.py | 25 +++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'utils/test/result_collection_api/result_collection_api.py') diff --git a/utils/test/result_collection_api/result_collection_api.py b/utils/test/result_collection_api/result_collection_api.py index 704d6075c..97aa58c77 100644 --- a/utils/test/result_collection_api/result_collection_api.py +++ b/utils/test/result_collection_api/result_collection_api.py @@ -54,25 +54,25 @@ def make_app(): return tornado.web.Application( [ # GET /version => GET API version - (r"/version", VersionHandler), + (r"/versions", VersionHandler), # few examples: # GET /pods => Get all pods # GET /pods/1 => Get details on POD 1 - (r"/pods", PodHandler), - (r"/pods/([^/]+)", PodHandler), + (r"/api/v1/pods", PodHandler), + (r"/api/v1/pods/([^/]+)", PodHandler), # few examples: # GET /projects # GET /projects/yardstick - (r"/projects", ProjectHandler), - (r"/projects/([^/]+)", ProjectHandler), + (r"/api/v1/projects", ProjectHandler), + (r"/api/v1/projects/([^/]+)", ProjectHandler), # few examples # GET /projects/qtip/cases => Get cases for qtip # - (r"/projects/([^/]+)/cases", TestcaseHandler), - (r"/projects/([^/]+)/cases/([^/]+)", TestcaseHandler), + (r"/api/v1/projects/([^/]+)/cases", TestcaseHandler), + (r"/api/v1/projects/([^/]+)/cases/([^/]+)", TestcaseHandler), # (r"/test_cases/([^/]+)", TestCasesHandler), # new path to avoid a long depth @@ -81,18 +81,17 @@ def make_app(): # POST /results => # Push results with mandatory request payload parameters # (project, case, and pod) - (r"/results", TestResultsHandler), - (r"/results([^/]*)", TestResultsHandler), - (r"/results/([^/]*)", TestResultsHandler), + (r"/api/v1/results", TestResultsHandler), + (r"/api/v1/results([^/]*)", TestResultsHandler), + (r"/api/v1/results/([^/]*)", TestResultsHandler), # Method to manage Dashboard ready results # GET /dashboard?project=functest&case=vPing&pod=opnfv-jump2 # => get results in dasboard ready format # get /dashboard # => get the list of project with dashboard ready results - (r"/dashboard", DashboardHandler), - (r"/dashboard([^/]*)", DashboardHandler), - (r"/dashboard/([^/]*)", DashboardHandler), + (r"/dashboard/v1/results", DashboardHandler), + (r"/dashboard/v1/results([^/]*)", DashboardHandler), ], db=db, debug=CONF.api_debug_on, -- cgit 1.2.3-korg