Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
4441 lines (4263 loc) · 173 KB
/
Copy pathopenapi.yaml
File metadata and controls
4441 lines (4263 loc) · 173 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
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
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
openapi: 3.1.0
info:
title: Apache Airavata HTTP API
version: "1.0.0"
description: |
The REST API served by `airavata-server` (see `internal/server/server.go`).
All request and response bodies are JSON (`Content-Type: application/json`).
## Authentication
Authentication is a bearer token validated by CILogon introspection, carried as
`Authorization: Bearer <token>`. A request without a token is anonymous rather
than rejected at the door: each operation decides for itself whether an anonymous
caller is acceptable. A token that is present but invalid is always `401`, with
`WWW-Authenticate: Bearer error="invalid_token"`. If the identity provider cannot
be reached the call fails `502`, because that is not the caller's fault.
## Authorization
Two schemes are in play, depending on the resource:
- **Platform roles** (`ADMIN`, `SUPER_ADMIN`) guard the shared catalogue —
Slurm clusters, partitions, application templates and batch deployments.
Reads of the catalogue are open to anyone, including anonymous callers;
writes require a role.
- **Ownership and sharing** guards the per-user resources — SSH credentials,
groups, cluster configs, SCP data storages, data products and processes. Ownership
comes from the token and is never carried in a request body, so nothing can be
created on someone else's behalf or handed over by editing it. None of these
are readable anonymously.
SSH credentials are the strictest case: platform admins are not treated as
owners, and there is no share that opens one up. Private key material and
passphrases are write-only — no read endpoint has a field for them.
## Errors
Every failure uses the same envelope (`Error`). Request-body validation adds a
`fieldErrors` array naming every constraint that failed, using the JSON path of
the offending field including indexes and nesting (`inputs[0].inputType`,
`defaultBatchJobConfig.wallTimeMinutes`).
Internal failures return `500` with a fixed `"Internal server error"` message;
the underlying detail is logged rather than returned, since it may name internal
state.
license:
name: Apache License 2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: http://localhost:9095
description: Local development server (override the port with `SERVER_PORT`)
tags:
- name: Health
description: Liveness probe.
- name: Users
description: User accounts.
- name: Groups
description: Groups and their membership; the subject of a group share.
- name: Audit
description: >-
The record of who changed what. Admin only. See docs/audit.md.
- name: Service Accounts
description: >-
Non-human users that authenticate with an Airavata-issued, expiring token.
Admin only. See docs/auth.md.
- name: SSH Credentials
description: Registered keypairs. Private material is write-only.
- name: Slurm Clusters
description: The machine catalogue and its partitions.
- name: Slurm Cluster Configs
description: Who a job submits as on a cluster, and with which key.
- name: Application Templates
description: An application's input/output contract, independent of where it runs.
- name: Batch Deployments
description: A template bound to a cluster, with the resource request a run starts from.
- name: SCP Data Storages
description: Hosts data is staged to and from over SCP.
- name: Data Products
description: Registered datasets on a storage.
- name: Sharing
description: >-
Granting access to a shareable record. One shape for every resource kind: the
subject's kind is a field, not a choice of endpoint. See docs/sharing.md.
- name: Processes
description: Runs, their status history and their tasks.
security:
- bearerAuth: []
paths:
/health:
get:
tags: [Health]
summary: Liveness probe
description: |
No token is required. The authentication middleware wraps the whole mux
rather than individual routes, so a request that does carry a token still has
it validated — call this without an `Authorization` header to probe liveness
independently of the identity provider.
operationId: health
security: []
responses:
"200":
description: The server is up.
content:
application/json:
schema:
type: object
properties:
status:
type: string
const: UP
required: [status]
"401": { $ref: "#/components/responses/Unauthorized" }
"502": { $ref: "#/components/responses/BadGateway" }
# ---------------------------------------------------------------- Users
/api/v1/users:
get:
tags: [Users]
summary: List users
description: |
Requires `ADMIN` or `SUPER_ADMIN` authority. Newest first, with the email, auth
method and roles an administrator needs to decide whether to activate someone.
operationId: listUsers
responses:
"200":
description: Every registered user.
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/UserAccount" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
post:
tags: [Users]
summary: Register a user
description: |
Creates the `users` row an owned resource is attached to, active straight away.
A CILogon user who signs in without one gets one created for them, suspended
until an administrator activates it.
operationId: createUser
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/UserRegistration" }
responses:
"200":
description: The registered user.
content:
application/json:
schema: { $ref: "#/components/schemas/UserResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/users/me:
get:
tags: [Users]
summary: Read the caller
description: |
Who the server thinks the caller is. This is the one route a suspended or
inactive account may call; every other route answers it with `403`.
operationId: getCurrentUser
responses:
"200":
description: The caller.
content:
application/json:
schema: { $ref: "#/components/schemas/CurrentUser" }
"401": { $ref: "#/components/responses/Unauthorized" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/users/{userId}/status:
parameters:
- $ref: "#/components/parameters/UserId"
post:
tags: [Users]
summary: Set a user's status
description: |
Activates, suspends or deactivates a user, from their next request. Requires
`ADMIN` or `SUPER_ADMIN` authority. Nobody can change their own status, only a
`SUPER_ADMIN` can change an administrator's, and service accounts are managed
under `/api/v1/service-accounts`.
operationId: setUserStatus
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/UserStatusUpdate" }
responses:
"200":
description: The user with their new status.
content:
application/json:
schema: { $ref: "#/components/schemas/UserAccount" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/users/{userId}:
parameters:
- $ref: "#/components/parameters/UserId"
get:
tags: [Users]
summary: Read a user
description: |
The response carries no email, auth method or roles — widening it would leak
more about an account than this API ever has.
operationId: getUser
responses:
"200":
description: The user.
content:
application/json:
schema: { $ref: "#/components/schemas/UserResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
post:
tags: [Users]
summary: Update a user
description: |
Update the user with the provided information.
operationId: updateUser
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/UserRegistration" }
responses:
"200":
description: The updated user.
content:
application/json:
schema: { $ref: "#/components/schemas/UserResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
# ------------------------------------------------------ Permissions
/api/v1/permissions:
get:
tags: [Service Accounts]
summary: List permissions
description: |
Any signed-in caller. Every permission that exists, with a description of what it
allows, sorted by name. `grantableToServiceAccount` is false for the permissions no
service account may hold. What a caller may grant from the list is decided where
the grant is made. See docs/auth.md.
operationId: listPermissions
responses:
"200":
description: Every permission.
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/Permission" }
"401": { $ref: "#/components/responses/Unauthorized" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
# ------------------------------------------------------ Service accounts
/api/v1/service-accounts:
get:
tags: [Service Accounts]
summary: List service accounts
description: Requires `ADMIN` or `SUPER_ADMIN` authority.
operationId: listServiceAccounts
responses:
"200":
description: Every service account. Tokens are never included.
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/ServiceAccountResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
post:
tags: [Service Accounts]
summary: Create a service account
description: |
Requires `ADMIN` or `SUPER_ADMIN` authority. Creates a user with id
`sa:<name>` and auth method `SERVICE_ACCOUNT`, and mints its first token.
**The token is returned only in this response.** Only its digest is stored.
A service account always authenticates with `USER` authority, whatever
`user_roles` says, so it can never administer anything — including creating
other service accounts. Otherwise it is an ordinary user: it owns what it
creates, can be shared with and can join groups.
operationId: createServiceAccount
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/ServiceAccountCreate" }
responses:
"201":
description: "The new account and its token. Sent with `Cache-Control: no-store`."
content:
application/json:
schema: { $ref: "#/components/schemas/ServiceAccountTokenResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"409": { $ref: "#/components/responses/Conflict" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/service-accounts/{serviceAccountId}:
parameters:
- $ref: "#/components/parameters/ServiceAccountId"
get:
tags: [Service Accounts]
summary: Read a service account
description: Requires `ADMIN` or `SUPER_ADMIN` authority.
operationId: getServiceAccount
responses:
"200":
description: The service account.
content:
application/json:
schema: { $ref: "#/components/schemas/ServiceAccountResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
put:
tags: [Service Accounts]
summary: Update a service account
description: |
Requires `ADMIN` or `SUPER_ADMIN` authority. Absent fields are unchanged.
Setting `status` to anything but `ACTIVE` stops the token working at once
without discarding it; setting it back to `ACTIVE` restores it.
operationId: updateServiceAccount
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/ServiceAccountUpdate" }
responses:
"200":
description: The updated service account.
content:
application/json:
schema: { $ref: "#/components/schemas/ServiceAccountResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
delete:
tags: [Service Accounts]
summary: Delete a service account
description: |
Requires `ADMIN` or `SUPER_ADMIN` authority. Removes the account, its token,
its group memberships and every share granted to it. An account that still
owns records gets `409`; set its status to `INACTIVE` instead.
operationId: deleteServiceAccount
responses:
"204": { $ref: "#/components/responses/NoContent" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"409": { $ref: "#/components/responses/Conflict" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/service-accounts/{serviceAccountId}/token/renew:
parameters:
- $ref: "#/components/parameters/ServiceAccountId"
post:
tags: [Service Accounts]
summary: Renew a service account token
description: |
Requires `ADMIN` or `SUPER_ADMIN` authority. Moves the current token's expiry
to `validityDays` from now. The token itself does not change, so whatever
holds it keeps working. An expired token can be renewed. The body is optional.
operationId: renewServiceAccountToken
requestBody:
required: false
content:
application/json:
schema: { $ref: "#/components/schemas/ServiceAccountTokenRequest" }
responses:
"200":
description: The service account with its new expiry.
content:
application/json:
schema: { $ref: "#/components/schemas/ServiceAccountResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/service-accounts/{serviceAccountId}/token/regenerate:
parameters:
- $ref: "#/components/parameters/ServiceAccountId"
post:
tags: [Service Accounts]
summary: Regenerate a service account token
description: |
Requires `ADMIN` or `SUPER_ADMIN` authority. Replaces the token with a new
one; the old token stops working immediately. Use this to revoke a leaked
token. The new token is returned only in this response. The body is optional.
operationId: regenerateServiceAccountToken
requestBody:
required: false
content:
application/json:
schema: { $ref: "#/components/schemas/ServiceAccountTokenRequest" }
responses:
"200":
description: "The account and its new token. Sent with `Cache-Control: no-store`."
content:
application/json:
schema: { $ref: "#/components/schemas/ServiceAccountTokenResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
# ------------------------------------------------------------ Audit log
/api/v1/audit-events:
get:
tags: [Audit]
summary: List audit events
description: |
Requires `ADMIN` or `SUPER_ADMIN` authority. Returns the changes users and the
system have made to records, newest first. Every filter is optional and they
combine with AND. See docs/audit.md.
Page through the log by passing the previous response's `nextCursor` as `before`.
operationId: listAuditEvents
parameters:
- name: userId
in: query
description: Only events by this actor — a user id, `root`, `sa:<name>` or `system`.
schema: { type: string }
- name: entityType
in: query
description: Only events on this kind of record, such as `processes`. See `/api/v1/audit-events/entity-types`.
schema: { type: string }
- name: from
in: query
description: Only events at or after this time, in milliseconds since the epoch.
schema: { type: integer, format: int64, minimum: 0 }
- name: to
in: query
description: Only events before this time (exclusive), in milliseconds since the epoch. Must be after `from`.
schema: { type: integer, format: int64, minimum: 0 }
- name: before
in: query
description: Only events with an id below this one; the previous page's `nextCursor`.
schema: { type: integer, format: int64, minimum: 0 }
- name: limit
in: query
description: Page size.
schema: { type: integer, minimum: 1, maximum: 500, default: 100 }
responses:
"200":
description: One page of events.
content:
application/json:
schema: { $ref: "#/components/schemas/AuditEventPage" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/audit-events/entity-types:
get:
tags: [Audit]
summary: List audited entity types
description: Requires `ADMIN` or `SUPER_ADMIN` authority. The values `entityType` accepts, for the kinds of record the log holds events for.
operationId: listAuditEntityTypes
responses:
"200":
description: Entity types, alphabetically.
content:
application/json:
schema:
type: array
items: { type: string }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
# --------------------------------------------------------------- Groups
/api/v1/groups:
get:
tags: [Groups]
summary: List all groups
description: Requires `ADMIN` or `SUPER_ADMIN` authority.
operationId: listGroups
responses:
"200":
description: Every group.
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/GroupResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
post:
tags: [Groups]
summary: Create a group
description: |
The owner is taken from the token — there is no owner field — and is not
transferable afterwards.
operationId: createGroup
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/GroupRequest" }
responses:
"201":
description: The created group.
content:
application/json:
schema: { $ref: "#/components/schemas/GroupResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/groups/me:
get:
tags: [Groups]
summary: List the caller's groups
description: The groups the caller owns or is a member of.
operationId: listMyGroups
responses:
"200":
description: The caller's groups.
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/GroupResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/groups/{groupId}:
parameters:
- $ref: "#/components/parameters/GroupId"
get:
tags: [Groups]
summary: Read a group
description: |
A caller with no standing to know the group exists gets `404` rather than
`403`. Members are not inlined; read them through the members sub-resource.
operationId: getGroup
responses:
"200":
description: The group.
content:
application/json:
schema: { $ref: "#/components/schemas/GroupResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
put:
tags: [Groups]
summary: Update a group
operationId: updateGroup
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/GroupRequest" }
responses:
"200":
description: The updated group.
content:
application/json:
schema: { $ref: "#/components/schemas/GroupResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
delete:
tags: [Groups]
summary: Delete a group
operationId: deleteGroup
responses:
"204": { $ref: "#/components/responses/NoContent" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"409": { $ref: "#/components/responses/Conflict" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/groups/{groupId}/members:
parameters:
- $ref: "#/components/parameters/GroupId"
get:
tags: [Groups]
summary: List group members
operationId: listGroupMembers
responses:
"200":
description: The group's memberships.
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/GroupMemberResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
post:
tags: [Groups]
summary: Add a group member
description: |
An omitted `groupRole` admits a plain `MEMBER`; an omitted
`groupMemberStatus` admits them as `ACTIVE`.
operationId: addGroupMember
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/GroupMemberRequest" }
responses:
"201":
description: The created membership.
content:
application/json:
schema: { $ref: "#/components/schemas/GroupMemberResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/groups/{groupId}/members/{userId}:
parameters:
- $ref: "#/components/parameters/GroupId"
- $ref: "#/components/parameters/UserId"
get:
tags: [Groups]
summary: Read one membership
operationId: getGroupMember
responses:
"200":
description: The membership.
content:
application/json:
schema: { $ref: "#/components/schemas/GroupMemberResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
put:
tags: [Groups]
summary: Update a membership
description: |
Both fields are optional and an omitted one is left as it stands, so a member
can be suspended without restating their role. The user is identified by the
path, so a membership cannot be moved to a different user by editing it.
operationId: updateGroupMember
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/GroupMemberUpdate" }
responses:
"200":
description: The updated membership.
content:
application/json:
schema: { $ref: "#/components/schemas/GroupMemberResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
delete:
tags: [Groups]
summary: Remove a member from a group
operationId: removeGroupMember
responses:
"204": { $ref: "#/components/responses/NoContent" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
# ------------------------------------------------------------- SSH credentials
/api/v1/ssh-credentials:
get:
tags: [SSH Credentials]
summary: List the caller's SSH credentials
description: Returns only the caller's own credentials. Admins are not exempt.
operationId: listSSHCredentials
responses:
"200":
description: The caller's credentials.
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/SSHCredentialResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
post:
tags: [SSH Credentials]
summary: Register an SSH credential
description: |
Self-service for any authenticated caller with a `users` row. `privateKey` is
required on create; `privateKey` and `passphrase` are write-only and are never
returned by any read endpoint.
operationId: createSSHCredential
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/SSHCredentialRequest" }
responses:
"201":
description: The registered credential, without its private material.
content:
application/json:
schema: { $ref: "#/components/schemas/SSHCredentialResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/ssh-credentials/{sshCredentialId}:
parameters:
- $ref: "#/components/parameters/SSHCredentialId"
get:
tags: [SSH Credentials]
summary: Read an SSH credential
description: Owner only.
operationId: getSSHCredential
responses:
"200":
description: The credential, without its private material.
content:
application/json:
schema: { $ref: "#/components/schemas/SSHCredentialResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
put:
tags: [SSH Credentials]
summary: Update an SSH credential
description: |
Owner only. An update that omits `privateKey` keeps the stored secret.
operationId: updateSSHCredential
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/SSHCredentialRequest" }
responses:
"200":
description: The updated credential.
content:
application/json:
schema: { $ref: "#/components/schemas/SSHCredentialResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
delete:
tags: [SSH Credentials]
summary: Delete an SSH credential
description: |
Owner only. A credential still referenced by a cluster config or a data
storage cannot be deleted: `409 Conflict`.
operationId: deleteSSHCredential
responses:
"204": { $ref: "#/components/responses/NoContent" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }
"404": { $ref: "#/components/responses/NotFound" }
"409": { $ref: "#/components/responses/Conflict" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/ssh-interactive-auths:
get:
tags: [SSH Credentials]
summary: List the caller's pending interactive SSH auths
description: |
Keyboard-interactive challenges (a password, an OTP, a Duo prompt) that a
connection made with a `fullInteractive` credential is waiting on, oldest
first. Only the caller's own auths are returned; admins are not exempt. A
auth disappears once it is answered or the connection gives up.
operationId: listInteractiveAuths
responses:
"200":
description: The caller's pending auths.
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/InteractiveAuthResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/ssh-interactive-auths/{authId}:
parameters:
- name: authId
in: path
required: true
schema: { type: string, format: uuid }
get:
tags: [SSH Credentials]
summary: Read one of the caller's pending interactive SSH auths
description: Owner only. An auth that is not the caller's, or no longer pending, is a 404.
operationId: getInteractiveAuth
responses:
"200":
description: The auth and its prompts.
content:
application/json:
schema: { $ref: "#/components/schemas/InteractiveAuthResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"404": { $ref: "#/components/responses/NotFound" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/ssh-interactive-auths/{authId}/response:
parameters:
- name: authId
in: path
required: true
schema: { type: string, format: uuid }
post:
tags: [SSH Credentials]
summary: Answer an interactive SSH auth
description: |
The REST form of the WebSocket's answer step. 204 means the answer was handed
to the SSH handshake, not that the host accepted it. Owner only.
operationId: answerInteractiveAuthRest
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/InteractiveAuthAnswer" }
responses:
"204": { $ref: "#/components/responses/NoContent" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"404": { $ref: "#/components/responses/NotFound" }
"409": { $ref: "#/components/responses/Conflict" }
"500": { $ref: "#/components/responses/InternalError" }
/api/v1/ssh-interactive-auths/{authId}/ws:
parameters:
- name: authId
in: path
required: true
schema: { type: string, format: uuid }
get:
tags: [SSH Credentials]
summary: Answer an interactive SSH auth over a WebSocket
description: |
Upgrades to a WebSocket. The server sends `{"type":"challenge","auth":{...}}`;
the client sends `{"responses":[...]}` (one per prompt) or `{"cancel":true}`;
the server replies `{"type":"accepted"}` and closes, or
`{"type":"error","message":"..."}`. Bearer auth on the upgrade request, as
everywhere else. Owner only.
operationId: answerInteractiveAuth
responses:
"101":
description: Switching to the WebSocket protocol.
"401": { $ref: "#/components/responses/Unauthorized" }
"404": { $ref: "#/components/responses/NotFound" }
"500": { $ref: "#/components/responses/InternalError" }
# ------------------------------------------------------- Slurm clusters
/api/v1/slurm-clusters:
get:
tags: [Slurm Clusters]
summary: List Slurm clusters
description: Catalogue read; open without a token.
operationId: listSlurmClusters
security:
- {}
- bearerAuth: []
responses:
"200":
description: Every registered cluster, with its partitions inlined.
content:
application/json:
schema:
type: array
items: { $ref: "#/components/schemas/SlurmClusterResponse" }
"401": { $ref: "#/components/responses/Unauthorized" }
"502": { $ref: "#/components/responses/BadGateway" }
"500": { $ref: "#/components/responses/InternalError" }
post:
tags: [Slurm Clusters]
summary: Register a Slurm cluster
description: |
Requires `ADMIN` or `SUPER_ADMIN` authority. Describes the machine only — the
account a job submits under and the key it presents are a cluster config, so
registering a cluster never puts anyone's credentials into the catalogue.
`partitions` is accepted on create so a cluster whose layout is already known
arrives complete.
operationId: createSlurmCluster
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/SlurmClusterRequest" }
responses:
"201":
description: The registered cluster.
content:
application/json:
schema: { $ref: "#/components/schemas/SlurmClusterResponse" }
"400": { $ref: "#/components/responses/BadRequest" }
"401": { $ref: "#/components/responses/Unauthorized" }
"403": { $ref: "#/components/responses/Forbidden" }