aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlice Ferrazzi <alicef@gentoo.org>2017-06-30 22:54:03 +0000
committerAlice Ferrazzi <alicef@gentoo.org>2017-06-30 22:54:03 +0000
commitd63c89249889ac90ff43d2aac2ce82d36f305173 (patch)
treefa655f560e4b75760523b197d9e7c3d98246d66c
parentdynamically passing kernel version (diff)
downloadelivepatch-d63c89249889ac90ff43d2aac2ce82d36f305173.tar.gz
elivepatch-d63c89249889ac90ff43d2aac2ce82d36f305173.tar.bz2
elivepatch-d63c89249889ac90ff43d2aac2ce82d36f305173.zip
refactored and added docstring
-rw-r--r--elivepatch_server/elivepatch19
1 files changed, 13 insertions, 6 deletions
diff --git a/elivepatch_server/elivepatch b/elivepatch_server/elivepatch
index 99a1d94..1934e64 100644
--- a/elivepatch_server/elivepatch
+++ b/elivepatch_server/elivepatch
@@ -5,21 +5,28 @@
# Distributed under the terms of the GNU General Public License v2 or later
-from flask import Flask, jsonify, abort, make_response
-from flask_restful import Api, Resource, reqparse, fields, marshal
+from flask import Flask
+from flask_restful import Api
from elivepatch_server.resources import AgentInfo, dispatcher
def create_app():
+ """
+ Create server application
+ """
app = Flask(__name__, static_url_path="")
api = Api(app)
- api.add_resource(AgentInfo.AgentAPI, '/elivepatch/api/', endpoint='root')
- api.add_resource(AgentInfo.AgentAPI, '/elivepatch/api/v1.0/agent', endpoint='agent')
- api.add_resource(dispatcher.BuildLivePatch, '/elivepatch/api/v1.0/build_livepatch',
+ api.add_resource(AgentInfo.AgentAPI, '/elivepatch/api/',
+ endpoint='root')
+ api.add_resource(AgentInfo.AgentAPI, '/elivepatch/api/v1.0/agent',
+ endpoint='agent')
+ api.add_resource(dispatcher.BuildLivePatch,
+ '/elivepatch/api/v1.0/build_livepatch',
endpoint='build_livepatch')
- api.add_resource(dispatcher.GetLivePatch, '/elivepatch/api/v1.0/get_livepatch',
+ api.add_resource(dispatcher.GetLivePatch,
+ '/elivepatch/api/v1.0/get_livepatch',
endpoint='get_livepatch')
api.add_resource(dispatcher.GetConfig, '/elivepatch/api/v1.0/config',
endpoint='config')