Skip to content

Commit 5e3e77f

Browse files
committed
update api-server api
1 parent cb00c7c commit 5e3e77f

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

services/api-server/openapi.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8317,7 +8317,7 @@
83178317
]
83188318
}
83198319
},
8320-
"/v0/tasks/{task_id}": {
8320+
"/v0/tasks/{task_uuid}": {
83218321
"get": {
83228322
"tags": [
83238323
"tasks"
@@ -8332,13 +8332,13 @@
83328332
],
83338333
"parameters": [
83348334
{
8335-
"name": "task_id",
8335+
"name": "task_uuid",
83368336
"in": "path",
83378337
"required": true,
83388338
"schema": {
83398339
"type": "string",
83408340
"format": "uuid",
8341-
"title": "Task Id"
8341+
"title": "Task Uuid"
83428342
}
83438343
}
83448344
],
@@ -8376,7 +8376,7 @@
83768376
}
83778377
}
83788378
},
8379-
"/v0/tasks/{task_id}:cancel": {
8379+
"/v0/tasks/{task_uuid}:cancel": {
83808380
"post": {
83818381
"tags": [
83828382
"tasks"
@@ -8391,13 +8391,13 @@
83918391
],
83928392
"parameters": [
83938393
{
8394-
"name": "task_id",
8394+
"name": "task_uuid",
83958395
"in": "path",
83968396
"required": true,
83978397
"schema": {
83988398
"type": "string",
83998399
"format": "uuid",
8400-
"title": "Task Id"
8400+
"title": "Task Uuid"
84018401
}
84028402
}
84038403
],
@@ -8428,7 +8428,7 @@
84288428
}
84298429
}
84308430
},
8431-
"/v0/tasks/{task_id}/result": {
8431+
"/v0/tasks/{task_uuid}/result": {
84328432
"get": {
84338433
"tags": [
84348434
"tasks"
@@ -8443,13 +8443,13 @@
84438443
],
84448444
"parameters": [
84458445
{
8446-
"name": "task_id",
8446+
"name": "task_uuid",
84478447
"in": "path",
84488448
"required": true,
84498449
"schema": {
84508450
"type": "string",
84518451
"format": "uuid",
8452-
"title": "Task Id"
8452+
"title": "Task Uuid"
84538453
}
84548454
}
84558455
],

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ async def list_tasks(
8787

8888

8989
@router.get(
90-
"/{task_id}",
90+
"/{task_uuid}",
9191
response_model=TaskStatus,
9292
responses=_DEFAULT_TASK_STATUS_CODES,
9393
description=create_route_description(
@@ -99,7 +99,7 @@ async def list_tasks(
9999
include_in_schema=True,
100100
)
101101
async def get_task_status(
102-
task_id: AsyncJobId,
102+
task_uuid: AsyncJobId,
103103
app: Annotated[FastAPI, Depends(get_app)],
104104
user_id: Annotated[UserID, Depends(get_current_user_id)],
105105
product_name: Annotated[ProductName, Depends(get_product_name)],
@@ -111,7 +111,7 @@ async def get_task_status(
111111
)
112112
task_status = await task_manager.get_task_status(
113113
owner_metadata=owner_metadata,
114-
task_uuid=TaskUUID(f"{task_id}"),
114+
task_uuid=TaskUUID(f"{task_uuid}"),
115115
)
116116

117117
return TaskStatus(
@@ -125,7 +125,7 @@ async def get_task_status(
125125

126126

127127
@router.post(
128-
"/{task_id}:cancel",
128+
"/{task_uuid}:cancel",
129129
status_code=status.HTTP_204_NO_CONTENT,
130130
responses=_DEFAULT_TASK_STATUS_CODES,
131131
description=create_route_description(
@@ -137,7 +137,7 @@ async def get_task_status(
137137
include_in_schema=True,
138138
)
139139
async def cancel_task(
140-
task_id: AsyncJobId,
140+
task_uuid: AsyncJobId,
141141
app: Annotated[FastAPI, Depends(get_app)],
142142
user_id: Annotated[UserID, Depends(get_current_user_id)],
143143
product_name: Annotated[ProductName, Depends(get_product_name)],
@@ -149,12 +149,12 @@ async def cancel_task(
149149
)
150150
await task_manager.cancel_task(
151151
owner_metadata=owner_metadata,
152-
task_uuid=TaskUUID(f"{task_id}"),
152+
task_uuid=TaskUUID(f"{task_uuid}"),
153153
)
154154

155155

156156
@router.get(
157-
"/{task_id}/result",
157+
"/{task_uuid}/result",
158158
response_model=TaskResult,
159159
responses={
160160
status.HTTP_404_NOT_FOUND: {
@@ -172,7 +172,7 @@ async def cancel_task(
172172
include_in_schema=True,
173173
)
174174
async def get_task_result(
175-
task_id: AsyncJobId,
175+
task_uuid: AsyncJobId,
176176
app: Annotated[FastAPI, Depends(get_app)],
177177
user_id: Annotated[UserID, Depends(get_current_user_id)],
178178
product_name: Annotated[ProductName, Depends(get_product_name)],
@@ -185,7 +185,7 @@ async def get_task_result(
185185

186186
task_status = await task_manager.get_task_status(
187187
owner_metadata=owner_metadata,
188-
task_uuid=TaskUUID(f"{task_id}"),
188+
task_uuid=TaskUUID(f"{task_uuid}"),
189189
)
190190

191191
if not task_status.is_done:
@@ -196,12 +196,12 @@ async def get_task_result(
196196

197197
task_result = await task_manager.get_task_result(
198198
owner_metadata=owner_metadata,
199-
task_uuid=TaskUUID(f"{task_id}"),
199+
task_uuid=TaskUUID(f"{task_uuid}"),
200200
)
201201

202202
if task_status.task_state == TaskState.FAILURE:
203203
assert isinstance(task_result, Exception)
204-
user_error_msg = f"The execution of task {task_id} failed"
204+
user_error_msg = f"The execution of task {task_uuid} failed"
205205
support_id = create_error_code(task_result)
206206
_logger.exception(
207207
**create_troubleshooting_log_kwargs(

0 commit comments

Comments
 (0)