-
Notifications
You must be signed in to change notification settings - Fork 0
/
oas3.yaml
685 lines (648 loc) · 20.6 KB
/
oas3.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
openapi: 3.0.1
info:
title: Burnout
description: Burnout is a tool used to anonymously track your team's happiness and risk of burnout.
license:
name: MIT
url: https://sierrasoftworks.com/licenses/MIT
version: 1.0.
servers:
- url: https://burnout.sierrasoftworks.com
- url: http://localhost:8000
tags:
- name: health
description: APIs used to determine the health of a Burnout instance.
- name: teams
description: APIs used to manage and retrieve team information.
- name: reports
description: APIs used to manage burnout reports by individuals.
paths:
/api/v1/health:
get:
tags:
- health
summary: Get Health (v2)
description: Gets the current health status of the Burnout instance.
operationId: health_v2
responses:
200:
description: The service is healthy.
content:
application/json:
schema:
$ref: "#/components/schemas/HealthV1"
example:
ok: true
started_at: "2019-03-14T23:17:27.210333300Z"
500:
description: The service is unhealthy.
content:
application/json:
schema:
$ref: "#/components/schemas/HealthV1"
example:
ok: false
started_at: "2019-03-14T23:17:27.210333300Z"
/api/v1/teams:
get:
tags:
- teams
security:
- AzureAD: [Teams.Read]
summary: Get Teams (v1)
description: Gets the list of teams that you have access to.
operationId: teams_v1
responses:
200:
description: List of teams
content:
application/json:
schema:
type: array
description: The list of records registered with the server.
items:
$ref: "#/components/schemas/TeamV1"
post:
tags:
- teams
security:
- AzureAD: [Teams.Write]
summary: New Team (v1)
description: Creates a new team on the server.
operationId: new_team_v1
requestBody:
description: The team to add to the server.
content:
application/json:
schema:
$ref: "#/components/schemas/TeamV1"
example:
name: "Test Record"
description: "This is a test record"
responses:
201:
description: Team was created.
headers:
Location:
description: The relative path at which you can find the newly created object.
schema:
type: string
content:
application/json:
schema:
$ref: "#/components/schemas/TeamV1"
500:
description: The server could not create the team, please try again.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
code: 500
error: Internal Server Error
description: The server encountered an error while processing your request, please try again later.
/api/v1/team/{id}:
get:
tags:
- teams
security:
- AzureAD: [Teams.Read]
summary: Get Team (v1)
description: Gets a specific team from the server based on its ID.
operationId: team_v1
parameters:
- name: id
in: path
description: The unique ID of the team you wish to retrieve.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
responses:
200:
description: The details of the team.
content:
application/json:
schema:
$ref: "#/components/schemas/TeamV1"
404:
description: The server could not find any teams matching that ID, please check it and try again.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
code: 404
error: Not Found
description: The resource you were looking for could not be found, please check your request and try again.
put:
tags:
- teams
security:
- AzureAD: [Teams.Write]
summary: Store Team (v1)
description: Stores a team idempotently with the given identifier, replacing an existing instance if one is present.
operationId: store_team_v1
parameters:
- name: id
in: path
description: The unique ID of the team you wish to store.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
requestBody:
description: The team to store on the server.
content:
application/json:
schema:
$ref: "#/components/schemas/TeamV1"
example:
name: "Test Record"
description: "This is a test record"
responses:
200:
description: Stored team
content:
application/json:
schema:
$ref: "#/components/schemas/TeamV1"
404:
description: The server could not find any teams matching that ID, please create one and try again.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
code: 404
error: Not Found
description: The resource you were looking for could not be found, please check your request and try again.
500:
description: The server could not store the team, please try again.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
code: 500
error: Internal Server Error
description: The server encountered an error while processing your request, please try again later.
/api/v1/team/{teamId}/users:
get:
tags:
- teams
security:
- AzureAD: [TeamAssignments.Write]
summary: Get Team Role Assignments (v1)
description: Gets the list of users which can access this team and their role assignments.
operationId: team_assignments_v1
parameters:
- name: teamId
in: path
description: The unique ID of the team to retrieve users for.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
example: 957d25c0baec7557f45a67ed2e427e9
responses:
200:
description: List of team assignments.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/TeamAssignmentV1"
text/xml:
schema:
type: array
items:
$ref: "#/components/schemas/TeamAssignmentV1"
xml:
name: TeamAssignments
wrapped: true
404:
description: Team not found.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
code: 404
error: Not Found
description: The resource you were looking for could not be found, please check your request and try again.
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
500:
$ref: "#/components/responses/InternalServerError"
/api/v1/team/{teamId}/user/{userId}:
get:
tags:
- teams
security:
- AzureAD: [TeamAssignments.Write]
summary: Get User Role Assignment (v1)
description: Gets the details of a user's role assignment within a team.
operationId: team_assignment_v1
parameters:
- name: teamId
in: path
description: The unique ID of the team to retrieve the user from.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
example: 957d25c0baec7557f45a67ed2e427e9
- name: userId
in: path
description: The unique ID of the user to retrieve.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
example: c0baec767ed2557f957d2545ae427e9
responses:
200:
description: User role assignment details.
content:
application/json:
schema:
$ref: "#/components/schemas/TeamAssignmentV1"
text/xml:
schema:
$ref: "#/components/schemas/TeamAssignmentV1"
404:
description: Team or role assignment not found.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
code: 404
error: Not Found
description: The resource you were looking for could not be found, please check your request and try again.
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
500:
$ref: "#/components/responses/InternalServerError"
put:
tags:
- teams
security:
- AzureAD: [TeamAssignments.Write]
summary: Update User Role Assignment (v1)
description: Update the role assignment associated with a user on a given team.
operationId: update_team_assignment_v1
parameters:
- name: teamId
in: path
description: The unique ID of the team to retrieve the user from.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
example: 957d25c0baec7557f45a67ed2e427e9
- name: userId
in: path
description: The unique ID of the user to retrieve.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
example: c0baec767ed2557f957d2545ae427e9
requestBody:
description: The role assignment to apply for this user when accessing the team.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TeamAssignmentV1'
text/xml:
schema:
$ref: '#/components/schemas/TeamAssignmentV1'
responses:
200:
description: User role assignment details.
content:
application/json:
schema:
$ref: "#/components/schemas/TeamAssignmentV1"
text/xml:
schema:
$ref: "#/components/schemas/TeamAssignmentV1"
404:
description: Team not found.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
code: 404
error: Not Found
description: The resource you were looking for could not be found, please check your request and try again.
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
500:
$ref: "#/components/responses/InternalServerError"
delete:
tags:
- teams
security:
- AzureAD: [TeamAssignments.Write]
summary: Remove User Role Assignment (v1)
description: Removes a user's role assignment from a team.
operationId: remove_team_assignment_v1
parameters:
- name: teamId
in: path
description: The unique ID of the team to retrieve the user from.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
example: 957d25c0baec7557f45a67ed2e427e9
- name: userId
in: path
description: The unique ID of the user to retrieve.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
example: c0baec767ed2557f957d2545ae427e9
responses:
204:
description: Role assignment removed.
404:
description: Team or role assignment not found.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
code: 404
error: Not Found
description: The resource you were looking for could not be found, please check your request and try again.
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
500:
$ref: "#/components/responses/InternalServerError"
/api/v1/team/{teamId}/reports:
get:
tags:
- teams
security:
- AzureAD: [Teams.Read]
summary: Get Team Reports (v1)
description: Fetches the reports submitted for a team.
operationId: get_team_reports_v1
parameters:
- name: teamId
in: path
description: The unique ID of the team to retrieve the reports for.
required: true
schema:
type: string
pattern: ^[a-f0-9]{32}$
example: 957d25c0baec7557f45a67ed2e427e9
responses:
200:
description: List of the team's report submissions.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ReportV1'
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
500:
$ref: "#/components/responses/InternalServerError"
/api/v1/reports:
get:
tags:
- reports
security:
- AzureAD: [Reports.Read]
summary: Get Your Reports (v1)
description: Fetches the full history of your report submissions.
operationId: get_reports_v1
responses:
200:
description: List of your previous report submissions.
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/ReportV1'
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
500:
$ref: "#/components/responses/InternalServerError"
post:
tags:
- reports
security:
- AzureAD: [Reports.Write]
summary: Submit Report (v1)
description: Submits a new report which will appear in your report history as well as that of the teams you are a member of.
operationId: new_report_v1
requestBody:
description: The details of the report to submit.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ReportV1'
text/xml:
schema:
$ref: '#/components/schemas/ReportV1'
responses:
200:
description: The details of the report which has been created.
content:
application/json:
schema:
$ref: '#/components/schemas/ReportV1'
401:
$ref: "#/components/responses/Unauthorized"
403:
$ref: "#/components/responses/Forbidden"
500:
$ref: "#/components/responses/InternalServerError"
components:
securitySchemes:
AzureAD:
type: oauth2
flows:
implicit:
authorizationUrl: https://login.microsoftonline.com/a26571f1-22b3-4756-ac7b-39ca684fab48/oauth2/v2.0/authorize
scopes:
"Reports.Read": Allows the reading of your report data.
"Reports.Write": Allows the submission of reports.
"Teams.Read": Allows the reading of team information.
"Teams.Write": Allows the creation, modification and removal of teams.
"TeamAssignments.Write": Allows the creation, modification and removal of role assignments for teams.
responses:
Unauthorized:
description: You have not provided a valid authentication token.
headers:
WWW-Authenticate:
schema:
type: string
example: Bearer
required: true
Forbidden:
description: Your access token does not grant you the required role or scopes needed to access this resource.
InternalServerError:
description: The server failed to process your request successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
example:
code: 500
error: Internal Server Error
description: The server encountered an error while processing your request, please try again later.
schemas:
HealthV1:
required:
- ok
- started_at
type: object
properties:
ok:
type: boolean
description: Whether the service is healthy or not.
readOnly: true
xml:
name: OK
started_at:
type: string
description: The ISO 8601 datetime at which the service was started.
format: datetime
readOnly: true
xml:
name: StartedAt
xml:
name: Health
TeamV1:
required:
- name
type: object
properties:
id:
pattern: ^[a-z0-9]{32}$
type: string
description: A unique ID used to identify this team internally.
readOnly: true
name:
type: string
description: The short name used to identify this team.
xml:
name: Team
example:
id: "225c5957d7f450baec75a67ede427e9"
name: "Ops Team"
TeamAssignmentV1:
required:
- userID
- teamID
- role
type: object
properties:
teamID:
pattern: ^[a-z0-9]{32}$
type: string
description: A unique ID used to identify this team internally.
readOnly: true
xml:
name: team-id
attribute: true
userID:
pattern: ^[a-z0-9]{32}$
type: string
description: A unique ID used to identify this user internally.
readOnly: true
xml:
name: user-id
attribute: true
role:
type: string
description: The role that the user has been granted on this team.
example: Owner
enum:
- Manager
- Member
- Viewer
xml:
name: role
attribute: true
xml:
name: TeamAssignment
example:
teamID: "225c5957d7f450baec75a67ede427e9"
userID: "de427e9225c59ec75a67e57d7f450ba"
role: "Manager"
ReportV1:
required:
- metric
- value
type: object
properties:
timestamp:
type: string
format: datetime
description: The time at which the report was received.
readOnly: true
xml:
name: time
metric:
type: string
description: The name of a measurement metric which is being tracked.
xml:
name: metric
value:
type: number
description: A numerical value used to measure this metric.
xml:
name: value
xml:
name: Report
example:
time: "2020-02-14T12:02:49Z"
metric: burnout_index
value: 3.1
Error:
type: object
description: An error describing a problem that the server has encountered or identified.
required:
- code
- error
- message
properties:
code:
type: number
format: integer
minimum: 100
maximum: 599
description: The HTTP status code corresponding to this error.
error:
type: string
description: The human readable description of the HTTP status code.
description:
type: string
description: A human readable description of the exact error that occurred.