Skip to content

Commit 560fb37

Browse files
committed
revert rename
1 parent 66760a2 commit 560fb37

File tree

5 files changed

+19
-11
lines changed

5 files changed

+19
-11
lines changed

services/web/server/src/simcore_service_webserver/catalog/_catalog_rest_client_service.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,13 @@ def to_backend_service(rel_url: URL, origin: URL, version_prefix: str) -> URL:
9898
key_builder=lambda _f, *_args, **kw: f"get_services_for_user_in_product_{kw['user_id']}_{kw['product_name']}",
9999
cache=Cache.MEMORY,
100100
)
101-
async def list_user_services_with_versions(
101+
async def get_services_for_user_in_product(
102102
app: web.Application, *, user_id: UserID, product_name: str
103103
) -> list[ServiceKeyVersionDict]:
104-
104+
"""
105+
DEPRECATED: see instead RPC interface.
106+
SEE https://github.com/ITISFoundation/osparc-simcore/issues/7838
107+
"""
105108
settings: CatalogSettings = get_plugin_settings(app)
106109
only_key_versions = True
107110

@@ -143,6 +146,10 @@ async def get_service(
143146
service_version: ServiceVersion,
144147
product_name: ProductName,
145148
) -> dict[str, Any]:
149+
"""
150+
DEPRECATED: see instead RPC interface.
151+
SEE https://github.com/ITISFoundation/osparc-simcore/issues/7838
152+
"""
146153
settings: CatalogSettings = get_plugin_settings(app)
147154
url = URL(
148155
f"{settings.api_base_url}/services/{urllib.parse.quote_plus(service_key)}/{service_version}",
@@ -154,8 +161,8 @@ async def get_service(
154161
url, headers={X_PRODUCT_NAME_HEADER: product_name}
155162
) as response:
156163
response.raise_for_status()
157-
body: dict[str, Any] = await response.json()
158-
return body
164+
service: dict[str, Any] = await response.json()
165+
return service
159166

160167

161168
async def get_service_resources(

services/web/server/src/simcore_service_webserver/catalog/catalog_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
get_service,
33
get_service_access_rights,
44
get_service_resources,
5+
get_services_for_user_in_product,
56
is_catalog_service_responsive,
6-
list_user_services_with_versions,
77
to_backend_service,
88
)
99
from ._models import ServiceKeyVersionDict
@@ -14,7 +14,7 @@
1414
"get_service",
1515
"get_service_access_rights",
1616
"get_service_resources",
17-
"list_user_services_with_versions",
17+
"get_services_for_user_in_product",
1818
"is_catalog_service_responsive",
1919
"to_backend_service",
2020
"ServiceKeyVersionDict",

services/web/server/src/simcore_service_webserver/projects/_controller/projects_rest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ async def get_project(request: web.Request):
271271
req_ctx = RequestContext.model_validate(request)
272272
path_params = parse_request_path_parameters_as(ProjectPathParams, request)
273273

274-
user_available_services = await catalog_service.list_user_services_with_versions(
274+
user_available_services = await catalog_service.get_services_for_user_in_product(
275275
request.app, user_id=req_ctx.user_id, product_name=req_ctx.product_name
276276
)
277277

services/web/server/src/simcore_service_webserver/projects/_crud_api_read.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ async def list_projects( # pylint: disable=too-many-arguments
121121
db = ProjectDBAPI.get_from_app_context(app)
122122

123123
user_available_services: list[ServiceKeyVersionDict] = (
124-
await catalog_service.list_user_services_with_versions(
124+
await catalog_service.get_services_for_user_in_product(
125125
app, user_id=user_id, product_name=product_name
126126
)
127127
)
@@ -205,7 +205,7 @@ async def list_projects_full_depth(
205205
db = ProjectDBAPI.get_from_app_context(app)
206206

207207
user_available_services: list[ServiceKeyVersionDict] = (
208-
await catalog_service.list_user_services_with_versions(
208+
await catalog_service.get_services_for_user_in_product(
209209
app, user_id=user_id, product_name=product_name
210210
)
211211
)

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
)
1616
from simcore_service_webserver.catalog.catalog_service import (
1717
get_service_access_rights,
18+
get_services_for_user_in_product,
1819
is_catalog_service_responsive,
19-
list_user_services_with_versions,
2020
)
2121

2222

@@ -62,7 +62,8 @@ async def test_get_services_for_user_in_product(
6262
status=backend_status_code,
6363
)
6464
assert client.app
65-
await list_user_services_with_versions(
65+
# tests it does not raise an exception
66+
await get_services_for_user_in_product(
6667
app=client.app,
6768
user_id=logged_user["id"],
6869
product_name="osparc",

0 commit comments

Comments
 (0)