-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmission-management.yaml
More file actions
454 lines (449 loc) · 17.5 KB
/
Copy pathadmission-management.yaml
File metadata and controls
454 lines (449 loc) · 17.5 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
openapi: "3.0.0"
info:
description: "This is the Admission API for UC4."
version: "0.17.1"
title: "UC4"
servers:
- url: https://uc4.cs.upb.de/api/experimental/admission-management
- url: https://uc4.cs.upb.de/api/develop/admission-management
- url: https://uc4.cs.upb.de/api/production/admission-management
tags:
- name: "Version Management"
description: "Everything about the Version"
externalDocs:
description: "Find out more"
url: "https://github.com/upb-uc4"
- name: "Admission Management"
description: "Everything about the Admissions"
externalDocs:
description: "Find out more"
url: "https://github.com/upb-uc4"
- name: "Course Admission Management"
description: "Everything about the Course Admissions"
externalDocs:
description: "Find out more"
url: "https://github.com/upb-uc4"
- name: "Exam Admission Management"
description: "Everything about the Exam Admissions"
externalDocs:
description: "Find out more"
url: "https://github.com/upb-uc4"
paths:
/version:
get:
tags:
- "Version Management"
summary: "Get version"
description: "Returns the version of the current service"
operationId: "getVersion"
responses:
"200":
description: "OK"
content:
application/json:
schema:
$ref: '#/components/schemas/JsonServiceVersion'
/version/hyperledger:
get:
tags:
- "Version Management"
summary: "Get Hyperledger version"
description: "Returns the version of the current hyperledger backend"
operationId: "getVersionHyperledger"
responses:
"200":
description: "OK"
content:
application/json:
schema:
$ref: '#/components/schemas/JsonHyperledgerVersion'
/admissions/unsigned_add_proposal:
post:
tags:
- "Admission Management"
summary: "Fetch a proposal for admitting a student to a course or an exam"
description: "Fetch a proposal for admitting the student to either the course or the exam specified by the object. AdmissionId, EnrollmentID and timestamp will be set in the returned proposal. Only invokable by Students."
operationId: "getProposalAddAdmission"
security:
- uc4_token_login: []
- uc4_token_login_header: []
requestBody:
description: "Admission object from which the proposal is constructed"
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CourseAdmission'
examples:
AddCourseAdmission:
$ref: '#/components/examples/ExampleCourseAdmissionPost'
AddExamAdmission:
$ref: '#/components/examples/ExampleExamAdmissionPost'
responses:
"200":
description: "OK"
content:
application/json:
schema:
$ref: '#/components/schemas/UnsignedProposal'
examples:
ExampleUnsignedProposal:
$ref: '#/components/examples/ExampleUnsignedProposal'
headers:
Location:
schema:
type: string
description: "URI of the newly created Admission"
"400":
description: |
Bad Request
types: MalformedLoginToken, Deserialization, JsonValidation, MultipleAuthorizationError
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/GenericError'
- $ref: '#/components/schemas/DetailedError'
"401":
description: |
Unauthorized
types: JwtAuthorization, LoginTokenExpired
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"403":
description: |
Forbidden
types: NotEnoughPrivileges, OwnerMismatch
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"422":
description: |
Unprocessable Entity
types: Validation, ValidationTimeout, LoginTokenSignatureInvalid
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/GenericError'
- $ref: '#/components/schemas/DetailedError'
/admissions/unsigned_drop_proposal:
post:
tags:
- "Admission Management"
summary: "Fetch a proposal for dropping an Admission"
description: "Fetch a proposal for dropping an Admission, using the parameters in the body."
security:
- uc4_token_login: []
- uc4_token_login_header: []
operationId: "getProposalDropAdmission"
requestBody:
description: "DropAdmission object, containing the AdmissionId of the admission to drop."
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DropAdmission'
responses:
"200":
description: "OK"
content:
application/json:
schema:
$ref: '#/components/schemas/UnsignedProposal'
examples:
ExampleUnsignedProposal:
$ref: '#/components/examples/ExampleUnsignedProposal'
"400":
description: |
Bad Request
types: MalformedLoginToken, MultipleAuthorizationError
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"401":
description: |
Unauthorized
types: JwtAuthorization, LoginTokenExpired
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"403":
description: |
Forbidden
types: NotEnoughPrivileges, OwnerMismatch
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"404":
description: |
Not Found
types: KeyNotFound
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"422":
description: |
Unprocessable Entity
types: LoginTokenSignatureInvalid
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
/admissions/courses:
get:
tags:
- "Course Admission Management"
summary: "Get All Course Admissions"
description: "When invoked by an Admin and without query parameters, returns all Course Admissions. When invoked with query parameters, returns Course Admissions filtered by the parameters."
operationId: "getAllCourseAdmissions"
parameters:
- name: "username"
in: "query"
description: "Username for which to fetch the course admissions"
required: false
schema:
type: "string"
- name: "courseId"
in: "query"
description: "CourseId for which to fetch the course admissions"
required: false
schema:
type: "string"
- name: "moduleId"
in: "query"
description: "ModuleId for which to fetch the course admissions"
required: false
schema:
type: "string"
responses:
"200":
description: "OK"
content:
application/json:
schema:
type: "array"
items:
$ref: '#/components/schemas/CourseAdmission'
examples:
GetCourseAdmission:
$ref: '#/components/examples/ExampleCourseAdmissionGet'
"400":
description: |
Bad Request
types: MalformedLoginToken, MultipleAuthorizationError
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"401":
description: |
Unauthorized
types: JwtAuthorization, LoginTokenExpired
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"403":
description: |
Forbidden
types: NotEnoughPrivileges, OwnerMismatch
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"422":
description: |
Unprocessable Entity
types: LoginTokenSignatureInvalid
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
/admissions/exams:
get:
tags:
- "Exam Admission Management"
summary: "Get All Exam Admissions"
description: "When invoked by an Admin and without query parameters, returns all Exam Admissions. When invoked with query parameters, returns Exam Admissions filtered by the parameters."
operationId: "getAllExamAdmissions"
parameters:
- name: "username"
in: "query"
description: "Username, whose enrollmentId to filter by"
required: false
schema:
type: "string"
- name: "admissionIds"
in: "query"
description: "Comma separated list of AdmissionIds to filter by"
required: false
schema:
type: "string"
- name: "examIds"
in: "query"
description: "Comma separated list of examIds to filter by"
required: false
schema:
type: "string"
responses:
"200":
description: "OK"
content:
application/json:
schema:
type: "array"
items:
$ref: '#/components/schemas/ExamAdmission'
examples:
GetExamAdmission:
$ref: '#/components/examples/ExampleExamAdmissionGet'
"400":
description: |
Bad Request
types: MalformedLoginToken, MultipleAuthorizationError
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"401":
description: |
Unauthorized
types: JwtAuthorization, LoginTokenExpired
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"403":
description: |
Forbidden
types: NotEnoughPrivileges, OwnerMismatch
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
"422":
description: |
Unprocessable Entity
types: LoginTokenSignatureInvalid
content:
application/json:
schema:
$ref: '#/components/schemas/GenericError'
components:
securitySchemes:
uc4_token_login:
type: apiKey
in: cookie
name: login
uc4_token_login_header:
type: http
scheme: bearer
schemas:
AbstractAdmission:
type: object
properties:
admissionId:
type: string
enrollmentId:
type: string
timestamp:
type: string
format: date
type:
type: string
enum: [Course, Exam]
CourseAdmission:
allOf:
- $ref: '#/components/schemas/AbstractAdmission'
- type: object
properties:
courseId:
type: string
moduleId:
type: string
ExamAdmission:
allOf:
- $ref: '#/components/schemas/AbstractAdmission'
- type: object
properties:
examId:
type: string
DropAdmission:
type: object
properties:
admissionId:
type: string
UnsignedProposal:
allOf:
- $ref: 'https://raw.githubusercontent.com/upb-uc4/api/develop/hyperledger-proposals.yaml#/components/schemas/UnsignedProposal'
- type: object
JsonServiceVersion:
type: object
properties:
serviceVersion:
type: string
JsonHyperledgerVersion:
type: object
properties:
hlfApiVersion:
type: string
chaincodeVersion:
type: string
GenericError:
allOf:
- $ref: 'https://raw.githubusercontent.com/upb-uc4/api/develop/errors.yaml#/components/schemas/GenericError'
- type: object
DetailedError:
allOf:
- $ref: 'https://raw.githubusercontent.com/upb-uc4/api/develop/errors.yaml#/components/schemas/DetailedError'
- type: object
examples:
ExampleCourseAdmissionPost:
summary: "An example for a CourseAdmission object"
value:
admissionId: ""
enrollmentId: ""
timestamp: ""
courseId: "eae27105-2fd5-11eb-ad58-572c5dfe1b7a"
moduleId: "M.1275.01158"
type: "Course"
ExampleExamAdmissionPost:
summary: "An example for an ExamAdmission object"
value:
admissionId: ""
enrollmentId: ""
timestamp: ""
examId: "AnExampleExamId"
type: "Exam"
ExampleCourseAdmissionGet:
summary: "An example for a list of filled course admissions"
value:
- admissionId: "e53143d725255d70945989901ebc137a7d35c2b61ffdfecb9a135c6136eea4a6:eae27105-2fd5-11eb-ad58-572c5dfe1b7a:M.1275.01158"
enrollmentId: "e53143d725255d70945989901ebc137a7d35c2b61ffdfecb9a135c6136eea4a6"
timestamp: "2020-12-01"
type: "Course"
courseId: "eae27105-2fd5-11eb-ad58-572c5dfe1b7a"
moduleId: "M.1275.01158"
ExampleExamAdmissionGet:
summary: "An example for a list of filled exam admissions"
value:
- admissionId: "e53143d725255d70945989901ebc137a7d35c2b61ffdfecb9a135c6136eea4a6:AnExampleExamId"
enrollmentId: "e53143d725255d70945989901ebc137a7d35c2b61ffdfecb9a135c6136eea4a6"
timestamp: "2020-12-01"
type: "Exam"
examId: "AnExampleExamId"
ExampleUnsignedProposal:
summary: "Example for UnsignedProposal"
value:
unsignedProposal: "CpUJCmoIAxABGgsIgL22/AUQ+NbCWSIJbXljaGFubmVsKkBhMzUwNzA1YWNiMGVmNDUyMzQxN2RjYTRkMTA0ZDUxNmYzMmMxNTgwNzhiYTA4Yzk0NmU1OGRkZWIzZWJhYTJmOgoSCBIGdWM0LWNjEqYICokICgdvcmcxTVNQEv0HLS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUN4akNDQW0yZ0F3SUJBZ0lVYkFLNmdwb1BGaTQxeEloY1Z5YkdXZUV0cXpBd0NnWUlLb1pJemowRUF3SXcKWURFTE1Ba0dBMVVFQmhNQ1ZWTXhGekFWQmdOVkJBZ1REazV2Y25Sb0lFTmhjbTlzYVc1aE1SUXdFZ1lEVlFRSwpFd3RJZVhCbGNteGxaR2RsY2pFUE1BMEdBMVVFQ3hNR1JtRmljbWxqTVJFd0R3WURWUVFERXdoeVkyRXRiM0puCk1UQWVGdzB5TURFd01Ua3hNelU0TURCYUZ3MHlNVEV3TVRreE5EQXpNREJhTURneER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