add copyright to files in testAPI
[releng.git] / utils / test / result_collection_api / 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 from opnfv_testapi.resources.handlers import VersionHandler
10 from opnfv_testapi.resources.testcase_handlers import TestcaseCLHandler, \
11     TestcaseGURHandler
12 from opnfv_testapi.resources.pod_handlers import PodCLHandler, PodGURHandler
13 from opnfv_testapi.resources.project_handlers import ProjectCLHandler, \
14     ProjectGURHandler
15 from opnfv_testapi.resources.result_handlers import ResultsCLHandler, \
16     ResultsGURHandler
17 from opnfv_testapi.resources.dashboard_handlers import DashboardHandler
18
19
20 mappings = [
21     # GET /versions => GET API version
22     (r"/versions", VersionHandler),
23
24     # few examples:
25     # GET /api/v1/pods => Get all pods
26     # GET /api/v1/pods/1 => Get details on POD 1
27     (r"/api/v1/pods", PodCLHandler),
28     (r"/api/v1/pods/([^/]+)", PodGURHandler),
29
30     # few examples:
31     # GET /projects
32     # GET /projects/yardstick
33     (r"/api/v1/projects", ProjectCLHandler),
34     (r"/api/v1/projects/([^/]+)", ProjectGURHandler),
35
36     # few examples
37     # GET /projects/qtip/cases => Get cases for qtip
38     (r"/api/v1/projects/([^/]+)/cases", TestcaseCLHandler),
39     (r"/api/v1/projects/([^/]+)/cases/([^/]+)", TestcaseGURHandler),
40
41     # new path to avoid a long depth
42     # GET /results?project=functest&case=keystone.catalog&pod=1
43     #   => get results with optional filters
44     # POST /results =>
45     # Push results with mandatory request payload parameters
46     # (project, case, and pod)
47     (r"/api/v1/results", ResultsCLHandler),
48     (r"/api/v1/results/([^/]+)", ResultsGURHandler),
49
50     # Method to manage Dashboard ready results
51     # GET /dashboard?project=functest&case=vPing&pod=opnfv-jump2
52     #  => get results in dasboard ready format
53     # get /dashboard
54     #  => get the list of project with dashboard ready results
55     (r"/dashboard/v1/results", DashboardHandler),
56 ]