Skip to content

Commit 5726949

Browse files
authored
🐛Storage: fix access to DatCore (#7213)
1 parent f9f5df3 commit 5726949

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

api/specs/web-server/_storage.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
from fastapi import APIRouter, Query, status
1010
from models_library.api_schemas_storage import (
11+
FileLocation,
1112
FileMetaDataGet,
1213
FileUploadCompleteFutureResponse,
1314
FileUploadCompleteResponse,
@@ -37,7 +38,7 @@
3738

3839
@router.get(
3940
"/storage/locations",
40-
response_model=list[DatasetMetaData],
41+
response_model=list[FileLocation],
4142
description="Get available storage locations",
4243
)
4344
async def list_storage_locations():

services/storage/src/simcore_service_storage/modules/datcore_adapter/datcore_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
from pydantic import AnyUrl, TypeAdapter
1111
from servicelib.fastapi.client_session import get_client_session
1212
from servicelib.utils import logged_gather
13-
from simcore_service_storage.core.settings import get_application_settings
1413

1514
from ...constants import DATCORE_ID, DATCORE_STR, MAX_CONCURRENT_REST_CALLS
15+
from ...core.settings import get_application_settings
1616
from ...models import DatasetMetaData, FileMetaData
1717
from .datcore_adapter_exceptions import (
1818
DatcoreAdapterClientError,
@@ -64,7 +64,7 @@ async def _request(
6464
**request_kwargs,
6565
)
6666
response.raise_for_status()
67-
response_data = await response.json()
67+
response_data = response.json()
6868
assert isinstance(response_data, dict | list) # nosec
6969
return response_data
7070

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5670,7 +5670,7 @@ paths:
56705670
application/json:
56715671
schema:
56725672
items:
5673-
$ref: '#/components/schemas/DatasetMetaData'
5673+
$ref: '#/components/schemas/FileLocation'
56745674
type: array
56755675
title: Response List Storage Locations
56765676
/v0/storage/locations/{location_id}/datasets:
@@ -9296,6 +9296,20 @@ components:
92969296
required:
92979297
- date
92989298
title: FeaturesDict
9299+
FileLocation:
9300+
properties:
9301+
name:
9302+
type: string
9303+
title: Name
9304+
id:
9305+
type: integer
9306+
title: Id
9307+
additionalProperties: false
9308+
type: object
9309+
required:
9310+
- name
9311+
- id
9312+
title: FileLocation
92999313
FileMetaData:
93009314
properties:
93019315
file_uuid:

0 commit comments

Comments
 (0)