forked from moov-io/achgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
468 lines (444 loc) · 14.8 KB
/
openapi.yaml
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
openapi: 3.0.2
info:
description: |
Moov ACHGateway is an extensible, highly-available, distributed, and fault-tolerant ACH uploader and downloader. ACHGateway creates events for outside services and transforms files prior to upload to fit real-world requirements of production systems.
Refer to the documentation site for more information on running ACHGateway. https://moov-io.github.io/achgateway/
version: v1
title: ACHGateway API
contact:
url: https://github.com/moov-io/achgateway
license:
name: Apache 2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html
servers: []
tags:
- name: Files
description: Endpoint for submitting files to ACHGateway for later upload.
- name: Shards
description: |
Shards are logical grouping for ACH file delivery. They are designed to allow a large number of identifiers map to a small number
of upload agents and schedules. This allows customization to match business and banking requirements. Identifiers can be random
values (e.g. UUIDs) with shard names (e.g. testing, SD-live).
- name: Operations
description: |
Endpoints for monitoring ACHGateway and triggering manual steps outside of the automated processes.
There are endpoints for liveness/readiness checks and Prometheus metrics. The [`admin` package from `moov-io/base` describes these endpoints](https://github.com/moov-io/base/tree/master/admin#endpoints).
paths:
/shards/{shardKey}/files/{fileID}:
post:
description: |
Submit a file to ACHGateway for upload at the next cutoff processing. The file may be in either Nacha formatted ACH or moov-io/ach's
JSON specification. When ValidateOpts are required the JSON specification must be used.
tags: [ "Files" ]
operationId: submitFile
summary: Submit file
servers:
- url: http://localhost:8484
description: Business Logic
parameters:
- name: shardKey
in: path
required: true
schema:
type: string
example: "testing"
- name: fileID
in: path
required: true
schema:
type: string
example: AE694B55-C103-4FA5-B62E-E4F6F79AD581
requestBody:
description: Content of the ACH file in moov-io/ach JSON or Nacha formatted text
required: true
content:
text/plain:
schema:
description: A plaintext ACH file
type: string
example: |
101 23138010401210428821906240000A094101Federal Reserve Bank My Bank Name
5225Name on Account 121042882 PPDREG.SALARY 190625 1121042880000001
62723138010412345678 0100000000 Receiver Account Name 0121042880000001
82250000010023138010000100000000000000000000121042882 121042880000001
9000001000001000000010023138010000100000000000000000000
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
application/json:
schema:
$ref: 'https://raw.githubusercontent.com/moov-io/ach/master/openapi.yaml#/components/schemas/CreateFile'
responses:
'200':
description: File accepted successfully without errors.
'400':
description: Unable to read file, make sure the file is in either valid Nacha or moov-io/ach formatting.
'500':
description: Error publishing the file. Check logs for publishing errors.
delete:
description: Cancel a pending ACH file
tags: [ "Files" ]
operationId: cancelFile
servers:
- url: http://localhost:8484
description: Business Logic
parameters:
- name: shardKey
in: path
required: true
schema:
type: string
example: "testing"
- name: fileID
in: path
required: true
schema:
type: string
example: AE694B55-C103-4FA5-B62E-E4F6F79AD581
responses:
'200':
description: File accepted successfully without errors.
'500':
description: Error canceling the file. Check logs for publishing errors.
/shards/{shardName}/files:
get:
description: |
List files pending for the given shard.
tags: [ "Operations" ]
operationId: listPendingFiles
summary: List pending files
servers:
- url: http://localhost:9494
description: Admin Endpoints
parameters:
- name: shardName
in: path
required: true
description: Name of shard from configuration file
schema:
type: string
example: SD-live
responses:
'200':
description: List of pending files in the shard.
content:
application/json:
schema:
$ref: '#/components/schemas/ShardFilesResponse'
/shards/{shardName}/files/{filepath}:
get:
description: |
Get pending file metadata.
tags: [ "Operations" ]
operationId: getPendingFile
summary: Get pending file
servers:
- url: http://localhost:9494
description: Admin Endpoints
parameters:
- name: shardName
in: path
required: true
description: Name of shard from configuration file
schema:
type: string
example: SD-live
- name: filepath
in: path
required: true
description: Relative filepath within the shard
schema:
type: string
example: "616d04d8-f8ec-46a9-b467-1d6ec009852f.ach"
responses:
'200':
description: Content of pending ACH file
content:
application/json:
schema:
$ref: '#/components/schemas/PendingFile'
/shards:
get:
description: |
List the configured shards.
tags: [ "Shard Mapping" ]
operationId: listShards
summary: List shards
servers:
- url: http://localhost:9494
description: Admin Endpoints
responses:
'200':
description: List of configured shards
content:
application/json:
schema:
$ref: '#/components/schemas/Shards'
/shard_mappings:
get:
description: |
List existing shard mappings.
tags: [ "Shard Mapping" ]
operationId: listShardMappings
summary: List shard mappings
servers:
- url: http://localhost:8484
description: Business Logic
responses:
'200':
description: List of shard mappings
content:
application/json:
schema:
$ref: '#/components/schemas/ShardMappings'
post:
description: |
Create a new shard mapping.
tags: [ "Shard Mapping" ]
operationId: createShardMapping
summary: Create shard mapping
servers:
- url: http://localhost:8484
description: Business Logic
requestBody:
description: Shard mapping to create
content:
application/json:
schema:
$ref: '#/components/schemas/ShardMapping'
responses:
'201':
description: Shard mapping created
'400':
description: Error creating shard mapping
/shard_mappings/{shardKey}:
get:
description: |
Get shard for a specific key.
tags: [ "Shard Mapping" ]
operationId: getShardMapping
summary: Get shard mapping
servers:
- url: http://localhost:8484
description: Business Logic
parameters:
- name: shardKey
in: path
required: true
description: Key to lookup and retrieve the configured shard mapped to it.
schema:
type: string
example: userID123
responses:
'200':
description: Shard mapped to specified key
content:
application/json:
schema:
$ref: '#/components/schemas/ShardMapping'
'404':
description: Shard key not found
# Operations
/config:
get:
description: |
Retrieve the active configuration.
tags: [ "Operations" ]
operationId: getConfig
summary: Get ACHGateway config
servers:
- url: http://localhost:9494
description: Admin Endpoints
responses:
'200':
description: Masked application configuration
content:
application/json:
schema:
$ref: '#/components/schemas/Config'
/ping:
get:
description: PONG if the service is running.
tags: [ "Operations" ]
operationId: ping
summary: Ping ACHGateway
servers:
- url: http://localhost:8484
description: Business Logic
responses:
'200':
description: ACHGateway is running
content:
text/plain:
schema:
type: string
example: PONG
/trigger-cutoff:
put:
description: |
Initiate cutoff processing for shards.
tags: [ "Operations" ]
operationId: triggerCutoff
summary: Trigger cutoff processing
servers:
- url: http://localhost:9494
description: Admin Endpoints
requestBody:
description: |
List of shards to trigger cutoff processing for. If no shards are specified then all configured shards will be processed.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TriggerRequest'
responses:
'200':
description: All specified shards have completed cutoff processing successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/TriggerResponse'
/trigger-inbound:
put:
description: |
Initiate inbound processing of ODFI files for shards.
tags: [ "Operations" ]
operationId: triggerInbound
summary: Trigger inbound processing
servers:
- url: http://localhost:9494
description: Admin Endpoints
requestBody:
description: |
List of shards to trigger inbound processing for. This involves consuming all Correction, Inbound, Return, Pre-Note, and Reconciliation files on the upload agent servers, If no shards are specified then all configured shards will be processed.
required: false
content:
application/json:
schema:
$ref: '#/components/schemas/TriggerRequest'
responses:
'200':
description: All specified shards have completed inbound processing successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/TriggerResponse'
/shards/{shardName}/pipeline/{isolatedDirectory}/file-uploaded:
put:
description: |
Produce FileUploaded events from an isolatedDirectory.
tags: [ "Operations" ]
operationId: produceFileUploaded
summary: Produce FileUploaded event
servers:
- url: http://localhost:9494
description: Admin Endpoints
parameters:
- name: shardName
in: path
required: true
description: Name of shard from configuration file
schema:
type: string
example: SD-live
- name: isolatedDirectory
in: path
required: true
description: Directory name that was previously isolated/uploaded
schema:
type: string
example: SD-live-1234567890
responses:
'200':
description: List of pending files in the shard.
'400':
description: An internal error occurred.
'404':
description: The shard or directory was not found.
components:
schemas:
Config:
description: |
Full config object loaded with ACHGateway. Certain sensitive values are masked to protect their value.
See https://moov-io.github.io/achgateway/config/ for a full specification.
properties: {}
Shards:
type: array
items:
type: string
example:
- testing
- SD-live
- ND-live
ShardFilesResponse:
properties:
Files:
type: array
items:
$ref: '#/components/schemas/ShardFile'
SourceHostname:
type: string
example: "achgateway-1.apps.svc.cluster.local"
ShardFile:
properties:
Filename:
type: string
example: "dd437bdf-c5ff-4caf-9e0c-9bf2a100b7be.ach"
Path:
type: string
example: "mergable/SD-live/dd437bdf-c5ff-4caf-9e0c-9bf2a100b7be.ach"
ModTime:
type: string
format: date-time
example: "2022-01-02T15:04:05Z07:00"
PendingFile:
properties:
Filename:
type: string
example: "dd437bdf-c5ff-4caf-9e0c-9bf2a100b7be.ach"
ContentsBase64:
type: string
example: "bW9vdi1pbyBhY2hnYXRld2F5Cg=="
Valid:
type: string
description: Optional value describing Nacha validation
ModTime:
type: string
format: date-time
example: "2022-01-02T15:04:05Z07:00"
SourceHostname:
type: string
example: "achgateway-1.apps.svc.cluster.local"
ShardMapping:
properties:
shardKey:
type: string
example: 8c458c10-5476-4f9c-aeb4-9339fb85d481
shardName:
type: string
example: SD-live
ShardMappings:
type: array
items:
$ref: '#/components/schemas/ShardMapping'
TriggerRequest:
properties:
shardNames:
type: array
items:
type: string
example:
- "SD-live"
- "ND-live"
required:
- shardNames
TriggerResponse:
properties:
Shards:
description: A map of shards and any errors encountered during processing.
type: object
example:
"testing": "ERROR processing shard: hostname not found"
"SD-live": null