Repository navigation
Expand file tree
/
Copy pathopenapi.yml
More file actions
2986 lines (2892 loc) · 121 KB
/
Copy pathopenapi.yml
File metadata and controls
2986 lines (2892 loc) · 121 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
openapi: 3.1.0
info:
title: HSDS REST API
description: |
HSDS (Highly Scalable Data Service) is a REST-based web service for HDF5 data.
It implements the HDF5 REST API convention used by h5pyd and h5serv: domains
(roughly analogous to HDF5 files), groups, datasets, committed datatypes,
links, and attributes, plus dataset value read/write with hyperslab/point/query
selection.
This spec documents the public Service-Node (SN) REST API - the interface
exposed to REST clients. It was generated from the HSDS source code
(hsds/domain_sn.py, group_sn.py, link_sn.py, attr_sn.py, ctype_sn.py,
dset_sn.py, chunk_sn.py, servicenode.py) rather than hand-written, so it
should closely track actual server behavior; however some undocumented
edge cases / internal inconsistencies noted in the source are called out
in operation descriptions rather than fully modeled.
### Addressing a domain
Every request (except `GET /domains`) operates on a "domain" (an HDF5
file-like container). The domain is specified either via the `domain`
query parameter or the `X-Hdf-domain` request header. An optional `bucket`
query parameter (or `X-Hdf-bucket` header) selects a non-default storage
bucket.
### Authentication
Basic Auth (`Authorization: Basic <base64(user:pass)>`). Many read (GET)
operations also accept anonymous requests (no `Authorization` header) if
the server is configured with `allow_noauth` - in that case the request
is treated as user `"default"`. All write operations (PUT/POST/DELETE)
require a valid `Authorization` header.
### Error responses
HSDS does not use a JSON error envelope. Error responses use aiohttp's
default plain-text rendering: `Content-Type: text/plain`, body of the
form `"<status>: <reason>"` (e.g. `"400: Invalid domain name"`).
### Boolean query parameters
Many query-string boolean parameters (e.g. `verbose`, `include_attrs`,
`include_links`, `getalias`, `getdnids`, `flush`, `rescan`, `meta_only`,
`keep_root`) are, in several handlers, parsed with a naive
"is this key present and non-empty string" check rather than true
boolean parsing. In those handlers `?flag=0` or `?flag=false` are
**truthy** (they enable the flag, they do not disable it) - only
omitting the parameter entirely is guaranteed to mean "false". This is
called out per-parameter below where explicitly confirmed against the
source; treat any other boolean query parameter with the same
suspicion unless it's documented as using the shared `getBooleanParam`
helper (which does parse `"0"`/`"false"` correctly).
### Known service-level issues (not just documentation gaps)
- `PUT .../value` with a `query` parameter (query-based update) and
`Limit` set: when the matching rows span more than one chunk, `Limit`
is applied independently within each chunk rather than coordinated
across chunks, so more than `Limit` rows total can end up updated.
This is a known, deliberately-deferred bug - see the `query`
parameter description on `PUT /datasets/{id}/value`.
version: "1.0.0"
license:
name: Apache-2.0
servers:
- url: "{scheme}://{host}:{port}"
description: HSDS service node endpoint
variables:
scheme:
enum: [http, https]
default: http
host:
default: localhost
port:
default: "5101"
security:
- basicAuth: []
- {} # anonymous access is allowed for many read operations when the server has allow_noauth set
tags:
- name: Status
description: Service/node status and health-check endpoints. Not domain-specific - no `domain` param is needed or used.
- name: Domains
description: Domain (HDF5-file-equivalent) and folder operations
- name: ACLs
description: Access control list operations
- name: Groups
description: Group operations
- name: Links
description: Link operations (hard/soft/external links between groups and objects)
- name: Attributes
description: Attribute operations, shared across groups/datasets/datatypes
- name: Datatypes
description: Committed (named) datatype operations
- name: Datasets
description: Dataset metadata, shape, and type operations
- name: Value
description: Dataset data read/write (hyperslab, point, and query selection)
paths:
/about:
get:
operationId: GetAbout
tags: [Status]
summary: Get service status and version info
description: |
Returns general information about the service as a whole (not a
specific node): overall cluster state, version, and node count.
This is the endpoint `tools/status_check.py` polls to determine
when the service has finished starting up (`state == "READY"`).
Authentication is optional. If `Authorization` is supplied it is
validated and the response reflects the authenticated user;
otherwise the response reports `username: "anonymous"`.
security: []
responses:
'200':
description: Service status.
content:
application/json:
schema:
type: object
properties:
start_time:
type: integer
description: Unix timestamp the service node started.
state:
type: string
enum: [INITIALIZING, WAITING, READY, TERMINATING]
description: Overall cluster readiness state.
hsds_version: { type: string }
name:
type: string
description: Configured server name (`server_name` config value).
greeting: { type: string }
about: { type: string }
node_count:
type: integer
description: Number of DN nodes currently registered.
dn_urls:
type: array
items: { type: string }
dn_ids:
type: array
items: { type: string }
username:
type: string
description: The authenticated username, or "anonymous" if no credentials were supplied.
isadmin: { type: boolean }
'401': { $ref: '#/components/responses/Unauthorized' }
/info:
get:
operationId: GetInfo
tags: [Status]
summary: Get this node's state and resource usage
description: |
Returns state and OS-level resource usage (CPU, disk I/O, network
I/O) for the specific node that handles the request - unlike
`/about`, this reflects one node's local state, not the cluster
as a whole. No authentication is required or checked.
security: []
responses:
'200':
description: Node status.
content:
application/json:
schema:
type: object
properties:
node:
type: object
properties:
id: { type: string }
type:
type: string
description: Node type - "sn" for the service node handling this request.
enum: [sn, dn, head_node]
start_time: { type: integer }
state:
type: string
enum: [INITIALIZING, WAITING, READY, TERMINATING]
node_number:
type: integer
description: Only present for `dn` nodes.
node_count: { type: integer }
cpu:
type: object
properties:
percent: { type: number }
cores: { type: integer }
diskio:
type: object
properties:
read_count: { type: integer }
read_time: { type: integer }
read_bytes: { type: integer }
write_count: { type: integer }
write_time: { type: integer }
write_bytes: { type: integer }
netio:
type: object
properties:
bytes_sent:
type: integer
description: "Note: a source-level bug (hsds/basenode.py) assigns bytes_recv over this key immediately after setting it, so this actually reports received bytes, and sent-byte count is not exposed."
packets_sent: { type: integer }
packets_recv: { type: integer }
errin: { type: integer }
errout: { type: integer }
dropin: { type: integer }
dropout: { type: integer }
memory:
type: object
properties:
phys_total: { type: integer }
phys_available: { type: integer }
swap_total: { type: integer }
swap_used: { type: integer }
swap_free: { type: integer }
percent: { type: number }
disk:
type: object
properties:
total: { type: integer }
used: { type: integer }
free: { type: integer }
percent: { type: number }
log_stats:
type: object
description: Count of log messages emitted, by level.
req_count:
type: integer
description: Number of HTTP requests handled by this node so far.
s3_stats:
type: object
description: Present only when using S3 storage.
azure_stats:
type: object
description: Present only when using Azure Blob storage.
meta_cache_stats:
type: object
description: Metadata object cache stats. Populated only on DN nodes - empty on SN/head.
properties:
count: { type: integer }
dirty_count: { type: integer }
utililization_per: { type: number }
mem_used: { type: integer }
mem_target: { type: integer }
chunk_cache_stats:
type: object
description: Chunk data cache stats. Populated only on DN nodes - empty on SN/head.
properties:
count: { type: integer }
dirty_count: { type: integer }
utililization_per: { type: number }
mem_used: { type: integer }
mem_target: { type: integer }
domain_cache_stats:
type: object
description: Domain object cache stats. Populated only on DN nodes - empty on SN/head.
properties:
count: { type: integer }
dirty_count: { type: integer }
utililization_per: { type: number }
mem_used: { type: integer }
mem_target: { type: integer }
/:
get:
operationId: GetDomain
tags: [Domains]
summary: Get domain (or resolve an object by h5path within it)
description: |
Returns JSON describing the domain identified by the `domain` query
param / `X-Hdf-domain` header.
If neither is given, returns the list of top-level domains instead
(the same `DomainList` payload as `GET /domains`, since the
top-level folder is not itself a domain and has no domain JSON in
the object store). Passing the domain path as a `host` query param
is no longer supported and 400s.
If `h5path` is given, resolves that path (relative to `parent_id`, or
the domain root if `parent_id` is absent) and returns the JSON for the
object found there (group/dataset/datatype) instead of the domain
itself. `getdnids`/`verbose`/`getobjs` only apply to the plain
domain-JSON response - they're silently ignored when `h5path` is
used.
parameters:
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
- name: parent_id
in: query
description: Base group id to resolve `h5path` under. Defaults to the domain root.
schema: { type: string }
- name: h5path
in: query
description: If present, resolve this path and return the target object's JSON instead of the domain JSON.
schema: { type: string }
- name: include_links
in: query
description: Include links when returning an `h5path`-resolved object.
schema: { type: boolean, default: false }
- name: include_attrs
in: query
description: Include attributes when returning an `h5path`-resolved object.
schema: { type: boolean, default: false }
- name: follow_soft_links
in: query
description: Allow following soft links while resolving `h5path`.
schema: { type: boolean, default: false }
- name: follow_external_links
in: query
description: Allow following external links while resolving `h5path`.
schema: { type: boolean, default: false }
- name: verbose
in: query
description: Include extended domain statistics (num_groups, num_datasets, total_size, md5_sum, etc.)
schema: { type: boolean, default: false }
- name: getobjs
in: query
description: Include a full `domain_objs` map of every object in the domain.
schema: { type: boolean, default: false }
- name: getdnids
in: query
description: Include the list of data-node ids serving this domain.
schema: { type: boolean, default: false }
responses:
'200':
description: >
Domain JSON; or (with `h5path`) resolved-object JSON; or, when no
domain is given, the top-level domain list - see description.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/DomainResponse'
- $ref: '#/components/schemas/ObjectResponse'
- $ref: '#/components/schemas/DomainList'
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'410': { $ref: '#/components/responses/Gone' }
'503': { $ref: '#/components/responses/ServiceUnavailable' }
put:
operationId: PutDomain
tags: [Domains]
summary: Create a domain or folder, flush pending writes, or trigger a rescan
description: |
Default behavior creates a new domain (or folder, if `folder: true`).
Passing `flush: true` (query param or body key) flushes the domain
instead. Passing `rescan: true` triggers a background rescan of the
domain's root group. `flush` and `rescan` may be combined; flush runs
first.
`rescan` only makes sense for domains that have a `root` group
(ordinary, non-folder domains) - passing `rescan=true` for an
existing *folder* domain 400s rather than attempting a rescan.
The `201` response does not actually include a `class` field (the
DN's creation handler never sets it, even though `DomainResponse` -
shared with `GET /` - declares one); fetch the domain again via
`GET /` if you need `class`.
parameters:
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
- name: getdnids
in: query
schema: { type: boolean, default: false }
description: Include `dn_ids` in the response (also settable via body).
- name: flush
in: query
schema: { type: boolean, default: false }
description: Flush the domain instead of creating it (also settable via body).
- name: rescan
in: query
schema: { type: boolean, default: false }
description: Rescan the domain root instead of creating it (also settable via body).
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
getdnids: { type: boolean }
flush: { type: boolean }
rescan: { type: boolean }
folder:
type: boolean
description: Create a folder domain (a container for other domains) rather than a data domain.
owner:
type: string
description: Domain owner. Setting this to a user other than the requester requires admin privileges.
linked_domain:
type: string
description: Existing domain whose root group this new domain should link to (creates an alias domain). Mutually exclusive with `folder`.
linked_bucket:
type: string
description: Storage bucket for `linked_domain`, if different from the request's bucket.
root_id:
type: string
description: Client-supplied root group id (schema2 uuid) for the new domain.
group:
type: object
description: Options for the new domain's root group.
properties:
creationProperties:
type: object
description: Creation properties copied onto the new root group.
responses:
'201':
description: Domain created.
content:
application/json:
schema: { $ref: '#/components/schemas/DomainResponse' }
'204':
description: Flush or rescan completed with nothing further to report (or `getdnids` requested a body with just `dn_ids`, in which case 200 is returned instead - see description).
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'410': { $ref: '#/components/responses/Gone' }
'503': { $ref: '#/components/responses/ServiceUnavailable' }
delete:
operationId: DeleteDomain
tags: [Domains]
summary: Delete a domain
description: |
Deletes the domain and (unless `keep_root` is set) its root group and
all reachable objects/chunks. Deleting a non-empty folder domain
(one that still has sub-domains/folders) returns 409.
If `meta_only` is set, only the server's in-memory domain cache entry
is cleared - no authentication or ACL check is performed in this case
and no actual storage delete happens.
If a JSON body is supplied, its `meta_only`/`keep_root` keys take
priority over the query parameters of the same name (the two are not
merged).
parameters:
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
- name: meta_only
in: query
schema: { type: boolean, default: false }
description: Only clear the cached domain entry; skip auth and the real delete.
- name: keep_root
in: query
schema: { type: boolean, default: false }
description: Don't delete the root group object when deleting the domain.
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
meta_only: { type: boolean }
keep_root: { type: boolean }
responses:
'200':
description: Domain deleted (or meta-cache cleared).
content:
application/json:
schema: { type: object }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'410': { $ref: '#/components/responses/Gone' }
post:
operationId: PostDomain
tags: [Domains]
summary: Resolve multiple h5paths within a domain in one request
parameters:
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
- name: parent_id
in: query
schema: { type: string }
description: Base group id to resolve each h5path under. Defaults to the domain root.
- name: include_links
in: query
schema: { type: boolean, default: false }
- name: include_attrs
in: query
schema: { type: boolean, default: false }
- name: follow_soft_links
in: query
schema: { type: boolean, default: false }
- name: follow_external_links
in: query
schema: { type: boolean, default: false }
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [h5paths]
properties:
h5paths:
type: array
items: { type: string }
description: List of h5paths to resolve.
responses:
'200':
description: Map of each requested h5path to its resolved object JSON.
content:
application/json:
schema:
type: object
properties:
h5paths:
type: object
additionalProperties:
$ref: '#/components/schemas/ObjectResponse'
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'410': { $ref: '#/components/responses/Gone' }
/domains:
get:
operationId: GetDomains
tags: [Domains]
summary: List domains under a folder
description: |
Lists domains directly under the folder given by `domain`/`X-Hdf-domain`
(default `/`, i.e. top-level domains). Supports glob-pattern filtering,
a query filter over root-group attributes, and S3-style pagination.
### Query syntax (`query`)
Same engine and grammar as `GET /datasets/{id}/value`'s `query`
param (`h5json.query_util.arrayQuery`): `"temperature > 20"`,
`"city IN ('seattle', 'portland')"`, combined with
`AND`/`OR`/`NOT`/`XOR`. Each candidate domain's root-group scalar
primitive attributes (integer/float/string) are used as the query
variables - unlike a dataset (one fixed schema for every row),
each domain can have a completely different set of attributes,
so:
- A domain missing an attribute the query references (or having
it as a non-scalar or non-primitive type) simply doesn't match
- this is not an error, even if *no* domain anywhere has that
attribute.
- Folder domains (no root group) never match a query.
- Genuine syntax errors (unlike a missing attribute) still 400.
parameters:
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
- name: pattern
in: query
description: Glob pattern matched against each candidate domain's basename.
schema: { type: string }
- name: query
in: query
description: Query-filter string over root-group scalar attributes (see syntax above).
schema: { type: string }
- name: verbose
in: query
schema: { type: boolean, default: false }
- $ref: '#/components/parameters/LimitParam'
- $ref: '#/components/parameters/MarkerParam'
responses:
'200':
description: List of domains.
content:
application/json:
schema: { $ref: '#/components/schemas/DomainList' }
'400': { $ref: '#/components/responses/BadRequest' }
'503': { $ref: '#/components/responses/ServiceUnavailable' }
/acls/{username}:
parameters:
- name: username
in: path
required: true
schema: { type: string }
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
get:
operationId: GetAcl
tags: [ACLs]
summary: Get the ACL entry for a user on a domain
description: |
Users may always read their own ACL entry (or the `default` entry)
with just "read" permission on the domain; reading another user's
entry requires "readACL" permission.
Note: with no `domain` given, this raises an unhandled server-side
error rather than a clean 400 (unlike most domain-scoped GETs,
which explicitly check for a missing domain and 400).
responses:
'200':
description: ACL entry.
content:
application/json:
schema:
type: object
properties:
acl: { $ref: '#/components/schemas/ACL' }
hrefs:
type: array
items: { $ref: '#/components/schemas/Href' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'410': { $ref: '#/components/responses/Gone' }
put:
operationId: PutAcl
tags: [ACLs]
summary: Create or update the ACL entry for a user on a domain
description: |
Requires "updateACL" permission on the domain (checked the same
way as every other ACL/domain-mutating operation).
requestBody:
required: true
content:
application/json:
schema:
type: object
description: Any subset of the 6 ACL action keys, each a boolean.
properties:
create: { type: boolean }
read: { type: boolean }
update: { type: boolean }
delete: { type: boolean }
readACL: { type: boolean }
updateACL: { type: boolean }
responses:
'201':
description: ACL entry created/updated.
content:
application/json:
schema: { type: object }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
/acls:
get:
operationId: GetAcls
tags: [ACLs]
summary: List all ACL entries on a domain
description: |
Unlike `GET /acls/{username}`, listing all ACL entries always
requires "readACL" permission (no self-record exception).
Note: with no `domain` given, this raises an unhandled server-side
error rather than a clean 400 (see the same note on
`GET /acls/{username}`).
parameters:
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
responses:
'200':
description: List of ACL entries.
content:
application/json:
schema:
type: object
properties:
acls:
type: array
items: { $ref: '#/components/schemas/ACL' }
hrefs:
type: array
items: { $ref: '#/components/schemas/Href' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'410': { $ref: '#/components/responses/Gone' }
/groups:
get:
operationId: GetGroups
tags: [Groups]
summary: List all group ids in a domain
parameters:
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
- $ref: '#/components/parameters/LimitParam'
- $ref: '#/components/parameters/MarkerParam'
responses:
'200':
description: List of group ids.
content:
application/json:
schema:
type: object
properties:
groups:
type: array
items: { type: string }
hrefs:
type: array
items: { $ref: '#/components/schemas/Href' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
post:
operationId: PostGroup
tags: [Groups]
summary: Create one or more groups
description: |
Accepts a single group-creation object, or a JSON list to batch-create
multiple groups in one request. `type` is not permitted in the body
(groups have no datatype).
**Bug:** `implicit` is only forwarded to argument construction for
single-object creates. For a batch create (a JSON list with more
than one item), it is not passed through and always behaves as
`implicit=0` regardless of the query param - missing intermediate
groups will cause the create to fail rather than being created
implicitly.
parameters:
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
- name: implicit
in: query
schema: { type: boolean, default: false }
description: Allow implicit creation of missing intermediate parent groups when `h5path` is used.
requestBody:
required: false
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/CreateObjectRequest'
- type: array
items: { $ref: '#/components/schemas/CreateObjectRequest' }
responses:
'201':
description: Group(s) created.
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/GroupObject'
- type: object
properties:
objects:
type: array
items: { $ref: '#/components/schemas/GroupObject' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
/groups/:
get:
operationId: GetRootOrGroupByPath
tags: [Groups]
summary: Resolve a group by h5path
description: |
Registered separately from `GET /groups/{id}` (note the trailing
slash, no id segment) for the case where the caller doesn't yet
know any group id.
**`h5path` is effectively required here, and must be absolute**
(start with `/`): the handler 400s with "Missing group id" if
there is neither a path `id` nor an `h5path`, so calling this route
with no `h5path` does NOT return the domain's root group as might
be expected - there is no way to fetch the root group without
already knowing its id (e.g. from the domain response's `root`
field). A relative `h5path` (not starting with `/`) also 400s on
this route, since there is no group id to resolve it against.
There is no supported way to resolve a *relative* `h5path` without
an id: a `grpid` parameter for this purpose is mentioned in older
references, but it is never actually read anywhere in the
group-handling code, so it has no effect.
parameters:
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
- name: h5path
in: query
required: true
schema: { type: string }
description: Absolute path to resolve. Must start with "/".
- name: getalias
in: query
schema: { type: boolean, default: false }
- name: include_links
in: query
schema: { type: boolean, default: false }
- name: include_attrs
in: query
schema: { type: boolean, default: false }
responses:
'200':
description: Group JSON.
content:
application/json:
schema: { $ref: '#/components/schemas/GroupObject' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
/groups/{id}:
parameters:
- name: id
in: path
required: true
schema: { type: string }
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
get:
operationId: GetGroup
tags: [Groups]
summary: Get a group
description: |
A group can also be located by an absolute path via the `h5path`
query parameter, resolved relative to `id`. See `GET /groups/` for
resolving an absolute `h5path` with no known group id (there is no
way to fetch the root group itself without already knowing its id).
parameters:
- name: h5path
in: query
schema: { type: string }
description: Resolve this path (relative to `id`) to a group instead of using the path id directly.
- name: getalias
in: query
schema: { type: boolean, default: false }
description: |
Include an `alias` list of h5paths that resolve to this group.
Note: parsed with a raw truthiness check rather than real
boolean parsing, so `?getalias=0` is truthy and turns this on.
- name: include_links
in: query
schema: { type: boolean, default: false }
- name: include_attrs
in: query
schema: { type: boolean, default: false }
responses:
'200':
description: Group JSON.
content:
application/json:
schema: { $ref: '#/components/schemas/GroupObject' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
delete:
operationId: DeleteGroup
tags: [Groups]
summary: Delete a group
description: Deleting a domain's root group is not allowed (403) - delete the domain instead.
responses:
'200':
description: Group deleted.
content:
application/json:
schema: { type: object }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
/groups/{id}/links:
parameters:
- name: id
in: path
required: true
schema: { type: string }
- $ref: '#/components/parameters/DomainParam'
- $ref: '#/components/parameters/DomainHeader'
- $ref: '#/components/parameters/BucketParam'
get:
operationId: GetLinks
tags: [Links]
summary: List links in a group
parameters:
- name: follow_links
in: query
schema: { type: boolean, default: false }
description: |
Recursively follow links into sub-groups. Response shape
changes to a map of group id to link list. Note: when set,
`CreateOrder` and `Marker` are silently ignored (only `Limit`
is honored) - the crawler used for this mode doesn't forward
them.
- name: pattern
in: query
schema: { type: string }
description: Glob pattern filter on link title.
- name: CreateOrder
in: query
schema: { type: boolean, default: false }
description: Return links in creation order instead of name order. Ignored when `follow_links` is set.
- $ref: '#/components/parameters/LimitParam'
- $ref: '#/components/parameters/MarkerParam'
responses:
'200':
description: |
List of links (or, with `follow_links`, a map of group id to
link list). Note: the two response shapes also differ in
per-link content, not just array-vs-map - the non-crawler
(default) path decorates each hard link with extra
`collection`/`target`/`href` keys not present in the `Link`
schema; these decorations are absent when `follow_links` is used.
content:
application/json:
schema:
type: object
properties:
links:
oneOf:
- type: array
items: { $ref: '#/components/schemas/Link' }
- type: object
additionalProperties:
type: array
items: { $ref: '#/components/schemas/Link' }
hrefs:
type: array
items: { $ref: '#/components/schemas/Href' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
'500': { $ref: '#/components/responses/InternalError' }
post:
operationId: PostLinks
tags: [Links]
summary: Batch-fetch links across one or more groups
description: |
Despite the POST verb this is a read operation. Provide `titles`
to fetch specific link names for the path group, or `grp_ids` to
fetch links from multiple groups in one call.
`titles` is mutually exclusive with `follow_links`, `Limit`, and
`CreateOrder` - combining `titles` with any of those three 400s.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
titles:
type: array
items: { type: string }
description: Specific link titles to fetch. Cannot be combined with a `grp_ids` object (dict) form.
grp_ids:
description: Either a list of group ids (fetch all/`titles` links from each), or a map of group id to a list of titles for that group.
oneOf:
- type: array
items: { type: string }
- type: object
additionalProperties:
type: array
items: { type: string }
parameters:
- name: follow_links
in: query
schema: { type: boolean, default: false }
- name: CreateOrder
in: query
schema: { type: boolean, default: false }
- $ref: '#/components/parameters/LimitParam'
- name: pattern
in: query
schema: { type: string }
responses:
'200':
description: Links for the requested group(s).
content:
application/json:
schema:
type: object
properties:
links:
oneOf:
- type: array
items: { $ref: '#/components/schemas/Link' }
- type: object
additionalProperties:
type: array
items: { $ref: '#/components/schemas/Link' }
'400': { $ref: '#/components/responses/BadRequest' }
'403': { $ref: '#/components/responses/Forbidden' }
put:
operationId: PutLinks
tags: [Links]
summary: Batch-create links across one or more groups
description: |
When `grp_ids` targets multiple groups, the overall response status
comes from a crawler that returns the highest status code seen
across all the individual per-group writes - so in practice this
operation can also surface status codes beyond 200/201/400/403