-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Is686/apiserver api
0.4.2
: studies ports (#3623)
- Loading branch information
Showing
16 changed files
with
293 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
55 changes: 55 additions & 0 deletions
55
packages/pytest-simcore/src/pytest_simcore/helpers/faker_webserver.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from typing import Any, Final | ||
|
||
# Web-server API responses of /projects/{project_id}/metadata/ports | ||
# as reponses in this mock. SEE services/web/server/tests/unit/with_dbs/02/test_projects_ports_handlers.py | ||
# NOTE: this could be added as examples in the OAS but for the moment we want to avoid overloading openapi.yml | ||
# in the web-server. | ||
PROJECTS_METADATA_PORTS_RESPONSE_BODY_DATA: Final[list[dict[str, Any]]] = [ | ||
{ | ||
"key": "38a0d401-af4b-4ea7-ab4c-5005c712a546", | ||
"kind": "input", | ||
"content_schema": { | ||
"description": "Parameter of type integer", | ||
"title": "X", | ||
"type": "integer", | ||
}, | ||
}, | ||
{ | ||
"key": "fc48252a-9dbb-4e07-bf9a-7af65a18f612", | ||
"kind": "input", | ||
"content_schema": { | ||
"description": "Parameter of type integer", | ||
"title": "Z", | ||
"type": "integer", | ||
}, | ||
}, | ||
{ | ||
"key": "7bf0741f-bae4-410b-b662-fc34b47c27c9", | ||
"kind": "input", | ||
"content_schema": { | ||
"description": "Parameter of type boolean", | ||
"title": "on", | ||
"type": "boolean", | ||
}, | ||
}, | ||
{ | ||
"key": "09fd512e-0768-44ca-81fa-0cecab74ec1a", | ||
"kind": "output", | ||
"content_schema": { | ||
"default": 0, | ||
"description": "Captures integer values attached to it", | ||
"title": "Random sleep interval_2", | ||
"type": "integer", | ||
}, | ||
}, | ||
{ | ||
"key": "76f607b4-8761-4f96-824d-cab670bc45f5", | ||
"kind": "output", | ||
"content_schema": { | ||
"default": 0, | ||
"description": "Captures integer values attached to it", | ||
"title": "Random sleep interval", | ||
"type": "integer", | ||
}, | ||
}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.4.1 | ||
0.4.2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
services/api-server/src/simcore_service_api_server/api/routes/studies.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import logging | ||
from typing import Any | ||
|
||
from fastapi import APIRouter, Depends | ||
|
||
from ...core.settings import BasicSettings | ||
from ...models.schemas.studies import StudyID, StudyPort | ||
from ..dependencies.webserver import AuthSession, get_webserver_session | ||
|
||
logger = logging.getLogger(__name__) | ||
router = APIRouter() | ||
settings = BasicSettings.create_from_envs() | ||
|
||
|
||
@router.get( | ||
"/{study_id}/ports", | ||
response_model=list[StudyPort], | ||
include_in_schema=settings.API_SERVER_DEV_FEATURES_ENABLED, | ||
) | ||
async def list_study_ports( | ||
study_id: StudyID, | ||
webserver_api: AuthSession = Depends(get_webserver_session), | ||
): | ||
"""Lists metadata on ports of a given study | ||
New in *version 0.5.0* (only with API_SERVER_DEV_FEATURES_ENABLED=1) | ||
""" | ||
project_ports: list[ | ||
dict[str, Any] | ||
] = await webserver_api.get_project_metadata_ports(project_id=study_id) | ||
return project_ports |
16 changes: 16 additions & 0 deletions
16
services/api-server/src/simcore_service_api_server/models/schemas/studies.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from models_library.projects import ProjectID | ||
from models_library.projects_nodes_io import NodeID | ||
from pydantic import Field | ||
|
||
from .solvers import SolverPort | ||
|
||
StudyID = ProjectID | ||
|
||
|
||
class StudyPort(SolverPort): | ||
key: NodeID = Field( | ||
..., | ||
description="port identifier name." | ||
"Correponds to the UUID of the parameter/probe node in the study", | ||
title="Key name", | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.