Skip to content

Commit d33057d

Browse files
committed
refactor
1 parent 8b6e2d2 commit d33057d

File tree

8 files changed

+15
-14
lines changed

8 files changed

+15
-14
lines changed

api/specs/storage/openapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,10 @@
9191
f"/{API_VTAG}/locations/{{location_id}}/datasets",
9292
response_model=Envelope[list[DatasetMetaData]],
9393
tags=TAGS_DATASETS,
94-
operation_id="get_datasets_metadata",
94+
operation_id="list_datasets_metadata",
9595
summary="Get datasets metadata",
9696
)
97-
async def get_datasets_metadata(location_id: LocationID, user_id: UserID):
97+
async def list_datasets_metadata(location_id: LocationID, user_id: UserID):
9898
"""returns all the top level datasets a user has access to"""
9999

100100

api/specs/web-server/_storage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ async def synchronise_meta_data_table(
6161
response_model=Envelope[list[DatasetMetaData]],
6262
summary="Get datasets metadata",
6363
)
64-
async def get_datasets_metadata(location_id: LocationID):
64+
async def list_datasets_metadata(location_id: LocationID):
6565
"""returns all the top level datasets a user has access to"""
6666

6767

services/storage/src/simcore_service_storage/api/v0/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ paths:
2626
- datasets
2727
summary: Get datasets metadata
2828
description: returns all the top level datasets a user has access to
29-
operationId: get_datasets_metadata
29+
operationId: list_datasets_metadata
3030
parameters:
3131
- name: location_id
3232
in: path

services/storage/src/simcore_service_storage/handlers_datasets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ async def list_datasets_metadata(request: web.Request) -> web.Response:
3737
)
3838
path_params = parse_request_path_parameters_as(LocationPathParams, request)
3939
log.debug(
40-
"received call to get_datasets_metadata with %s",
40+
"received call to list_datasets_metadata with %s",
4141
f"{path_params=}, {query_params=}",
4242
)
4343

services/storage/tests/unit/test_handlers_datasets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def test_get_files_metadata_dataset(
8282
assert fmd.file_size == file.stat().st_size
8383

8484

85-
async def test_get_datasets_metadata(
85+
async def test_list_datasets_metadata(
8686
client: TestClient,
8787
user_id: UserID,
8888
location_id: int,
@@ -91,7 +91,7 @@ async def test_get_datasets_metadata(
9191
assert client.app
9292

9393
url = (
94-
client.app.router["get_datasets_metadata"]
94+
client.app.router["list_datasets_metadata"]
9595
.url_for(location_id=f"{location_id}")
9696
.with_query(user_id=f"{user_id}")
9797
)

services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5719,7 +5719,7 @@ paths:
57195719
- storage
57205720
summary: Get datasets metadata
57215721
description: returns all the top level datasets a user has access to
5722-
operationId: get_datasets_metadata
5722+
operationId: list_datasets_metadata
57235723
parameters:
57245724
- name: location_id
57255725
in: path

services/web/server/src/simcore_service_webserver/storage/_handlers.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
""" Handlers exposed by storage subsystem
1+
"""Handlers exposed by storage subsystem
22
3-
Mostly resolves and redirect to storage API
3+
Mostly resolves and redirect to storage API
44
"""
5+
56
import logging
67
from typing import Any, Final, NamedTuple
78

@@ -110,10 +111,10 @@ async def get_storage_locations(request: web.Request) -> web.Response:
110111
return create_data_response(payload, status=status)
111112

112113

113-
@routes.get(_path_prefix + "/{location_id}/datasets", name="get_datasets_metadata")
114+
@routes.get(_path_prefix + "/{location_id}/datasets", name="list_datasets_metadata")
114115
@login_required
115116
@permission_required("storage.files.*")
116-
async def get_datasets_metadata(request: web.Request) -> web.Response:
117+
async def list_datasets_metadata(request: web.Request) -> web.Response:
117118
class _PathParams(BaseModel):
118119
location_id: LocationID
119120

services/web/server/tests/unit/with_dbs/01/test_storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ async def test_sync_file_meta_table(
215215
(UserRole.TESTER, status.HTTP_200_OK),
216216
],
217217
)
218-
async def test_get_datasets_metadata(
218+
async def test_list_datasets_metadata(
219219
client: TestClient, storage_server: TestServer, logged_user, expected
220220
):
221221
url = "/v0/storage/locations/0/datasets"
222222
assert url.startswith(PREFIX)
223223

224-
_url = client.app.router["get_datasets_metadata"].url_for(location_id="0")
224+
_url = client.app.router["list_datasets_metadata"].url_for(location_id="0")
225225

226226
assert url == str(_url)
227227

0 commit comments

Comments
 (0)