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.config import CONF
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 from opnfv_testapi.ui import root
19 from opnfv_testapi.ui.auth import sign
20 from opnfv_testapi.ui.auth import user
23 # GET /versions => GET API version
24 (r"/versions", handlers.VersionHandler),
27 # GET /api/v1/pods => Get all pods
28 # GET /api/v1/pods/1 => Get details on POD 1
29 (r"/api/v1/pods", pod_handlers.PodCLHandler),
30 (r"/api/v1/pods/([^/]+)", pod_handlers.PodGURHandler),
34 # GET /projects/yardstick
35 (r"/api/v1/projects", project_handlers.ProjectCLHandler),
36 (r"/api/v1/projects/([^/]+)", project_handlers.ProjectGURHandler),
39 # GET /projects/qtip/cases => Get cases for qtip
40 (r"/api/v1/projects/([^/]+)/cases", testcase_handlers.TestcaseCLHandler),
41 (r"/api/v1/projects/([^/]+)/cases/([^/]+)",
42 testcase_handlers.TestcaseGURHandler),
44 # new path to avoid a long depth
45 # GET /results?project=functest&case=keystone.catalog&pod=1
46 # => get results with optional filters
48 # Push results with mandatory request payload parameters
49 # (project, case, and pod)
50 (r"/api/v1/results", result_handlers.ResultsCLHandler),
51 (r'/api/v1/results/upload', result_handlers.ResultsUploadHandler),
52 (r"/api/v1/results/([^/]+)", result_handlers.ResultsGURHandler),
55 (r"/api/v1/scenarios", scenario_handlers.ScenariosCLHandler),
56 (r"/api/v1/scenarios/([^/]+)", scenario_handlers.ScenarioGURHandler),
57 (r"/api/v1/scenarios/([^/]+)/scores",
58 scenario_handlers.ScenarioScoresHandler),
59 (r"/api/v1/scenarios/([^/]+)/trust_indicators",
60 scenario_handlers.ScenarioTIsHandler),
61 (r"/api/v1/scenarios/([^/]+)/customs",
62 scenario_handlers.ScenarioCustomsHandler),
63 (r"/api/v1/scenarios/([^/]+)/projects",
64 scenario_handlers.ScenarioProjectsHandler),
65 (r"/api/v1/scenarios/([^/]+)/owner",
66 scenario_handlers.ScenarioOwnerHandler),
67 (r"/api/v1/scenarios/([^/]+)/versions",
68 scenario_handlers.ScenarioVersionsHandler),
69 (r"/api/v1/scenarios/([^/]+)/installers",
70 scenario_handlers.ScenarioInstallersHandler),
73 (r'/(.*\.(css|png|gif|js|html|json|map|woff2|woff|ttf))',
74 tornado.web.StaticFileHandler,
75 {'path': CONF.ui_static_path}),
77 (r'/', root.RootHandler),
78 (r'/api/v1/auth/signin', sign.SigninHandler),
79 (r'/{}'.format(CONF.lfid_signin_return), sign.SigninReturnHandler),
80 (r'/api/v1/auth/signout', sign.SignoutHandler),
81 (r'/api/v1/profile', user.UserHandler),