Skip to content

Commit

Permalink
changed name of store variables
Browse files Browse the repository at this point in the history
  • Loading branch information
niklastheman committed Feb 28, 2024
1 parent dd8615d commit fa04433
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 51 deletions.
12 changes: 6 additions & 6 deletions fedn/fedn/network/api/v1/client_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

bp = Blueprint("client", __name__, url_prefix=f"/api/{api_version}/clients")

client_repository = ClientStore(mdb, "network.clients")
client_store = ClientStore(mdb, "network.clients")


@bp.route("/", methods=["GET"])
Expand Down Expand Up @@ -115,7 +115,7 @@ def get_clients():
limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers)
kwargs = request.args.to_dict()

clients = client_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
clients = client_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = clients["result"]

Expand Down Expand Up @@ -202,7 +202,7 @@ def list_clients():
try:
limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers)
kwargs = get_post_data_to_kwargs(request)
clients = client_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
clients = client_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = clients["result"]

Expand Down Expand Up @@ -269,7 +269,7 @@ def get_clients_count():
"""
try:
kwargs = request.args.to_dict()
count = client_repository.count(**kwargs)
count = client_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -321,7 +321,7 @@ def clients_count():
"""
try:
kwargs = get_post_data_to_kwargs(request)
count = client_repository.count(**kwargs)
count = client_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -362,7 +362,7 @@ def get_client(id: str):
type: string
"""
try:
client = client_repository.get(id, use_typing=False)
client = client_store.get(id, use_typing=False)

response = client

Expand Down
12 changes: 6 additions & 6 deletions fedn/fedn/network/api/v1/combiner_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

bp = Blueprint("combiner", __name__, url_prefix=f"/api/{api_version}/combiners")

combiner_repository = CombinerStore(mdb, "network.combiners")
combiner_store = CombinerStore(mdb, "network.combiners")


@bp.route("/", methods=["GET"])
Expand Down Expand Up @@ -106,7 +106,7 @@ def get_combiners():

kwargs = request.args.to_dict()

combiners = combiner_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
combiners = combiner_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = combiners["result"]

Expand Down Expand Up @@ -191,7 +191,7 @@ def list_combiners():

kwargs = get_post_data_to_kwargs(request)

combiners = combiner_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
combiners = combiner_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = combiners["result"]

Expand Down Expand Up @@ -244,7 +244,7 @@ def get_combiners_count():
"""
try:
kwargs = request.args.to_dict()
count = combiner_repository.count(**kwargs)
count = combiner_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -292,7 +292,7 @@ def combiners_count():
"""
try:
kwargs = get_post_data_to_kwargs(request)
count = combiner_repository.count(**kwargs)
count = combiner_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -333,7 +333,7 @@ def get_combiner(id: str):
type: string
"""
try:
combiner = combiner_repository.get(id, use_typing=False)
combiner = combiner_store.get(id, use_typing=False)
response = combiner

return jsonify(response), 200
Expand Down
16 changes: 8 additions & 8 deletions fedn/fedn/network/api/v1/model_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

bp = Blueprint("model", __name__, url_prefix=f"/api/{api_version}/models")

model_repository = ModelStore(mdb, "control.model")
model_store = ModelStore(mdb, "control.model")


@bp.route("/", methods=["GET"])
Expand Down Expand Up @@ -101,7 +101,7 @@ def get_models():
limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers)
kwargs = request.args.to_dict()

models = model_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
models = model_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = models["result"]

Expand Down Expand Up @@ -188,7 +188,7 @@ def list_models():
limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers)
kwargs = get_post_data_to_kwargs(request)

models = model_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
models = model_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = models["result"]

Expand Down Expand Up @@ -242,7 +242,7 @@ def get_models_count():
"""
try:
kwargs = request.args.to_dict()
count = model_repository.count(**kwargs)
count = model_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -293,7 +293,7 @@ def models_count():
"""
try:
kwargs = get_post_data_to_kwargs(request)
count = model_repository.count(**kwargs)
count = model_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -334,7 +334,7 @@ def get_model(id: str):
type: string
"""
try:
model = model_repository.get(id, use_typing=False)
model = model_store.get(id, use_typing=False)

response = model

Expand Down Expand Up @@ -387,7 +387,7 @@ def get_descendants(id: str):
try:
limit = get_limit(request.headers)

descendants = model_repository.list_descendants(id, limit or 10, use_typing=False)
descendants = model_store.list_descendants(id, limit or 10, use_typing=False)

response = descendants

Expand Down Expand Up @@ -440,7 +440,7 @@ def get_ancestors(id: str):
try:
limit = get_limit(request.headers)

ancestors = model_repository.list_ancestors(id, limit or 10, use_typing=False)
ancestors = model_store.list_ancestors(id, limit or 10, use_typing=False)

response = ancestors

Expand Down
14 changes: 7 additions & 7 deletions fedn/fedn/network/api/v1/package_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

bp = Blueprint("package", __name__, url_prefix=f"/api/{api_version}/packages")

package_repository = PackageStore(mdb, "control.package")
package_store = PackageStore(mdb, "control.package")


@bp.route("/", methods=["GET"])
Expand Down Expand Up @@ -118,7 +118,7 @@ def get_packages():
limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers)
kwargs = request.args.to_dict()

packages = package_repository.list(limit, skip, sort_key, sort_order, use_typing=True, **kwargs)
packages = package_store.list(limit, skip, sort_key, sort_order, use_typing=True, **kwargs)

result = [package.__dict__ for package in packages["result"]]

Expand Down Expand Up @@ -208,7 +208,7 @@ def list_packages():
limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers)
kwargs = get_post_data_to_kwargs(request)

packages = package_repository.list(limit, skip, sort_key, sort_order, use_typing=True, **kwargs)
packages = package_store.list(limit, skip, sort_key, sort_order, use_typing=True, **kwargs)

result = [package.__dict__ for package in packages["result"]]

Expand Down Expand Up @@ -275,7 +275,7 @@ def get_packages_count():
"""
try:
kwargs = request.args.to_dict()
count = package_repository.count(**kwargs)
count = package_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -336,7 +336,7 @@ def packages_count():
"""
try:
kwargs = get_post_data_to_kwargs(request)
count = package_repository.count(**kwargs)
count = package_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -378,7 +378,7 @@ def get_package(id: str):
"""
try:
use_typing: bool = get_use_typing(request.headers)
package = package_repository.get(id, use_typing=use_typing)
package = package_store.get(id, use_typing=use_typing)

response = package.__dict__ if use_typing else package

Expand Down Expand Up @@ -418,7 +418,7 @@ def get_active_package():
"""
try:
use_typing: bool = get_use_typing(request.headers)
package = package_repository.get_active(use_typing=use_typing)
package = package_store.get_active(use_typing=use_typing)
response = package.__dict__ if use_typing else package

return jsonify(response), 200
Expand Down
12 changes: 6 additions & 6 deletions fedn/fedn/network/api/v1/round_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

bp = Blueprint("round", __name__, url_prefix=f"/api/{api_version}/rounds")

round_repository = RoundStore(mdb, "control.rounds")
round_store = RoundStore(mdb, "control.rounds")


@bp.route("/", methods=["GET"])
Expand Down Expand Up @@ -94,7 +94,7 @@ def get_rounds():

kwargs = request.args.to_dict()

rounds = round_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
rounds = round_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = rounds["result"]

Expand Down Expand Up @@ -175,7 +175,7 @@ def list_rounds():

kwargs = get_post_data_to_kwargs(request)

rounds = round_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
rounds = round_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = rounds["result"]

Expand Down Expand Up @@ -222,7 +222,7 @@ def get_rounds_count():
"""
try:
kwargs = request.args.to_dict()
count = round_repository.count(**kwargs)
count = round_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -266,7 +266,7 @@ def rounds_count():
"""
try:
kwargs = get_post_data_to_kwargs(request)
count = round_repository.count(**kwargs)
count = round_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -307,7 +307,7 @@ def get_round(id: str):
type: string
"""
try:
round = round_repository.get(id, use_typing=False)
round = round_store.get(id, use_typing=False)
response = round

return jsonify(response), 200
Expand Down
12 changes: 6 additions & 6 deletions fedn/fedn/network/api/v1/session_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

bp = Blueprint("session", __name__, url_prefix=f"/api/{api_version}/sessions")

session_repository = SessionStore(mdb, "control.sessions")
session_store = SessionStore(mdb, "control.sessions")


@bp.route("/", methods=["GET"])
Expand Down Expand Up @@ -86,7 +86,7 @@ def get_sessions():
limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers)
kwargs = request.args.to_dict()

sessions = session_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
sessions = session_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = sessions["result"]

Expand Down Expand Up @@ -166,7 +166,7 @@ def list_sessions():
limit, skip, sort_key, sort_order, _ = get_typed_list_headers(request.headers)
kwargs = get_post_data_to_kwargs(request)

sessions = session_repository.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)
sessions = session_store.list(limit, skip, sort_key, sort_order, use_typing=False, **kwargs)

result = sessions["result"]

Expand Down Expand Up @@ -213,7 +213,7 @@ def get_sessions_count():
"""
try:
kwargs = request.args.to_dict()
count = session_repository.count(**kwargs)
count = session_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -257,7 +257,7 @@ def sessions_count():
"""
try:
kwargs = get_post_data_to_kwargs(request)
count = session_repository.count(**kwargs)
count = session_store.count(**kwargs)
response = count
return jsonify(response), 200
except Exception as e:
Expand Down Expand Up @@ -298,7 +298,7 @@ def get_session(id: str):
type: string
"""
try:
session = session_repository.get(id, use_typing=False)
session = session_store.get(id, use_typing=False)
response = session

return jsonify(response), 200
Expand Down
Loading

0 comments on commit fa04433

Please sign in to comment.