Skip to content

Commit 89cee2f

Browse files
authored
✨ web-api: exposes project's icon as an ui attribute (#7204)
1 parent d432c6c commit 89cee2f

File tree

34 files changed

+592
-345
lines changed

34 files changed

+592
-345
lines changed

api/specs/web-server/_catalog.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def get_service_resources(
138138
@router.get(
139139
"/catalog/services/{service_key:path}/{service_version}/pricing-plan",
140140
response_model=Envelope[ServicePricingPlanGet],
141-
summary="Retrieve default pricing plan for provided service",
141+
description="Retrieve default pricing plan for provided service",
142142
tags=["pricing-plans"],
143143
)
144144
async def get_service_pricing_plan(

api/specs/web-server/_diagnostics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async def healthcheck_liveness_probe():
3636

3737
@router.get(
3838
"/config",
39-
summary="Front end runtime configuration",
39+
description="Front end runtime configuration",
4040
response_model=Envelope[dict[str, Any]],
4141
)
4242
async def get_config():
@@ -53,7 +53,7 @@ async def get_scheduled_maintenance():
5353

5454
@router.get(
5555
"/status",
56-
summary="checks status of self and connected services",
56+
description="checks status of self and connected services",
5757
response_model=Envelope[AppStatusCheck],
5858
response_description="Returns app status check",
5959
)

api/specs/web-server/_folders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async def delete_folder(
105105
@router.post(
106106
"/folders/{folder_id}/workspaces/{workspace_id}:move",
107107
status_code=status.HTTP_204_NO_CONTENT,
108-
summary="Move folder to the workspace",
108+
description="Move folder to the workspace",
109109
tags=["workspaces"],
110110
)
111111
async def move_folder_to_workspace(

api/specs/web-server/_projects_crud.py renamed to api/specs/web-server/_projects.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
from pydantic import BaseModel
3232
from simcore_service_webserver._meta import API_VTAG
3333
from simcore_service_webserver.projects._common.models import ProjectPathParams
34-
from simcore_service_webserver.projects._crud_handlers import ProjectCreateParams
34+
from simcore_service_webserver.projects._crud_handlers import ProjectCreateQueryParams
3535
from simcore_service_webserver.projects._crud_handlers_models import (
3636
ProjectActiveQueryParams,
3737
ProjectsListQueryParams,
@@ -67,12 +67,14 @@ class _ProjectCreateHeaderParams(BaseModel):
6767
@router.post(
6868
"/projects",
6969
response_model=Envelope[TaskGet],
70-
summary="Creates a new project or copies an existing one",
71-
status_code=status.HTTP_201_CREATED,
70+
description="Creates a new project or copies an existing one. "
71+
"NOTE: implemented as a long running task, "
72+
"i.e. requires polling `status_href` (HTTP_200_OK) to get status and `result_href` (HTTP_201_CREATED) to get created project",
73+
status_code=status.HTTP_202_ACCEPTED,
7274
)
7375
async def create_project(
7476
_h: Annotated[_ProjectCreateHeaderParams, Depends()],
75-
_path: Annotated[ProjectCreateParams, Depends()],
77+
_path: Annotated[ProjectCreateQueryParams, Depends()],
7678
_body: ProjectCreateNew | ProjectCopyOverride,
7779
):
7880
...

api/specs/web-server/_projects_comments.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
@router.post(
4141
"/projects/{project_uuid}/comments",
4242
response_model=Envelope[dict[Literal["comment_id"], CommentID]],
43-
summary="Create a new comment for a specific project. The request body should contain the comment contents and user information.",
43+
description="Create a new comment for a specific project. The request body should contain the comment contents and user information.",
4444
status_code=201,
4545
)
4646
async def create_project_comment(
@@ -57,7 +57,7 @@ async def create_project_comment(
5757
@router.get(
5858
"/projects/{project_uuid}/comments",
5959
response_model=Envelope[list[ProjectsCommentsAPI]],
60-
summary="Retrieve all comments for a specific project.",
60+
description="Retrieve all comments for a specific project.",
6161
)
6262
async def list_project_comments(
6363
project_uuid: ProjectID, limit: int = 20, offset: NonNegativeInt = 0
@@ -73,7 +73,7 @@ async def list_project_comments(
7373
@router.put(
7474
"/projects/{project_uuid}/comments/{comment_id}",
7575
response_model=Envelope[ProjectsCommentsAPI],
76-
summary="Update the contents of a specific comment for a project. The request body should contain the updated comment contents.",
76+
description="Update the contents of a specific comment for a project. The request body should contain the updated comment contents.",
7777
)
7878
async def update_project_comment(
7979
project_uuid: ProjectID,
@@ -90,7 +90,7 @@ async def update_project_comment(
9090

9191
@router.delete(
9292
"/projects/{project_uuid}/comments/{comment_id}",
93-
summary="Delete a specific comment associated with a project.",
93+
description="Delete a specific comment associated with a project.",
9494
status_code=204,
9595
)
9696
async def delete_project_comment(project_uuid: ProjectID, comment_id: CommentID):
@@ -105,7 +105,7 @@ async def delete_project_comment(project_uuid: ProjectID, comment_id: CommentID)
105105
@router.get(
106106
"/projects/{project_uuid}/comments/{comment_id}",
107107
response_model=Envelope[ProjectsCommentsAPI],
108-
summary="Retrieve a specific comment by its ID within a project.",
108+
description="Retrieve a specific comment by its ID within a project.",
109109
)
110110
async def get_project_comment(project_uuid: ProjectID, comment_id: CommentID):
111111
...

api/specs/web-server/_projects_folders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
@router.put(
2727
"/projects/{project_id}/folders/{folder_id}",
2828
status_code=status.HTTP_204_NO_CONTENT,
29-
summary="Move project to the folder",
29+
description="Move project to the folder",
3030
)
3131
async def replace_project_folder(
3232
_path: Annotated[_ProjectsFoldersPathParams, Depends()],

api/specs/web-server/_projects_nodes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def replace_node_resources(
159159
@router.get(
160160
"/projects/{project_id}/nodes/-/services:access",
161161
response_model=Envelope[_ProjectGroupAccess],
162-
summary="Check whether provided group has access to the project services",
162+
description="Check whether provided group has access to the project services",
163163
)
164164
async def get_project_services_access_for_gid(
165165
project_id: ProjectID, for_gid: GroupID # noqa: ARG001
@@ -180,7 +180,7 @@ async def get_project_services_access_for_gid(
180180
@router.get(
181181
"/projects/{project_id}/nodes/-/preview",
182182
response_model=Envelope[list[_ProjectNodePreview]],
183-
summary="Lists all previews in the node's project",
183+
description="Lists all previews in the node's project",
184184
)
185185
async def list_project_nodes_previews(project_id: ProjectID): # noqa: ARG001
186186
...
@@ -192,7 +192,7 @@ async def list_project_nodes_previews(project_id: ProjectID): # noqa: ARG001
192192
@router.get(
193193
"/projects/{project_id}/nodes/{node_id}/preview",
194194
response_model=Envelope[_ProjectNodePreview],
195-
summary="Gets a give node's preview",
195+
description="Gets a give node's preview",
196196
responses={status.HTTP_404_NOT_FOUND: {"description": "Node has no preview"}},
197197
)
198198
async def get_project_node_preview(

api/specs/web-server/_projects_nodes_pricing_unit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
@router.get(
3434
"/projects/{project_id}/nodes/{node_id}/pricing-unit",
3535
response_model=Envelope[PricingUnitGet | None],
36-
summary="Get currently connected pricing unit to the project node.",
36+
description="Get currently connected pricing unit to the project node.",
3737
)
3838
async def get_project_node_pricing_unit(project_id: ProjectID, node_id: NodeID):
3939
...
@@ -44,7 +44,7 @@ async def get_project_node_pricing_unit(project_id: ProjectID, node_id: NodeID):
4444

4545
@router.put(
4646
"/projects/{project_id}/nodes/{node_id}/pricing-plan/{pricing_plan_id}/pricing-unit/{pricing_unit_id}",
47-
summary="Connect pricing unit to the project node (Project node can have only one pricing unit)",
47+
description="Connect pricing unit to the project node (Project node can have only one pricing unit)",
4848
status_code=status.HTTP_204_NO_CONTENT,
4949
)
5050
async def connect_pricing_unit_to_project_node(

api/specs/web-server/_projects_wallet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
@router.get(
3535
"/projects/{project_id}/wallet",
3636
response_model=Envelope[WalletGet | None],
37-
summary="Get current connected wallet to the project.",
37+
description="Get current connected wallet to the project.",
3838
)
3939
async def get_project_wallet(project_id: ProjectID):
4040
...
@@ -46,7 +46,7 @@ async def get_project_wallet(project_id: ProjectID):
4646
@router.put(
4747
"/projects/{project_id}/wallet/{wallet_id}",
4848
response_model=Envelope[WalletGet],
49-
summary="Connect wallet to the project (Project can have only one wallet)",
49+
description="Connect wallet to the project (Project can have only one wallet)",
5050
)
5151
async def connect_wallet_to_project(
5252
project_id: ProjectID,

api/specs/web-server/_projects_workspaces.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
@router.post(
2727
"/projects/{project_id}/workspaces/{workspace_id}:move",
2828
status_code=status.HTTP_204_NO_CONTENT,
29-
summary="Move project to the workspace",
29+
description="Move project to the workspace",
3030
)
3131
async def move_project_to_workspace(
3232
_path: Annotated[_ProjectWorkspacesPathParams, Depends()],

0 commit comments

Comments
 (0)