-
Notifications
You must be signed in to change notification settings - Fork 32
Add functions rest api inside webserver ✨ ♻️ #7693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mergify
merged 35 commits into
ITISFoundation:master
from
wvangeit:add_wbserver_functions_rest
May 20, 2025
Merged
Changes from 6 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
45c28b6
Add functions rest api inside webserver
wvangeit 5083273
Merge branch 'master' into add_wbserver_functions_rest
wvangeit 9b35341
Remove some commented out code
wvangeit 9f39af5
includes _functsions in openapi
pcrespov e835dc0
Merge remote-tracking branch 'origin/master' into add_wbserver_functi…
wvangeit 0605cd8
Merge branch 'add_wbserver_functions_rest' of github.com:wvangeit/osp…
wvangeit 89393df
Resolve comments in PR about function wb rest api
wvangeit 6efb10a
Merge branch 'master' into add_wbserver_functions_rest
wvangeit 74c9251
Merge branch 'add_wbserver_functions_rest' of github.com:wvangeit/osp…
wvangeit 6eb93db
Merge branch 'master' into add_wbserver_functions_rest
wvangeit d676c18
Merge branch 'master' into add_wbserver_functions_rest
wvangeit db30f3d
Merge branch 'add_wbserver_functions_rest' of github.com:wvangeit/osp…
wvangeit 4f165f3
Changes to create function frontend
wvangeit 1348ea8
Remove newlines in functions frontend
wvangeit ee73225
Allow empty description
wvangeit 74530d7
Merge branch 'master' into add_wbserver_functions_rest
wvangeit a1b41cd
Fix linting
wvangeit 184e164
Merge branch 'add_wbserver_functions_rest' of github.com:wvangeit/osp…
wvangeit 5ff3c85
One more pylint error fix
wvangeit dc371c7
Add a few type annotation in function wb rest
wvangeit 6db18ee
Add function_id / jobs endpoint
wvangeit a6ac82d
Add new openapi json for functions
wvangeit 7b6214e
services/api-server version: 0.7.1 → 0.7.2
wvangeit c94f6cd
Merge branch 'master' into add_wbserver_functions_rest
wvangeit 4193632
Mention release versoin
wvangeit e37e22e
services/api-server version: 0.7.2 → 0.8.0
wvangeit cf58d48
Merge branch 'add_wbserver_functions_rest' of github.com:wvangeit/osp…
wvangeit 9abff15
Update openapi spec for functions
wvangeit adbf763
Merge branch 'master' into add_wbserver_functions_rest
wvangeit ef271f7
Add context manager to catch validation error in function rest
wvangeit db308ad
Merge branch 'add_wbserver_functions_rest' of github.com:wvangeit/osp…
wvangeit fafeaac
Merge branch 'master' into add_wbserver_functions_rest
wvangeit c1b2b74
Fix e2e test by avoid importing fastapi in webserver rest
wvangeit d7b7f98
Merge branch 'master' into add_wbserver_functions_rest
wvangeit e814088
Merge branch 'master' into add_wbserver_functions_rest
wvangeit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,53 @@ | ||
| # pylint: disable=protected-access | ||
| # pylint: disable=redefined-outer-name | ||
| # pylint: disable=too-many-arguments | ||
| # pylint: disable=unused-argument | ||
| # pylint: disable=unused-variable | ||
|
|
||
|
|
||
| from typing import Annotated | ||
|
|
||
| from fastapi import APIRouter, Depends, status | ||
| from models_library.api_schemas_webserver.functions import ( | ||
| FunctionToRegister, | ||
| RegisteredFunctionGet, | ||
| ) | ||
| from models_library.generics import Envelope | ||
| from simcore_service_webserver._meta import API_VTAG | ||
| from simcore_service_webserver.functions._controller._functions_rest_schemas import ( | ||
| FunctionPathParams, | ||
| ) | ||
|
|
||
| router = APIRouter( | ||
| prefix=f"/{API_VTAG}", | ||
| tags=[ | ||
| "functions", | ||
| ], | ||
| ) | ||
|
|
||
|
|
||
| @router.post( | ||
| "/functions", | ||
| response_model=Envelope[RegisteredFunctionGet], | ||
| ) | ||
| async def register_function( | ||
| _body: FunctionToRegister, | ||
| ) -> Envelope[RegisteredFunctionGet]: ... | ||
|
|
||
|
|
||
| @router.get( | ||
| "/functions/{function_id}", | ||
| response_model=Envelope[RegisteredFunctionGet], | ||
| ) | ||
| async def get_function( | ||
| _path: Annotated[FunctionPathParams, Depends()], | ||
| ): ... | ||
|
|
||
|
|
||
| @router.delete( | ||
| "/projects/{function_id}", | ||
| status_code=status.HTTP_204_NO_CONTENT, | ||
| ) | ||
| async def delete_function( | ||
| _path: Annotated[FunctionPathParams, Depends()], | ||
| ): ... | ||
This file contains hidden or 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
38 changes: 38 additions & 0 deletions
38
packages/models-library/src/models_library/api_schemas_api_server/functions.py
This file contains hidden or 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,38 @@ | ||
| # pylint: disable=unused-import | ||
|
|
||
| from ..functions import ( # noqa: F401 | ||
| Function, | ||
| FunctionClass, | ||
| FunctionClassSpecificData, | ||
| FunctionID, | ||
| FunctionIDNotFoundError, | ||
| FunctionInputs, | ||
| FunctionInputSchema, | ||
| FunctionInputsList, | ||
| FunctionInputsValidationError, | ||
| FunctionJob, | ||
| FunctionJobClassSpecificData, | ||
| FunctionJobCollection, | ||
| FunctionJobCollectionID, | ||
| FunctionJobCollectionIDNotFoundError, | ||
| FunctionJobCollectionStatus, | ||
| FunctionJobID, | ||
| FunctionJobIDNotFoundError, | ||
| FunctionJobStatus, | ||
| FunctionOutputs, | ||
| FunctionOutputSchema, | ||
| FunctionSchemaClass, | ||
| JSONFunctionInputSchema, | ||
| JSONFunctionOutputSchema, | ||
| ProjectFunction, | ||
| ProjectFunctionJob, | ||
| RegisteredFunction, | ||
| RegisteredFunctionJob, | ||
| RegisteredFunctionJobCollection, | ||
| RegisteredProjectFunction, | ||
| RegisteredProjectFunctionJob, | ||
| SolverFunction, | ||
| SolverFunctionJob, | ||
| UnsupportedFunctionClassError, | ||
| UnsupportedFunctionFunctionJobClassCombinationError, | ||
| ) |
69 changes: 69 additions & 0 deletions
69
packages/models-library/src/models_library/api_schemas_webserver/functions.py
This file contains hidden or 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,69 @@ | ||
| # pylint: disable=unused-import | ||
|
|
||
| from typing import Annotated, TypeAlias | ||
|
|
||
| from pydantic import Field | ||
|
|
||
| from ..functions import ( # noqa: F401 | ||
| Function, | ||
| FunctionBase, | ||
| FunctionClass, | ||
| FunctionClassSpecificData, | ||
| FunctionID, | ||
| FunctionIDNotFoundError, | ||
| FunctionInputs, | ||
| FunctionInputSchema, | ||
| FunctionInputsList, | ||
| FunctionInputsValidationError, | ||
| FunctionJob, | ||
| FunctionJobClassSpecificData, | ||
| FunctionJobCollection, | ||
| FunctionJobCollectionID, | ||
| FunctionJobCollectionIDNotFoundError, | ||
| FunctionJobCollectionStatus, | ||
| FunctionJobID, | ||
| FunctionJobIDNotFoundError, | ||
| FunctionJobStatus, | ||
| FunctionOutputs, | ||
| FunctionOutputSchema, | ||
| FunctionSchemaClass, | ||
| JSONFunctionInputSchema, | ||
| JSONFunctionOutputSchema, | ||
| ProjectFunction, | ||
| ProjectFunctionJob, | ||
| RegisteredFunction, | ||
| RegisteredFunctionBase, | ||
| RegisteredFunctionJob, | ||
| RegisteredFunctionJobCollection, | ||
| RegisteredProjectFunction, | ||
| RegisteredProjectFunctionJob, | ||
| RegisteredSolverFunction, | ||
| SolverFunction, | ||
| SolverFunctionJob, | ||
| UnsupportedFunctionClassError, | ||
| UnsupportedFunctionFunctionJobClassCombinationError, | ||
| ) | ||
| from ._base import InputSchema, OutputSchema | ||
|
|
||
|
|
||
| class RegisteredSolverFunctionGet(RegisteredSolverFunction, OutputSchema): ... | ||
|
|
||
|
|
||
| class RegisteredProjectFunctionGet(RegisteredProjectFunction, OutputSchema): ... | ||
|
|
||
|
|
||
| class SolverFunctionToRegister(SolverFunction, InputSchema): ... | ||
|
|
||
|
|
||
| class ProjectFunctionToRegister(ProjectFunction, InputSchema): ... | ||
|
|
||
|
|
||
| FunctionToRegister: TypeAlias = Annotated[ | ||
| ProjectFunctionToRegister | SolverFunctionToRegister, | ||
| Field(discriminator="function_class"), | ||
| ] | ||
|
|
||
| RegisteredFunctionGet: TypeAlias = Annotated[ | ||
| RegisteredProjectFunctionGet | RegisteredSolverFunctionGet, | ||
| Field(discriminator="function_class"), | ||
| ] |
This file contains hidden or 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
2 changes: 1 addition & 1 deletion
2
...ary/src/servicelib/rabbitmq/rpc_interfaces/webserver/functions/functions_rpc_interface.py
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
85 changes: 0 additions & 85 deletions
85
services/api-server/src/simcore_service_api_server/models/schemas/functions_api_schema.py
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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
Empty file.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.