Skip to content

Commit 89393df

Browse files
committed
Resolve comments in PR about function wb rest api
1 parent 0605cd8 commit 89393df

File tree

7 files changed

+351
-31
lines changed

7 files changed

+351
-31
lines changed

api/specs/web-server/_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ async def get_function(
4545

4646

4747
@router.delete(
48-
"/projects/{function_id}",
48+
"/functions/{function_id}",
4949
status_code=status.HTTP_204_NO_CONTENT,
5050
)
5151
async def delete_function(

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

Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3093,6 +3093,70 @@ paths:
30933093
schema:
30943094
$ref: '#/components/schemas/EnvelopedError'
30953095
description: Service Unavailable
3096+
/v0/functions:
3097+
post:
3098+
tags:
3099+
- functions
3100+
summary: Register Function
3101+
operationId: register_function
3102+
requestBody:
3103+
content:
3104+
application/json:
3105+
schema:
3106+
oneOf:
3107+
- $ref: '#/components/schemas/ProjectFunctionToRegister'
3108+
- $ref: '#/components/schemas/SolverFunctionToRegister'
3109+
title: ' Body'
3110+
discriminator:
3111+
propertyName: functionClass
3112+
mapping:
3113+
PROJECT: '#/components/schemas/ProjectFunctionToRegister'
3114+
SOLVER: '#/components/schemas/SolverFunctionToRegister'
3115+
required: true
3116+
responses:
3117+
'200':
3118+
description: Successful Response
3119+
content:
3120+
application/json:
3121+
schema:
3122+
$ref: '#/components/schemas/Envelope_Annotated_Union_RegisteredProjectFunctionGet__RegisteredSolverFunctionGet___FieldInfo_annotation_NoneType__required_True__discriminator__function_class____'
3123+
/v0/functions/{function_id}:
3124+
get:
3125+
tags:
3126+
- functions
3127+
summary: Get Function
3128+
operationId: get_function
3129+
parameters:
3130+
- name: function_id
3131+
in: path
3132+
required: true
3133+
schema:
3134+
type: string
3135+
format: uuid
3136+
title: Function Id
3137+
responses:
3138+
'200':
3139+
description: Successful Response
3140+
content:
3141+
application/json:
3142+
schema:
3143+
$ref: '#/components/schemas/Envelope_Annotated_Union_RegisteredProjectFunctionGet__RegisteredSolverFunctionGet___FieldInfo_annotation_NoneType__required_True__discriminator__function_class____'
3144+
delete:
3145+
tags:
3146+
- functions
3147+
summary: Delete Function
3148+
operationId: delete_function
3149+
parameters:
3150+
- name: function_id
3151+
in: path
3152+
required: true
3153+
schema:
3154+
type: string
3155+
format: uuid
3156+
title: Function Id
3157+
responses:
3158+
'204':
3159+
description: Successful Response
30963160
/v0/tasks:
30973161
get:
30983162
tags:
@@ -9688,6 +9752,28 @@ components:
96889752
additionalProperties: false
96899753
type: object
96909754
title: EmptyModel
9755+
? Envelope_Annotated_Union_RegisteredProjectFunctionGet__RegisteredSolverFunctionGet___FieldInfo_annotation_NoneType__required_True__discriminator__function_class____
9756+
: properties:
9757+
data:
9758+
anyOf:
9759+
- oneOf:
9760+
- $ref: '#/components/schemas/RegisteredProjectFunctionGet'
9761+
- $ref: '#/components/schemas/RegisteredSolverFunctionGet'
9762+
discriminator:
9763+
propertyName: functionClass
9764+
mapping:
9765+
PROJECT: '#/components/schemas/RegisteredProjectFunctionGet'
9766+
SOLVER: '#/components/schemas/RegisteredSolverFunctionGet'
9767+
- type: 'null'
9768+
title: Data
9769+
error:
9770+
anyOf:
9771+
- {}
9772+
- type: 'null'
9773+
title: Error
9774+
type: object
9775+
title: Envelope[Annotated[Union[RegisteredProjectFunctionGet, RegisteredSolverFunctionGet],
9776+
FieldInfo(annotation=NoneType, required=True, discriminator='function_class')]]
96919777
Envelope_AnyUrl_:
96929778
properties:
96939779
data:
@@ -12100,6 +12186,34 @@ components:
1210012186
additionalProperties: false
1210112187
type: object
1210212188
title: InvitationInfo
12189+
JSONFunctionInputSchema:
12190+
properties:
12191+
schema_content:
12192+
type: object
12193+
title: JSON Schema
12194+
description: JSON Schema
12195+
default: {}
12196+
schema_class:
12197+
type: string
12198+
const: application/schema+json
12199+
title: Schema Class
12200+
default: application/schema+json
12201+
type: object
12202+
title: JSONFunctionInputSchema
12203+
JSONFunctionOutputSchema:
12204+
properties:
12205+
schema_content:
12206+
type: object
12207+
title: JSON Schema
12208+
description: JSON Schema
12209+
default: {}
12210+
schema_class:
12211+
type: string
12212+
const: application/schema+json
12213+
title: Schema Class
12214+
default: application/schema+json
12215+
type: object
12216+
title: JSONFunctionOutputSchema
1210312217
LicensedItemPurchaseGet:
1210412218
properties:
1210512219
licensedItemPurchaseId:
@@ -14382,6 +14496,53 @@ components:
1438214496
- workbench
1438314497
- accessRights
1438414498
title: ProjectCreateNew
14499+
ProjectFunctionToRegister:
14500+
properties:
14501+
functionClass:
14502+
type: string
14503+
const: PROJECT
14504+
title: Functionclass
14505+
default: PROJECT
14506+
title:
14507+
type: string
14508+
title: Title
14509+
default: ''
14510+
description:
14511+
type: string
14512+
title: Description
14513+
default: ''
14514+
inputSchema:
14515+
oneOf:
14516+
- $ref: '#/components/schemas/JSONFunctionInputSchema'
14517+
title: Inputschema
14518+
discriminator:
14519+
propertyName: schema_class
14520+
mapping:
14521+
application/schema+json: '#/components/schemas/JSONFunctionInputSchema'
14522+
outputSchema:
14523+
oneOf:
14524+
- $ref: '#/components/schemas/JSONFunctionOutputSchema'
14525+
title: Outputschema
14526+
discriminator:
14527+
propertyName: schema_class
14528+
mapping:
14529+
application/schema+json: '#/components/schemas/JSONFunctionOutputSchema'
14530+
defaultInputs:
14531+
anyOf:
14532+
- type: object
14533+
- type: 'null'
14534+
title: Defaultinputs
14535+
projectId:
14536+
type: string
14537+
format: uuid
14538+
title: Projectid
14539+
type: object
14540+
required:
14541+
- inputSchema
14542+
- outputSchema
14543+
- defaultInputs
14544+
- projectId
14545+
title: ProjectFunctionToRegister
1438514546
ProjectGet:
1438614547
properties:
1438714548
uuid:
@@ -15154,6 +15315,115 @@ components:
1515415315
- name
1515515316
- message
1515615317
title: RegisterPhoneNextPage
15318+
RegisteredProjectFunctionGet:
15319+
properties:
15320+
functionClass:
15321+
type: string
15322+
const: PROJECT
15323+
title: Functionclass
15324+
default: PROJECT
15325+
title:
15326+
type: string
15327+
title: Title
15328+
default: ''
15329+
description:
15330+
type: string
15331+
title: Description
15332+
default: ''
15333+
inputSchema:
15334+
oneOf:
15335+
- $ref: '#/components/schemas/JSONFunctionInputSchema'
15336+
title: Inputschema
15337+
discriminator:
15338+
propertyName: schema_class
15339+
mapping:
15340+
application/schema+json: '#/components/schemas/JSONFunctionInputSchema'
15341+
outputSchema:
15342+
oneOf:
15343+
- $ref: '#/components/schemas/JSONFunctionOutputSchema'
15344+
title: Outputschema
15345+
discriminator:
15346+
propertyName: schema_class
15347+
mapping:
15348+
application/schema+json: '#/components/schemas/JSONFunctionOutputSchema'
15349+
defaultInputs:
15350+
anyOf:
15351+
- type: object
15352+
- type: 'null'
15353+
title: Defaultinputs
15354+
uid:
15355+
type: string
15356+
format: uuid
15357+
title: Uid
15358+
projectId:
15359+
type: string
15360+
format: uuid
15361+
title: Projectid
15362+
type: object
15363+
required:
15364+
- inputSchema
15365+
- outputSchema
15366+
- defaultInputs
15367+
- uid
15368+
- projectId
15369+
title: RegisteredProjectFunctionGet
15370+
RegisteredSolverFunctionGet:
15371+
properties:
15372+
functionClass:
15373+
type: string
15374+
const: SOLVER
15375+
title: Functionclass
15376+
default: SOLVER
15377+
title:
15378+
type: string
15379+
title: Title
15380+
default: ''
15381+
description:
15382+
type: string
15383+
title: Description
15384+
default: ''
15385+
inputSchema:
15386+
oneOf:
15387+
- $ref: '#/components/schemas/JSONFunctionInputSchema'
15388+
title: Inputschema
15389+
discriminator:
15390+
propertyName: schema_class
15391+
mapping:
15392+
application/schema+json: '#/components/schemas/JSONFunctionInputSchema'
15393+
outputSchema:
15394+
oneOf:
15395+
- $ref: '#/components/schemas/JSONFunctionOutputSchema'
15396+
title: Outputschema
15397+
discriminator:
15398+
propertyName: schema_class
15399+
mapping:
15400+
application/schema+json: '#/components/schemas/JSONFunctionOutputSchema'
15401+
defaultInputs:
15402+
anyOf:
15403+
- type: object
15404+
- type: 'null'
15405+
title: Defaultinputs
15406+
uid:
15407+
type: string
15408+
format: uuid
15409+
title: Uid
15410+
solverKey:
15411+
type: string
15412+
pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$
15413+
title: Solverkey
15414+
solverVersion:
15415+
type: string
15416+
pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$
15417+
title: Solverversion
15418+
type: object
15419+
required:
15420+
- inputSchema
15421+
- outputSchema
15422+
- defaultInputs
15423+
- uid
15424+
- solverKey
15425+
- solverVersion
15426+
title: RegisteredSolverFunctionGet
1515715427
ReplaceWalletAutoRecharge:
1515815428
properties:
1515915429
enabled:
@@ -15945,6 +16215,58 @@ components:
1594516215
required:
1594616216
- position
1594716217
title: SlideshowUI
16218+
SolverFunctionToRegister:
16219+
properties:
16220+
functionClass:
16221+
type: string
16222+
const: SOLVER
16223+
title: Functionclass
16224+
default: SOLVER
16225+
title:
16226+
type: string
16227+
title: Title
16228+
default: ''
16229+
description:
16230+
type: string
16231+
title: Description
16232+
default: ''
16233+
inputSchema:
16234+
oneOf:
16235+
- $ref: '#/components/schemas/JSONFunctionInputSchema'
16236+
title: Inputschema
16237+
discriminator:
16238+
propertyName: schema_class
16239+
mapping:
16240+
application/schema+json: '#/components/schemas/JSONFunctionInputSchema'
16241+
outputSchema:
16242+
oneOf:
16243+
- $ref: '#/components/schemas/JSONFunctionOutputSchema'
16244+
title: Outputschema
16245+
discriminator:
16246+
propertyName: schema_class
16247+
mapping:
16248+
application/schema+json: '#/components/schemas/JSONFunctionOutputSchema'
16249+
defaultInputs:
16250+
anyOf:
16251+
- type: object
16252+
- type: 'null'
16253+
title: Defaultinputs
16254+
solverKey:
16255+
type: string
16256+
pattern: ^simcore/services/((comp|dynamic|frontend))/([a-z0-9][a-z0-9_.-]*/)*([a-z0-9-_]+[a-z0-9])$
16257+
title: Solverkey
16258+
solverVersion:
16259+
type: string
16260+
pattern: ^(0|[1-9]\d*)(\.(0|[1-9]\d*)){2}(-(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*)(\.(0|[1-9]\d*|\d*[-a-zA-Z][-\da-zA-Z]*))*)?(\+[-\da-zA-Z]+(\.[-\da-zA-Z-]+)*)?$
16261+
title: Solverversion
16262+
type: object
16263+
required:
16264+
- inputSchema
16265+
- outputSchema
16266+
- defaultInputs
16267+
- solverKey
16268+
- solverVersion
16269+
title: SolverFunctionToRegister
1594816270
SpecificInfo:
1594916271
properties:
1595016272
aws_ec2_instances:
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@
77
)
88
from pydantic import TypeAdapter
99
from servicelib.aiohttp.requests_validation import parse_request_path_parameters_as
10-
from servicelib.rabbitmq import RPCRouter
1110
from simcore_service_webserver.utils_aiohttp import envelope_json_response
1211

1312
from ..._meta import API_VTAG as VTAG
1413
from .. import _functions_service
1514
from ._functions_rest_exceptions import handle_rest_requests_exceptions
1615
from ._functions_rest_schemas import FunctionPathParams
1716

18-
router = RPCRouter()
19-
2017
routes = web.RouteTableDef()
2118

2219

0 commit comments

Comments
 (0)