Skip to content

Commit c3758bd

Browse files
committed
update opena api specs
1 parent df04839 commit c3758bd

File tree

2 files changed

+166
-115
lines changed

2 files changed

+166
-115
lines changed

api/specs/web-server/_storage.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99

1010
from fastapi import APIRouter, Query, status
1111
from models_library.api_schemas_storage.rest.storage_schemas import (
12-
AsyncJobGet,
13-
AsyncJobResult,
14-
AsyncJobStatus,
15-
DataExportPost,
1612
FileLocation,
1713
FileMetaDataGet,
1814
FileUploadCompleteFutureResponse,
@@ -22,6 +18,12 @@
2218
LinkType,
2319
PresignedLink,
2420
)
21+
from models_library.api_schemas_webserver.storage import (
22+
DataExportPost,
23+
StorageAsyncJobGet,
24+
StorageAsyncJobResult,
25+
StorageAsyncJobStatus,
26+
)
2527
from models_library.generics import Envelope
2628
from models_library.projects_nodes_io import LocationID
2729
from pydantic import AnyUrl, ByteSize
@@ -177,7 +179,7 @@ async def is_completed_upload_file(
177179
# data export
178180
@router.post(
179181
"/storage/locations/{location_id}/export-data",
180-
response_model=Envelope[AsyncJobGet],
182+
response_model=Envelope[StorageAsyncJobGet],
181183
name="storage_export_data",
182184
description="Export data",
183185
)
@@ -187,25 +189,25 @@ async def export_data(data_export: DataExportPost, location_id: LocationID):
187189

188190
@router.get(
189191
"/storage/async-jobs/{job_id}/status",
190-
response_model=Envelope[AsyncJobStatus],
192+
response_model=Envelope[StorageAsyncJobStatus],
191193
name="storage_async_job_status",
192194
)
193-
async def get_async_job_status(task_id: AsyncJobGet, job_id: UUID):
195+
async def get_async_job_status(task_id: StorageAsyncJobGet, job_id: UUID):
194196
"""Get async job status"""
195197

196198

197199
@router.post(
198200
"/storage/async-jobs/{job_id}:abort",
199201
name="abort_async_job",
200202
)
201-
async def abort_async_job(task_id: AsyncJobGet, job_id: UUID):
203+
async def abort_async_job(task_id: StorageAsyncJobGet, job_id: UUID):
202204
"""Get async job status"""
203205

204206

205207
@router.get(
206208
"/storage/async-jobs/{job_id}/result",
207-
response_model=Envelope[AsyncJobResult],
209+
response_model=Envelope[StorageAsyncJobResult],
208210
name="get_async_job_result",
209211
)
210-
async def get_async_job_result(task_id: AsyncJobGet, job_id: UUID):
212+
async def get_async_job_result(task_id: StorageAsyncJobGet, job_id: UUID):
211213
"""Get async job status"""

services/web/server/src/simcore_service_webserver/api/v0/openapi.yaml

Lines changed: 154 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -6377,7 +6377,7 @@ paths:
63776377
content:
63786378
application/json:
63796379
schema:
6380-
$ref: '#/components/schemas/Envelope_AsyncJobGet_'
6380+
$ref: '#/components/schemas/Envelope_StorageAsyncJobGet_'
63816381
/v0/storage/async-jobs/{job_id}/status:
63826382
get:
63836383
tags:
@@ -6398,14 +6398,14 @@ paths:
63986398
content:
63996399
application/json:
64006400
schema:
6401-
$ref: '#/components/schemas/AsyncJobGet'
6401+
$ref: '#/components/schemas/StorageAsyncJobGet'
64026402
responses:
64036403
'200':
64046404
description: Successful Response
64056405
content:
64066406
application/json:
64076407
schema:
6408-
$ref: '#/components/schemas/Envelope_AsyncJobStatus_'
6408+
$ref: '#/components/schemas/Envelope_StorageAsyncJobStatus_'
64096409
/v0/storage/async-jobs/{job_id}:abort:
64106410
post:
64116411
tags:
@@ -6426,7 +6426,7 @@ paths:
64266426
content:
64276427
application/json:
64286428
schema:
6429-
$ref: '#/components/schemas/AsyncJobGet'
6429+
$ref: '#/components/schemas/StorageAsyncJobGet'
64306430
responses:
64316431
'200':
64326432
description: Successful Response
@@ -6453,14 +6453,14 @@ paths:
64536453
content:
64546454
application/json:
64556455
schema:
6456-
$ref: '#/components/schemas/AsyncJobGet'
6456+
$ref: '#/components/schemas/StorageAsyncJobGet'
64576457
responses:
64586458
'200':
64596459
description: Successful Response
64606460
content:
64616461
application/json:
64626462
schema:
6463-
$ref: '#/components/schemas/Envelope_AsyncJobResult_'
6463+
$ref: '#/components/schemas/Envelope_StorageAsyncJobResult_'
64646464
/v0/trash:empty:
64656465
post:
64666466
tags:
@@ -7741,66 +7741,6 @@ components:
77417741
- app_name
77427742
- version
77437743
title: AppStatusCheck
7744-
AsyncJobGet:
7745-
properties:
7746-
job_id:
7747-
type: string
7748-
format: uuid
7749-
title: Job Id
7750-
type: object
7751-
required:
7752-
- job_id
7753-
title: AsyncJobGet
7754-
AsyncJobResult:
7755-
properties:
7756-
result:
7757-
anyOf:
7758-
- {}
7759-
- type: 'null'
7760-
title: Result
7761-
error:
7762-
anyOf:
7763-
- {}
7764-
- type: 'null'
7765-
title: Error
7766-
type: object
7767-
required:
7768-
- result
7769-
- error
7770-
title: AsyncJobResult
7771-
AsyncJobStatus:
7772-
properties:
7773-
job_id:
7774-
type: string
7775-
format: uuid
7776-
title: Job Id
7777-
task_progress:
7778-
type: number
7779-
maximum: 1.0
7780-
minimum: 0.0
7781-
exclusiveMinimum: true
7782-
title: Task Progress
7783-
done:
7784-
type: boolean
7785-
title: Done
7786-
started:
7787-
type: string
7788-
format: date-time
7789-
title: Started
7790-
stopped:
7791-
anyOf:
7792-
- type: string
7793-
format: date-time
7794-
- type: 'null'
7795-
title: Stopped
7796-
type: object
7797-
required:
7798-
- job_id
7799-
- task_progress
7800-
- done
7801-
- started
7802-
- stopped
7803-
title: AsyncJobStatus
78047744
Author:
78057745
properties:
78067746
name:
@@ -8577,45 +8517,6 @@ components:
85778517
title: Error
85788518
type: object
85798519
title: Envelope[AppStatusCheck]
8580-
Envelope_AsyncJobGet_:
8581-
properties:
8582-
data:
8583-
anyOf:
8584-
- $ref: '#/components/schemas/AsyncJobGet'
8585-
- type: 'null'
8586-
error:
8587-
anyOf:
8588-
- {}
8589-
- type: 'null'
8590-
title: Error
8591-
type: object
8592-
title: Envelope[AsyncJobGet]
8593-
Envelope_AsyncJobResult_:
8594-
properties:
8595-
data:
8596-
anyOf:
8597-
- $ref: '#/components/schemas/AsyncJobResult'
8598-
- type: 'null'
8599-
error:
8600-
anyOf:
8601-
- {}
8602-
- type: 'null'
8603-
title: Error
8604-
type: object
8605-
title: Envelope[AsyncJobResult]
8606-
Envelope_AsyncJobStatus_:
8607-
properties:
8608-
data:
8609-
anyOf:
8610-
- $ref: '#/components/schemas/AsyncJobStatus'
8611-
- type: 'null'
8612-
error:
8613-
anyOf:
8614-
- {}
8615-
- type: 'null'
8616-
title: Error
8617-
type: object
8618-
title: Envelope[AsyncJobStatus]
86198520
Envelope_CatalogServiceGet_:
86208521
properties:
86218522
data:
@@ -9188,6 +9089,45 @@ components:
91889089
title: Error
91899090
type: object
91909091
title: Envelope[StatusDiagnosticsGet]
9092+
Envelope_StorageAsyncJobGet_:
9093+
properties:
9094+
data:
9095+
anyOf:
9096+
- $ref: '#/components/schemas/StorageAsyncJobGet'
9097+
- type: 'null'
9098+
error:
9099+
anyOf:
9100+
- {}
9101+
- type: 'null'
9102+
title: Error
9103+
type: object
9104+
title: Envelope[StorageAsyncJobGet]
9105+
Envelope_StorageAsyncJobResult_:
9106+
properties:
9107+
data:
9108+
anyOf:
9109+
- $ref: '#/components/schemas/StorageAsyncJobResult'
9110+
- type: 'null'
9111+
error:
9112+
anyOf:
9113+
- {}
9114+
- type: 'null'
9115+
title: Error
9116+
type: object
9117+
title: Envelope[StorageAsyncJobResult]
9118+
Envelope_StorageAsyncJobStatus_:
9119+
properties:
9120+
data:
9121+
anyOf:
9122+
- $ref: '#/components/schemas/StorageAsyncJobStatus'
9123+
- type: 'null'
9124+
error:
9125+
anyOf:
9126+
- {}
9127+
- type: 'null'
9128+
title: Error
9129+
type: object
9130+
title: Envelope[StorageAsyncJobStatus]
91919131
Envelope_TagGet_:
91929132
properties:
91939133
data:
@@ -12940,6 +12880,59 @@ components:
1294012880
- productName
1294112881
- ui
1294212882
title: ProductUIGet
12883+
ProgressReport:
12884+
properties:
12885+
actual_value:
12886+
type: number
12887+
title: Actual Value
12888+
total:
12889+
type: number
12890+
title: Total
12891+
default: 1.0
12892+
attempt:
12893+
type: integer
12894+
title: Attempt
12895+
default: 0
12896+
unit:
12897+
anyOf:
12898+
- type: string
12899+
const: Byte
12900+
- type: 'null'
12901+
title: Unit
12902+
message:
12903+
anyOf:
12904+
- $ref: '#/components/schemas/ProgressStructuredMessage'
12905+
- type: 'null'
12906+
type: object
12907+
required:
12908+
- actual_value
12909+
title: ProgressReport
12910+
ProgressStructuredMessage:
12911+
properties:
12912+
description:
12913+
type: string
12914+
title: Description
12915+
current:
12916+
type: number
12917+
title: Current
12918+
total:
12919+
type: integer
12920+
title: Total
12921+
unit:
12922+
anyOf:
12923+
- type: string
12924+
- type: 'null'
12925+
title: Unit
12926+
sub:
12927+
anyOf:
12928+
- $ref: '#/components/schemas/ProgressStructuredMessage'
12929+
- type: 'null'
12930+
type: object
12931+
required:
12932+
- description
12933+
- current
12934+
- total
12935+
title: ProgressStructuredMessage
1294312936
ProjectCopyOverride:
1294412937
properties:
1294512938
name:
@@ -14554,6 +14547,62 @@ components:
1455414547
- loop_tasks
1455514548
- top_tracemalloc
1455614549
title: StatusDiagnosticsGet
14550+
StorageAsyncJobGet:
14551+
properties:
14552+
job_id:
14553+
type: string
14554+
format: uuid
14555+
title: Job Id
14556+
type: object
14557+
required:
14558+
- job_id
14559+
title: StorageAsyncJobGet
14560+
StorageAsyncJobResult:
14561+
properties:
14562+
result:
14563+
anyOf:
14564+
- {}
14565+
- type: 'null'
14566+
title: Result
14567+
error:
14568+
anyOf:
14569+
- {}
14570+
- type: 'null'
14571+
title: Error
14572+
type: object
14573+
required:
14574+
- result
14575+
- error
14576+
title: StorageAsyncJobResult
14577+
StorageAsyncJobStatus:
14578+
properties:
14579+
job_id:
14580+
type: string
14581+
format: uuid
14582+
title: Job Id
14583+
progress:
14584+
$ref: '#/components/schemas/ProgressReport'
14585+
done:
14586+
type: boolean
14587+
title: Done
14588+
started:
14589+
type: string
14590+
format: date-time
14591+
title: Started
14592+
stopped:
14593+
anyOf:
14594+
- type: string
14595+
format: date-time
14596+
- type: 'null'
14597+
title: Stopped
14598+
type: object
14599+
required:
14600+
- job_id
14601+
- progress
14602+
- done
14603+
- started
14604+
- stopped
14605+
title: StorageAsyncJobStatus
1455714606
Structure:
1455814607
properties:
1455914608
key:

0 commit comments

Comments
 (0)