Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
responds with parent
Browse files Browse the repository at this point in the history
pcrespov committed Sep 4, 2024
1 parent a833985 commit 7f4d6e0
Showing 3 changed files with 24 additions and 16 deletions.
7 changes: 4 additions & 3 deletions api/specs/web-server/_catalog_tags.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,8 @@

from typing import Annotated

from fastapi import APIRouter, Depends, status
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 (
@@ -36,7 +37,7 @@ def list_service_tags(

@router.put(
"/catalog/services/{service_key}/{service_version}/tags/{tag_id}",
response_model=Envelope[TagGet],
response_model=Envelope[CatalogServiceGet],
)
def add_service_tag(
_path_params: Annotated[ServiceTagPathParams, Depends()],
@@ -46,7 +47,7 @@ def add_service_tag(

@router.delete(
"/catalog/services/{service_key}/{service_version}/tags/{tag_id}",
status_code=status.HTTP_204_NO_CONTENT,
response_model=Envelope[CatalogServiceGet],
)
def remove_service_tag(
_path_params: Annotated[ServiceTagPathParams, Depends()],
Original file line number Diff line number Diff line change
@@ -761,7 +761,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags._handlers.TagGet__'
$ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags.schemas.TagGet__'
post:
tags:
- tags
@@ -847,7 +847,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags._handlers.TagGroupGet__'
$ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags.schemas.TagGroupGet__'
/v0/tags/{tag_id}/groups/{group_id}:
put:
tags:
@@ -884,7 +884,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags._handlers.TagGroupGet__'
$ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags.schemas.TagGroupGet__'
post:
tags:
- tags
@@ -2237,7 +2237,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags._handlers.TagGet__'
$ref: '#/components/schemas/Envelope_list_simcore_service_webserver.tags.schemas.TagGet__'
/v0/catalog/services/{service_key}/{service_version}/tags/{tag_id}:
put:
tags:
@@ -2274,7 +2274,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/Envelope_TagGet_'
$ref: '#/components/schemas/Envelope_CatalogServiceGet_'
delete:
tags:
- catalog
@@ -2305,8 +2305,12 @@ paths:
name: tag_id
in: path
responses:
'204':
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/Envelope_CatalogServiceGet_'
/v0/clusters:
get:
tags:
@@ -4253,7 +4257,7 @@ paths:
'403':
description: ProjectInvalidRightsError
'404':
description: ProjectNotFoundError, UserDefaultWalletNotFoundError
description: UserDefaultWalletNotFoundError, ProjectNotFoundError
'409':
description: ProjectTooManyProjectOpenedError
'422':
@@ -7846,8 +7850,8 @@ components:
$ref: '#/components/schemas/Viewer'
error:
title: Error
Envelope_list_simcore_service_webserver.tags._handlers.TagGet__:
title: Envelope[list[simcore_service_webserver.tags._handlers.TagGet]]
Envelope_list_simcore_service_webserver.tags.schemas.TagGet__:
title: Envelope[list[simcore_service_webserver.tags.schemas.TagGet]]
type: object
properties:
data:
@@ -7857,8 +7861,8 @@ components:
$ref: '#/components/schemas/TagGet'
error:
title: Error
Envelope_list_simcore_service_webserver.tags._handlers.TagGroupGet__:
title: Envelope[list[simcore_service_webserver.tags._handlers.TagGroupGet]]
Envelope_list_simcore_service_webserver.tags.schemas.TagGroupGet__:
title: Envelope[list[simcore_service_webserver.tags.schemas.TagGroupGet]]
type: object
properties:
data:
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging

from aiohttp import web
from models_library.api_schemas_webserver.catalog import CatalogServiceGet
from models_library.basic_types import IdInt
from servicelib.aiohttp.requests_validation import parse_request_path_parameters_as

@@ -44,7 +45,8 @@ async def add_service_tag(request: web.Request):
path_params = parse_request_path_parameters_as(ServiceTagPathParams, request)
assert path_params # nosec

assert TagGet # nosec
# responds with parent's resource to get the current state (as with patch/update)
assert CatalogServiceGet # nosec
raise NotImplementedError


@@ -58,5 +60,6 @@ async def remove_service_tag(request: web.Request):
path_params = parse_request_path_parameters_as(ServiceTagPathParams, request)
assert path_params # nosec

# responds with parent's resource to get the current state (as with patch/update)
assert CatalogServiceGet # nosec
raise NotImplementedError
# NOTE: will raise web.HTTPNoContent(content_type=MIMETYPE_APPLICATION_JSON)

0 comments on commit 7f4d6e0

Please sign in to comment.