1 ##############################################################################
2 # Copyright (c) 2015 Orange
3 # guyrodrigue.koffi@orange.com / koffirodrigue@gmail.com
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
11 from opnfv_testapi.common import config
12 from opnfv_testapi.resources import handlers
13 from opnfv_testapi.resources import pod_handlers
14 from opnfv_testapi.resources import project_handlers
15 from opnfv_testapi.resources import result_handlers
16 from opnfv_testapi.resources import scenario_handlers
17 from opnfv_testapi.resources import testcase_handlers
18 import opnfv_testapi.resources.ui_handlers
21 # GET /versions => GET API version
22 (r'/', opnfv_testapi.resources.ui_handlers.UIHandler),
23 (r"/versions", handlers.VersionHandler),
26 # GET /api/v1/pods => Get all pods
27 # GET /api/v1/pods/1 => Get details on POD 1
28 (r"/api/v1/pods", pod_handlers.PodCLHandler),
29 (r"/api/v1/pods/([^/]+)", pod_handlers.PodGURHandler),
33 # GET /projects/yardstick
34 (r"/api/v1/projects", project_handlers.ProjectCLHandler),
35 (r"/api/v1/projects/([^/]+)", project_handlers.ProjectGURHandler),
38 # GET /projects/qtip/cases => Get cases for qtip
39 (r"/api/v1/projects/([^/]+)/cases", testcase_handlers.TestcaseCLHandler),
40 (r"/api/v1/projects/([^/]+)/cases/([^/]+)",
41 testcase_handlers.TestcaseGURHandler),
43 # new path to avoid a long depth
44 # GET /results?project=functest&case=keystone.catalog&pod=1
45 # => get results with optional filters
47 # Push results with mandatory request payload parameters
48 # (project, case, and pod)
49 (r"/api/v1/results", result_handlers.ResultsCLHandler),
50 (r"/api/v1/results/([^/]+)", result_handlers.ResultsGURHandler),
53 (r"/api/v1/scenarios", scenario_handlers.ScenariosCLHandler),
54 (r"/api/v1/scenarios/([^/]+)", scenario_handlers.ScenarioGURHandler),
57 (r'/(.*\.(css|png|gif|js|html|json))',
58 tornado.web.StaticFileHandler,
59 {'path': config.Config().static_path}),