generated from ghga-de/microservice-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathopenapi.yaml
280 lines (280 loc) · 7.58 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
components:
schemas:
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/WorkType'
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:
extension:
description: The file extension with a leading dot.
title: Extension
type: string
id:
description: The file ID.
title: Id
type: string
required:
- id
- extension
title: DatasetFile
type: object
WorkPackageCreationData:
additionalProperties: false
description: All data necessary to create a work package.
properties:
dataset_id:
title: Dataset Id
type: string
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
type:
$ref: '#/components/schemas/WorkType'
user_public_crypt4gh_key:
description: The user's public Crypt4GH key in base64 encoding
title: User Public Crypt4Gh Key
type: string
required:
- dataset_id
- type
- user_public_crypt4gh_key
title: WorkPackageCreationData
type: object
WorkPackageCreationResponse:
description: Response when a work package has been created.
properties:
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
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
files:
additionalProperties:
type: string
description: IDs of all included files mapped to their file extensions
examples:
- file-id-1: .json
file-id-2: .csv
title: Files
type: object
type:
$ref: '#/components/schemas/WorkType'
required:
- type
- files
- created
- expires
title: WorkPackageDetails
type: object
WorkType:
description: The type of work that a work package describes.
enum:
- download
- upload
title: WorkType
type: string
securitySchemes:
HTTPBearer:
scheme: bearer
type: http
info:
description: A service managing work packages for the GHGA CLI
title: Work Package Service
version: 3.0.1
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}/datasets:
get:
description: Endpoint used to get details for all datasets that are accessible
to the given user
operationId: get_datasets
parameters:
- in: path
name: user_id
required: true
schema:
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.
'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
/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.
'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:
title: Work Package Id
type: string
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/WorkPackageDetails'
description: Work package details have been found.
'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}/files/{file_id}/work-order-tokens:
post:
description: Endpoint used to create a work order token
operationId: create_work_order_token
parameters:
- in: path
name: work_package_id
required: true
schema:
title: Work Package Id
type: string
- in: path
name: file_id
required: true
schema:
title: File Id
type: string
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
tags:
- WorkPackages
servers:
- url: ''
tags:
- name: WorkPackages
- name: Datasets