-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathingest_openapi.yaml
708 lines (707 loc) · 20.8 KB
/
ingest_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
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
openapi: 3.0.0
info:
version: v1.0.0
title: 'CanDIGv2 Ingest Service'
description: 'API for ingesting data into the CanDIG stack'
paths:
/service-info:
get:
summary: Retrieve information about this service
description: Returns information about the ingest service
operationId: ingest_operations.get_service_info
responses:
200:
description: Retrieve info about the ingest service
content:
application/json:
schema:
type: object
/s3-credential:
post:
summary: Add credentials for an S3 bucket
description: Add credentials for an S3 bucket
operationId: ingest_operations.add_s3_credential
requestBody:
$ref: '#/components/requestBodies/S3CredentialRequest'
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/s3-credential/endpoint/{endpoint_id}/bucket/{bucket_id}:
parameters:
- in: path
name: endpoint_id
schema:
type: string
required: true
- in: path
name: bucket_id
schema:
type: string
required: true
get:
summary: get credentials for an S3 bucket
description: get credentials for an S3 bucket
operationId: ingest_operations.get_s3_credential
responses:
200:
description: Success
content:
application/json:
schema:
type: object
delete:
summary: delete credentials for an S3 bucket
description: delete credentials for an S3 bucket
operationId: ingest_operations.delete_s3_credential
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/site-role/{role_type}:
parameters:
- in: path
name: role_type
schema:
type: string
required: true
get:
summary: List users in role_type
description: List users in role_type
operationId: ingest_operations.list_role
responses:
200:
description: Success
content:
application/json:
schema:
type: object
post:
summary: Assign users to role
description: Assign users to role
operationId: ingest_operations.update_role
requestBody:
$ref: "#/components/requestBodies/RoleTypeRequest"
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/site-role/{role_type}/email/{email}:
parameters:
- in: path
name: role_type
schema:
type: string
required: true
- in: path
name: email
schema:
type: string
required: true
get:
summary: Is user in this role?
description: Is user in this role?
operationId: ingest_operations.is_user_in_role
responses:
200:
description: Success
content:
application/json:
schema:
type: boolean
post:
summary: Assign user to role
description: Assign user to role
operationId: ingest_operations.add_user_to_role
responses:
200:
description: Success
content:
application/json:
schema:
type: object
delete:
summary: Remove user from role
description: Remove user from role
operationId: ingest_operations.remove_user_from_role
responses:
200:
description: Success
content:
application/json:
schema:
type: object
404:
description: User not found in role
content:
application/json:
schema:
type: object
405:
description: Can't remove user from role
content:
application/json:
schema:
type: object
/program:
post:
summary: Add authorization information for a new program
description: Add authorization information for a new program
operationId: ingest_operations.add_program_authorization
requestBody:
$ref: '#/components/requestBodies/ProgramAuthorizationRequest'
responses:
200:
description: Success
content:
application/json:
schema:
type: object
get:
summary: List registered programs
description: List programs authorized on server
operationId: ingest_operations.list_program_authorizations
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/program/{program_id}:
parameters:
- in: path
name: program_id
schema:
type: string
required: true
get:
summary: Get authorization information for a program
description: Get authorization information for a program
operationId: ingest_operations.get_program_authorization
responses:
200:
description: Success
content:
application/json:
schema:
type: object
delete:
description: Delete a program
operationId: ingest_operations.remove_program
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/user/pending/request:
post:
summary: Add pending user
description: Add the user specified in the Bearer jwt to the pending users list
operationId: ingest_operations.add_pending_user
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/user/pending:
get:
summary: List pending users
description: List pending users for authorization
operationId: ingest_operations.list_pending_users
responses:
200:
description: Success
content:
application/json:
schema:
type: object
post:
summary: Approve pending users
description: Approve bulk pending users for CanDIG access
operationId: ingest_operations.approve_pending_users
requestBody:
$ref: '#/components/requestBodies/PendingUsersAuthorizationRequest'
responses:
200:
description: Success
content:
application/json:
schema:
type: object
delete:
summary: Delete pending users
description: Clear pending users for CanDIG access
operationId: ingest_operations.clear_pending_users
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/user/pending/{user_id}:
parameters:
- in: path
name: user_id
schema:
type: string
required: true
post:
summary: Approve pending user
description: Approve a pending user for CanDIG access
operationId: ingest_operations.approve_pending_user
responses:
200:
description: Success
content:
application/json:
schema:
type: object
delete:
summary: Reject pending user
description: Reject a pending user for CanDIG access
operationId: ingest_operations.reject_pending_user
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/user/{user_id}/authorize:
parameters:
- in: path
name: user_id
schema:
type: string
required: true
description: The user ID to check. If "me", return information about the requesting user
get:
summary: List program authorizations
description: List authorizations for programs for a user
operationId: ingest_operations.list_programs_for_user
responses:
200:
description: Success
content:
application/json:
schema:
type: object
post:
summary: Authorize a program for a user
description: Authorize a program for a user (or update a program auth for a user)
operationId: ingest_operations.authorize_program_for_user
requestBody:
$ref: '#/components/requestBodies/UserProgramAuthorizationRequest'
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/user/{user_id}/authorize/{program_id}:
parameters:
- in: path
name: user_id
schema:
type: string
required: true
- in: path
name: program_id
schema:
type: string
required: true
get:
summary: Get program authorization for a user
description: Get authorization for a program for a user
operationId: ingest_operations.get_program_for_user
responses:
200:
description: Success
content:
application/json:
schema:
type: object
delete:
summary: Remove a program authorization for a user
description: Remove a program for a user
operationId: ingest_operations.remove_program_for_user
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/genomic:
post:
summary: Ingest Genomic data
description: Add linkages between clinical donors and genomic data.
operationId: ingest_operations.add_genomic_linkages
parameters:
- name: do_not_index
in: query
required: false
schema:
type: boolean
description: set to true to prevent indexing of genomic files
requestBody:
$ref: '#/components/requestBodies/GenomicIngestRequest'
responses:
200:
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/IngestResponse"
/clinical:
post:
summary: Ingest Clinical data
description: Add a list of donors with clinical data produced by the clinical ETL.
operationId: ingest_operations.add_clinical_donors
parameters:
- name: batch_size
in: query
required: false
schema:
type: integer
description: Number of items to be processed in one batch
requestBody:
$ref: "#/components/requestBodies/ClinicalDonorRequest"
responses:
200:
description: Success
content:
application/json:
schema:
$ref: "#/components/schemas/IngestResponse"
/status/{queue_id}:
parameters:
- in: path
name: queue_id
schema:
type: string
required: true
get:
summary: Check status of ingest
description: Return status of ingest operation
operationId: ingest_operations.get_ingest_status
responses:
200:
description: Success
content:
application/json:
schema:
type: object
/get-token:
get:
summary: Get a new token
description: Exchange the refresh token implicit in the request for a new one
operationId: ingest_operations.get_token
responses:
200:
description: Success
content:
application/json:
schema:
type: object
components:
requestBodies:
S3CredentialRequest:
content:
'application/json':
schema:
type: object
properties:
endpoint:
type: string
description: URL to the endpoint
pattern: (https*):\/\/(.+)
example: http://candig.docker.internal:9000
bucket:
type: string
description: name of the bucket
access_key:
type: string
description: access key for the bucket
secret_key:
type: string
description: secret key for the bucket
required:
- endpoint
- bucket
- access_key
- secret_key
GenomicIngestRequest:
content:
'application/json':
schema:
type: array
items:
$ref: "#/components/schemas/GenomicSample"
ClinicalDonorRequest:
content:
'application/json':
schema:
$ref: "#/components/schemas/ClinicalDonor"
ProgramAuthorizationRequest:
content:
'application/json':
schema:
$ref: "#/components/schemas/ProgramAuthorization"
PendingUsersAuthorizationRequest:
content:
'application/json':
schema:
type: array
items:
type: string
RoleTypeRequest:
content:
'application/json':
schema:
type: array
items:
type: string
UserProgramAuthorizationRequest:
content:
'application/json':
schema:
$ref: "#/components/schemas/Program"
schemas:
ClinicalDonor:
type: object
properties:
openapi_url:
type: string
description: URL of schema used to generate this mapping
donors:
type: array
items:
type: object
description: A DonorWithClinicalData object, as specified in the schema in openapi_url
katsu_sha:
type: string
description: the SHA of the version of Katsu used to generate the schema.
statistics:
$ref: "#/components/schemas/Statistics"
Statistics:
type: object
properties:
required_but_missing:
type: object
description: for each schema, a count of required fields that are present vs missing
schemas_used:
type: array
description: a list of schemas used in this dataset
items:
type: string
cases_missing_data:
type: array
description: a list of cases that have missing data
items:
type: string
schemas_not_used:
type: array
description: a list of schemas that are never used in this dataset
items:
type: string
summary_cases:
type: object
description: overall completeness counts
properties:
complete_cases:
type: integer
description: how many cases have complete data
total_cases:
type: integer
description: how many cases are in this dataset
IngestResponse:
type: object
properties:
queue_id:
type: string
description: Queue ID to get status of ingest
warnings:
type: array
items:
type: string
GenomicSample:
type: object
properties:
program_id:
type: string
description: Name of the program this sample belongs to. The user must be authorized to add data to this program.
genomic_file_id:
type: string
description: A unique name for this genomic data resource
example: "HG00096.vcf"
metadata:
type: object
description: Additional data that describes the genomic resource
properties:
sequence_type:
type: string
description: type of data sequenced (whole genome or whole transcriptome)
enum:
- wgs
- wts
default: wgs
data_type:
type: string
description: type of data represented in the resource (variant or read)
enum:
- variant
- read
reference:
type: string
description: which reference genome was used for alignment (hg37 or hg38)
enum:
- hg37
- hg38
default: hg38
required:
- sequence_type
- data_type
- reference
main:
$ref: "#/components/schemas/File"
index:
$ref: "#/components/schemas/File"
samples:
type: array
description: An array of links between donor data (e.g. MoH Sample Registrations) and the samples in the genomic data resource
items:
$ref: "#/components/schemas/SampleLink"
required:
- program_id
- genomic_file_id
- metadata
- main
- index
- samples
File:
type: object
description: Object describing a file
properties:
name:
type: string
description: name of the file, including all extensions
access_method:
type: string
description: fully-described URI to the file
oneOf:
- $ref: "#/components/schemas/S3Access"
- $ref: "#/components/schemas/FileAccess"
required:
- name
- access_method
FileAccess:
type: string
description: an absolute path to a local file on the HTSGet server itself, expressed as a file URI
pattern: file:\/\/\/(.+)
example: file:///data/samples/HG00096.vcf.gz
S3Access:
type: string
description: |
a description of an S3 URI. NB: even though the s3 prefix is incorrect, we allow it in parsing so that we can give better feedback to the user if a url is provided in that form.
pattern: (https*|s3):\/\/(.+)\/(.+)\/(.+)
example: http://s3.us-east-1.amazonaws.com/1000genomes/HG00096.vcf.gz
SampleLink:
type: object
description: Link between donor data (e.g. MoH Sample Registrations) and the samples in the genomic data resource
properties:
submitter_sample_id:
type: string
description: the name of the sample as listed in the linked donor data
example: sample_registration_id_1
genomic_file_sample_id:
type: string
description: the name of the sample in the genomic data resource
example: TUMOUR/NORMAL/PROGRAM_SAMPLE_REGISTRATION_ID_1
required:
- submitter_sample_id
- genomic_file_sample_id
ProgramAuthorization:
type: object
description: Describes who is allowed to access a program
properties:
program_id:
type: string
description: name of the program
program_curators:
type: array
description: list of users who are program curators for this program
items:
type: string
team_members:
type: array
description: list of users who are original researchers for this program
items:
type: string
creation_date:
type: string
description: date program was created, for embargo purposes. This may or may not be the date of ingest.
required:
- program_id
- program_curators
- team_members
Program:
type: object
properties:
program_id:
type: string
start_date:
type: string
end_date:
type: string
required:
- program_id
- start_date
- end_date
User:
type: object
description: describes an authenticated user
properties:
sample_jwt:
type: string
description: a sample jwt for this user from their IDP
user_name:
type: string
description: unique id of user, from CANDIG_USER_KEY field
required:
- user_name
PendingUsers:
type: array
description: a list of Users that are pending approval for access to this CanDIG node
items:
$ref: "#/components/schemas/User"
UserProgramAuthorization:
type: object
description: describes an authorized user and the programs the user is authorized to view
properties:
user:
$ref: "#/components/schemas/User"
programs:
type: array
description: list of programs that this user is authorized to view
items:
$ref: "#/components/schemas/Program"
required:
- user
- programs