-
Notifications
You must be signed in to change notification settings - Fork 30
✨ web-api interface for tags sharing and add to services #6298
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
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
751e7b0
adds the interface to share tags
pcrespov cb000bc
rename project tags
pcrespov 3ccc4ea
API add/rm tags to services
pcrespov f5e1757
OAS
pcrespov 8bd6a3e
cleanup OAS
pcrespov c094896
WIP
pcrespov 48dc4a6
updates workspaces
pcrespov a11cd91
updates OAS
pcrespov 7af524d
updates models
pcrespov 63f6644
adds service tags
pcrespov cfe2233
OAS with service tags
pcrespov 87050a2
rest schemas public
pcrespov f226372
missing routes
pcrespov 2a44aa2
responds with parent
pcrespov 3b744f3
adds tests
pcrespov 98b7ca5
@sanderegg review: unused import
pcrespov d130946
@sanderegg review: add/remove API
pcrespov d422ed3
fixes urls
pcrespov 796bf2a
Merge branch 'master' into is6202/web-api-tags
pcrespov 2759e90
Merge branch 'master' into is6202/web-api-tags
pcrespov 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,55 @@ | ||
# pylint: disable=redefined-outer-name | ||
# pylint: disable=unused-argument | ||
# pylint: disable=unused-variable | ||
# pylint: disable=too-many-arguments | ||
|
||
|
||
from typing import Annotated | ||
|
||
from fastapi import APIRouter, Depends | ||
from models_library.api_schemas_webserver.catalog import CatalogServiceGet | ||
from models_library.generics import Envelope | ||
from simcore_service_webserver._meta import API_VTAG | ||
from simcore_service_webserver.catalog._tags_handlers import ( | ||
ServicePathParams, | ||
ServiceTagPathParams, | ||
) | ||
from simcore_service_webserver.tags.schemas import TagGet | ||
|
||
router = APIRouter( | ||
prefix=f"/{API_VTAG}", | ||
tags=[ | ||
"catalog", | ||
"tags", | ||
], | ||
) | ||
|
||
|
||
@router.get( | ||
"/catalog/services/{service_key}/{service_version}/tags", | ||
response_model=Envelope[list[TagGet]], | ||
) | ||
def list_service_tags( | ||
_path_params: Annotated[ServicePathParams, Depends()], | ||
): | ||
... | ||
|
||
|
||
@router.post( | ||
"/catalog/services/{service_key}/{service_version}/tags/{tag_id}:add", | ||
response_model=Envelope[CatalogServiceGet], | ||
) | ||
def add_service_tag( | ||
_path_params: Annotated[ServiceTagPathParams, Depends()], | ||
): | ||
... | ||
|
||
|
||
@router.post( | ||
"/catalog/services/{service_key}/{service_version}/tags/{tag_id}:remove", | ||
response_model=Envelope[CatalogServiceGet], | ||
) | ||
def remove_service_tag( | ||
_path_params: Annotated[ServiceTagPathParams, 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,7 @@ | |
|
||
router = APIRouter( | ||
prefix=f"/{API_VTAG}", | ||
tags=[ | ||
"projects", | ||
], | ||
tags=["projects", "groups"], | ||
) | ||
|
||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# pylint: disable=redefined-outer-name | ||
# pylint: disable=unused-argument | ||
# pylint: disable=unused-variable | ||
# pylint: disable=too-many-arguments | ||
|
||
|
||
from typing import Annotated | ||
|
||
from fastapi import APIRouter, Depends, status | ||
from models_library.generics import Envelope | ||
from simcore_service_webserver._meta import API_VTAG | ||
from simcore_service_webserver.tags.schemas import ( | ||
TagGet, | ||
TagGroupCreate, | ||
TagGroupGet, | ||
TagGroupPathParams, | ||
TagPathParams, | ||
) | ||
|
||
router = APIRouter( | ||
prefix=f"/{API_VTAG}", | ||
tags=[ | ||
"tags", | ||
"groups", | ||
], | ||
) | ||
|
||
|
||
@router.get( | ||
"/tags/{tag_id}/groups", | ||
response_model=Envelope[list[TagGroupGet]], | ||
) | ||
async def list_tag_groups(_path_params: Annotated[TagPathParams, Depends()]): | ||
... | ||
|
||
|
||
@router.post( | ||
"/tags/{tag_id}/groups/{group_id}", | ||
response_model=Envelope[TagGet], | ||
status_code=status.HTTP_201_CREATED, | ||
) | ||
async def create_tag_group( | ||
_path_params: Annotated[TagGroupPathParams, Depends()], _body: TagGroupCreate | ||
): | ||
... | ||
|
||
|
||
@router.put( | ||
"/tags/{tag_id}/groups/{group_id}", | ||
response_model=Envelope[list[TagGroupGet]], | ||
) | ||
async def replace_tag_groups( | ||
_path_params: Annotated[TagGroupPathParams, Depends()], _body: TagGroupCreate | ||
): | ||
... | ||
|
||
|
||
@router.delete( | ||
"/tags/{tag_id}/groups/{group_id}", | ||
status_code=status.HTTP_204_NO_CONTENT, | ||
) | ||
async def delete_tag_group(_path_params: Annotated[TagGroupPathParams, 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
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
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.