diff --git a/streampipes-wrapper-python/requirements.txt b/streampipes-wrapper-python/requirements.txt index 4ebe9a9a69..7c51160b43 100644 --- a/streampipes-wrapper-python/requirements.txt +++ b/streampipes-wrapper-python/requirements.txt @@ -1,4 +1,4 @@ -bjoern==3.1.0 +waitress==-1.4.4 certifi==2020.6.20 chardet==3.0.4 click==7.1.2 diff --git a/streampipes-wrapper-python/setup.py b/streampipes-wrapper-python/setup.py index a4e074cfc4..89b69eaa9b 100644 --- a/streampipes-wrapper-python/setup.py +++ b/streampipes-wrapper-python/setup.py @@ -43,7 +43,7 @@ 'Flask==1.1.2', 'flask-classful==0.14.2', 'Flask-Negotiate==0.1.0', - 'bjoern==3.1.0', + 'waitress==1.4.4', 'python-consul==1.1.0' ], tests_require=[], diff --git a/streampipes-wrapper-python/streampipes/api/resources/base.py b/streampipes-wrapper-python/streampipes/api/resources/base.py index 76f92f4ce6..ebee17ec0a 100644 --- a/streampipes-wrapper-python/streampipes/api/resources/base.py +++ b/streampipes-wrapper-python/streampipes/api/resources/base.py @@ -16,7 +16,7 @@ # import abc import os -from flask import jsonify, make_response +from flask import jsonify, make_response, request from flask_classful import FlaskView, route from flask_negotiate import consumes @@ -85,6 +85,7 @@ class InvocableElement(Element): def invoke_runtime(self, element_id: str): # TODO: parse invocation graph # payload = request.json + print(request.json) resp = {'element_id': element_id, 'status': 'sucess'} return make_response(jsonify(resp), 200) diff --git a/streampipes-wrapper-python/streampipes/api/rest.py b/streampipes-wrapper-python/streampipes/api/rest.py index 61d828d980..9f47a4d807 100644 --- a/streampipes-wrapper-python/streampipes/api/rest.py +++ b/streampipes-wrapper-python/streampipes/api/rest.py @@ -17,7 +17,7 @@ """ API endpoints """ import threading -import bjoern +from waitress import serve from flask import Flask from streampipes.api.resources.dummy import DummyInterimsResource @@ -44,6 +44,6 @@ def __init__(self): DummyInterimsResource.register(self.app, route_base='/') def run(self, port: int): - print('serving API via bjoern WSGI server ... http://{}:{}'.format('0.0.0.0', port)) - threading.Thread(target=bjoern.run, args=(self.app,), kwargs={'host': '0.0.0.0', 'port': int(port)}).start() + print('serving API via waitress WSGI server ... http://{}:{}'.format('0.0.0.0', port)) + threading.Thread(target=serve, args=(self.app,), kwargs={'host': '0.0.0.0', 'port': int(port), '_quiet': True}).start() diff --git a/streampipes-wrapper-python/streampipes/core.py b/streampipes-wrapper-python/streampipes/core.py index cf21c91690..543f5d7901 100644 --- a/streampipes-wrapper-python/streampipes/core.py +++ b/streampipes-wrapper-python/streampipes/core.py @@ -24,7 +24,7 @@ class EventProcessor(object): - __metaclass__ = abc.ABC0 + __metaclass__ = abc.ABC _DEFAULT_KAFKA_CONSUMER_CONFIG = { 'bootstrap.servers': 'kafka:9092', diff --git a/streampipes-wrapper-python/streampipes/declarer.py b/streampipes-wrapper-python/streampipes/declarer.py index 35c0b17f05..40ab81072c 100644 --- a/streampipes-wrapper-python/streampipes/declarer.py +++ b/streampipes-wrapper-python/streampipes/declarer.py @@ -51,10 +51,10 @@ def get_processor(cls, key): def get(cls): return cls._processors - # def get_declarers(self): - # return self.sepa_declarers - # - # def get_base_uri(self): - # return 'http://' + self.host + ':' + self.port + self.route + def get_declarers(self): + return self.sepa_declarers + + def get_base_uri(self): + return 'http://' + self.host + ':' + self.port + self.route