Skip to content

Commit 4193632

Browse files
committed
Mention release versoin
1 parent 7b6214e commit 4193632

File tree

4 files changed

+138
-31
lines changed

4 files changed

+138
-31
lines changed

services/api-server/src/simcore_service_api_server/api/routes/function_job_collections_routes.py

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@
1919
from ..dependencies.authentication import get_current_user_id
2020
from ..dependencies.services import get_api_client
2121
from ..dependencies.webserver_rpc import get_wb_api_rpc_client
22+
from ._constants import FMSG_CHANGELOG_NEW_IN_VERSION, create_route_description
2223
from .function_jobs_routes import function_job_status, get_function_job
2324

2425
# pylint: disable=too-many-arguments
2526

2627
function_job_collections_router = APIRouter()
2728

29+
FIRST_RELEASE_VERSION = "0.8.0"
30+
2831

2932
_COMMON_FUNCTION_JOB_COLLECTION_ERROR_RESPONSES: Final[dict] = {
3033
status.HTTP_404_NOT_FOUND: {
@@ -37,7 +40,10 @@
3740
@function_job_collections_router.get(
3841
"",
3942
response_model=Page[RegisteredFunctionJobCollection],
40-
description="List function job collections",
43+
description=create_route_description(
44+
base="List function job collections",
45+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
46+
),
4147
)
4248
async def list_function_job_collections(
4349
wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)],
@@ -58,7 +64,10 @@ async def list_function_job_collections(
5864
"/{function_job_collection_id:uuid}",
5965
response_model=RegisteredFunctionJobCollection,
6066
responses={**_COMMON_FUNCTION_JOB_COLLECTION_ERROR_RESPONSES},
61-
description="Get function job collection",
67+
description=create_route_description(
68+
base="Get function job collection",
69+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
70+
),
6271
)
6372
async def get_function_job_collection(
6473
function_job_collection_id: FunctionJobCollectionID,
@@ -72,7 +81,10 @@ async def get_function_job_collection(
7281
@function_job_collections_router.post(
7382
"",
7483
response_model=RegisteredFunctionJobCollection,
75-
description="Register function job collection",
84+
description=create_route_description(
85+
base="Register function job collection",
86+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
87+
),
7688
)
7789
async def register_function_job_collection(
7890
function_job_collection: FunctionJobCollection,
@@ -87,7 +99,10 @@ async def register_function_job_collection(
8799
"/{function_job_collection_id:uuid}",
88100
response_model=None,
89101
responses={**_COMMON_FUNCTION_JOB_COLLECTION_ERROR_RESPONSES},
90-
description="Delete function job collection",
102+
description=create_route_description(
103+
base="Delete function job collection",
104+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
105+
),
91106
)
92107
async def delete_function_job_collection(
93108
function_job_collection_id: FunctionJobCollectionID,
@@ -102,7 +117,9 @@ async def delete_function_job_collection(
102117
"/{function_job_collection_id:uuid}/function_jobs",
103118
response_model=list[RegisteredFunctionJob],
104119
responses={**_COMMON_FUNCTION_JOB_COLLECTION_ERROR_RESPONSES},
105-
description="Get the function jobs in function job collection",
120+
description=create_route_description(
121+
base="Get the function jobs in function job collection",
122+
),
106123
)
107124
async def function_job_collection_list_function_jobs(
108125
function_job_collection_id: FunctionJobCollectionID,
@@ -125,7 +142,9 @@ async def function_job_collection_list_function_jobs(
125142
"/{function_job_collection_id:uuid}/status",
126143
response_model=FunctionJobCollectionStatus,
127144
responses={**_COMMON_FUNCTION_JOB_COLLECTION_ERROR_RESPONSES},
128-
description="Get function job collection status",
145+
description=create_route_description(
146+
base="Get function job collection status",
147+
),
129148
)
130149
async def function_job_collection_status(
131150
function_job_collection_id: FunctionJobCollectionID,

services/api-server/src/simcore_service_api_server/api/routes/function_jobs_routes.py

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
from ..dependencies.webserver_http import get_webserver_session
2929
from ..dependencies.webserver_rpc import get_wb_api_rpc_client
3030
from . import solvers_jobs, solvers_jobs_getters, studies_jobs
31+
from ._constants import FMSG_CHANGELOG_NEW_IN_VERSION, create_route_description
3132

3233
# pylint: disable=too-many-arguments
3334
# pylint: disable=cyclic-import
@@ -42,9 +43,16 @@
4243
},
4344
}
4445

46+
FIRST_RELEASE_VERSION = "0.8.0"
47+
4548

4649
@function_job_router.get(
47-
"", response_model=Page[RegisteredFunctionJob], description="List function jobs"
50+
"",
51+
response_model=Page[RegisteredFunctionJob],
52+
description=create_route_description(
53+
base="List function jobs",
54+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
55+
),
4856
)
4957
async def list_function_jobs(
5058
wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)],
@@ -63,7 +71,12 @@ async def list_function_jobs(
6371

6472

6573
@function_job_router.post(
66-
"", response_model=RegisteredFunctionJob, description="Create function job"
74+
"",
75+
response_model=RegisteredFunctionJob,
76+
description=create_route_description(
77+
base="Create function job",
78+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
79+
),
6780
)
6881
async def register_function_job(
6982
function_job: FunctionJob,
@@ -76,7 +89,10 @@ async def register_function_job(
7689
"/{function_job_id:uuid}",
7790
response_model=RegisteredFunctionJob,
7891
responses={**_COMMON_FUNCTION_JOB_ERROR_RESPONSES},
79-
description="Get function job",
92+
description=create_route_description(
93+
base="Get function job",
94+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
95+
),
8096
)
8197
async def get_function_job(
8298
function_job_id: FunctionJobID,
@@ -89,7 +105,10 @@ async def get_function_job(
89105
"/{function_job_id:uuid}",
90106
response_model=None,
91107
responses={**_COMMON_FUNCTION_JOB_ERROR_RESPONSES},
92-
description="Delete function job",
108+
description=create_route_description(
109+
base="Delete function job",
110+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
111+
),
93112
)
94113
async def delete_function_job(
95114
function_job_id: FunctionJobID,
@@ -102,7 +121,10 @@ async def delete_function_job(
102121
"/{function_job_id:uuid}/status",
103122
response_model=FunctionJobStatus,
104123
responses={**_COMMON_FUNCTION_JOB_ERROR_RESPONSES},
105-
description="Get function job status",
124+
description=create_route_description(
125+
base="Get function job status",
126+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
127+
),
106128
)
107129
async def function_job_status(
108130
function_job_id: FunctionJobID,
@@ -167,7 +189,10 @@ async def get_function_from_functionjobid(
167189
"/{function_job_id:uuid}/outputs",
168190
response_model=FunctionOutputs,
169191
responses={**_COMMON_FUNCTION_JOB_ERROR_RESPONSES},
170-
description="Get function job outputs",
192+
description=create_route_description(
193+
base="Get function job outputs",
194+
changelog=[FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION)],
195+
),
171196
)
172197
async def function_job_outputs(
173198
function_job_id: FunctionJobID,

services/api-server/src/simcore_service_api_server/api/routes/functions_routes.py

Lines changed: 77 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
from ..dependencies.webserver_http import get_webserver_session
4040
from ..dependencies.webserver_rpc import get_wb_api_rpc_client
4141
from . import solvers_jobs, studies_jobs
42+
from ._constants import FMSG_CHANGELOG_NEW_IN_VERSION, create_route_description
4243
from .function_jobs_routes import register_function_job
4344

4445
# pylint: disable=too-many-arguments
@@ -53,12 +54,19 @@
5354
},
5455
}
5556

57+
FIRST_RELEASE_VERSION = "0.8.0"
58+
5659

5760
@function_router.post(
5861
"",
5962
response_model=RegisteredFunction,
6063
responses={**_COMMON_FUNCTION_ERROR_RESPONSES},
61-
description="Create function",
64+
description=create_route_description(
65+
base="Create function",
66+
changelog=[
67+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
68+
],
69+
),
6270
)
6371
async def register_function(
6472
wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)],
@@ -71,7 +79,12 @@ async def register_function(
7179
"/{function_id:uuid}",
7280
response_model=RegisteredFunction,
7381
responses={**_COMMON_FUNCTION_ERROR_RESPONSES},
74-
description="Get function",
82+
description=create_route_description(
83+
base="Get function",
84+
changelog=[
85+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
86+
],
87+
),
7588
)
7689
async def get_function(
7790
function_id: FunctionID,
@@ -81,7 +94,14 @@ async def get_function(
8194

8295

8396
@function_router.get(
84-
"", response_model=Page[RegisteredFunction], description="List functions"
97+
"",
98+
response_model=Page[RegisteredFunction],
99+
description=create_route_description(
100+
base="List functions",
101+
changelog=[
102+
FMSG_CHANGELOG_NEW_IN_VERSION.format("0.8.0"),
103+
],
104+
),
85105
)
86106
async def list_functions(
87107
wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)],
@@ -102,7 +122,12 @@ async def list_functions(
102122
@function_router.get(
103123
"/{function_id:uuid}/jobs",
104124
response_model=Page[RegisteredFunctionJob],
105-
description="List function jobs for a function",
125+
description=create_route_description(
126+
base="List function jobs for a function",
127+
changelog=[
128+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
129+
],
130+
),
106131
)
107132
async def list_function_jobs_for_functionid(
108133
function_id: FunctionID,
@@ -126,7 +151,12 @@ async def list_function_jobs_for_functionid(
126151
"/{function_id:uuid}/title",
127152
response_model=RegisteredFunction,
128153
responses={**_COMMON_FUNCTION_ERROR_RESPONSES},
129-
description="Update function",
154+
description=create_route_description(
155+
base="Update function",
156+
changelog=[
157+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
158+
],
159+
),
130160
)
131161
async def update_function_title(
132162
function_id: FunctionID,
@@ -146,7 +176,12 @@ async def update_function_title(
146176
"/{function_id:uuid}/description",
147177
response_model=RegisteredFunction,
148178
responses={**_COMMON_FUNCTION_ERROR_RESPONSES},
149-
description="Update function",
179+
description=create_route_description(
180+
base="Update function",
181+
changelog=[
182+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
183+
],
184+
),
150185
)
151186
async def update_function_description(
152187
function_id: FunctionID,
@@ -180,7 +215,12 @@ def _join_inputs(
180215
"/{function_id:uuid}/input_schema",
181216
response_model=FunctionInputSchema,
182217
responses={**_COMMON_FUNCTION_ERROR_RESPONSES},
183-
description="Get function input schema",
218+
description=create_route_description(
219+
base="Get function input schema",
220+
changelog=[
221+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
222+
],
223+
),
184224
)
185225
async def get_function_inputschema(
186226
function_id: FunctionID,
@@ -194,7 +234,12 @@ async def get_function_inputschema(
194234
"/{function_id:uuid}/output_schema",
195235
response_model=FunctionInputSchema,
196236
responses={**_COMMON_FUNCTION_ERROR_RESPONSES},
197-
description="Get function input schema",
237+
description=create_route_description(
238+
base="Get function output schema",
239+
changelog=[
240+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
241+
],
242+
),
198243
)
199244
async def get_function_outputschema(
200245
function_id: FunctionID,
@@ -211,7 +256,12 @@ async def get_function_outputschema(
211256
status.HTTP_400_BAD_REQUEST: {"description": "Invalid inputs"},
212257
status.HTTP_404_NOT_FOUND: {"description": "Function not found"},
213258
},
214-
description="Validate inputs against the function's input schema",
259+
description=create_route_description(
260+
base="Validate inputs against the function's input schema",
261+
changelog=[
262+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
263+
],
264+
),
215265
)
216266
async def validate_function_inputs(
217267
function_id: FunctionID,
@@ -242,7 +292,12 @@ async def validate_function_inputs(
242292
"/{function_id:uuid}:run",
243293
response_model=RegisteredFunctionJob,
244294
responses={**_COMMON_FUNCTION_ERROR_RESPONSES},
245-
description="Run function",
295+
description=create_route_description(
296+
base="Run function",
297+
changelog=[
298+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
299+
],
300+
),
246301
)
247302
async def run_function( # noqa: PLR0913
248303
request: Request,
@@ -353,7 +408,12 @@ async def run_function( # noqa: PLR0913
353408
"/{function_id:uuid}",
354409
response_model=None,
355410
responses={**_COMMON_FUNCTION_ERROR_RESPONSES},
356-
description="Delete function",
411+
description=create_route_description(
412+
base="Delete function",
413+
changelog=[
414+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
415+
],
416+
),
357417
)
358418
async def delete_function(
359419
wb_api_rpc: Annotated[WbApiRpcClient, Depends(get_wb_api_rpc_client)],
@@ -374,7 +434,12 @@ async def delete_function(
374434
"/{function_id:uuid}:map",
375435
response_model=RegisteredFunctionJobCollection,
376436
responses={**_COMMON_FUNCTION_ERROR_RESPONSES},
377-
description="Map function over input parameters",
437+
description=create_route_description(
438+
base="Map function over input parameters",
439+
changelog=[
440+
FMSG_CHANGELOG_NEW_IN_VERSION.format(FIRST_RELEASE_VERSION),
441+
],
442+
),
378443
)
379444
async def map_function( # noqa: PLR0913
380445
function_id: FunctionID,

services/api-server/src/simcore_service_api_server/api/routes/programs.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
from fastapi import APIRouter, Body, Depends, Header, HTTPException, status
77
from fastapi_pagination import create_page
88
from httpx import HTTPStatusError
9-
from models_library.api_schemas_storage.storage_schemas import (
10-
LinkType,
11-
)
9+
from models_library.api_schemas_storage.storage_schemas import LinkType
1210
from models_library.projects import ProjectID
1311
from models_library.projects_nodes_io import NodeID
1412
from pydantic import ByteSize, PositiveInt, StringConstraints, ValidationError
@@ -44,10 +42,10 @@
4442
description=create_route_description(
4543
base="Lists the latest of all available programs",
4644
changelog=[
47-
FMSG_CHANGELOG_NEW_IN_VERSION.format("0.8"),
45+
FMSG_CHANGELOG_NEW_IN_VERSION.format("0.9"),
4846
],
4947
),
50-
include_in_schema=False, # TO BE RELEASED in 0.8
48+
include_in_schema=False, # TO BE RELEASED in 0.9
5149
)
5250
async def list_programs(
5351
program_service: Annotated[ProgramService, Depends(get_program_service)],
@@ -79,10 +77,10 @@ async def list_programs(
7977
description=create_route_description(
8078
base="Lists the latest of all available programs",
8179
changelog=[
82-
FMSG_CHANGELOG_NEW_IN_VERSION.format("0.8"),
80+
FMSG_CHANGELOG_NEW_IN_VERSION.format("0.9"),
8381
],
8482
),
85-
include_in_schema=False, # TO BE RELEASED in 0.8
83+
include_in_schema=False, # TO BE RELEASED in 0.9
8684
)
8785
async def list_program_history(
8886
program_key: ProgramKeyId,

0 commit comments

Comments
 (0)