From 75ce82fbe8c7ae66ba3b6923cb93646585e255eb Mon Sep 17 00:00:00 2001 From: Alexis Lucattini Date: Tue, 20 Aug 2024 15:27:14 +1000 Subject: [PATCH] Use the new metadata library endpoint for queries --- .../src/metadata_tools/utils/library_helpers.py | 4 ++-- .../src/metadata_tools/utils/specimen_helpers.py | 4 ++-- .../src/metadata_tools/utils/subject_helpers.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/library_helpers.py b/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/library_helpers.py index 411f24d1f..d66408a94 100644 --- a/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/library_helpers.py +++ b/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/library_helpers.py @@ -10,7 +10,7 @@ def get_library_from_library_id(library_id: Union[int | str]) -> Dict: :param library_id: :return: """ - endpoint = "library" + endpoint = "api/v1/library" # Get library id if isinstance(library_id, str): @@ -99,6 +99,6 @@ def get_all_libraries() -> List[Dict]: Collect all libraries from the database :return: """ - endpoint = "library" + endpoint = "api/v1/library" return get_request_response_results(endpoint) diff --git a/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/specimen_helpers.py b/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/specimen_helpers.py index 2d409a601..2748101b8 100644 --- a/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/specimen_helpers.py +++ b/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/specimen_helpers.py @@ -47,7 +47,7 @@ def list_libraries_in_specimen(specimen_id: Union[str, int]) -> List[Dict]: # If subject id is a string, we have the internal id (SBJ...) specimen = get_specimen_from_specimen_id(specimen_id) - endpoint = f"library" + endpoint = f"api/v1/library" # Get the subject return list( @@ -63,7 +63,7 @@ def get_all_specimens(): Get all specimens from the specimen database :return: """ - endpoint = "specimen" + endpoint = "api/v1/specimen" return get_request_response_results(endpoint) diff --git a/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/subject_helpers.py b/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/subject_helpers.py index a5bed3407..a5e73db24 100644 --- a/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/subject_helpers.py +++ b/lib/workload/components/python-metadata-tools-layer/metadata_tools_layer/src/metadata_tools/utils/subject_helpers.py @@ -18,7 +18,7 @@ def get_subject_from_subject_id(subject_id: Union[str, int]) -> Dict: :param subject_id: :return: """ - endpoint = "subject" + endpoint = "api/v1/subject" # Get subject id if isinstance(subject_id, str): @@ -80,6 +80,6 @@ def get_all_subjects() -> List[Dict]: :return: """ - endpoint = "subject" + endpoint = "api/v1/subject" return get_request_response_results(endpoint)