-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
521 lines (521 loc) · 14.8 KB
/
openapi.yaml
File metadata and controls
521 lines (521 loc) · 14.8 KB
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
components:
schemas:
BoxWithExpiration:
description: A model describing a research data upload box with an expiration
date.
properties:
description:
anyOf:
- type: string
- type: 'null'
description: The description of the upload box.
title: Description
expires:
description: The expiration date of access to the research data upload box.
format: date-time
title: Expires
type: string
file_upload_box_id:
description: The ID of the file upload box. This is the ID referenced by
the Connector.
format: uuid4
title: File Upload Box Id
type: string
id:
description: The ID of the full research data upload box. This is the ID
tied to upload claims.
format: uuid4
title: Id
type: string
title:
description: The title of the upload box.
title: Title
type: string
required:
- id
- file_upload_box_id
- title
- expires
title: BoxWithExpiration
type: object
Dataset:
additionalProperties: false
description: A model describing a dataset.
properties:
description:
anyOf:
- type: string
- type: 'null'
description: The description of the dataset.
title: Description
files:
description: Files contained in the dataset.
items:
$ref: '#/components/schemas/DatasetFile'
title: Files
type: array
id:
description: ID of the dataset
title: Id
type: string
stage:
$ref: '#/components/schemas/WorkPackageType'
description: Current stage of this dataset.
title:
description: The title of the dataset.
title: Title
type: string
required:
- id
- stage
- title
- description
- files
title: Dataset
type: object
DatasetFile:
additionalProperties: false
description: A file as that is part of a dataset.
properties:
accession:
description: The file accession.
pattern: ^GHGAF.+
title: Accession
type: string
extension:
description: The file extension with a leading dot.
title: Extension
type: string
required:
- accession
- extension
title: DatasetFile
type: object
DatasetWithExpiration:
additionalProperties: false
description: A model describing a dataset with an expiration date.
properties:
description:
anyOf:
- type: string
- type: 'null'
description: The description of the dataset.
title: Description
expires:
description: The expiration date of access to the dataset.
format: date-time
title: Expires
type: string
files:
description: Files contained in the dataset.
items:
$ref: '#/components/schemas/DatasetFile'
title: Files
type: array
id:
description: ID of the dataset
title: Id
type: string
stage:
$ref: '#/components/schemas/WorkPackageType'
description: Current stage of this dataset.
title:
description: The title of the dataset.
title: Title
type: string
required:
- id
- stage
- title
- description
- files
- expires
title: DatasetWithExpiration
type: object
UploadWorkOrderTokenRequest:
description: Request model for creating upload-path work order tokens.
properties:
alias:
anyOf:
- type: string
- type: 'null'
description: File alias (required for CREATE work type)
title: Alias
file_id:
anyOf:
- format: uuid4
type: string
- type: 'null'
description: File ID (required for UPLOAD, CLOSE, DELETE work types)
title: File Id
work_type:
anyOf:
- const: create
type: string
- const: upload
type: string
- const: close
type: string
- const: delete
type: string
- const: view
type: string
description: The type of work order token to create
title: Work Type
required:
- work_type
title: UploadWorkOrderTokenRequest
type: object
WorkPackageCreationData:
additionalProperties: false
description: All data necessary to create a work package.
properties:
dataset_id:
anyOf:
- type: string
- type: 'null'
description: ID of the dataset (for download work packages)
title: Dataset Id
file_ids:
anyOf:
- items:
type: string
type: array
- type: 'null'
description: IDs of all included files. If None, all files of the dataset
are assumed as target.
title: File Ids
research_data_upload_box_id:
anyOf:
- format: uuid4
type: string
- type: 'null'
description: ID of the research data upload box (for upload work packages)
title: Research Data Upload Box Id
type:
$ref: '#/components/schemas/WorkPackageType'
description: The work package type
user_public_crypt4gh_key:
description: The user's public Crypt4GH key in base64 encoding
title: User Public Crypt4Gh Key
type: string
required:
- type
- user_public_crypt4gh_key
title: WorkPackageCreationData
type: object
WorkPackageCreationResponse:
description: Response when a work package has been created.
properties:
expires:
description: The expiration date of the work package access token
format: date-time
title: Expires
type: string
id:
description: ID of the work package
title: Id
type: string
token:
description: The work package access token, encrypted with the user's public
Crypt4GH key
title: Token
type: string
required:
- id
- token
- expires
title: WorkPackageCreationResponse
type: object
WorkPackageDetails:
description: Details about the work package that can be requested.
properties:
created:
description: Creation date of the work package
format: date-time
title: Created
type: string
expires:
format: date-time
title: Expiration date of the work package
type: string
file_upload_box_id:
anyOf:
- format: uuid4
type: string
- type: 'null'
description: ID of the file upload box (for upload work packages)
title: File Upload Box Id
files:
anyOf:
- additionalProperties:
type: string
type: object
- type: 'null'
description: IDs of all included files mapped to their file extensions (None
for upload work packages)
examples:
- GHGAF01: .json
GHGAF02: .csv
title: Files
research_data_upload_box_id:
anyOf:
- format: uuid4
type: string
- type: 'null'
description: ID of the research data upload box (for upload work packages)
title: Research Data Upload Box Id
type:
$ref: '#/components/schemas/WorkPackageType'
description: The work package type
required:
- type
- created
- expires
title: WorkPackageDetails
type: object
WorkPackageType:
description: The type of work that a work package describes.
enum:
- download
- upload
title: WorkPackageType
type: string
securitySchemes:
HTTPBearer:
scheme: bearer
type: http
info:
description: A service managing work packages for the GHGA CLI
title: Work Package Service
version: 10.0.0
openapi: 3.1.0
paths:
/health:
get:
description: Used to test if this service is alive
operationId: health_health_get
responses:
'200':
content:
application/json:
schema: {}
description: Successful Response
summary: health
tags:
- WorkPackages
/users/{user_id}/boxes:
get:
description: Endpoint used to get details for all upload boxes that are accessible
to the given user, along with the access expiration date.
operationId: get_upload_boxes
parameters:
- in: path
name: user_id
required: true
schema:
format: uuid4
title: User Id
type: string
responses:
'200':
content:
application/json:
schema:
items:
$ref: '#/components/schemas/BoxWithExpiration'
title: Response 200 Get Upload Boxes
type: array
description: Upload boxes have been fetched.
'401':
description: Not authenticated.
'403':
description: Not authorized to get upload boxes.
'422':
description: Validation error in submitted user data.
security:
- HTTPBearer: []
summary: Get all accessible upload boxes and access expiry for the given user
tags:
- UploadBoxes
- upload
/users/{user_id}/datasets:
get:
description: Endpoint used to get details for all datasets that are accessible
to the given user including their expiration dates.
operationId: get_datasets
parameters:
- in: path
name: user_id
required: true
schema:
format: uuid4
title: User Id
type: string
responses:
'200':
content:
application/json:
schema:
items:
$ref: '#/components/schemas/Dataset'
title: Response 200 Get Datasets
type: array
description: Datasets have been fetched.
'401':
description: Not authenticated.
'403':
description: Not authorized to get datasets.
'422':
description: Validation error in submitted user data.
security:
- HTTPBearer: []
summary: Get all datasets of the given user
tags:
- Datasets
- download
/work-packages:
post:
description: Endpoint used to create a new work package
operationId: create_work_package
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/WorkPackageCreationData'
required: true
responses:
'201':
content:
application/json:
schema:
$ref: '#/components/schemas/WorkPackageCreationResponse'
description: Work package was successfully created.
'401':
description: Not authenticated.
'403':
description: Not authorized to create a work package.
'422':
description: Validation error in submitted user data.
security:
- HTTPBearer: []
summary: Create a work package
tags:
- WorkPackages
/work-packages/{work_package_id}:
get:
description: Endpoint used to get work package details
operationId: get_work_package
parameters:
- in: path
name: work_package_id
required: true
schema:
format: uuid4
title: Work Package Id
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WorkPackageDetails'
description: Work package details have been found.
'401':
description: Not authenticated.
'403':
description: Not authorized to get the work package.
'422':
description: Validation error in submitted user data.
security:
- HTTPBearer: []
summary: Get a work package
tags:
- WorkPackages
/work-packages/{work_package_id}/boxes/{box_id}/work-order-tokens:
post:
description: Endpoint used to create a work order token for uploading a single
file
operationId: create_upload_work_order_token
parameters:
- in: path
name: work_package_id
required: true
schema:
format: uuid4
title: Work Package Id
type: string
- in: path
name: box_id
required: true
schema:
format: uuid4
title: Box Id
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UploadWorkOrderTokenRequest'
required: true
responses:
'201':
content:
application/json:
schema: {}
description: Work order token has been created.
'403':
description: Not authorized to create the work order token.
'422':
description: Validation error in submitted user data.
security:
- HTTPBearer: []
summary: Create a work order token for file upload operations
tags:
- WorkPackages
- upload
/work-packages/{work_package_id}/files/{accession}/work-order-tokens:
post:
description: Endpoint used to create a work order token for downloading a single
file
operationId: create_download_work_order_token
parameters:
- in: path
name: work_package_id
required: true
schema:
format: uuid4
title: Work Package Id
type: string
- in: path
name: accession
required: true
schema:
title: Accession
type: string
responses:
'201':
content:
application/json:
schema: {}
description: Work order token has been created.
'401':
description: Not authenticated.
'403':
description: Not authorized to create the work order token.
'422':
description: Validation error in submitted user data.
security:
- HTTPBearer: []
summary: Create a work order token for file download operations
tags:
- WorkPackages
- download
servers:
- url: ''
tags:
- name: WorkPackages
- name: Datasets
- name: UploadBoxes
- name: download
- name: upload