diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2017-01-04 14:25:42 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-01-04 14:25:42 +0000 |
commit | fd41180285d17f79adafd31cedb995bd5579dfcf (patch) | |
tree | 52e962e0cdfc46e44117340eae58edaa6442f9b8 /reporting/api | |
parent | af50eeb83a79412e7e3ef79667f72ce5a6b0dd6c (diff) | |
parent | 74c7067bffccd76f92dcbf51ba9211b9d6c6e533 (diff) |
Merge "Create Test Reporting landing page"
Diffstat (limited to 'reporting/api')
-rw-r--r-- | reporting/api/__init__.py | 0 | ||||
-rw-r--r-- | reporting/api/handlers/__init__.py | 0 | ||||
-rw-r--r-- | reporting/api/handlers/landing.py | 20 | ||||
-rw-r--r-- | reporting/api/server.py | 27 | ||||
-rw-r--r-- | reporting/api/urls.py | 14 |
5 files changed, 61 insertions, 0 deletions
diff --git a/reporting/api/__init__.py b/reporting/api/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/reporting/api/__init__.py diff --git a/reporting/api/handlers/__init__.py b/reporting/api/handlers/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/reporting/api/handlers/__init__.py diff --git a/reporting/api/handlers/landing.py b/reporting/api/handlers/landing.py new file mode 100644 index 0000000..137c050 --- /dev/null +++ b/reporting/api/handlers/landing.py @@ -0,0 +1,20 @@ +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from tornado.web import RequestHandler +from tornado.escape import json_encode + + +class FiltersHandler(RequestHandler): + def get(self): + return self.write(json_encode({'status': 'SUCCESS'})) + + +class ScenariosHandler(RequestHandler): + def get(self): + return self.write(json_encode({'status': 'SUCCESS'})) diff --git a/reporting/api/server.py b/reporting/api/server.py new file mode 100644 index 0000000..0b00e93 --- /dev/null +++ b/reporting/api/server.py @@ -0,0 +1,27 @@ +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +import tornado.ioloop +import tornado.web +from tornado.options import define +from tornado.options import options + +from urls import mappings + +define("port", default=8000, help="run on the given port", type=int) + + +def main(): + tornado.options.parse_command_line() + application = tornado.web.Application(mappings) + application.listen(options.port) + tornado.ioloop.IOLoop.current().start() + + +if __name__ == "__main__": + main() diff --git a/reporting/api/urls.py b/reporting/api/urls.py new file mode 100644 index 0000000..fcfb2d7 --- /dev/null +++ b/reporting/api/urls.py @@ -0,0 +1,14 @@ +############################################################################## +# Copyright (c) 2016 Huawei Technologies Co.,Ltd and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## +from handlers import landing + +mappings = [ + (r"/landing-page/filters", landing.FiltersHandler), + (r"/landing-page/scenarios", landing.ScenariosHandler) +] |