diff --git a/fedn/fedn/network/api/v1/client_routes.py b/fedn/fedn/network/api/v1/client_routes.py index fcc0a35a3..90f30aa5b 100644 --- a/fedn/fedn/network/api/v1/client_routes.py +++ b/fedn/fedn/network/api/v1/client_routes.py @@ -1,15 +1,13 @@ -from flask import Blueprint, jsonify, request +from flask import Blueprint, jsonify -from fedn.network.storage.statestore.stores.client_store import ClientStore -from fedn.network.storage.statestore.stores.shared import EntityNotFound +# from fedn.network.storage.statestore.stores.client_store import ClientStore -from .shared import (api_version, get_post_data_to_kwargs, - get_typed_list_headers, mdb) +from .shared import (api_version) bp = Blueprint("client", __name__, url_prefix=f"/api/{api_version}/clients") -client_store = ClientStore(mdb, "network.clients") +# client_store = ClientStore(mdb, "network.clients") @bp.route("/", methods=["GET"]) @@ -111,22 +109,7 @@ def get_clients(): message: type: string """ - try: - limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers) - kwargs = request.args.to_dict() - - clients = client_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs) - - result = clients["result"] - - response = { - "count": clients["count"], - "result": result - } - - return jsonify(response), 200 - except Exception as e: - return jsonify({"message": str(e)}), 500 + return jsonify({"msg": "hej"}), 200 @bp.route("/list", methods=["POST"]) @@ -199,21 +182,8 @@ def list_clients(): message: type: string """ - try: - limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers) - kwargs = get_post_data_to_kwargs(request) - clients = client_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs) - - result = clients["result"] + return jsonify({"msg": "hej"}), 200 - response = { - "count": clients["count"], - "result": result - } - - return jsonify(response), 200 - except Exception as e: - return jsonify({"message": str(e)}), 500 @bp.route("/count", methods=["GET"]) @@ -267,13 +237,8 @@ def get_clients_count(): message: type: string """ - try: - kwargs = request.args.to_dict() - count = client_store.count(**kwargs) - response = count - return jsonify(response), 200 - except Exception as e: - return jsonify({"message": str(e)}), 404 + return jsonify({"msg": "hej"}), 200 + @bp.route("/count", methods=["POST"]) @@ -319,13 +284,8 @@ def clients_count(): message: type: string """ - try: - kwargs = get_post_data_to_kwargs(request) - count = client_store.count(**kwargs) - response = count - return jsonify(response), 200 - except Exception as e: - return jsonify({"message": str(e)}), 404 + return jsonify({"msg": "hej"}), 200 + @bp.route("/", methods=["GET"]) @@ -361,13 +321,4 @@ def get_client(id: str): message: type: string """ - try: - client = client_store.get(id, use_typing=False) - - response = client - - return jsonify(response), 200 - except EntityNotFound as e: - return jsonify({"message": str(e)}), 404 - except Exception as e: - return jsonify({"message": str(e)}), 500 + return jsonify({"msg": "hej"}), 200 diff --git a/fedn/fedn/network/api/v1/model_routes.py b/fedn/fedn/network/api/v1/model_routes.py index 4bbd8386c..09a93e304 100644 --- a/fedn/fedn/network/api/v1/model_routes.py +++ b/fedn/fedn/network/api/v1/model_routes.py @@ -1,4 +1,3 @@ - from flask import Blueprint, jsonify, request from fedn.network.storage.statestore.stores.model_store import ModelStore