-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathmr-api.yaml
4042 lines (4025 loc) · 112 KB
/
mr-api.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
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.1
info:
title: ManagementResourceApi
description: This describes the API clients use for accessing features. This reflects the API from 1.6.1 onwards.
version: "1.2.4"
# CRUD for portfolios, environments, features, service account, people, and groups (edited)
# roles are fixed
# then people<->group association
# and group<->role association
paths:
/mr-api/dacha1/cache:
post:
security:
- bearerAuth: [ ]
tags:
- CacheService
description: "Allows superusers to refresh the global Dacha1 cache (if it exists)."
operationId: cacheRefresh
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CacheRefreshRequest"
responses:
200:
description: "Success"
content:
application/json:
schema:
$ref: "#/components/schemas/CacheRefreshResponse"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"
404:
description: "Dacha1 is not being used and API does not exist"
/mr-api/organization/{id}/group:
parameters:
- name: id
required: true
in: path
description: "the id of the organisation"
schema:
type: string
format: uuid
get:
security:
- bearerAuth: [ ]
tags:
- GroupService
description: "Gets the superuser group for this organisation. There is no other way to ascertain which org you are dealing with"
operationId: getSuperuserGroup
responses:
200:
description: "The superuser group presuming the organization exists"
content:
application/json:
schema:
$ref: "#/components/schemas/Group"
400:
description: "Bad Request"
401:
description: "no permission"
404:
description: "not found"
/mr-api/portfolio:
parameters:
- name: includeGroups
description: "Include groups for this this portfolio in results"
in: query
schema:
type: boolean
- name: includeApplications
description: "Include applications for this portfolio in results"
in: query
schema:
type: boolean
get:
security:
- bearerAuth: [ ]
tags:
- PortfolioService
description: "Gets a list of portfolios."
operationId: findPortfolios
parameters:
- name: order
in: query
description: "how to order the results"
schema:
$ref: "#/components/schemas/SortOrder"
- name: filter
in: query
description: "What to filter the results by"
schema:
type: string
- name: parentPortfolioId
in: query
description: "The parent portfolio to search under. If none is provided, use the top level one"
schema:
type: string
responses:
200:
description: "Gets all portfolios, alphabetically sorted"
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Portfolio"
400:
description: "Bad Request"
401:
description: "no permission"
post:
security:
- bearerAuth: [ ]
tags:
- PortfolioService
description: "Create a new portfolio"
operationId: createPortfolio
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreatePortfolio"
responses:
200:
description: "Resulting portfolio"
content:
application/json:
schema:
$ref: "#/components/schemas/Portfolio"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden to create portfolio"
404:
description: "unable to create portfolio"
409:
description: "duplicate portfolio"
put:
security:
- bearerAuth: [ ]
tags:
- PortfolioService
parameters:
- name: includeEnvironments
description: "Include environments for the included applications this portfolio in results"
in: query
schema:
type: boolean
description: "Update a portfolio"
operationId: updatePortfolioOnOrganisation
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Portfolio"
responses:
200:
description: "Resulting portfolio"
content:
application/json:
schema:
$ref: "#/components/schemas/Portfolio"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "no permission to update portfolio"
404:
description: "cannot find portfolio to update"
409:
description: "duplicate portfolio name"
422:
description: "updating old portfolio"
/mr-api/portfolio/{id}:
parameters:
- name: id
description: "The id of the portfolio to find"
in: path
schema:
type: string
format: uuid
required: true
- name: includeGroups
description: "Include groups for this this portfolio in results"
in: query
schema:
type: boolean
- name: includeApplications
description: "Include applications for this portfolio in results"
in: query
schema:
type: boolean
- name: includeEnvironments
description: "Include the environments inside the applications"
in: query
schema:
type: boolean
get:
security:
- bearerAuth: [ ]
tags:
- PortfolioService
description: "Get portfolio"
operationId: getPortfolio
responses:
200:
description: "Resulting portfolio"
content:
application/json:
schema:
$ref: "#/components/schemas/Portfolio"
400:
description: "Bad Request"
401:
description: "no permission"
404:
description: "not found"
put:
deprecated: true
security:
- bearerAuth: [ ]
tags:
- PortfolioService
description: "Update a portfolio"
operationId: updatePortfolio
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Portfolio"
responses:
200:
description: "Resulting portfolio"
content:
application/json:
schema:
$ref: "#/components/schemas/Portfolio"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "no permission to update portfolio"
404:
description: "cannot find portfolio to update"
409:
description: "duplicate portfolio name"
422:
description: "updating old portfolio"
delete:
security:
- bearerAuth: [ ]
tags:
- PortfolioService
description: "Delete a portfolio"
operationId: deletePortfolio
responses:
200:
description: "How many portfolios were deleted."
content:
application/json:
schema:
type: boolean
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"
/mr-api/portfolio/{id}/application:
parameters:
- name: id
description: "The id of the portfolio to find"
in: path
schema:
type: string
format: uuid
required: true
- name: includeEnvironments
in: query
description: "Include the environments in the result"
schema:
type: boolean
- name: includeFeatures
in: query
description: "Include the features in the result"
schema:
type: boolean
get:
security:
- bearerAuth: [ ]
tags:
- ApplicationService
description: "Gets a list of applications."
operationId: findApplications
parameters:
- name: order
in: query
description: "how to order the results"
schema:
$ref: "#/components/schemas/SortOrder"
- name: filter
in: query
description: "What to filter the results by"
schema:
type: string
responses:
200:
description: "Gets all portfolios, alphabetically sorted"
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Application"
400:
description: "Bad Request"
401:
description: "no permission"
404:
description: "none found"
post:
security:
- bearerAuth: [ ]
tags:
- ApplicationService
description: "Create a new application"
operationId: createApplication
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateApplication"
responses:
200:
description: "Resulting application"
content:
application/json:
schema:
$ref: "#/components/schemas/Application"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"
409:
description: "duplicates"
put:
security:
- bearerAuth: [ ]
tags:
- ApplicationService
description: "Update an application"
operationId: updateApplicationOnPortfolio
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Application"
responses:
200:
description: "Resulting portfolio"
content:
application/json:
schema:
$ref: "#/components/schemas/Application"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"
404:
description: "app not found"
409:
description: "Duplicate application"
422:
description: "Trying to save old record"
/mr-api/portfolio/{id}/group:
parameters:
- name: id
description: "The id of the portfolio to find"
in: path
schema:
type: string
format: uuid
required: true
- name: includePeople
description: "include people in each group"
in: query
schema:
type: boolean
get:
security:
- bearerAuth: [ ]
tags:
- GroupService
description: "Gets a list of groups."
operationId: findGroups
parameters:
- name: order
in: query
description: "how to order the results"
schema:
$ref: "#/components/schemas/SortOrder"
- name: filter
in: query
description: "What to filter the results by"
schema:
type: string
responses:
200:
description: "Gets groups, alphabetically sorted"
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Group"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"
404:
description: "not found"
post:
security:
- bearerAuth: [ ]
tags:
- GroupService
description: "Create a new group"
operationId: createGroup
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreateGroup"
responses:
200:
description: "Resulting group"
content:
application/json:
schema:
$ref: "#/components/schemas/Group"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "no permission"
409:
description: "duplicate"
put:
security:
- bearerAuth: [ ]
tags:
- GroupService
description: "Update a group"
operationId: updateGroupOnPortfolio
parameters:
- name: includeMembers
description: "include people in each group"
in: query
schema:
type: boolean
- name: includeGroupRoles
description: "include environment and application roles in each group"
in: query
schema:
type: boolean
- name: updateMembers
description: "update members, deleting those that are not passed"
in: query
schema:
type: boolean
required: false
- name: updateEnvironmentGroupRoles
description: "update environment group roles, deleting any not passed"
in: query
schema:
type: boolean
required: false
- name: updateApplicationGroupRoles
description: "update application group roles, deleting any not passed"
in: query
schema:
type: boolean
required: false
- name: applicationId
description: "if updating the application group roles, and the application id is passed, then the changes are limited to that application"
in: query
schema:
type: string
format: uuid
required: false
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Group"
responses:
200:
description: "Resulting group"
content:
application/json:
schema:
$ref: "#/components/schemas/Group"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"
404:
description: "not found"
409:
description: "duplicate user or duplicate group"
422:
description: "version conflict"
/mr-api/person:
parameters:
- name: includeGroups
description: "Include groups in result"
in: query
schema:
type: boolean
get:
security:
- bearerAuth: [ ]
tags:
- PersonService
description: "Gets a list of matching people."
operationId: findPeople
parameters:
- name: countGroups
description: "Return the number of groups"
in: query
required: false
schema:
type: boolean
- name: order
in: query
description: "how to order the results"
schema:
$ref: "#/components/schemas/SortOrder"
- name: filter
in: query
description: "What to filter the results by"
schema:
type: string
- name: startAt
in: query
description: "Where in the results to start"
schema:
type: integer
- name: pageSize
in: query
description: "How many results to return"
schema:
type: integer
- name: includeLastLoggedIn
in: query
description: "Include last logged in timestamp"
schema:
type: boolean
- name: includeDeactivated
in: query
description: "Include people who are no longer active"
schema:
type: boolean
- name: personTypes
in: query
description: "Filter by person types"
schema:
type: array
items:
$ref: "#/components/schemas/PersonType"
- name: sortBy
in: query
required: false
schema:
$ref: "#/components/schemas/SearchPersonSortBy"
responses:
200:
description: "Gets all persons, alphabetically sorted"
content:
application/json:
schema:
$ref: "#/components/schemas/SearchPersonResult"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "only admins can call this API"
post:
security:
- bearerAuth: [ ]
tags:
- PersonService
description: "Create a new person"
operationId: createPerson
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CreatePersonDetails"
responses:
200:
description: "Registration url"
content:
application/json:
schema:
$ref: "#/components/schemas/RegistrationUrl"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden to only admins"
409:
description: "person already exists"
/mr-api/person/{id}/token-reset:
post:
parameters:
- name: id
description: "The id of the person to find"
in: path
schema:
type: string
format: uuid
required: true
security:
- bearerAuth: [ ]
tags:
- PersonService
description: "Reset security token of supported person type (usually service accounts only)"
operationId: resetSecurityToken
responses:
200:
description: "New security token"
content:
application/json:
schema:
$ref: "#/components/schemas/AdminServiceResetTokenResponse"
404:
description: "Service account not found"
403:
description: "No permission to change"
401:
description: "Not authenticated"
/mr-api/person/{id}/v2:
parameters:
- name: id
description: "The id of the person to find"
in: path
schema:
type: string
format: uuid
required: true
put:
security:
- bearerAuth: [ ]
tags:
- PersonService
description: "Update a person"
operationId: updatePersonV2
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UpdatePerson"
responses:
204:
description: "Resulting person"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden to update that person"
404:
description: "person not found"
422:
description: "attempting to update old person record"
/mr-api/person/{id}:
parameters:
- name: id
description: "The id of the person to find"
in: path
schema:
type: string
format: uuid
required: true
- name: includeGroups
description: "Include groups in result"
in: query
schema:
type: boolean
- name: includeAcls
description: "include acls for each group"
in: query
schema:
type: boolean
get:
security:
- bearerAuth: [ ]
tags:
- PersonService
parameters:
- name: id
description: "The id of the person to find. Duplicated here as we accept a plain string (not only a uuid)"
in: path
schema:
type: string
required: true
description: "Get person"
operationId: getPerson
responses:
200:
description: "If this is a sdk service acocunt, ID of the service account is in the PersonInfo fields with the key serviceAccountId"
content:
application/json:
schema:
$ref: "#/components/schemas/Person"
400:
description: "Bad Request"
401:
description: "no permission"
404:
description: "not found"
put:
security:
- bearerAuth: [ ]
tags:
- PersonService
description: "Update a person"
operationId: updatePerson
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Person"
responses:
200:
description: "Resulting person"
content:
application/json:
schema:
$ref: "#/components/schemas/Person"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden to update that person"
404:
description: "person not found"
422:
description: "attempting to update old person record"
delete:
security:
- bearerAuth: [ ]
tags:
- PersonService
description: "Delete a person"
operationId: deletePerson
responses:
200:
description: "How many people were deleted."
content:
application/json:
schema:
type: boolean
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"
/mr-api/authentication:
post:
tags:
- AuthService
description: "Create a new user"
operationId: registerPerson
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PersonRegistrationDetails"
responses:
200:
description: "Tokenized person"
content:
application/json:
schema:
$ref: "#/components/schemas/TokenizedPerson"
400:
description: "Bad Request"
401:
description: "no permission"
404:
description: "person already registered who is using this token or cannot find person to register"
/mr-api/external-provider/{provider}:
parameters:
- name: provider
in: path
required: true
schema:
type: string
get:
tags:
- AuthService
description: "Gets a login URL for this specified provider if it is supported by the server"
operationId: getLoginUrlForProvider
responses:
200:
description: "The information required to redirect"
content:
application/json:
schema:
$ref: "#/components/schemas/ProviderRedirect"
400:
description: "Bad Request"
401:
description: "no permission"
404:
description: "not found"
/mr-api/login:
post:
tags:
- AuthService
description: "Login to Feature Hub"
operationId: login
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/UserCredentials"
responses:
200:
description: "Successfully logged in"
content:
application/json:
schema:
$ref: "#/components/schemas/TokenizedPerson"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "login is disabled for this instance"
404:
description: "user is not found"
/mr-api/logout:
get:
security:
- bearerAuth: [ ]
tags:
- AuthService
description: "Get person by token"
operationId: logout
responses:
204:
description: "Token deactivated"
400:
description: "Bad Request"
401:
description: "no permission"
/mr-api/authentication/{id}/replaceTempPassword:
parameters:
- name: id
description: "The id of the person to replace temporary password for"
in: path
schema:
type: string
format: uuid
required: true
put:
tags:
- AuthService
description: "Replace temporary password"
x-java-annotations: "@io.featurehub.mr.api.AllowedDuringPasswordReset"
security:
- bearerAuth: [ ]
operationId: replaceTempPassword
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PasswordReset"
responses:
200:
description: "Successfully reset temporary password"
content:
application/json:
schema:
$ref: "#/components/schemas/TokenizedPerson"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"
/mr-api/authentication/{email}/expiredTokenReset:
post:
security:
- bearerAuth: [ ]
tags:
- AuthService
parameters:
- name: email
in: path
description: "The email address of the person whose expired token to reset"
schema:
type: string
required: true
description: "Allows an administrator to reset a user's expired token so they can login"
operationId: resetExpiredToken
responses:
200:
description: "The token of the expired person"
content:
application/json:
schema:
$ref: "#/components/schemas/RegistrationUrl"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"
/mr-api/authentication/{id}/changePassword:
parameters:
- name: id
description: "The id of the person to change password for"
in: path
schema:
type: string
format: uuid
required: true
put:
security:
- bearerAuth: [ ]
tags:
- AuthService
description: "Change password"
operationId: changePassword
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/PasswordUpdate"
responses:
200:
description: "Successfully updated password"
content:
application/json:
schema:
$ref: "#/components/schemas/Person"
400:
description: "Bad Request"
401:
description: "no permission"
403:
description: "forbidden"