-
Notifications
You must be signed in to change notification settings - Fork 43
/
reana_server.json
927 lines (927 loc) · 29.3 KB
/
reana_server.json
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
{
"definitions": {},
"info": {
"description": "Submit workflows to be run on REANA Cloud",
"title": "REANA Server",
"version": "0.1"
},
"parameters": {},
"paths": {
"/api/ping": {
"get": {
"description": "Ping the server.",
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Ping succeeded. Service is running and accessible.",
"examples": {
"application/json": {
"message": "OK",
"status": 200
}
},
"schema": {
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "string"
}
},
"type": "object"
}
}
},
"summary": "Ping the server (healthcheck)"
}
},
"/api/users": {
"get": {
"description": "Get user information.",
"operationId": "get_user",
"parameters": [
{
"description": "Not required. The email of the user.",
"in": "query",
"name": "email",
"required": false,
"type": "string"
},
{
"description": "Not required. UUID of the user.",
"in": "query",
"name": "id_",
"required": false,
"type": "string"
},
{
"description": "Not required. API key of the admin.",
"in": "query",
"name": "user_token",
"required": false,
"type": "string"
},
{
"description": "Required. API key of the admin.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Users matching criteria were found. Returns all stored user information.",
"examples": {
"application/json": [
{
"access_token": "Drmhze6EPcv0fN_81Bj-nA",
"email": "user@reana.info",
"id": "00000000-0000-0000-0000-000000000000"
},
{
"access_token": "Drmhze6EPcv0fN_81Bj-nB",
"email": "user2@reana.info",
"id": "00000000-0000-0000-0000-000000000001"
}
]
},
"schema": {
"items": {
"properties": {
"access_token": {
"type": "string"
},
"email": {
"type": "string"
},
"id_": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"403": {
"description": "Request failed. The incoming payload seems malformed."
},
"404": {
"description": "Request failed. User does not exist.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 does not exist."
}
}
},
"500": {
"description": "Request failed. Internal server error.",
"examples": {
"application/json": {
"message": "Error while querying."
}
}
}
},
"summary": "Get user information. Requires the admin api key."
},
"post": {
"description": "This resource creates a new user with the provided information (email, id). Requires the admin api key.",
"operationId": "create_user",
"parameters": [
{
"description": "Required. The email of the user.",
"in": "query",
"name": "email",
"required": true,
"type": "string"
},
{
"description": "Required. API key of the user.",
"in": "query",
"name": "user_token",
"required": false,
"type": "string"
},
{
"description": "Required. API key of the admin.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"201": {
"description": "User created successfully. Returns the access_token and a message.",
"examples": {
"application/json": {
"access_token": "Drmhze6EPcv0fN_81Bj-nA",
"email": "user@reana.info",
"id_": "00000000-0000-0000-0000-000000000000"
}
},
"schema": {
"properties": {
"access_token": {
"type": "string"
},
"email": {
"type": "string"
},
"id_": {
"type": "string"
}
},
"type": "object"
}
},
"403": {
"description": "Request failed. The incoming payload seems malformed."
},
"500": {
"description": "Request failed. Internal server error.",
"examples": {
"application/json": {
"message": "Internal server error."
}
}
}
},
"summary": "Creates a new user with the provided information."
}
},
"/api/workflows": {
"get": {
"description": "This resource return all current workflows in JSON format.",
"operationId": "get_workflows",
"parameters": [
{
"description": "Required. The API access_token of workflow owner.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Request succeeded. The response contains the list of all workflows.",
"examples": {
"application/json": [
{
"created": "2018-06-13T09:47:35.66097",
"id": "256b25f4-4cfb-4684-b7a8-73872ef455a1",
"name": "mytest-1",
"status": "running",
"user": "00000000-0000-0000-0000-000000000000"
},
{
"created": "2018-06-13T09:47:35.66097",
"id": "3c9b117c-d40a-49e3-a6de-5f89fcada5a3",
"name": "mytest-2",
"status": "finished",
"user": "00000000-0000-0000-0000-000000000000"
},
{
"created": "2018-06-13T09:47:35.66097",
"id": "72e3ee4f-9cd3-4dc7-906c-24511d9f5ee3",
"name": "mytest-3",
"status": "created",
"user": "00000000-0000-0000-0000-000000000000"
},
{
"created": "2018-06-13T09:47:35.66097",
"id": "c4c0a1a6-beef-46c7-be04-bf4b3beca5a1",
"name": "mytest-4",
"status": "created",
"user": "00000000-0000-0000-0000-000000000000"
}
]
},
"schema": {
"items": {
"properties": {
"created": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"status": {
"type": "string"
},
"user": {
"type": "string"
}
},
"type": "object"
},
"type": "array"
}
},
"400": {
"description": "Request failed. The incoming payload seems malformed."
},
"403": {
"description": "Request failed. User is not allowed to access workflow.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 is not allowed to access workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1"
}
}
},
"404": {
"description": "Request failed. User does not exist.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 does not exist."
}
}
},
"500": {
"description": "Request failed. Internal controller error.",
"examples": {
"application/json": {
"message": "Something went wrong."
}
}
}
},
"summary": "Returns list of all current workflows in REANA."
},
"post": {
"consumes": [
"application/json"
],
"description": "This resource is expecting a REANA specification in JSON format with all the necessary information to instantiate a workflow.",
"operationId": "create_workflow",
"parameters": [
{
"description": "Name of the workflow to be created. If not provided name will be generated.",
"in": "query",
"name": "workflow_name",
"required": true,
"type": "string"
},
{
"description": "Remote repository which contains a valid REANA specification.",
"in": "query",
"name": "spec",
"required": false,
"type": "string"
},
{
"description": "REANA specification with necessary data to instantiate a workflow.",
"in": "body",
"name": "reana_spec",
"required": false,
"schema": {
"type": "object"
}
},
{
"description": "Required. The API access_token of workflow owner.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"201": {
"description": "Request succeeded. The workflow has been created.",
"examples": {
"application/json": {
"message": "The workflow has been successfully created.",
"workflow_id": "cdcf48b1-c2f3-4693-8230-b066e088c6ac",
"workflow_name": "mytest-1"
}
},
"schema": {
"properties": {
"message": {
"type": "string"
},
"workflow_id": {
"type": "string"
},
"workflow_name": {
"type": "string"
}
},
"type": "object"
}
},
"400": {
"description": "Request failed. The incoming payload seems malformed"
},
"403": {
"description": "Request failed. User is not allowed to access workflow.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 is not allowed to access workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1"
}
}
},
"404": {
"description": "Request failed. User does not exist.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 does not exist."
}
}
},
"500": {
"description": "Request failed. Internal controller error."
},
"501": {
"description": "Request failed. Not implemented."
}
},
"summary": "Creates a new workflow based on a REANA specification file."
}
},
"/api/workflows/{workflow_id_or_name}/logs": {
"get": {
"description": "This resource reports the status of a workflow. Resource is expecting a workflow UUID.",
"operationId": "get_workflow_logs",
"parameters": [
{
"description": "Required. API access_token of workflow owner.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
},
{
"description": "Required. Analysis UUID or name.",
"in": "path",
"name": "workflow_id_or_name",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Request succeeded. Info about a workflow, including the status is returned.",
"examples": {
"application/json": {
"logs": "<Workflow engine log output>",
"user": "00000000-0000-0000-0000-000000000000",
"workflow_id": "256b25f4-4cfb-4684-b7a8-73872ef455a1",
"workflow_name": "mytest-1"
}
},
"schema": {
"properties": {
"logs": {
"type": "string"
},
"user": {
"type": "string"
},
"workflow_id": {
"type": "string"
},
"workflow_name": {
"type": "string"
}
},
"type": "object"
}
},
"400": {
"description": "Request failed. The incoming data specification seems malformed.",
"examples": {
"application/json": {
"message": "Malformed request."
}
}
},
"403": {
"description": "Request failed. User is not allowed to access workflow.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 is not allowed to access workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1"
}
}
},
"404": {
"description": "Request failed. User does not exist.",
"examples": {
"application/json": {
"message": "Workflow cdcf48b1-c2f3-4693-8230-b066e088c6ac does not exist"
}
}
},
"500": {
"description": "Request failed. Internal controller error."
}
},
"summary": "Get workflow logs of a workflow."
}
},
"/api/workflows/{workflow_id_or_name}/status": {
"get": {
"description": "This resource reports the status of a workflow. Resource is expecting a workflow UUID.",
"operationId": "get_workflow_status",
"parameters": [
{
"description": "Required. Analysis UUID or name.",
"in": "path",
"name": "workflow_id_or_name",
"required": true,
"type": "string"
},
{
"description": "Required. The API access_token of workflow owner.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Request succeeded. Info about a workflow, including the status is returned.",
"examples": {
"application/json": {
"created": "2018-06-13T09:47:35.66097",
"id": "256b25f4-4cfb-4684-b7a8-73872ef455a1",
"name": "mytest-1",
"status": "created",
"user": "00000000-0000-0000-0000-000000000000"
}
},
"schema": {
"properties": {
"created": {
"type": "string"
},
"id": {
"type": "string"
},
"logs": {
"type": "string"
},
"name": {
"type": "string"
},
"progress": {
"type": "object"
},
"status": {
"type": "string"
},
"user": {
"type": "string"
}
},
"type": "object"
}
},
"400": {
"description": "Request failed. The incoming payload seems malformed.",
"examples": {
"application/json": {
"message": "Malformed request."
}
}
},
"403": {
"description": "Request failed. User is not allowed to access workflow.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 is not allowed to access workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1"
}
}
},
"404": {
"description": "Request failed. Either User or Analysis does not exist.",
"examples": {
"application/json": {
"message": "Analysis 256b25f4-4cfb-4684-b7a8-73872ef455a1 does not exist."
}
}
},
"500": {
"description": "Request failed. Internal controller error."
}
},
"summary": "Get status of a workflow."
},
"put": {
"consumes": [
"application/json"
],
"description": "This resource reports the status of a workflow. Resource is expecting a workflow UUID.",
"operationId": "set_workflow_status",
"parameters": [
{
"description": "Required. Analysis UUID or name.",
"in": "path",
"name": "workflow_id_or_name",
"required": true,
"type": "string"
},
{
"description": "Required. New workflow status.",
"in": "query",
"name": "status",
"required": true,
"type": "string"
},
{
"description": "Required. The API access_token of workflow owner.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
},
{
"description": "Optional. Extra parameters for workflow status.",
"in": "body",
"name": "parameters",
"required": false,
"schema": {
"type": "object"
}
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Request succeeded. Info about a workflow, including the status is returned.",
"examples": {
"application/json": {
"id": "256b25f4-4cfb-4684-b7a8-73872ef455a1",
"message": "Workflow successfully launched",
"status": "created",
"user": "00000000-0000-0000-0000-000000000000",
"workflow_name": "mytest-1"
}
},
"schema": {
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "string"
},
"user": {
"type": "string"
},
"workflow_id": {
"type": "string"
},
"workflow_name": {
"type": "string"
}
},
"type": "object"
}
},
"400": {
"description": "Request failed. The incoming payload seems malformed.",
"examples": {
"application/json": {
"message": "Malformed request."
}
}
},
"403": {
"description": "Request failed. User is not allowed to access workflow.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 is not allowed to access workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1"
}
}
},
"404": {
"description": "Request failed. Either User or Workflow does not exist.",
"examples": {
"application/json": {
"message": "Workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1 does not exist"
}
}
},
"409": {
"description": "Request failed. The workflow could not be started due to a conflict.",
"examples": {
"application/json": {
"message": "Workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1 could not be started because it is already running."
}
}
},
"500": {
"description": "Request failed. Internal controller error."
},
"501": {
"description": "Request failed. The specified status change is not implemented.",
"examples": {
"application/json": {
"message": "Status resume is not supported yet."
}
}
}
},
"summary": "Set status of a workflow."
}
},
"/api/workflows/{workflow_id_or_name}/workspace": {
"get": {
"description": "This resource retrieves the file list of a workspace, given its workflow UUID.",
"operationId": "get_files",
"parameters": [
{
"description": "Required. Analysis UUID or name.",
"in": "path",
"name": "workflow_id_or_name",
"required": true,
"type": "string"
},
{
"description": "Required. The API access_token of workflow owner.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Requests succeeded. The list of files has been retrieved.",
"schema": {
"items": {
"properties": {
"last-modified": {
"type": "string"
},
"name": {
"type": "string"
},
"size": {
"type": "integer"
}
},
"type": "object"
},
"type": "array"
}
},
"400": {
"description": "Request failed. The incoming payload seems malformed."
},
"403": {
"description": "Request failed. User is not allowed to access workflow.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 is not allowed to access workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1"
}
}
},
"404": {
"description": "Request failed. Analysis does not exist.",
"examples": {
"application/json": {
"message": "Analysis 256b25f4-4cfb-4684-b7a8-73872ef455a1 does not exist."
}
}
},
"500": {
"description": "Request failed. Internal server error.",
"examples": {
"application/json": {
"message": "Internal server error."
}
}
}
},
"summary": "Returns the workspace file list."
},
"post": {
"consumes": [
"multipart/form-data"
],
"description": "This resource is expecting a file to place in the workspace.",
"operationId": "upload_file",
"parameters": [
{
"description": "Required. Analysis UUID or name.",
"in": "path",
"name": "workflow_id_or_name",
"required": true,
"type": "string"
},
{
"description": "Required. File to be transferred to the workflow workspace.",
"in": "formData",
"name": "file_content",
"required": true,
"type": "file"
},
{
"description": "Required. File name.",
"in": "query",
"name": "file_name",
"required": true,
"type": "string"
},
{
"description": "Required. The API access_token of workflow owner.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
}
],
"produces": [
"application/json"
],
"responses": {
"200": {
"description": "Request succeeded. File successfully transferred.",
"schema": {
"properties": {
"message": {
"type": "string"
}
},
"type": "object"
}
},
"400": {
"description": "Request failed. The incoming payload seems malformed"
},
"403": {
"description": "Request failed. User is not allowed to access workflow.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 is not allowed to access workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1"
}
}
},
"404": {
"description": "Request failed. User does not exist.",
"examples": {
"application/json": {
"message": "Workflow cdcf48b1-c2f3-4693-8230-b066e088c6ac does not exist"
}
}
},
"500": {
"description": "Request failed. Internal server error.",
"examples": {
"application/json": {
"message": "Internal server error."
}
}
}
},
"summary": "Adds a file to the workspace."
}
},
"/api/workflows/{workflow_id_or_name}/workspace/{file_name}": {
"get": {
"description": "This resource is expecting a workflow UUID and a file name existing inside the workspace to return its content.",
"operationId": "download_file",
"parameters": [
{
"description": "Required. workflow UUID or name.",
"in": "path",
"name": "workflow_id_or_name",
"required": true,
"type": "string"
},
{
"description": "Required. Name (or path) of the file to be downloaded.",
"in": "path",
"name": "file_name",
"required": true,
"type": "string"
},
{
"description": "Required. The API access_token of workflow owner.",
"in": "query",
"name": "access_token",
"required": true,
"type": "string"
}
],
"produces": [
"multipart/form-data"
],
"responses": {
"200": {
"description": "Requests succeeded. The file has been downloaded.",
"schema": {
"type": "file"
}
},
"400": {
"description": "Request failed. The incoming payload seems malformed."
},
"403": {
"description": "Request failed. User is not allowed to access workflow.",
"examples": {
"application/json": {
"message": "User 00000000-0000-0000-0000-000000000000 is not allowed to access workflow 256b25f4-4cfb-4684-b7a8-73872ef455a1"
}
}
},
"404": {
"description": "Request failed. `file_name` does not exist .",
"examples": {
"application/json": {
"message": "input.csv does not exist"
}
}
},
"500": {
"description": "Request failed. Internal server error.",
"examples": {
"application/json": {
"message": "Internal server error."
}
}
}
},
"summary": "Returns the requested file."
}
}
},
"swagger": "2.0",
"tags": []
}