aboutsummaryrefslogtreecommitdiff
path: root/app/urls.py
blob: 22e74ca369d6c908887b93451f671ccfa2a3f6cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""Define URLs and handlers to server them."""

import tornado.web

import handlers.batch
import handlers.bisect
import handlers.boot
import handlers.count
import handlers.defconf
import handlers.job
import handlers.lab
import handlers.report
import handlers.send
import handlers.subscription
import handlers.token
import handlers.upload
import handlers.version


_JOB_URL = tornado.web.url(
    r"/job[s]?/?(?P<id>.*)", handlers.job.JobHandler, name="job"
)
_DEFCONF_URL = tornado.web.url(
    r"/defconfig[s]?/?(?P<id>.*)",
    handlers.defconf.DefConfHandler,
    name="defconf"
)
_SUBSCRIPTION_URL = tornado.web.url(
    r"/subscription[s]?/?(?P<id>.*)",
    handlers.subscription.SubscriptionHandler,
    name="subscription",
)
_BOOT_URL = tornado.web.url(
    r"/boot[s]?/?(?P<id>.*)", handlers.boot.BootHandler, name="boot"
)
_COUNT_URL = tornado.web.url(
    r"/count[s]?/?(?P<id>.*)", handlers.count.CountHandler, name="count"
)
_TOKEN_URL = tornado.web.url(
    r"/token[s]?/?(?P<id>.*)", handlers.token.TokenHandler, name="token"
)
_BATCH_URL = tornado.web.url(
    r"/batch", handlers.batch.BatchHandler, name="batch"
)
_BISECT_URL = tornado.web.url(
    r"/bisect[s]?/?(?P<id>.*)",
    handlers.bisect.BisectHandler,
    name="bisect"
)
_LAB_URL = tornado.web.url(
    r"/lab[s]?/?(?P<id>.*)", handlers.lab.LabHandler, name="lab"
)
_VERSION_URL = tornado.web.url(
    r"/version", handlers.version.VersionHandler, name="version"
)
_REPORT_URL = tornado.web.url(
    r"/report[s]?/?(?P<id>.*)",
    handlers.report.ReportHandler,
    name="response"
)
_UPLOAD_URL = tornado.web.url(
    r"/upload/?(?P<path>.*)",
    handlers.upload.UploadHandler,
    name="upload"
)
_SEND_URL = tornado.web.url(
    r"/send/?",
    handlers.send.SendHandler,
    name="send"
)

APP_URLS = [
    _BATCH_URL,
    _BISECT_URL,
    _BOOT_URL,
    _COUNT_URL,
    _DEFCONF_URL,
    _JOB_URL,
    _LAB_URL,
    _SUBSCRIPTION_URL,
    _TOKEN_URL,
    _VERSION_URL,
    _REPORT_URL,
    _UPLOAD_URL,
    _SEND_URL
]