-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathswagger.yml
900 lines (860 loc) · 21.5 KB
/
swagger.yml
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
swagger: '2.0'
info:
title: workflow-manager
description: Orchestrator for AWS Step Functions
# when changing the version here, make sure to
# re-run `make generate` to generate clients and server
version: 0.16.2
x-npm-package: workflow-manager
schemes:
- http
produces:
- application/json
responses:
BadRequest:
description: "Bad Request"
schema:
$ref: "#/definitions/BadRequest"
InternalError:
description: "Internal Error"
schema:
$ref: "#/definitions/InternalError"
NotFound:
description: "Entity Not Found"
schema:
$ref: "#/definitions/NotFound"
Conflict:
description: "Conflict with Current State" #409
schema:
$ref: "#/definitions/Conflict"
paths:
/_health:
get:
operationId: healthCheck
description: Checks if the service is healthy
responses:
200:
description: OK response
/workflow-definitions:
get:
operationId: getWorkflowDefinitions
description: Get the latest versions of all available WorkflowDefinitions
responses:
200:
description: Successfully fetched all WorkflowDefinitions
schema:
type: array
items:
$ref: '#/definitions/WorkflowDefinition'
post:
operationId: newWorkflowDefinition
summary: Create a new WorkflowDefinition
parameters:
- name: NewWorkflowDefinitionRequest
in: body
schema:
$ref: '#/definitions/NewWorkflowDefinitionRequest'
responses:
201:
description: Successful creation of a new WorkflowDefinition
schema:
$ref: '#/definitions/WorkflowDefinition'
/workflow-definitions/{name}:
get:
summary: List WorkflowDefinition Versions by Name
operationId: getWorkflowDefinitionVersionsByName
parameters:
- name: name
in: path
type: string
required: true
- name: latest
in: query
type: boolean
required: false
default: true
responses:
200:
description: WorkflowDefinitions
schema:
type: array
items:
$ref: "#/definitions/WorkflowDefinition"
404:
$ref: "#/responses/NotFound"
put:
operationId: updateWorkflowDefinition
summary: Update an exiting WorkflowDefinition
parameters:
- name: NewWorkflowDefinitionRequest
in: body
schema:
$ref: '#/definitions/NewWorkflowDefinitionRequest'
- name: name
in: path
type: string
required: true
responses:
201:
description: Successful creation of a new WorkflowDefinition
schema:
$ref: '#/definitions/WorkflowDefinition'
404:
$ref: "#/responses/NotFound"
/workflow-definitions/{name}/{version}:
get:
summary: Get a WorkflowDefinition by Name and Version
operationId: getWorkflowDefinitionByNameAndVersion
parameters:
- name: name
in: path
type: string
required: true
- name: version
in: path
type: integer
required: true
responses:
200:
description: WorkflowDefinition
schema:
$ref: "#/definitions/WorkflowDefinition"
404:
$ref: "#/responses/NotFound"
/workflows:
post:
summary: Start a Workflow
operationId: startWorkflow
parameters:
- name: StartWorkflowRequest
description: Parameters for starting a workflow (workflow definition, input, and optionally namespace, queue, and tags)
in: body
schema:
$ref: "#/definitions/StartWorkflowRequest"
responses:
200:
description: Responds with Workflow details including Id, Status, Jobs, Input, Namespace, and WorkflowDefinition
schema:
$ref: "#/definitions/Workflow"
404:
$ref: "#/responses/NotFound"
400:
$ref: "#/responses/BadRequest"
get:
summary: Get summary of all active Workflows for a given WorkflowDefinition
operationId: getWorkflows
x-paging:
pageParameter: pageToken
parameters:
# TODO: Add date range filters.
# should be kept in sync with WorkflowQuery model
- name: limit
default: 10 # TODO: this can be increased after ark support
maximum: 10000
in: query
type: integer
description:
Maximum number of workflows to return.
Defaults to 10.
Restricted to a max of 10,000.
- name: oldestFirst
in: query
type: boolean
- name: pageToken
in: query
type: string
- name: status
description:
The status of the workflow (queued, running, etc.).
in: query
type: string
- name: resolvedByUser
in: query
type: boolean
description:
A flag that indicates whether the workflow has been marked resolved by a user.
- name: summaryOnly
description:
Limits workflow data to the bare minimum - omits the full workflow definition and job
data.
in: query
type: boolean
default: false
- name: workflowDefinitionName
in: query
type: string
required: true
responses:
200:
description: Workflow
schema:
type: array
items:
$ref: "#/definitions/Workflow"
400:
$ref: "#/responses/BadRequest"
404:
$ref: "#/responses/NotFound"
/workflows/{workflowID}:
get:
summary: Get details for a single Workflow, given a workflowID
operationId: getWorkflowByID
parameters:
- name: workflowID
in: path
type: string
required: true
- name: fetchHistory
description: >-
When true, the execution history will be fetched from SFN along with the workflow summary
in: query
type: boolean
default: false
responses:
200:
description: Workflow
schema:
$ref: "#/definitions/Workflow"
404:
$ref: "#/responses/NotFound"
delete:
summary: Cancel workflow with the given workflowID
operationId: CancelWorkflow
parameters:
- name: workflowID
in: path
type: string
required: true
- name: reason
in: body
schema:
$ref: "#/definitions/CancelReason"
required: true
responses:
200:
description: "Workflow cancelled"
404:
$ref: "#/responses/NotFound"
post:
summary: Resume (restart) a Workflow using job outputs of a completed Workflow from the provided position
operationId: resumeWorkflowByID
parameters:
- name: workflowID
in: path
type: string
required: true
- name: overrides
in: body
required: true
schema:
$ref: '#/definitions/WorkflowDefinitionOverrides'
responses:
200:
description: Workflow
schema:
$ref: "#/definitions/Workflow"
404:
$ref: "#/responses/NotFound"
/workflows/{workflowID}/resolved:
post:
summary: Mark a workflow as resolved by user, given its workflowID. If the workflow is already marked resolved by user, the operation will fail.
operationId: resolveWorkflowByID
parameters:
- name: workflowID
in: path
type: string
required: true
responses:
201:
description: Workflow successfully resolved by user
404:
$ref: "#/responses/NotFound"
409:
$ref: "#/responses/Conflict"
/state-resources:
post:
summary: Create or Update a StateResource
operationId: postStateResource
parameters:
- name: NewStateResource
in: body
schema:
$ref: '#/definitions/NewStateResource'
responses:
201:
description: StateResource Successfully saved
schema:
$ref: "#/definitions/StateResource"
/state-resources/{namespace}/{name}:
get:
summary: Get details about StateResource given the namespace and name
operationId: getStateResource
parameters:
- name: namespace
in: path
type: string
required: true
- name: name
in: path
type: string
required: true
responses:
200:
description: StateResource
schema:
$ref: "#/definitions/StateResource"
404:
$ref: "#/responses/NotFound"
put:
summary: Create or Update a StateResource for the name and namespace
operationId: putStateResource
parameters:
- name: namespace
in: path
type: string
required: true
- name: name
type: string
in: path
required: true
- name: NewStateResource
in: body
schema:
$ref: '#/definitions/NewStateResource'
responses:
201:
description: StateResource Successfully saved
schema:
$ref: "#/definitions/StateResource"
400:
$ref: "#/responses/BadRequest"
delete:
summary: Delete an existing StateResource
operationId: deleteStateResource
parameters:
- name: namespace
in: path
type: string
required: true
- name: name
type: string
in: path
required: true
responses:
200:
description: StateResource deleted successfully
404:
$ref: "#/responses/NotFound"
definitions:
InternalError:
type: object
properties:
message:
type: string
BadRequest:
type: object
properties:
message:
type: string
NotFound:
type: object
properties:
message:
type: string
Conflict:
type: object
properties:
message:
type: string
NewWorkflowDefinitionRequest:
type: object
properties:
version:
type: integer
name:
type: string
manager:
$ref: '#/definitions/Manager'
stateMachine:
$ref: '#/definitions/SLStateMachine'
defaultTags:
description: "defaultTags: object with key-value pairs; keys and values should be strings"
additionalProperties:
type: object
WorkflowDefinition:
x-db:
AllowOverwrites: false
DynamoDB:
KeySchema:
- AttributeName: name
KeyType: HASH
- AttributeName: version
KeyType: RANGE
type: object
properties:
id:
type: string
version:
type: integer
name:
type: string
createdAt:
type: string
format: date-time
manager:
$ref: '#/definitions/Manager'
stateMachine:
$ref: '#/definitions/SLStateMachine'
defaultTags:
description: "defaultTags: object with key-value pairs; keys and values should be strings"
additionalProperties:
type: object
Manager:
type: string
enum:
- "step-functions"
Workflow:
allOf:
- $ref: '#/definitions/WorkflowSummary'
- type: object
properties:
statusReason:
type: string
output:
# format: json
type: string
jobs:
type: array
items:
$ref: '#/definitions/Job'
WorkflowSummary:
type: object
properties:
id:
type: string
createdAt:
type: string
format: date-time
stoppedAt:
type: string
format: date-time
lastUpdated:
type: string
format: date-time
workflowDefinition:
$ref: '#/definitions/WorkflowDefinition'
status:
$ref: '#/definitions/WorkflowStatus'
namespace:
type: string
queue:
type: string
input:
# format: json
type: string
resolvedByUser:
type: boolean
retryFor:
description: "workflow-id of original workflow in case this is a retry"
type: string
retries:
description: "workflow-id's of workflows created as retries for this workflow"
type: array
items:
type: string
tags:
description: "tags: object with key-value pairs; keys and values should be strings"
additionalProperties:
type: object
lastJob:
$ref: '#/definitions/Job'
WorkflowStatus:
type: string
enum:
- "queued"
- "running"
- "failed"
- "succeeded"
- "cancelled"
ResolvedByUserWrapper:
type: object
properties:
value:
type: boolean
isSet:
type: boolean
Job:
type: object
properties:
id:
type: string
attempts:
type: array
items:
$ref: '#/definitions/JobAttempt'
container:
type: string
createdAt:
type: string
format: date-time
input:
# format: json
type: string
name:
type: string
output:
# format: json
type: string
queue:
type: string
startedAt:
type: string
format: date-time
state:
type: string
stateResource:
$ref: '#/definitions/StateResource'
status:
$ref: '#/definitions/JobStatus'
statusReason:
type: string
stoppedAt:
type: string
format: date-time
JobStatus:
type: string
enum:
- "created"
- "queued"
- "waiting_for_deps"
- "running"
- "succeeded"
- "failed"
- "aborted_deps_failed"
- "aborted_by_user"
JobAttempt:
type: object
properties:
createdAt:
type: string
format: date-time
startedAt:
type: string
format: date-time
stoppedAt:
type: string
format: date-time
containerInstanceARN:
type: string
taskARN:
type: string
reason:
type: string
exitCode:
type: integer
StartWorkflowRequest:
type: object
properties:
workflowDefinition:
# required
$ref: '#/definitions/WorkflowDefinitionRef'
input:
# required
# format: json
type: string
namespace:
# required
type: string
queue:
# not required (defaults to "default")
type: string
tags:
description: "tags: object with key-value pairs; keys and values should be strings"
additionalProperties:
type: object
idSuffix:
description: "idSuffix is exclusively used for embedded workflow-manager to append human readable information to the newly created workflow's ID. Workflow IDs are truncated to 80 characters, so some or all of the suffix may be lost"
type: string
WorkflowDefinitionRef:
type: object
properties:
name:
type: string
version:
type: integer
CancelReason:
type: object
properties:
reason:
type: string
NewStateResource:
type: object
properties:
name:
type: string
namespace:
type: string
uri:
type: string
StateResource:
type: object
properties:
name:
type: string
namespace:
type: string
uri:
type: string
lastUpdated:
type: string
format: date-time
type:
$ref: '#/definitions/StateResourceType'
StateResourceType:
type: string
enum:
- "JobDefinitionARN"
- "ActivityARN"
- "LambdaFunctionARN"
- "TaskARN"
# States Language Types: https://states-language.net/spec.html
SLStateMachine:
type: object
properties:
StartAt:
type: string
Comment:
type: string
Version:
type: string
enum: ["1.0"]
TimeoutSeconds:
type: integer
States:
additionalProperties:
$ref: '#/definitions/SLState'
SLState:
type: object
properties:
Type:
$ref: '#/definitions/SLStateType'
Resource:
type: string
Comment:
type: string
Next:
type: string
End:
type: boolean
Parameters:
additionalProperties:
type: object
InputPath:
type: string
ItemsPath:
type: string
OutputPath:
type: string
ResultPath:
type: string
Result:
type: string
ResultSelector:
additionalProperties:
type: string
MaxConcurrency:
type: integer
Retry:
x-omitempty: true
type: array
items:
$ref: '#/definitions/SLRetrier'
Catch:
x-omitempty: true
type: array
items:
$ref: '#/definitions/SLCatcher'
TimeoutSeconds:
type: integer
HeartbeatSeconds:
type: integer
Choices:
x-omitempty: true
type: array
items:
$ref: '#/definitions/SLChoice'
Branches:
x-omitempty: true
type: array
items:
$ref: '#/definitions/SLStateMachine'
Iterator:
x-omitempty: true
$ref: '#/definitions/SLStateMachine'
Default:
type: string
Error:
type: string
Cause:
type: string
# The below properties apply to `Wait` states
# http://docs.aws.amazon.com/step-functions/latest/dg/amazon-states-language-wait-state.html
Seconds:
type: integer
Timestamp:
type: string
SecondsPath:
type: string
TimestampPath:
type: string
SLChoice:
type: object
properties:
Next:
type: string
Variable:
type: string
# x-nullable: true makes it so that these are pointers
# in the generated go types. This ensures that
# 1) you can create choices that involve the zero value of
# int and string, and they will appear in the marshalled JSON.
# 2) these fields are omitted from JSON when not provided
StringEquals:
x-nullable: true
type: string
StringLessThan:
x-nullable: true
type: string
StringGreaterThan:
x-nullable: true
type: string
StringLessThanEquals:
x-nullable: true
type: string
StringGreaterThanEquals:
x-nullable: true
type: string
NumericEquals:
x-nullable: true
type: integer
NumericLessThan:
x-nullable: true
type: number
NumericGreaterThan:
x-nullable: true
type: number
NumericLessThanEquals:
x-nullable: true
type: integer
NumericGreaterThanEquals:
x-nullable: true
type: integer
BooleanEquals:
x-nullable: true
type: boolean
TimestampEquals:
x-nullable: true
type: string
format: date-time
TimestampLessThan:
x-nullable: true
type: string
format: date-time
TimestampGreaterThan:
x-nullable: true
type: string
format: date-time
TimestampLessThanEquals:
x-nullable: true
type: string
format: date-time
TimestampGreaterThanEquals:
x-nullable: true
type: string
format: date-time
IsPresent:
x-nullable: true
type: boolean
IsNull:
x-nullable: true
type: boolean
And:
x-omitempty: true
type: array
items:
$ref: '#/definitions/SLChoice'
Or:
x-omitempty: true
type: array
items:
$ref: '#/definitions/SLChoice'
Not:
$ref: '#/definitions/SLChoice'
SLRetrier:
type: object
properties:
IntervalSeconds:
type: integer
BackoffRate:
type: number
ErrorEquals:
type: array
items:
$ref: '#/definitions/SLErrorEquals'
MaxAttempts:
type: integer
minimum: 0
maximum: 2000
SLCatcher:
type: object
properties:
ErrorEquals:
type: array
items:
$ref: '#/definitions/SLErrorEquals'
ResultPath:
type: string
Next:
type: string
SLStateType:
type: string
enum:
- "Pass"
- "Task"
- "Choice"
- "Wait"
- "Succeed"
- "Fail"
- "Parallel"
- "Map"
SLErrorEquals:
type: string
WorkflowDefinitionOverrides:
type: object
properties:
StartAt:
type: string
# Should be kept in sync with getWorkflows API
WorkflowQuery:
type: object
required:
- workflowDefinitionName
properties:
workflowDefinitionName:
type: string
limit:
type: integer
default: 10
maximum: 10000
oldestFirst:
type: boolean
pageToken:
type: string
status:
$ref: '#/definitions/WorkflowStatus'
summaryOnly:
type: boolean
default: false
resolvedByUserWrapper:
description: Tracks whether the resolvedByUser query parameter was sent or omitted in the request.
$ref: '#/definitions/ResolvedByUserWrapper'