generated from ghga-de/microservice-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
openapi.yaml
284 lines (284 loc) · 8.09 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
components:
schemas:
AccessRequest:
additionalProperties: false
description: An access request including a unique identifier.
properties:
access_ends:
description: Requested end date of access
format: date-time
title: Access Ends
type: string
access_starts:
description: Requested start date of access
format: date-time
title: Access Starts
type: string
changed_by:
anyOf:
- type: string
- type: 'null'
description: The ID of the data steward who made the status change
title: Changed By
dataset_id:
description: ID of the dataset for which access is requested
pattern: ^[A-Z]{1,6}[0-9]{3,18}$
title: Dataset Id
type: string
email:
description: Contact e-mail address of the requester
title: Email
type: string
full_user_name:
description: The requester's full name including academic title
title: Full User Name
type: string
id:
description: ID of the access request
title: Id
type: string
iva_id:
anyOf:
- type: string
- type: 'null'
description: ID of the IVA to be used for this request, but this can also
be specified later
title: Iva Id
request_created:
description: Creation date of the access request
format: date-time
title: Request Created
type: string
request_text:
description: Text note submitted with the request
title: Request Text
type: string
status:
$ref: '#/components/schemas/AccessRequestStatus'
default: pending
description: The status of this access request
status_changed:
anyOf:
- format: date-time
type: string
- type: 'null'
description: Last change date of the status of this request
title: Status Changed
user_id:
description: ID of the user who requests access
title: User Id
type: string
required:
- user_id
- dataset_id
- email
- request_text
- access_starts
- access_ends
- full_user_name
- request_created
- id
title: AccessRequest
type: object
AccessRequestCreationData:
additionalProperties: false
description: All data necessary to create an access request.
properties:
access_ends:
description: Requested end date of access
format: date-time
title: Access Ends
type: string
access_starts:
description: Requested start date of access
format: date-time
title: Access Starts
type: string
dataset_id:
description: ID of the dataset for which access is requested
pattern: ^[A-Z]{1,6}[0-9]{3,18}$
title: Dataset Id
type: string
email:
description: Contact e-mail address of the requester
title: Email
type: string
iva_id:
anyOf:
- type: string
- type: 'null'
description: ID of the IVA to be used for this request, but this can also
be specified later
title: Iva Id
request_text:
description: Text note submitted with the request
title: Request Text
type: string
user_id:
description: ID of the user who requests access
title: User Id
type: string
required:
- user_id
- dataset_id
- email
- request_text
- access_starts
- access_ends
title: AccessRequestCreationData
type: object
AccessRequestPatchData:
additionalProperties: false
description: All data that describes an access request patch.
properties:
iva_id:
anyOf:
- type: string
- type: 'null'
description: ID of the IVA to be used for this request
title: Iva Id
status:
$ref: '#/components/schemas/AccessRequestStatus'
description: The new status of this access request
required:
- status
title: AccessRequestPatchData
type: object
AccessRequestStatus:
description: The status of an access request.
enum:
- allowed
- denied
- pending
title: AccessRequestStatus
type: string
securitySchemes:
HTTPBearer:
scheme: bearer
type: http
info:
description: A service managing access requests for the GHGA Data Portal
title: Access Request Service
version: 2.0.5
openapi: 3.1.0
paths:
/access-requests:
get:
description: Endpoint used to get existing access requests
operationId: get_access_request
parameters:
- in: query
name: dataset_id
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: Dataset Id
- in: query
name: user_id
required: false
schema:
anyOf:
- type: string
- type: 'null'
title: User Id
- in: query
name: status
required: false
schema:
anyOf:
- $ref: '#/components/schemas/AccessRequestStatus'
- type: 'null'
title: Status
responses:
'200':
content:
application/json:
schema:
items:
$ref: '#/components/schemas/AccessRequest'
title: Response 200 Get Access Request
type: array
description: Access requests have been fetched.
'403':
description: Not authorized to get access requests.
'422':
description: Validation error in submitted parameters.
security:
- HTTPBearer: []
summary: Get access requests
tags:
- AccessRequests
post:
description: Endpoint used to create a new access request
operationId: create_access_request
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AccessRequestCreationData'
required: true
responses:
'201':
content:
application/json:
schema:
title: Response 201 Create Access Request
type: string
description: Access request was successfully created
'403':
description: Not authorized to create an access request.
'422':
description: Validation error in submitted data.
security:
- HTTPBearer: []
summary: Create an access request
tags:
- AccessRequests
/access-requests/{access_request_id}:
patch:
description: Endpoint used to set the status of an access request
operationId: patch_access_request
parameters:
- in: path
name: access_request_id
required: true
schema:
title: Access Request Id
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AccessRequestPatchData'
required: true
responses:
'204':
description: Status was successfully changed
'403':
description: Not authorized to create an access request.
'404':
description: Access request does not exist.
'422':
description: Validation error in submitted data.
security:
- HTTPBearer: []
summary: Set status of an access request
tags:
- AccessRequests
/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:
- AccessRequests
tags:
- name: AccessRequests