diff --git a/consumer_api/views/consumers_view.py b/consumer_api/views/consumers_view.py index 8c03a07..98349c6 100644 --- a/consumer_api/views/consumers_view.py +++ b/consumer_api/views/consumers_view.py @@ -1,7 +1,7 @@ import json from db import redis_client -from flask import jsonify, current_app +from flask import jsonify, request from flask_classful import FlaskView @@ -12,4 +12,7 @@ class ConsumersView(FlaskView): consumer_list = json.loads((redis_client.get("consumer_list") or b"{}").decode('utf-8')) # jsonify and return the list of active consumers - return jsonify([v['ip'] for k, v in consumer_list.items()]) + if 'full' in request.args: + return jsonify(consumer_list) + else: + return jsonify([v['ip'] for k, v in consumer_list.items()])