-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathopenapi.yaml
498 lines (498 loc) · 16.3 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
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
openapi: 3.0.3
info:
contact:
email: [email protected]
name: Tagbase Dev Team
url: https://github.com/tagbase/tagbase-server/issues
description: |
tagbse-server provides HTTP endpoints for ingestion of various files \
into a Tagbase SQL database. Input file support currently includes eTUFF (see [here](https://doi.org/10.6084/m9.figshare.10032848.v4) \
and [here](https://doi.org/10.6084/m9.figshare.10159820.v1)). The REST API complies with [OpenAPI v3.0.3](https://spec.openapis.org/oas/v3.0.3.html).
license:
name: Apache License v2.0
url: https://www.apache.org/licenses/LICENSE-2.0
termsOfService: TODO
title: tagbase-server API
version: v0.14.0
servers:
- description: Local development tagbase-server
url: https://localhost/tagbase/api/v0.14.0
- description: ICCAT Test tagbase-server
url: https://162.13.162.49/tagbase/api/v0.14.0
tags:
- description: Ingestion operations.
name: ingest
- description: Tag Operations.
name: tags
paths:
/ingest:
get:
description: Get network accessible file and execute ingestion
operationId: ingest_get
parameters:
- description: Location of a network accessible (file, ftp, http, https)
file e.g. 'file:///usr/src/app/data/eTUFF-sailfish-117259.txt'.
explode: true
in: query
name: file
required: true
schema:
maxLength: 100
minLength: 10
pattern: ^(?!\s*$).+
type: string
style: form
- $ref: '#/components/parameters/notes'
- $ref: '#/components/parameters/type'
- $ref: '#/components/parameters/version'
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Ingest200'
description: A success message confirming ingestion.
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
description: Internal tagbase-server error. Contact admin detailed in openapi.yaml.
summary: Get network accessible file and execute ingestion
tags:
- ingest
x-openapi-router-controller: tagbase_server.controllers.ingest_controller
post:
description: Post a local file and perform a ingest operation
operationId: ingest_post
parameters:
- $ref: '#/components/parameters/filename'
- $ref: '#/components/parameters/notes'
- $ref: '#/components/parameters/type'
- $ref: '#/components/parameters/version'
requestBody:
content:
application/octet-stream:
schema:
description: Compressed binary e.g. zip file containing one or more eTUFF files
format: binary
maxLength: 1000000000
minLength: 1
type: string
text/plain:
schema:
description: Plain text eTUFF file
format: binary
maxLength: 1000000000
minLength: 1
type: string
required: true
x-body-name: body
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Ingest200'
description: A success message confirming ingestion.
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
description: Internal tagbase-server error. Contact admin detailed in openapi.yaml.
summary: Post a local file and perform a ingest operation
tags:
- ingest
x-codegen-request-body-name: body
x-openapi-router-controller: tagbase_server.controllers.ingest_controller
/tags:
delete:
description: Delete all tags
operationId: delete_tags
responses:
"204":
description: Successful delete operation.
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
description: Internal tagbase-server error. Contact admin detailed in openapi.yaml.
summary: Delete all tags
tags:
- tags
x-openapi-router-controller: tagbase_server.controllers.tags_controller
get:
description: Get information about all tags
operationId: list_tags
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Tags200'
description: A success message confirming ingestion.
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
description: Internal tagbase-server error. Contact admin detailed in openapi.yaml.
summary: Get information about all tags
tags:
- tags
x-openapi-router-controller: tagbase_server.controllers.tags_controller
/tags/{tag_id}:
parameters:
- $ref: '#/components/parameters/tagId'
delete:
description: Delete an individual tag
operationId: delete_tag
responses:
"204":
description: Successful delete operation.
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
description: Internal tagbase-server error. Contact admin detailed in openapi.yaml.
summary: Delete an individual tag
tags:
- tags
x-openapi-router-controller: tagbase_server.controllers.tags_controller
get:
description: Get information about an individual tag
operationId: get_tag
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/Tag200'
description: A success message confirming ingestion.
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
description: Internal tagbase-server error. Contact admin detailed in openapi.yaml.
summary: Get information about an individual tag
tags:
- tags
x-openapi-router-controller: tagbase_server.controllers.tags_controller
/tags/{tag_id}/subs/{sub_id}:
parameters:
- $ref: '#/components/parameters/subId'
- $ref: '#/components/parameters/tagId'
delete:
description: Delete a tag submission
operationId: delete_sub
responses:
"204":
description: Successful delete operation.
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
description: Internal tagbase-server error. Contact admin detailed in openapi.yaml.
summary: Delete a tag submission
tags:
- tags
x-openapi-router-controller: tagbase_server.controllers.tags_controller
put:
description: Update a tag submission
operationId: replace_tag
parameters:
- $ref: '#/components/parameters/notes'
- $ref: '#/components/parameters/version'
responses:
"200":
content:
application/json:
schema:
$ref: '#/components/schemas/TagPut200'
description: A success message confirming ingestion.
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorContainer'
description: Internal tagbase-server error. Contact admin detailed in openapi.yaml.
summary: Update the 'notes' and/or 'version' associated with a tag submission
tags:
- tags
x-openapi-router-controller: tagbase_server.controllers.tags_controller
components:
parameters:
filename:
description: Free-form text field to explicitly define the name of the file to be persisted
explode: true
in: query
name: filename
required: true
schema:
maxLength: 100
minLength: 1
pattern: ^(?!\s*$).+
type: string
style: form
subId:
description: Existing submission id for an existing tag
explode: true
in: path
name: sub_id
required: true
schema:
type: integer
tagId:
description: Existing tag id
explode: true
in: path
name: tag_id
required: true
schema:
type: integer
notes:
description: Free-form text field where details of submitted eTUFF file for ingest can be provided e.g. submitter name, etuff data contents (tag metadata and measurements + primary position data, or just secondary solution-positional meta/data)
explode: true
in: query
name: notes
required: false
schema:
maxLength: 10000
minLength: 1
pattern: ^(?!\s*$).+
type: string
style: form
type:
description: Type of file to be ingested, defaults to 'etuff'
explode: true
in: query
name: type
required: false
schema:
default: etuff
enum:
- etuff
- netcdf
type: string
style: form
version:
description: Version identifier for the eTUFF tag data file ingested
explode: true
in: query
name: version
required: false
schema:
maxLength: 10
minLength: 1
pattern: ^(?!\s*$).+
type: string
style: form
schemas:
filename:
description: Full name and extension of the ingested eTUFF tag data file
example: "eTUFF-sailfish-117259_2.txt"
title: filename
type: string
tag_id:
description: Unique numeric Tag ID associated with the ingested tag eTUFF data file
example: 3
type: integer
ErrorContainer:
description: 'An error response for an operation.'
type: object
properties:
errors:
type: array
minItems: 1
maxItems: 100
description: 'The array of error entries associated with the error response'
items:
$ref: '#/components/schemas/Error'
trace:
description: 'The error trace information.'
example: 123e4567-e89b-12d3-a456-426614174000
format: uuid
type: string
Error:
description: 'An error response entry.'
type: object
properties:
code:
description: 'The error code.'
type: string
enum:
- 'internal_server_error'
- 'bad_request'
- 'unauthorized'
- 'service_unavailable'
message:
description: 'The error message.'
type: string
more_info:
description: 'Additional info about the error.'
type: string
Ingest200:
description: HTTP 200 success response
example:
code: "200"
elapsed: '0:00:06.506691'
message: Data file eTUFF-sailfish-117259.txt successfully ingested into Tagbase
DB.
properties:
code:
description: HTTP status code
example: "200"
type: string
elapsed:
description: Elapsed time for the operation
type: string
message:
description: A string detailing specifics of an HTTP operation
example: Data file eTUFF-sailfish-117259.txt successfully ingested into
Tagbase DB.
type: string
title: Ingest200
type: object
Metadata:
description: Contains the ingested tag metadata consistent with the eTUFF specification
example:
person_owner: John Do
owner_contect: [email protected]
manufacturer: telemetry inc.
model: new_gen
attachment_method: anchor
type: object
additionalProperties:
type: string
Tag200:
description: Information for a given tag
example:
tag:
- dataset_id: 1
date_time: '2022-04-01T04:58:21.319061+00:00'
filename: 'eTUFF-sailfish-117259_2.txt'
hash_sha256: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b977'
metadata:
person_owner: John Do
owner_contect: [email protected]
manufacturer: telemetry inc.
model: new_gen
attachment_method: anchor
notes: 'Ingested by admin on 2022-06-01 for Sailfish tagging campaign.'
submission_id: 5
tag_id: 3
version: '1'
- dataset_id: 1
date_time: '2022-06-01T05:39:46.896088+00:00'
filename: 'eTUFF-sailfish-117259_2.txt'
hash_sha256: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
metadata:
person_owner: Jane Do
owner_contect: [email protected]
manufacturer: telemetry inc.
model: newer_gen
attachment_method: anchor
notes: 'Ingested by admin on 2022-06-01 for version 2 of the Sailfish tagging campaign.'
submission_id: 6
tag_id: 3
version: '2'
properties:
tag:
description: List containing one or more submissions for a given tag
items:
$ref: '#/components/schemas/TagSubmission'
minItems: 1
maxItems: 100
type: array
title: Tag200
type: object
TagPut200:
description: HTTP 200 success response
example:
code: "200"
message: Tag '1' submission '5' successfully updated.
properties:
code:
description: HTTP status code
example: "200"
type: string
message:
description: A string detailing specifics of an HTTP operation
example: Tag '1' submission '5' successfully updated.
type: string
title: TagPut200
type: object
Tag:
description: Unique numeric Tag ID associated with the ingested tag eTUFF data file
example:
tag_id: 1
filename: eTUFF-sailfish-117259_2.txt
properties:
tag_id:
$ref: '#/components/schemas/tag_id'
filename:
$ref: '#/components/schemas/filename'
type: object
TagSubmission:
type: object
properties:
dataset_id:
description: The primary key from the Dataset relation
example: 1
type: integer
date_time:
description: Local datetime stamp at the time of eTUFF tag data file ingestion
example: '2022-04-01T04:58:21.319061+00:00'
#format: date
#pattern: '^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(([+-]\d\d:\d\d)|Z)?$'
type: string
filename:
$ref: '#/components/schemas/filename'
hash_sha256:
description: SHA256 hash representing the contents of the submission eTUFF file
example: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
type: string
metadata:
$ref: '#/components/schemas/Metadata'
notes:
description: Free-form text field where details of submitted eTUFF file for ingest can be provided e.g. submitter name, etuff data contents (tag metadata and measurements + primary position data, or just secondary solutionpositional meta/data)
example: "Ingested by admin on XXXX-XX-XX to back-process campaign XYZ."
type: string
submission_id:
description: Unique numeric ID assigned upon submission of a tag eTUFF data file for ingest/importation into Tagbase
example: 5
type: integer
tag_id:
$ref: '#/components/schemas/tag_id'
version:
description: Version identifier for the eTUFF tag data file ingested
example: "1"
type: string
Tags200:
description: Response detailing all available unique tags and associated filename
example:
count: 2
tags:
- tag_id: 1
filename: eTUFF-sailfish-117259_2.txt
- tag_id: 2
filename: eTUFF-sailfish-117259.txt
properties:
count:
description: Total count of unique tags
example: 2
type: integer
tags:
description: List of unique numeric Tag IDs and associated filename
type: array
items:
$ref: '#/components/schemas/Tag'
minItems: 1
maxItems: 100000
title: Tags200
type: object