44# pylint: disable=too-many-arguments
55
66
7- from typing import TypeAlias
7+ from typing import Annotated , TypeAlias
88from uuid import UUID
99
10- from fastapi import APIRouter , Query , status
10+ from fastapi import APIRouter , Depends , Query , status
11+ from fastapi_pagination .cursor import CursorPage
1112from models_library .api_schemas_storage .storage_schemas import (
1213 FileLocation ,
1314 FileMetaDataGet ,
2021)
2122from models_library .api_schemas_webserver .storage import (
2223 DataExportPost ,
24+ ListPathsQueryParams ,
2325 StorageAsyncJobGet ,
2426 StorageAsyncJobResult ,
2527 StorageAsyncJobStatus ,
28+ StorageLocationPathParams ,
2629)
2730from models_library .generics import Envelope
2831from models_library .projects_nodes_io import LocationID
@@ -53,12 +56,25 @@ async def list_storage_locations():
5356 """Returns the list of available storage locations"""
5457
5558
59+ @router .get (
60+ "/storage/locations/{location_id}/paths" ,
61+ response_model = CursorPage [FileMetaDataGet ],
62+ )
63+ async def list_storage_paths (
64+ _path : Annotated [StorageLocationPathParams , Depends ()],
65+ _query : Annotated [ListPathsQueryParams , Depends ()],
66+ ):
67+ """Lists the files/directories in WorkingDirectory"""
68+
69+
5670@router .get (
5771 "/storage/locations/{location_id}/datasets" ,
5872 response_model = Envelope [list [DatasetMetaData ]],
5973 description = "Get datasets metadata" ,
6074)
61- async def list_datasets_metadata (location_id : LocationID ):
75+ async def list_datasets_metadata (
76+ _path : Annotated [StorageLocationPathParams , Depends ()],
77+ ):
6278 """returns all the top level datasets a user has access to"""
6379
6480
@@ -68,7 +84,7 @@ async def list_datasets_metadata(location_id: LocationID):
6884 description = "Get datasets metadata" ,
6985)
7086async def get_files_metadata (
71- location_id : LocationID ,
87+ _path : Annotated [ StorageLocationPathParams , Depends ()] ,
7288 uuid_filter : str = "" ,
7389 expand_dirs : bool = Query (
7490 True ,
0 commit comments