Skip to content

Commit

Permalink
api client should use api/v1
Browse files Browse the repository at this point in the history
  • Loading branch information
niklastheman committed Jan 13, 2025
1 parent d734c55 commit 72bff6a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fedn/network/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def get_client_config(self, checksum=True):
"""
_params = {"checksum": "true" if checksum else "false"}

response = requests.get(self._get_url("get_client_config"), params=_params, verify=self.verify, headers=self.headers)
response = requests.get(self._get_url_api_v1("clients/config"), params=_params, verify=self.verify, headers=self.headers)

_json = response.json()

Expand Down Expand Up @@ -338,9 +338,7 @@ def set_active_model(self, path):
response = requests.put(self._get_url_api_v1("helpers/active"), json={"helper": helper}, verify=self.verify, headers=self.headers)

with open(path, "rb") as file:
response = requests.post(
self._get_url("set_initial_model"), files={"file": file}, data={"helper": helper}, verify=self.verify, headers=self.headers
)
response = requests.post(self._get_url_api_v1("models"), files={"file": file}, data={"helper": helper}, verify=self.verify, headers=self.headers)
return response.json()

# --- Packages --- #
Expand Down Expand Up @@ -422,7 +420,7 @@ def download_package(self, path: str):
:return: Message with success or failure.
:rtype: dict
"""
response = requests.get(self._get_url("download_package"), verify=self.verify, headers=self.headers)
response = requests.get(self._get_url_api_v1("packages/download"), verify=self.verify, headers=self.headers)
if response.status_code == 200:
with open(path, "wb") as file:
file.write(response.content)
Expand All @@ -442,7 +440,7 @@ def set_active_package(self, path: str, helper: str, name: str = None, descripti
"""
with open(path, "rb") as file:
response = requests.post(
self._get_url("set_package"),
self._get_url_api_v1("packages"),
files={"file": file},
data={"helper": helper, "name": name, "description": description},
verify=self.verify,
Expand Down

0 comments on commit 72bff6a

Please sign in to comment.