-
Notifications
You must be signed in to change notification settings - Fork 2.3k
/
rest-catalog-open-api.yaml
4085 lines (3762 loc) · 125 KB
/
rest-catalog-open-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
#
# 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.0.3
info:
title: Apache Iceberg REST Catalog API
license:
name: Apache 2.0
url: https://www.apache.org/licenses/LICENSE-2.0.html
version: 0.0.1
description:
Defines the specification for the first version of the REST Catalog API.
Implementations should ideally support both Iceberg table specs v1 and v2, with priority given to v2.
servers:
- url: "{scheme}://{host}/{basePath}"
description: Server URL when the port can be inferred from the scheme
variables:
scheme:
description: The scheme of the URI, either http or https.
default: https
host:
description: The host address for the specified server
default: localhost
basePath:
description: Optional prefix to be appended to all routes
default: ""
- url: "{scheme}://{host}:{port}/{basePath}"
description: Generic base server URL, with all parts configurable
variables:
scheme:
description: The scheme of the URI, either http or https.
default: https
host:
description: The host address for the specified server
default: localhost
port:
description: The port used when addressing the host
default: "443"
basePath:
description: Optional prefix to be appended to all routes
default: ""
# All routes are currently configured using an Authorization header.
security:
- OAuth2: [catalog]
- BearerAuth: []
paths:
/v1/config:
get:
tags:
- Configuration API
summary: List all catalog configuration settings
operationId: getConfig
parameters:
- name: warehouse
in: query
required: false
schema:
type: string
description: Warehouse location or identifier to request from the service
description:
"
All REST clients should first call this route to get catalog configuration
properties from the server to configure the catalog and its HTTP client.
Configuration from the server consists of two sets of key/value pairs.
- defaults - properties that should be used as default configuration; applied before client configuration
- overrides - properties that should be used to override client configuration; applied after defaults and client configuration
Catalog configuration is constructed by setting the defaults, then client-
provided configuration, and finally overrides. The final property set is then
used to configure the catalog.
For example, a default configuration property might set the size of the
client pool, which can be replaced with a client-specific setting. An
override might be used to set the warehouse location, which is stored
on the server rather than in client configuration.
Common catalog configuration settings are documented at
https://iceberg.apache.org/docs/latest/configuration/#catalog-properties
"
responses:
200:
description: Server specified configuration values.
content:
application/json:
schema:
$ref: '#/components/schemas/CatalogConfig'
example: {
"overrides": {
"warehouse": "s3://bucket/warehouse/"
},
"defaults": {
"clients": "4"
}
}
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
/v1/oauth/tokens:
post:
tags:
- OAuth2 API
summary: Get a token using an OAuth2 flow (DEPRECATED for REMOVAL)
deprecated: true
operationId: getToken
description:
The `oauth/tokens` endpoint is **DEPRECATED for REMOVAL**. It is _not_ recommended to
implement this endpoint, unless you are fully aware of the potential security implications.
All clients are encouraged to explicitly set the configuration property `oauth2-server-uri`
to the correct OAuth endpoint.
Deprecated since Iceberg (Java) 1.6.0. The endpoint and related types will be removed from
this spec in Iceberg (Java) 2.0.
See [Security improvements in the Iceberg REST specification](https://github.com/apache/iceberg/issues/10537)
Exchange credentials for a token using the OAuth2 client credentials flow or token exchange.
This endpoint is used for three purposes -
1. To exchange client credentials (client ID and secret) for an access token
This uses the client credentials flow.
2. To exchange a client token and an identity token for a more specific access token
This uses the token exchange flow.
3. To exchange an access token for one with the same claims and a refreshed expiration period
This uses the token exchange flow.
For example, a catalog client may be configured with client credentials from the OAuth2
Authorization flow. This client would exchange its client ID and secret for an access token
using the client credentials request with this endpoint (1). Subsequent requests would then
use that access token.
Some clients may also handle sessions that have additional user context. These clients would
use the token exchange flow to exchange a user token (the "subject" token) from the session
for a more specific access token for that user, using the catalog's access token as the
"actor" token (2). The user ID token is the "subject" token and can be any token type
allowed by the OAuth2 token exchange flow, including a unsecured JWT token with a sub claim.
This request should use the catalog's bearer token in the "Authorization" header.
Clients may also use the token exchange flow to refresh a token that is about to expire by
sending a token exchange request (3). The request's "subject" token should be the expiring
token. This request should use the subject token in the "Authorization" header.
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/OAuthTokenRequest'
responses:
200:
$ref: '#/components/responses/OAuthTokenResponse'
400:
$ref: '#/components/responses/OAuthErrorResponse'
401:
$ref: '#/components/responses/OAuthErrorResponse'
5XX:
$ref: '#/components/responses/OAuthErrorResponse'
/v1/{prefix}/namespaces:
parameters:
- $ref: '#/components/parameters/prefix'
get:
tags:
- Catalog API
summary: List namespaces, optionally providing a parent namespace to list underneath
description:
List all namespaces at a certain level, optionally starting from a given parent namespace.
If table accounting.tax.paid.info exists, using 'SELECT NAMESPACE IN accounting' would
translate into `GET /namespaces?parent=accounting` and must return a namespace, ["accounting", "tax"] only.
Using 'SELECT NAMESPACE IN accounting.tax' would
translate into `GET /namespaces?parent=accounting%1Ftax` and must return a namespace, ["accounting", "tax", "paid"].
If `parent` is not provided, all top-level namespaces should be listed.
operationId: listNamespaces
parameters:
- $ref: '#/components/parameters/page-token'
- $ref: '#/components/parameters/page-size'
- name: parent
in: query
description:
An optional namespace, underneath which to list namespaces.
If not provided or empty, all top-level namespaces should be listed.
If parent is a multipart namespace, the parts must be separated by the unit separator (`0x1F`) byte.
required: false
allowEmptyValue: true
schema:
type: string
example: "accounting%1Ftax"
responses:
200:
$ref: '#/components/responses/ListNamespacesResponse'
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description: Not Found - Namespace provided in the `parent` query parameter is not found.
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NoSuchNamespaceExample:
$ref: '#/components/examples/NoSuchNamespaceError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
post:
tags:
- Catalog API
summary: Create a namespace
description:
Create a namespace, with an optional set of properties.
The server might also add properties, such as `last_modified_time` etc.
operationId: createNamespace
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateNamespaceRequest'
responses:
200:
$ref: '#/components/responses/CreateNamespaceResponse'
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
406:
$ref: '#/components/responses/UnsupportedOperationResponse'
409:
description: Conflict - The namespace already exists
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NamespaceAlreadyExists:
$ref: '#/components/examples/NamespaceAlreadyExistsError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
/v1/{prefix}/namespaces/{namespace}:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'
get:
tags:
- Catalog API
summary: Load the metadata properties for a namespace
operationId: loadNamespaceMetadata
description: Return all stored metadata properties for a given namespace
responses:
200:
$ref: '#/components/responses/GetNamespaceResponse'
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description: Not Found - Namespace not found
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NoSuchNamespaceExample:
$ref: '#/components/examples/NoSuchNamespaceError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
head:
tags:
- Catalog API
summary: Check if a namespace exists
operationId: namespaceExists
description:
Check if a namespace exists. The response does not contain a body.
responses:
204:
description: Success, no content
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description: Not Found - Namespace not found
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NoSuchNamespaceExample:
$ref: '#/components/examples/NoSuchNamespaceError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
delete:
tags:
- Catalog API
summary: Drop a namespace from the catalog. Namespace must be empty.
operationId: dropNamespace
responses:
204:
description: Success, no content
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description: Not Found - Namespace to delete does not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NoSuchNamespaceExample:
$ref: '#/components/examples/NoSuchNamespaceError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
/v1/{prefix}/namespaces/{namespace}/properties:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'
post:
tags:
- Catalog API
summary: Set or remove properties on a namespace
operationId: updateProperties
description:
Set and/or remove properties on a namespace.
The request body specifies a list of properties to remove and a map
of key value pairs to update.
Properties that are not in the request are not modified or removed by this call.
Server implementations are not required to support namespace properties.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateNamespacePropertiesRequest'
examples:
UpdateAndRemoveProperties:
$ref: '#/components/examples/UpdateAndRemoveNamespacePropertiesRequest'
responses:
200:
$ref: '#/components/responses/UpdateNamespacePropertiesResponse'
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description: Not Found - Namespace not found
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NamespaceNotFound:
$ref: '#/components/examples/NoSuchNamespaceError'
406:
$ref: '#/components/responses/UnsupportedOperationResponse'
422:
description: Unprocessable Entity - A property key was included in both `removals` and `updates`
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
UnprocessableEntityDuplicateKey:
$ref: '#/components/examples/UnprocessableEntityDuplicateKey'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
/v1/{prefix}/namespaces/{namespace}/tables:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'
get:
tags:
- Catalog API
summary: List all table identifiers underneath a given namespace
description: Return all table identifiers under this namespace
operationId: listTables
parameters:
- $ref: '#/components/parameters/page-token'
- $ref: '#/components/parameters/page-size'
responses:
200:
$ref: '#/components/responses/ListTablesResponse'
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description: Not Found - The namespace specified does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NamespaceNotFound:
$ref: '#/components/examples/NoSuchNamespaceError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
post:
tags:
- Catalog API
summary: Create a table in the given namespace
description:
Create a table or start a create transaction, like atomic CTAS.
If `stage-create` is false, the table is created immediately.
If `stage-create` is true, the table is not created, but table metadata is initialized and returned.
The service should prepare as needed for a commit to the table commit endpoint to complete the create
transaction. The client uses the returned metadata to begin a transaction. To commit the transaction,
the client sends all create and subsequent changes to the table commit route. Changes from the table
create operation include changes like AddSchemaUpdate and SetCurrentSchemaUpdate that set the initial
table state.
operationId: createTable
parameters:
- $ref: '#/components/parameters/data-access'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateTableRequest'
responses:
200:
$ref: '#/components/responses/CreateTableResponse'
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description: Not Found - The namespace specified does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NamespaceNotFound:
$ref: '#/components/examples/NoSuchNamespaceError'
409:
description: Conflict - The table already exists
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NamespaceAlreadyExists:
$ref: '#/components/examples/TableAlreadyExistsError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
/v1/{prefix}/namespaces/{namespace}/register:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'
post:
tags:
- Catalog API
summary: Register a table in the given namespace using given metadata file location
description:
Register a table using given metadata file location.
operationId: registerTable
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/RegisterTableRequest'
responses:
200:
$ref: '#/components/responses/LoadTableResponse'
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description: Not Found - The namespace specified does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NamespaceNotFound:
$ref: '#/components/examples/NoSuchNamespaceError'
409:
description: Conflict - The table already exists
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
NamespaceAlreadyExists:
$ref: '#/components/examples/TableAlreadyExistsError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
/v1/{prefix}/namespaces/{namespace}/tables/{table}:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'
- $ref: '#/components/parameters/table'
get:
tags:
- Catalog API
summary: Load a table from the catalog
operationId: loadTable
description:
Load a table from the catalog.
The response contains both configuration and table metadata. The configuration, if non-empty is used
as additional configuration for the table that overrides catalog configuration. For example, this
configuration may change the FileIO implementation to be used for the table.
The response also contains the table's full metadata, matching the table metadata JSON file.
The catalog configuration may contain credentials that should be used for subsequent requests for the
table. The configuration key "token" is used to pass an access token to be used as a bearer token
for table requests. Otherwise, a token may be passed using a RFC 8693 token type as a configuration
key. For example, "urn:ietf:params:oauth:token-type:jwt=<JWT-token>".
parameters:
- $ref: '#/components/parameters/data-access'
- in: query
name: snapshots
description:
The snapshots to return in the body of the metadata. Setting the value to `all` would
return the full set of snapshots currently valid for the table. Setting the value to
`refs` would load all snapshots referenced by branches or tags.
Default if no param is provided is `all`.
required: false
schema:
type: string
enum: [ all, refs ]
responses:
200:
$ref: '#/components/responses/LoadTableResponse'
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description:
Not Found - NoSuchTableException, table to load does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
TableToLoadDoesNotExist:
$ref: '#/components/examples/NoSuchTableError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
post:
tags:
- Catalog API
summary: Commit updates to a table
operationId: updateTable
description:
Commit updates to a table.
Commits have two parts, requirements and updates. Requirements are assertions that will be validated
before attempting to make and commit changes. For example, `assert-ref-snapshot-id` will check that a
named ref's snapshot ID has a certain value.
Updates are changes to make to table metadata. For example, after asserting that the current main ref
is at the expected snapshot, a commit may add a new child snapshot and set the ref to the new
snapshot id.
Create table transactions that are started by createTable with `stage-create` set to true are
committed using this route. Transactions should include all changes to the table, including table
initialization, like AddSchemaUpdate and SetCurrentSchemaUpdate. The `assert-create` requirement is
used to ensure that the table was not created concurrently.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CommitTableRequest'
responses:
200:
$ref: '#/components/responses/CommitTableResponse'
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description:
Not Found - NoSuchTableException, table to load does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
TableToUpdateDoesNotExist:
$ref: '#/components/examples/NoSuchTableError'
409:
description:
Conflict - CommitFailedException, one or more requirements failed. The client may retry.
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
500:
description:
An unknown server-side problem occurred; the commit state is unknown.
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
example: {
"error": {
"message": "Internal Server Error",
"type": "CommitStateUnknownException",
"code": 500
}
}
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
502:
description:
A gateway or proxy received an invalid response from the upstream server; the commit state is unknown.
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
example: {
"error": {
"message": "Invalid response from the upstream server",
"type": "CommitStateUnknownException",
"code": 502
}
}
504:
description:
A server-side gateway timeout occurred; the commit state is unknown.
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
example: {
"error": {
"message": "Gateway timed out during commit",
"type": "CommitStateUnknownException",
"code": 504
}
}
5XX:
description:
A server-side problem that might not be addressable on the client.
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
example: {
"error": {
"message": "Bad Gateway",
"type": "InternalServerError",
"code": 502
}
}
delete:
tags:
- Catalog API
summary: Drop a table from the catalog
operationId: dropTable
description: Remove a table from the catalog
parameters:
- name: purgeRequested
in: query
required: false
description: Whether the user requested to purge the underlying table's data and metadata
schema:
type: boolean
default: false
responses:
204:
description: Success, no content
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description:
Not Found - NoSuchTableException, Table to drop does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
TableToDeleteDoesNotExist:
$ref: '#/components/examples/NoSuchTableError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
head:
tags:
- Catalog API
summary: Check if a table exists
operationId: tableExists
description:
Check if a table exists within a given namespace. The response does not contain a body.
responses:
204:
description: Success, no content
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description:
Not Found - NoSuchTableException, Table not found
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
TableToLoadDoesNotExist:
$ref: '#/components/examples/NoSuchTableError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
/v1/{prefix}/tables/rename:
parameters:
- $ref: '#/components/parameters/prefix'
post:
tags:
- Catalog API
summary: Rename a table from its current name to a new name
description:
Rename a table from one identifier to another. It's valid to move a table
across namespaces, but the server implementation is not required to support it.
operationId: renameTable
requestBody:
description: Current table identifier to rename and new table identifier to rename to
content:
application/json:
schema:
$ref: '#/components/schemas/RenameTableRequest'
examples:
RenameTableSameNamespace:
$ref: '#/components/examples/RenameTableSameNamespace'
required: true
responses:
204:
description: Success, no content
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description:
Not Found
- NoSuchTableException, Table to rename does not exist
- NoSuchNamespaceException, The target namespace of the new table identifier does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
TableToRenameDoesNotExist:
$ref: '#/components/examples/NoSuchTableError'
NamespaceToRenameToDoesNotExist:
$ref: '#/components/examples/NoSuchNamespaceError'
406:
$ref: '#/components/responses/UnsupportedOperationResponse'
409:
description: Conflict - The target identifier to rename to already exists as a table or view
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
example:
$ref: '#/components/examples/TableAlreadyExistsError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
/v1/{prefix}/namespaces/{namespace}/tables/{table}/metrics:
parameters:
- $ref: '#/components/parameters/prefix'
- $ref: '#/components/parameters/namespace'
- $ref: '#/components/parameters/table'
post:
tags:
- Catalog API
summary: Send a metrics report to this endpoint to be processed by the backend
operationId: reportMetrics
requestBody:
description: The request containing the metrics report to be sent
content:
application/json:
schema:
$ref: '#/components/schemas/ReportMetricsRequest'
required: true
responses:
204:
description: Success, no content
400:
$ref: '#/components/responses/BadRequestErrorResponse'
401:
$ref: '#/components/responses/UnauthorizedResponse'
403:
$ref: '#/components/responses/ForbiddenResponse'
404:
description:
Not Found - NoSuchTableException, table to load does not exist
content:
application/json:
schema:
$ref: '#/components/schemas/IcebergErrorResponse'
examples:
TableToLoadDoesNotExist:
$ref: '#/components/examples/NoSuchTableError'
419:
$ref: '#/components/responses/AuthenticationTimeoutResponse'
503:
$ref: '#/components/responses/ServiceUnavailableResponse'
5XX:
$ref: '#/components/responses/ServerErrorResponse'
/v1/{prefix}/transactions/commit:
parameters:
- $ref: '#/components/parameters/prefix'
post:
tags:
- Catalog API
summary: Commit updates to multiple tables in an atomic operation
operationId: commitTransaction
requestBody:
description:
Commit updates to multiple tables in an atomic operation
A commit for a single table consists of a table identifier with requirements and updates.
Requirements are assertions that will be validated before attempting to make and commit changes.
For example, `assert-ref-snapshot-id` will check that a named ref's snapshot ID has a certain value.
Updates are changes to make to table metadata. For example, after asserting that the current main ref
is at the expected snapshot, a commit may add a new child snapshot and set the ref to the new
snapshot id.
content:
application/json:
schema:
$ref: '#/components/schemas/CommitTransactionRequest'
required: true
responses:
204: