diff options
Diffstat (limited to 'legacy')
-rw-r--r-- | legacy/api/cmd/__init__.py | 0 | ||||
-rw-r--r-- | legacy/api/cmd/server.py | 31 | ||||
-rw-r--r-- | legacy/api/router/mapper.py | 2 | ||||
-rw-r--r-- | legacy/assets/perftest/common/sys_info_pbook.yaml | 42 |
4 files changed, 32 insertions, 43 deletions
diff --git a/legacy/api/cmd/__init__.py b/legacy/api/cmd/__init__.py new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/legacy/api/cmd/__init__.py diff --git a/legacy/api/cmd/server.py b/legacy/api/cmd/server.py new file mode 100644 index 00000000..eea45ad3 --- /dev/null +++ b/legacy/api/cmd/server.py @@ -0,0 +1,31 @@ +############################################################################## +# Copyright (c) 2016 ZTE Corp 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 flask import Flask +from flask_restful import Api +from flask_restful_swagger import swagger + +import legacy.api.router.mapper as mapper + +app = Flask(__name__) +api = swagger.docs(Api(app), apiVersion='0.1', description='QTIP API specs') + + +def add_routers(): + for (handler, url) in mapper.mappers: + api.add_resource(handler, url) + + +def main(): + add_routers() + app.run(host='0.0.0.0') + + +if __name__ == "__main__": + main() diff --git a/legacy/api/router/mapper.py b/legacy/api/router/mapper.py index 8839f3f5..cd21fbe1 100644 --- a/legacy/api/router/mapper.py +++ b/legacy/api/router/mapper.py @@ -1,4 +1,4 @@ -from legacy.api.handler import Job, JobList +from legacy.api.handler.job_handler import Job, JobList mappers = [ diff --git a/legacy/assets/perftest/common/sys_info_pbook.yaml b/legacy/assets/perftest/common/sys_info_pbook.yaml deleted file mode 100644 index 5c2d8f79..00000000 --- a/legacy/assets/perftest/common/sys_info_pbook.yaml +++ /dev/null @@ -1,42 +0,0 @@ - - name: Epel Release install when CentOS - shell: sudo yum install epel-release -y - when: ansible_os_family == "RedHat" - - - name: Inxi install when CentOS - shell: sudo yum install inxi -y - when: ansible_os_family == "RedHat" - - - name: Software Properties Common - shell: sudo apt-get install software-properties-common -y - when: ansible_os_family == "Debian" - - - name: adding trusty-backport main repo - shell: sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse" - when: ansible_os_family == "Debian" - - - name: adding trusty main repo - shell: sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe multiverse" - when: ansible_os_family == "Debian" - - - name: system info collection tool install when Ubuntu - shell: sudo apt-get update && apt-get install inxi -y - when: ansible_os_family == "Debian" - - - name: Install ansible copy dependencies if remote host has selinux enabled - shell: sudo yum install libselinux-python -y - when: ansible_os_family == "RedHat" - - - name: Install ansiblle copy dependencies if remote host has selinux enaled - shell: sudo apt-get install python-selinux -y - when: ansible_os_family == "Debian" - - - name: system_info script copy - copy: src=../etc/info_collect.py dest={{home_dir.stdout}}/qtip_result/ - - - name: collecting system informaton for non-network test cases - shell: cd $HOME/qtip_result && sudo python info_collect.py c - when: not network - - - name: collecting system information for network test cases - shell: cd $HOME/qtip_result && sudo python info_collect.py n - when: network |