Skip to content

Commit 79ade3d

Browse files
committed
server
1 parent 626b08a commit 79ade3d

File tree

4 files changed

+86
-98
lines changed

4 files changed

+86
-98
lines changed

api/specs/web-server/_catalog.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from fastapi import APIRouter, Depends
44
from models_library.api_schemas_api_server.pricing_plans import ServicePricingPlanGet
55
from models_library.api_schemas_webserver.catalog import (
6+
CatalogLatestServiceGet,
67
CatalogServiceGet,
7-
CatalogServiceListItem,
88
CatalogServiceUpdate,
99
ServiceInputGet,
1010
ServiceInputKey,
@@ -34,10 +34,9 @@
3434

3535
@router.get(
3636
"/catalog/services/-/latest",
37-
response_model=Page[CatalogServiceListItem],
37+
response_model=Page[CatalogLatestServiceGet],
3838
)
39-
def list_services_latest(_query: Annotated[ListServiceParams, Depends()]):
40-
pass
39+
def list_services_latest(_query: Annotated[ListServiceParams, Depends()]): ...
4140

4241

4342
@router.get(

packages/models-library/src/models_library/api_schemas_webserver/catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def _update_json_schema_extra(schema: JsonDict) -> None:
228228
ServiceResourcesGet: TypeAlias = api_schemas_catalog_services.ServiceResourcesGet
229229

230230

231-
class CatalogServiceListItem(api_schemas_catalog_services.ServiceListItem):
231+
class CatalogLatestServiceGet(api_schemas_catalog_services.LatestServiceGet):
232232
inputs: ServiceInputsGetDict # type: ignore[assignment]
233233
outputs: ServiceOutputsGetDict # type: ignore[assignment]
234234

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

Lines changed: 80 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -2027,7 +2027,7 @@ paths:
20272027
content:
20282028
application/json:
20292029
schema:
2030-
$ref: '#/components/schemas/Page_CatalogServiceListItem_'
2030+
$ref: '#/components/schemas/Page_CatalogLatestServiceGet_'
20312031
/v0/catalog/services/{service_key}/{service_version}:
20322032
get:
20332033
tags:
@@ -7873,7 +7873,7 @@ components:
78737873
- default
78747874
- items
78757875
title: BootOption
7876-
CatalogServiceGet:
7876+
CatalogLatestServiceGet:
78777877
properties:
78787878
key:
78797879
type: string
@@ -7932,11 +7932,9 @@ components:
79327932
inputs:
79337933
type: object
79347934
title: Inputs
7935-
description: inputs with extended information
79367935
outputs:
79377936
type: object
79387937
title: Outputs
7939-
description: outputs with extended information
79407938
bootOptions:
79417939
anyOf:
79427940
- type: object
@@ -7962,19 +7960,10 @@ components:
79627960
type: array
79637961
- type: 'null'
79647962
title: Classifiers
7965-
default: []
79667963
quality:
79677964
type: object
79687965
title: Quality
7969-
default: {}
7970-
history:
7971-
items:
7972-
$ref: '#/components/schemas/ServiceRelease'
7973-
type: array
7974-
title: History
7975-
description: history of releases for this service at this point in time,
7976-
starting from the newest to the oldest. It includes current release.
7977-
default: []
7966+
additionalProperties: false
79787967
type: object
79797968
required:
79807969
- key
@@ -7988,75 +7977,8 @@ components:
79887977
- inputs
79897978
- outputs
79907979
- accessRights
7991-
title: CatalogServiceGet
7992-
example:
7993-
accessRights:
7994-
'1':
7995-
execute: true
7996-
write: false
7997-
authors:
7998-
- affiliation: ACME
7999-
8000-
name: Author Bar
8001-
classifiers: []
8002-
8003-
description: A service which awaits for time to pass, two times.
8004-
description_ui: true
8005-
history:
8006-
- released: '2024-07-20T15:00:00'
8007-
version: 2.2.1
8008-
version_display: Summer Release
8009-
- compatibility:
8010-
canUpdateTo:
8011-
version: 2.2.1
8012-
version: 2.0.0
8013-
- version: 0.9.11
8014-
- version: 0.9.10
8015-
- compatibility:
8016-
canUpdateTo:
8017-
version: 0.9.11
8018-
version: 0.9.8
8019-
- compatibility:
8020-
can_update_to:
8021-
version: 0.9.11
8022-
released: '2024-01-20T18:49:17'
8023-
version: 0.9.1
8024-
versionDisplay: Matterhorn
8025-
- retired: '2024-07-20T15:00:00'
8026-
version: 0.9.0
8027-
- version: 0.8.0
8028-
- version: 0.1.0
8029-
icon: https://cdn-icons-png.flaticon.com/512/25/25231.png
8030-
inputs:
8031-
input0:
8032-
contentSchema:
8033-
title: Acceleration
8034-
type: number
8035-
x_unit: m/s**2
8036-
description: acceleration with units
8037-
keyId: input_1
8038-
label: Acceleration
8039-
type: ref_contentSchema
8040-
unitLong: meter/second<sup>3</sup>
8041-
unitShort: m/s<sup>3</sup>
8042-
key: simcore/services/comp/itis/sleeper
8043-
name: sleeper
8044-
outputs:
8045-
outFile:
8046-
description: Time the service waited before completion
8047-
displayOrder: 2
8048-
keyId: output_2
8049-
label: Time Slept
8050-
type: number
8051-
unit: second
8052-
unitLong: seconds
8053-
unitShort: sec
8054-
8055-
quality: {}
8056-
type: computational
8057-
version: 2.2.1
8058-
version_display: 2 Xtreme
8059-
CatalogServiceListItem:
7980+
title: CatalogLatestServiceGet
7981+
CatalogServiceGet:
80607982
properties:
80617983
key:
80627984
type: string
@@ -8115,9 +8037,11 @@ components:
81158037
inputs:
81168038
type: object
81178039
title: Inputs
8040+
description: inputs with extended information
81188041
outputs:
81198042
type: object
81208043
title: Outputs
8044+
description: outputs with extended information
81218045
bootOptions:
81228046
anyOf:
81238047
- type: object
@@ -8143,20 +8067,17 @@ components:
81438067
type: array
81448068
- type: 'null'
81458069
title: Classifiers
8146-
default: []
81478070
quality:
81488071
type: object
81498072
title: Quality
8150-
default: {}
81518073
history:
81528074
items:
81538075
$ref: '#/components/schemas/ServiceRelease'
81548076
type: array
81558077
title: History
8156-
description: History will be replaced by current 'release' instead
8078+
description: history of releases for this service at this point in time,
8079+
starting from the newest to the oldest. It includes current release.
81578080
default: []
8158-
deprecated: true
8159-
additionalProperties: false
81608081
type: object
81618082
required:
81628083
- key
@@ -8170,7 +8091,74 @@ components:
81708091
- inputs
81718092
- outputs
81728093
- accessRights
8173-
title: CatalogServiceListItem
8094+
title: CatalogServiceGet
8095+
example:
8096+
accessRights:
8097+
'1':
8098+
execute: true
8099+
write: false
8100+
authors:
8101+
- affiliation: ACME
8102+
8103+
name: Author Bar
8104+
classifiers: []
8105+
8106+
description: A service which awaits for time to pass, two times.
8107+
description_ui: true
8108+
history:
8109+
- released: '2024-07-20T15:00:00'
8110+
version: 2.2.1
8111+
version_display: Summer Release
8112+
- compatibility:
8113+
canUpdateTo:
8114+
version: 2.2.1
8115+
version: 2.0.0
8116+
- version: 0.9.11
8117+
- version: 0.9.10
8118+
- compatibility:
8119+
canUpdateTo:
8120+
version: 0.9.11
8121+
version: 0.9.8
8122+
- compatibility:
8123+
can_update_to:
8124+
version: 0.9.11
8125+
released: '2024-01-20T18:49:17'
8126+
version: 0.9.1
8127+
versionDisplay: Matterhorn
8128+
- retired: '2024-07-20T15:00:00'
8129+
version: 0.9.0
8130+
- version: 0.8.0
8131+
- version: 0.1.0
8132+
icon: https://cdn-icons-png.flaticon.com/512/25/25231.png
8133+
inputs:
8134+
input0:
8135+
contentSchema:
8136+
title: Acceleration
8137+
type: number
8138+
x_unit: m/s**2
8139+
description: acceleration with units
8140+
keyId: input_1
8141+
label: Acceleration
8142+
type: ref_contentSchema
8143+
unitLong: meter/second<sup>3</sup>
8144+
unitShort: m/s<sup>3</sup>
8145+
key: simcore/services/comp/itis/sleeper
8146+
name: sleeper
8147+
outputs:
8148+
outFile:
8149+
description: Time the service waited before completion
8150+
displayOrder: 2
8151+
keyId: output_2
8152+
label: Time Slept
8153+
type: number
8154+
unit: second
8155+
unitLong: seconds
8156+
unitShort: sec
8157+
8158+
quality: {}
8159+
type: computational
8160+
version: 2.2.1
8161+
version_display: 2 Xtreme
81748162
CatalogServiceUpdate:
81758163
properties:
81768164
name:
@@ -12400,15 +12388,15 @@ components:
1240012388
- total
1240112389
- count
1240212390
title: PageMetaInfoLimitOffset
12403-
Page_CatalogServiceListItem_:
12391+
Page_CatalogLatestServiceGet_:
1240412392
properties:
1240512393
_meta:
1240612394
$ref: '#/components/schemas/PageMetaInfoLimitOffset'
1240712395
_links:
1240812396
$ref: '#/components/schemas/PageLinks'
1240912397
data:
1241012398
items:
12411-
$ref: '#/components/schemas/CatalogServiceListItem'
12399+
$ref: '#/components/schemas/CatalogLatestServiceGet'
1241212400
type: array
1241312401
title: Data
1241412402
additionalProperties: false
@@ -12417,7 +12405,7 @@ components:
1241712405
- _meta
1241812406
- _links
1241912407
- data
12420-
title: Page[CatalogServiceListItem]
12408+
title: Page[CatalogLatestServiceGet]
1242112409
Page_LicensedItemPurchaseGet_:
1242212410
properties:
1242312411
_meta:

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from aiohttp import web
1313
from aiohttp.web import Request, RouteTableDef
1414
from models_library.api_schemas_webserver.catalog import (
15+
CatalogLatestServiceGet,
1516
CatalogServiceGet,
1617
CatalogServiceUpdate,
1718
ServiceInputKey,
@@ -83,7 +84,7 @@ async def list_services_latest(request: Request):
8384
assert page_meta.limit == query_params.limit # nosec
8485
assert page_meta.offset == query_params.offset # nosec
8586

86-
page = Page[CatalogServiceGet].model_validate(
87+
page = Page[CatalogLatestServiceGet].model_validate(
8788
paginate_data(
8889
chunk=page_items,
8990
request_url=request.url,

0 commit comments

Comments
 (0)