-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflameAPI2.yaml
More file actions
1051 lines (976 loc) · 26.8 KB
/
flameAPI2.yaml
File metadata and controls
1051 lines (976 loc) · 26.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: "3.0.0"
kind: Service
info:
version: "0.2"
title: Flame
description: eTRANSAFE modeling framework for building and applying predictive models.
license:
name: GLP v3 and posterior
url: https://www.gnu.org/licenses/gpl-3.0.en.html
x-meta:
serviceType: prediction
uuid: f27b70ef-1003-4b99-8015-09ab9e052082
provider: Universitat Pompeu Fabra
created: 2019-09-27
released: 2019-09-27
lastChanged: 2019-09-27
software:
- name: Flame
version: 0.2
description: eTRANSAFE modeling framework for building and applying predictive models.
provider: Universitat Pompeu Fabra
license: Universitat Pompeu Fabra
servers:
- url: /api/v1
variables:
version:
enum:
- 'v1'
default: 'v1'
tags:
- name: Minimal
description: Minimal API specifications
- name: Manage
description: Manage models, versioning, etc.
- name: Build
description: Build a predictive model
- name: Predict
description: Predict the properties of a query compound
- name: Smanage
description: Manage spaces, versioning, etc.
- name: Sbuild
description: Build a chemical space
- name: Search
description: Search compounds similar to a query compound
#- name: user
# description: user with acces to prediction and basic manage
#- name: modeler
# description: model developer with acces to all of the api'''
#==================
# PATHS
#==================
paths:
#----------------------
# MINIMAL specification
#----------------------
/api:
get:
tags:
- Minimal
summary: Returns this API definition
responses:
200:
description: YAML specification of the API
content:
text/yaml:
schema:
type: object
401:
$ref: "#/components/schemas/UnauthorizedError"
/ready:
get:
tags:
- Minimal
summary: Reports the status of the service component
responses:
200:
description: Service is up and operational
content:
text/plain:
schema:
type: string
example: Service is ready
401:
$ref: "#/components/schemas/UnauthorizedError"
503:
description: Service is non-operational
content:
text/plain:
schema:
type: string
example: Service is down for maintenance
/alive:
get:
tags:
- Minimal
summary: Performs a health check of the service
responses:
200:
description: Service passes the internal tests and works
content:
text/plain:
schema:
type: string
example: Service is up and running
401:
$ref: "#/components/schemas/UnauthorizedError"
503:
description: Service is non-operational
content:
text/plain:
schema:
type: string
example: Service is non-operation
#--------
# MANAGE
#--------
# LIST
/manage/models:
get:
tags:
- Manage
#- user
summary: Model list
parameters:
- in: query
name: limit
schema:
type: integer
description: The numbers of Models to return. Default to all.
responses:
"200":
description: requested models
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ListModel"
"404":
$ref: "#/components/schemas/BadRequest"
"500":
$ref: "#/components/schemas/InternalServerError"
#"501":
#$ref: "#/components/schemas/NotImplemented"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
/manage/import:
post:
tags:
- Manage
summary: Import model
description: import the new model from selecetd tar file
requestBody:
description: tarfile of the model
required: true
content:
multipart/form-data:
schema:
type: object
properties:
tarfile:
type: string
format: binary
responses:
"200":
description: Model imported successfully
"404":
$ref: "#/components/schemas/BadRequest"
"409":
$ref: "#/components/schemas/ResourceAlreadyExists"
"500":
$ref: "#/components/schemas/InternalServerError"
#"501":
#$ref: "#/components/schemas/NotImplemented"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
/manage/model/{modelname}:
# CREATE
post:
tags:
- Manage
#- modeler
description: create a new model with the given name
summary: New model
parameters:
- in: path
name: modelname
description: model name
required: true
schema:
type: string
responses:
"201":
description: The model has been created succesfully
content:
application/json:
schema:
$ref: "#/components/schemas/Model"
"404":
$ref: "#/components/schemas/BadRequest"
"401":
$ref: "#/components/schemas/UnauthorizedError"
"409":
$ref: "#/components/schemas/ResourceAlreadyExists"
"500":
$ref: "#/components/schemas/InternalServerError"
# GET INFO
get:
tags:
- Manage
#- user
description: retrieve information of of given Model
summary: Model info
parameters:
- name: modelname
in: path
description: model name
required: true
schema:
type: string
responses:
"200":
description: requested info of model
content:
application/json:
schema:
$ref: "#/components/schemas/ModelInfoArray"
"404":
$ref: "#/components/schemas/ModelNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
"501":
$ref: "#/components/schemas/NotImplemented"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
# PUBLISH MODEL
put:
tags:
- Manage
#- modeler
description: create a new version via flame publish method
summary: New version
parameters:
- in: path
name: modelname
description: name of the model that will be published
required: true
schema:
type: string
responses:
"201":
description: The model version has been created succesfully
content:
application/json:
schema:
$ref: "#/components/schemas/Model"
#"400":
# $ref: "#/components/schemas/BadRequest"
"401":
$ref: "#/components/schemas/UnauthorizedError"
"404":
$ref: "#/components/schemas/ModelNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
# DELETE MODEL
delete:
tags:
- Manage
#- modeler
description: delete model
summary: Delete model
parameters:
- name: modelname
in: path
description: model name
required: true
schema:
type: string
responses:
"204":
description: model deleted
"400":
$ref: "#/components/schemas/BadRequest"
"401":
$ref: "#/components/schemas/UnauthorizedError"
"404":
$ref: "#/components/schemas/ModelNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
/manage/model/{modelname}/export:
get:
tags:
- Manage
description: export model selected as a tar file
summary: export model selected
parameters:
- in: path
name: modelname
description: name of the model to export
required: true
schema:
type: string
responses:
"200":
description: requested info of version
/manage/model/{modelname}/version/{version}:
get:
tags:
- Manage
#- user
description: retrive information about the model version
summary: Version info
parameters:
- in: path
name: modelname
description: name of the model that will be build
required: true
schema:
type: string
- in: path
name: version
description: version of the model
required: true
schema:
type: string
responses:
"200":
description: requested info of version
content:
application/json:
schema:
$ref: "#/components/schemas/ModelInfoArray"
"400":
$ref: "#/components/schemas/BadRequest"
"404":
$ref: "#/components/schemas/ModelNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
"501":
$ref: "#/components/schemas/NotImplemented"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
delete:
tags:
- Manage
#- modeler
description: delete version
summary: Delete version
parameters:
- name: modelname
in: path
description: model name
required: true
schema:
type: string
- name: version
in: path
description: version of the model to get info from
required: true
schema:
type: string
responses:
"204":
description: version deleted
"400":
$ref: "#/components/schemas/BadRequest"
"401":
$ref: "#/components/schemas/UnauthorizedError"
"404":
$ref: "#/components/schemas/VersionNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
# PARAMETERS
/manage/model/{modelname}/version/{version}/parameters:
get:
tags:
- Manage
#- user
description: retrieve model parameters
summary: Model parameters
parameters:
- name: modelname
in: path
description: model name
required: true
schema:
type: string
- name: version
in: path
description: version of the model to get info from
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ModelParameters"
"400":
$ref: "#/components/schemas/BadRequest"
"404":
$ref: "#/components/schemas/ModelNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
/manage/model/{modelname}/version/{version}/validation:
get:
tags:
- Manage
#- user
description: retrieve model parameters
summary: Model parameters
parameters:
- name: modelname
in: path
description: model name
required: true
schema:
type: string
- name: version
in: path
description: version of the model to get info from
required: true
schema:
type: string
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/ModelParameters"
"400":
$ref: "#/components/schemas/BadRequest"
"404":
$ref: "#/components/schemas/ModelNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
#---------
# BUILD
#---------
# PLACE SDF IN POST IN BODY
/build/model/{modelname}:
post:
tags:
- Build
#- modeler
description: Build model with the present SDF in the body as training set. Always builds version 0
summary: Build model
parameters:
- in: path
name: modelname
description: name of the model that will be build
required: true
schema:
type: string
requestBody:
description: training SDF to build the model with
required: false
content:
multipart/form-data:
schema:
type: object
properties:
SDF:
type: string
format: binary
modelParams:
$ref: "#/components/schemas/ModelParameters"
responses:
"200":
description: Model built succesfully
content:
application/json:
schema:
type: object
properties:
buildStatus:
description: return flame status
type: string
fileName:
description: uploaded file name in the server
type: string
modelName:
type: string
version:
type: number
"404":
$ref: "#/components/schemas/BadRequest"
"500":
$ref: "#/components/schemas/InternalServerError"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
#----------
# PREDICT
#----------
/predict/model/{modelname}/version/{version}:
put:
tags:
- Predict
#- user
description: 'uploads molecules and runs prediction with specified model '
summary: Predict
operationId: Predict
parameters:
- in: path
required: true
name: modelname
description: model id to run prediction
schema:
type: string
- name: version
in: path
description: version of the model to run prediction
required: true
schema:
type: string
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
SDF:
type: string
format: binary
responses:
'200':
description: prediction successful
content:
application/json:
schema:
type: object
properties:
Manifest:
description: especification of what data is represented
type: array
items:
type: object
Meta:
description: model metainformation
type: object
"400":
$ref: "#/components/schemas/FileNotProvided"
"404":
$ref: "#/components/schemas/BadRequest"
"500":
$ref: "#/components/schemas/InternalServerError"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
#---------
# SBUILD
#---------
# PLACE SDF IN POST IN BODY
/sbuild/space/{spacename}:
post:
tags:
- Sbuild
description: Build a chemical space with the present SDF in the body. Always builds version 0
summary: Build a chemical space
parameters:
- in: path
name: space name
description: name of the chemical space that will be build
required: true
schema:
type: string
requestBody:
description: SDFile with a collection of compounds populating the chemical space
required: false
content:
multipart/form-data:
schema:
type: object
properties:
SDF:
type: string
format: binary
modelParams:
$ref: "#/components/schemas/ModelParameters"
responses:
"200":
description: Space built succesfully
content:
application/json:
schema:
type: object
properties:
buildStatus:
description: return flame status
type: string
fileName:
description: uploaded file name in the server
type: string
modelName:
type: string
version:
type: number
"404":
$ref: "#/components/schemas/BadRequest"
"500":
$ref: "#/components/schemas/InternalServerError"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
#----------
# SEARCH
#----------
/search/space/{spacename}/version/{version}:
put:
tags:
- Search
description: 'uploads molecules and runs simuilarity search with specified space and parameters '
summary: Search
operationId: Search
parameters:
- in: path
required: true
name: spacename
description: space id to run similarity search
schema:
type: string
- name: version
in: path
description: version of the chemical space to run similarity search
required: true
schema:
type: string
requestBody:
required: true
content:
multipart/form-data:
schema:
type: object
properties:
SDF:
type: string
format: binary
searchParams:
$ref: "#/components/schemas/SearchParameters"
responses:
'200':
description: search successful
content:
application/json:
schema:
type: object
properties:
Manifest:
description: especification of what data is represented
type: array
items:
type: object
Meta:
description: model metainformation
type: object
"404":
$ref: "#/components/schemas/BadRequest"
"500":
$ref: "#/components/schemas/InternalServerError"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
#=============================
#---------
# SMANAGE
#---------
/smanage/spaces:
get:
tags:
- Smanage
#- user
summary: Spaces list
parameters:
- in: query
name: limit
schema:
type: integer
description: The numbers of spaces to return. Default to all.
responses:
"200":
description: requested spaces
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/ListModel"
"404":
$ref: "#/components/schemas/BadRequest"
"500":
$ref: "#/components/schemas/InternalServerError"
#"501":
#$ref: "#/components/schemas/NotImplemented"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
/smanage/space/{spacename}:
# CREATE
post:
tags:
- Smanage
#- modeler
description: create a new model with the given name
summary: New model
parameters:
- in: path
name: spacename
description: apace name
required: true
schema:
type: string
responses:
"201":
description: The space has been created succesfully
content:
application/json:
schema:
$ref: "#/components/schemas/Model"
"404":
$ref: "#/components/schemas/BadRequest"
"401":
$ref: "#/components/schemas/UnauthorizedError"
"409":
$ref: "#/components/schemas/ResourceAlreadyExists"
"500":
$ref: "#/components/schemas/InternalServerError"
# GET INFO
get:
tags:
- Smanage
#- user
description: retrieve information of of given Model
summary: Space info
parameters:
- name: spacename
in: path
description: space name
required: true
schema:
type: string
responses:
"200":
description: requested info of model
content:
application/json:
schema:
$ref: "#/components/schemas/ModelInfoArray"
"404":
$ref: "#/components/schemas/ModelNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
"501":
$ref: "#/components/schemas/NotImplemented"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
# PUBLISH MODEL
put:
tags:
- Smanage
#- modeler
description: create a new version via flame publish method
summary: New version
parameters:
- in: path
name: modelname
description: name of the model that will be published
required: true
schema:
type: string
responses:
"201":
description: The model version has been created succesfully
content:
application/json:
schema:
$ref: "#/components/schemas/Model"
#"400":
# $ref: "#/components/schemas/BadRequest"
"401":
$ref: "#/components/schemas/UnauthorizedError"
"404":
$ref: "#/components/schemas/ModelNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
# DELETE MODEL
delete:
tags:
- Smanage
#- modeler
description: delete model
summary: Delete model
parameters:
- name: modelname
in: path
description: model name
required: true
schema:
type: string
responses:
"204":
description: model deleted
"400":
$ref: "#/components/schemas/BadRequest"
"401":
$ref: "#/components/schemas/UnauthorizedError"
"404":
$ref: "#/components/schemas/ModelNotFound"
"500":
$ref: "#/components/schemas/InternalServerError"
"503":
$ref: "#/components/schemas/ServiceUnavailable"
#==============
#======================
# COMPONENTS
#======================
components:
schemas:
AnyValue:
nullable: true
description: Can be any value, including `null`.
# -------
# MODEL
# -------
Model:
type: object
properties:
modelNname:
type: string
version:
type: string
example:
modelName: CACO2
versions: "0"
# -------
# ListModel
# -------
ListModel:
type: object
properties:
modelName:
type: string
nodes:
type: array
items:
type: object
properties:
text:
type: string
example:
text:
example:
text: Model4
nodes: [text: dev,text: ver000001]
# ----------------
# MODEL PARAMETERS
# ----------------
ModelParameters:
description: Model parameters object
type: object
# ----------------
# SEARCH PARAMETERS
# ----------------
SearchParameters:
description: Search parameters object
type: object
# -------------
# MODEL RESULTS
# -------------
PredictionResults:
type: object
properties:
Manifest:
description: especification of what data is represented
type: array
items:
type: object
Meta:
description: model metainformation
type: object
# ----------
# MODEL INFO
# ----------
ModelInfo:
type: array
items:
type: object
properties:
varName:
type: string
varDescription:
type: string
values:
$ref: "#/components/schemas/AnyValue"
example: |
[
{
varName: "nobj",
varDescription: "number of objects",
values: 100
},
{
varName: "model"
varDescription: "model type"
values: "RF quantitave"
},
...
]
#----------
# MODEL INFO
# ----------
ModelInfoArray:
type: array
items:
type: array
items:
type: string
example: |
[
[
"nobj",
"number of objects",
100
],
[
"nvarx",
"number of predictor variables",
10