update customs in scenario
[releng.git] / utils / test / testapi / opnfv_testapi / router / url_mappings.py
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 ##############################################################################
9 import tornado.web
10
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
21
22 mappings = [
23     # GET /versions => GET API version
24     (r"/versions", handlers.VersionHandler),
25
26     # few examples:
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),
31
32     # few examples:
33     # GET /projects
34     # GET /projects/yardstick
35     (r"/api/v1/projects", project_handlers.ProjectCLHandler),
36     (r"/api/v1/projects/([^/]+)", project_handlers.ProjectGURHandler),
37
38     # few examples
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),
43
44     # new path to avoid a long depth
45     # GET /results?project=functest&case=keystone.catalog&pod=1
46     #   => get results with optional filters
47     # POST /results =>
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),
53
54     # scenarios
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
64     # static path
65     (r'/(.*\.(css|png|gif|js|html|json|map|woff2|woff|ttf))',
66      tornado.web.StaticFileHandler,
67      {'path': CONF.static_path}),
68
69     (r'/', root.RootHandler),
70     (r'/api/v1/auth/signin', sign.SigninHandler),
71     (r'/api/v1/auth/signin_return', sign.SigninReturnHandler),
72     (r'/api/v1/auth/signout', sign.SignoutHandler),
73     (r'/api/v1/profile', user.ProfileHandler),
74
75 ]