-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_catalog.py
More file actions
1971 lines (1908 loc) · 88.1 KB
/
api_catalog.py
File metadata and controls
1971 lines (1908 loc) · 88.1 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
"""Databricks API Catalog -- Workspace and Account endpoints.
Declarative registry of every Databricks REST API endpoint exposed by
the explorer UI, organised by scope and category.
Two top-level catalogs:
* :data:`API_CATALOG` -- **Workspace** APIs (target: workspace URL).
* :data:`ACCOUNT_API_CATALOG` -- **Account** APIs (target:
``accounts.cloud.databricks.com`` or ``accounts.azuredatabricks.net``).
Each catalog is a nested dict of categories → endpoint definitions.
:data:`LIST_TO_GET` / :data:`ACCOUNT_LIST_TO_GET` drive inline
navigation links from list responses to their corresponding *get*
endpoints.
Attributes:
API_CATALOG: Workspace endpoint registry keyed by category name.
ACCOUNT_API_CATALOG: Account endpoint registry keyed by category.
LIST_TO_GET: Workspace list→get link map.
ACCOUNT_LIST_TO_GET: Account list→get link map.
ENDPOINT_MAP: Flat map of *all* endpoints (both scopes) keyed by ID.
TOTAL_ENDPOINTS: Total number of workspace endpoints.
TOTAL_CATEGORIES: Total number of workspace categories.
TOTAL_ACCOUNT_ENDPOINTS: Total number of account endpoints.
TOTAL_ACCOUNT_CATEGORIES: Total number of account categories.
"""
from typing import Any, Dict, List, Optional
STR: str = "string"
INT: str = "integer"
BOOL: str = "boolean"
def _p(
name: str,
desc: str,
required: bool = False,
type_: str = STR,
default: str = "",
) -> Dict[str, Any]:
"""Build a parameter definition dict for an endpoint.
Args:
name: Parameter name as expected by the Databricks REST API.
desc: Human-readable description shown in the UI.
required: Whether the parameter is mandatory.
type_: Data type hint (``"string"``, ``"integer"``, or
``"boolean"``).
default: Default value pre-filled in the input field.
Returns:
A parameter dict consumable by :func:`app.build_param_form`.
"""
return {
"name": name,
"description": desc,
"required": required,
"type": type_,
"default": default,
}
API_CATALOG: Dict[str, Any] = {
"Clusters": {
"icon": "bi-cpu",
"color": "#00d4ff",
"endpoints": [
{
"id": "clusters-list",
"name": "List All Clusters",
"method": "GET",
"path": "/api/2.0/clusters/list",
"description": "Returns information about all pinned clusters, active clusters, up to 200 recently terminated interactive clusters, and up to 30 recently terminated job clusters.",
"params": [],
"body": None,
},
{
"id": "clusters-get",
"name": "Get Cluster",
"method": "GET",
"path": "/api/2.0/clusters/get",
"description": "Retrieves the information for a cluster given its identifier.",
"params": [_p("cluster_id", "The cluster to retrieve information about.", required=True)],
"body": None,
},
{
"id": "clusters-list-node-types",
"name": "List Node Types",
"method": "GET",
"path": "/api/2.0/clusters/list-node-types",
"description": "Returns a list of supported Spark node types. These node types can be used to launch a cluster.",
"params": [],
"body": None,
},
{
"id": "clusters-spark-versions",
"name": "List Spark Versions",
"method": "GET",
"path": "/api/2.0/clusters/spark-versions",
"description": "Returns the list of available Spark versions. These versions can be used to launch a cluster.",
"params": [],
"body": None,
},
{
"id": "clusters-events",
"name": "Get Cluster Events",
"method": "POST",
"path": "/api/2.0/clusters/events",
"description": "Retrieves a list of events about the activity of a cluster.",
"params": [],
"body": '{\n "cluster_id": "<cluster-id>",\n "limit": 20\n}',
},
],
},
"Jobs": {
"icon": "bi-briefcase",
"color": "#a855f7",
"endpoints": [
{
"id": "jobs-list",
"name": "List Jobs",
"method": "GET",
"path": "/api/2.1/jobs/list",
"description": "Retrieves a list of jobs. Does not include deleted jobs.",
"params": [
_p("limit", "Max number of jobs to return (1–100).", default="25", type_=INT),
_p("offset", "Offset of the first job to return.", default="0", type_=INT),
_p("expand_tasks", "Include task and cluster spec info (true/false).", default="false"),
],
"body": None,
},
{
"id": "jobs-get",
"name": "Get Job",
"method": "GET",
"path": "/api/2.1/jobs/get",
"description": "Retrieves the details for a single job.",
"params": [_p("job_id", "The canonical identifier of the job.", required=True, type_=INT)],
"body": None,
},
{
"id": "jobs-runs-list",
"name": "List Job Runs",
"method": "GET",
"path": "/api/2.1/jobs/runs/list",
"description": "Lists runs in descending order by start time.",
"params": [
_p("job_id", "Filter runs by job ID (optional).", type_=INT),
_p("limit", "Max number of runs to return (1–25).", default="25", type_=INT),
_p("offset", "Offset of the first run.", default="0", type_=INT),
_p("active_only", "Return only active runs (true/false).", default="false"),
_p("completed_only", "Return only completed runs (true/false).", default="false"),
],
"body": None,
},
{
"id": "jobs-runs-get",
"name": "Get Run",
"method": "GET",
"path": "/api/2.1/jobs/runs/get",
"description": "Retrieves the metadata of a run.",
"params": [
_p("run_id", "The canonical identifier of the run.", required=True, type_=INT),
_p("include_history", "Include iteration history (true/false).", default="false"),
],
"body": None,
},
],
},
"Workspace": {
"icon": "bi-folder2-open",
"color": "#f59e0b",
"endpoints": [
{
"id": "workspace-list",
"name": "List Objects",
"method": "GET",
"path": "/api/2.0/workspace/list",
"description": "Lists the contents of a directory, or the object if it is not a directory.",
"params": [_p("path", "The absolute path of the directory.", required=True, default="/")],
"body": None,
},
{
"id": "workspace-get-status",
"name": "Get Object Status",
"method": "GET",
"path": "/api/2.0/workspace/get-status",
"description": "Gets the status of an object or a directory.",
"params": [_p("path", "The absolute path of the notebook or directory.", required=True)],
"body": None,
},
],
},
"DBFS": {
"icon": "bi-hdd-network",
"color": "#10b981",
"endpoints": [
{
"id": "dbfs-list",
"name": "List Files",
"method": "GET",
"path": "/api/2.0/dbfs/list",
"description": "Lists the contents of a directory, or details of a file. If path is a file, returns a single-element list.",
"params": [_p("path", "The path of the file or directory.", required=True, default="/")],
"body": None,
},
{
"id": "dbfs-get-status",
"name": "Get File Status",
"method": "GET",
"path": "/api/2.0/dbfs/get-status",
"description": "Gets the file information for a file or directory on DBFS.",
"params": [_p("path", "The path of the file or directory.", required=True)],
"body": None,
},
],
},
"SQL Warehouses": {
"icon": "bi-database",
"color": "#ec4899",
"endpoints": [
{
"id": "sql-warehouses-list",
"name": "List Warehouses",
"method": "GET",
"path": "/api/2.0/sql/warehouses",
"description": "Lists all SQL warehouses that a user has manager permissions on.",
"params": [_p("run_as_user_id", "Filter by run-as user ID.", type_=INT)],
"body": None,
},
{
"id": "sql-warehouses-get",
"name": "Get Warehouse",
"method": "GET",
"path": "/api/2.0/sql/warehouses/{id}",
"description": "Gets the information for a single SQL warehouse.",
"params": [_p("id", "Required ID of the warehouse.", required=True)],
"body": None,
"path_params": ["id"],
},
{
"id": "sql-queries-list",
"name": "List Saved Queries",
"method": "GET",
"path": "/api/2.0/sql/queries",
"description": "Gets a list of saved SQL queries.",
"params": [
_p("page_size", "Number of queries per page.", default="25", type_=INT),
_p("q", "Search query string."),
_p("order", "Sort field (e.g., name, created_at)."),
],
"body": None,
},
],
},
"Unity Catalog": {
"icon": "bi-layers",
"color": "#6366f1",
"endpoints": [
{
"id": "uc-catalogs-list",
"name": "List Catalogs",
"method": "GET",
"path": "/api/2.1/unity-catalog/catalogs",
"description": "Lists the available catalogs. There is no guarantee of a specific ordering of the elements in the list.",
"params": [_p("max_results", "Maximum number of catalogs to return.", type_=INT)],
"body": None,
},
{
"id": "uc-schemas-list",
"name": "List Schemas",
"method": "GET",
"path": "/api/2.1/unity-catalog/schemas",
"description": "Lists the schemas for a catalog.",
"params": [
_p("catalog_name", "Parent catalog for schemas of interest.", required=True),
_p("max_results", "Maximum number of schemas to return.", type_=INT),
],
"body": None,
},
{
"id": "uc-tables-list",
"name": "List Tables",
"method": "GET",
"path": "/api/2.1/unity-catalog/tables",
"description": "Gets an array of all tables for the current metastore under the parent catalog and schema.",
"params": [
_p("catalog_name", "Name of the catalog.", required=True),
_p("schema_name", "Name of the schema.", required=True),
_p("max_results", "Maximum number of tables to return.", type_=INT),
],
"body": None,
},
{
"id": "uc-tables-get",
"name": "Get Table",
"method": "GET",
"path": "/api/2.1/unity-catalog/tables/{full_name}",
"description": "Gets a table from Unity Catalog using its full name (catalog.schema.table).",
"params": [_p("full_name", "Full name of the table: catalog.schema.table", required=True)],
"body": None,
"path_params": ["full_name"],
},
{
"id": "uc-volumes-list",
"name": "List Volumes",
"method": "GET",
"path": "/api/2.1/unity-catalog/volumes",
"description": "Lists volumes from the specified catalog and schema.",
"params": [
_p("catalog_name", "The identifier of the catalog.", required=True),
_p("schema_name", "The identifier of the schema.", required=True),
_p("max_results", "Maximum number of volumes to return.", type_=INT),
],
"body": None,
},
{
"id": "uc-metastore-get",
"name": "Get Current Metastore",
"method": "GET",
"path": "/api/2.1/unity-catalog/metastore_summary",
"description": "Gets the summary of the metastore assigned to the workspace.",
"params": [],
"body": None,
},
],
},
"MLflow": {
"icon": "bi-graph-up",
"color": "#0ea5e9",
"endpoints": [
{
"id": "mlflow-experiments-search",
"name": "Search Experiments",
"method": "GET",
"path": "/api/2.0/mlflow/experiments/search",
"description": "Gets a list of all experiments.",
"params": [
_p("max_results", "Maximum number of experiments.", default="100", type_=INT),
_p("filter", "A filter expression over experiment attributes and tags."),
_p("order_by", "List of columns for ordering (e.g., last_update_time DESC)."),
],
"body": None,
},
{
"id": "mlflow-experiments-get",
"name": "Get Experiment",
"method": "GET",
"path": "/api/2.0/mlflow/experiments/get",
"description": "Gets metadata for an experiment. This method works on deleted experiments.",
"params": [_p("experiment_id", "ID of the associated experiment.", required=True)],
"body": None,
},
{
"id": "mlflow-runs-search",
"name": "Search Runs",
"method": "POST",
"path": "/api/2.0/mlflow/runs/search",
"description": "Searches for runs that satisfy expressions. Search expressions can use Metric and Param keys.",
"params": [],
"body": '{\n "experiment_ids": ["<experiment-id>"],\n "max_results": 25,\n "order_by": ["start_time DESC"]\n}',
},
{
"id": "mlflow-registered-models-search",
"name": "Search Registered Models",
"method": "GET",
"path": "/api/2.0/mlflow/registered-models/search",
"description": "Searches for registered models based on the specified filters.",
"params": [
_p("max_results", "Max number of registered models.", default="100", type_=INT),
_p("filter", "String filter condition for models."),
_p("order_by", "Columns for ordering results."),
],
"body": None,
},
],
},
"Model Serving": {
"icon": "bi-lightning",
"color": "#f97316",
"endpoints": [
{
"id": "serving-endpoints-list",
"name": "List Endpoints",
"method": "GET",
"path": "/api/2.0/serving-endpoints",
"description": "Retrieves a list of serving endpoints.",
"params": [],
"body": None,
},
{
"id": "serving-endpoints-get",
"name": "Get Endpoint",
"method": "GET",
"path": "/api/2.0/serving-endpoints/{name}",
"description": "Retrieves the object and model serving endpoint configuration.",
"params": [_p("name", "The name of the serving endpoint.", required=True)],
"body": None,
"path_params": ["name"],
},
],
},
"Pipelines (DLT)": {
"icon": "bi-diagram-3",
"color": "#38bdf8",
"endpoints": [
{
"id": "pipelines-list",
"name": "List Pipelines",
"method": "GET",
"path": "/api/2.0/pipelines",
"description": "Returns a list of pipelines.",
"params": [
_p("max_results", "Maximum number of entries to return.", default="25", type_=INT),
_p("filter", "Select a subset based on the specified criteria (e.g., state = 'RUNNING')."),
],
"body": None,
},
{
"id": "pipelines-get",
"name": "Get Pipeline",
"method": "GET",
"path": "/api/2.0/pipelines/{pipeline_id}",
"description": "Gets a pipeline by its ID.",
"params": [_p("pipeline_id", "The pipeline ID.", required=True)],
"body": None,
"path_params": ["pipeline_id"],
},
{
"id": "pipelines-events",
"name": "List Pipeline Events",
"method": "GET",
"path": "/api/2.0/pipelines/{pipeline_id}/events",
"description": "Retrieves events for a pipeline, ordered by timestamp descending.",
"params": [
_p("pipeline_id", "The pipeline ID.", required=True),
_p("max_results", "Max number of results.", default="25", type_=INT),
],
"body": None,
"path_params": ["pipeline_id"],
},
],
},
"Secrets": {
"icon": "bi-key",
"color": "#84cc16",
"endpoints": [
{
"id": "secrets-list-scopes",
"name": "List Secret Scopes",
"method": "GET",
"path": "/api/2.0/secrets/scopes/list",
"description": "Lists all secret scopes available in the workspace.",
"params": [],
"body": None,
},
{
"id": "secrets-list",
"name": "List Secrets in Scope",
"method": "GET",
"path": "/api/2.0/secrets/list",
"description": "Lists the secrets stored within a given scope.",
"params": [_p("scope", "The name of the scope whose secrets to list.", required=True)],
"body": None,
},
],
},
"Identity (SCIM)": {
"icon": "bi-people",
"color": "#14b8a6",
"endpoints": [
{
"id": "scim-me",
"name": "Get Current User",
"method": "GET",
"path": "/api/2.0/preview/scim/v2/Me",
"description": "Gets the current authenticated user's profile.",
"params": [],
"body": None,
},
{
"id": "scim-users-list",
"name": "List Users",
"method": "GET",
"path": "/api/2.0/preview/scim/v2/Users",
"description": "Retrieves a list of users in the workspace.",
"params": [
_p("startIndex", "Index of the first result (1-based).", default="1", type_=INT),
_p("count", "Max number of results per page.", default="20", type_=INT),
_p("filter", 'Filter expression, e.g.: displayName co "admin"'),
],
"body": None,
},
{
"id": "scim-groups-list",
"name": "List Groups",
"method": "GET",
"path": "/api/2.0/preview/scim/v2/Groups",
"description": "Retrieves a list of groups in the workspace.",
"params": [
_p("startIndex", "Index of the first result.", default="1", type_=INT),
_p("count", "Max number of results per page.", default="20", type_=INT),
_p("filter", "Filter expression over group attributes."),
],
"body": None,
},
{
"id": "scim-service-principals-list",
"name": "List Service Principals",
"method": "GET",
"path": "/api/2.0/preview/scim/v2/ServicePrincipals",
"description": "Retrieves a list of service principals.",
"params": [
_p("startIndex", "Index of the first result.", default="1", type_=INT),
_p("count", "Max number of results.", default="20", type_=INT),
_p("filter", "Filter expression."),
],
"body": None,
},
],
},
"Tokens": {
"icon": "bi-shield-lock",
"color": "#d946ef",
"endpoints": [
{
"id": "tokens-list",
"name": "List Tokens",
"method": "GET",
"path": "/api/2.0/token/list",
"description": "Lists the public token information for all tokens in the workspace (admin-only).",
"params": [],
"body": None,
},
],
},
"Instance Pools": {
"icon": "bi-stack",
"color": "#78716c",
"endpoints": [
{
"id": "instance-pools-list",
"name": "List Instance Pools",
"method": "GET",
"path": "/api/2.0/instance-pools/list",
"description": "Returns a list of instance pools.",
"params": [],
"body": None,
},
],
},
"Cluster Policies": {
"icon": "bi-file-ruled",
"color": "#94a3b8",
"endpoints": [
{
"id": "policies-list",
"name": "List Cluster Policies",
"method": "GET",
"path": "/api/2.0/policies/clusters/list",
"description": "Returns a list of policies accessible by the requestor.",
"params": [
_p("sort_by", "Sort field: NAME, CREATOR, or CREATION_TIME."),
_p("sort_order", "Sort order: ASC or DESC."),
],
"body": None,
},
],
},
"Repos": {
"icon": "bi-git",
"color": "#fb7185",
"endpoints": [
{
"id": "repos-list",
"name": "List Repos",
"method": "GET",
"path": "/api/2.0/repos",
"description": "Returns repos that the calling user has Manage permissions on.",
"params": [
_p("path_prefix", "Filter repos with paths beginning with this prefix."),
_p("next_page_token", "Token for the next page of results."),
],
"body": None,
},
],
},
"Permissions": {
"icon": "bi-shield-check",
"color": "#fbbf24",
"endpoints": [
{
"id": "permissions-clusters-get",
"name": "Get Cluster Permissions",
"method": "GET",
"path": "/api/2.0/permissions/clusters/{cluster_id}",
"description": "Gets the permissions of a cluster. Clusters can inherit permissions from their root object.",
"params": [_p("cluster_id", "The cluster ID.", required=True)],
"body": None,
"path_params": ["cluster_id"],
},
{
"id": "permissions-jobs-get",
"name": "Get Job Permissions",
"method": "GET",
"path": "/api/2.0/permissions/jobs/{job_id}",
"description": "Gets the permissions of a job.",
"params": [_p("job_id", "The job ID.", required=True, type_=INT)],
"body": None,
"path_params": ["job_id"],
},
{
"id": "permissions-warehouses-get",
"name": "Get Warehouse Permissions",
"method": "GET",
"path": "/api/2.0/permissions/sql/warehouses/{warehouse_id}",
"description": "Gets the permissions of a SQL warehouse.",
"params": [_p("warehouse_id", "The warehouse ID.", required=True)],
"body": None,
"path_params": ["warehouse_id"],
},
],
},
"Lakebase Provisioned": {
"icon": "bi-database-gear",
"color": "#22d3ee",
"endpoints": [
{
"id": "lakebase-instances-list",
"name": "List Database Instances",
"method": "GET",
"path": "/api/2.0/database/instances",
"description": "Returns a list of all Lakebase (managed PostgreSQL) database instances in the workspace.",
"params": [
_p("page_size", "Maximum number of results per page.", type_=INT),
_p("page_token", "Pagination token for the next page."),
],
"body": None,
},
{
"id": "lakebase-instances-get",
"name": "Get Database Instance",
"method": "GET",
"path": "/api/2.0/database/instances/{name}",
"description": "Gets details for a single Lakebase database instance.",
"params": [_p("name", "The instance name.", required=True)],
"body": None,
"path_params": ["name"],
},
{
"id": "lakebase-catalogs-get",
"name": "Get Database Catalog",
"method": "GET",
"path": "/api/2.0/database/catalogs/{name}",
"description": "Gets details for a Lakebase database catalog registered in Unity Catalog.",
"params": [_p("name", "The catalog name.", required=True)],
"body": None,
"path_params": ["name"],
},
{
"id": "lakebase-tables-get",
"name": "Get Database Table",
"method": "GET",
"path": "/api/2.0/database/tables/{name}",
"description": "Gets details for a Lakebase database table. Name is the full three-part name (catalog.schema.table).",
"params": [_p("name", "Full three-part table name (catalog.schema.table).", required=True)],
"body": None,
"path_params": ["name"],
},
{
"id": "lakebase-synced-tables-get",
"name": "Get Synced Database Table",
"method": "GET",
"path": "/api/2.0/database/synced-tables/{name}",
"description": "Gets details for a synced database table (reverse ETL from Delta Lake to Lakebase).",
"params": [_p("name", "Full three-part synced table name (catalog.schema.table).", required=True)],
"body": None,
"path_params": ["name"],
},
{
"id": "lakebase-instances-create",
"name": "Create Database Instance",
"method": "POST",
"path": "/api/2.0/database/instances",
"description": "Creates a new Lakebase database instance.",
"params": [],
"body": '{\n "name": "my-instance",\n "capacity": "CU_1",\n "stopped": false\n}',
},
{
"id": "lakebase-instances-update",
"name": "Update Database Instance",
"method": "PATCH",
"path": "/api/2.0/database/instances/{name}",
"description": "Updates a Lakebase database instance (e.g. capacity, stopped state).",
"params": [_p("name", "The instance name.", required=True)],
"body": '{\n "capacity": "CU_2",\n "stopped": false\n}',
"path_params": ["name"],
},
{
"id": "lakebase-instances-delete",
"name": "Delete Database Instance",
"method": "DELETE",
"path": "/api/2.0/database/instances/{name}",
"description": "Deletes a Lakebase database instance.",
"params": [
_p("name", "The instance name.", required=True),
_p("force", "Force delete even if instance has PITR descendants.", type_=BOOL),
],
"body": None,
"path_params": ["name"],
},
{
"id": "lakebase-credential-generate",
"name": "Generate Database Credential",
"method": "POST",
"path": "/api/2.0/database/credential",
"description": "Generates an OAuth token for connecting to Lakebase instances (expires after 1 hour).",
"params": [],
"body": '{\n "instance_names": ["my-instance"]\n}',
},
{
"id": "lakebase-catalogs-create",
"name": "Create Database Catalog",
"method": "POST",
"path": "/api/2.0/database/catalogs",
"description": "Registers a Lakebase database as a Unity Catalog catalog.",
"params": [],
"body": '{\n "name": "my-catalog",\n "database_instance_name": "my-instance",\n "database_name": "postgres"\n}',
},
{
"id": "lakebase-catalogs-delete",
"name": "Delete Database Catalog",
"method": "DELETE",
"path": "/api/2.0/database/catalogs/{name}",
"description": "Deletes a Lakebase database catalog from Unity Catalog.",
"params": [_p("name", "The catalog name.", required=True)],
"body": None,
"path_params": ["name"],
},
{
"id": "lakebase-tables-create",
"name": "Create Database Table",
"method": "POST",
"path": "/api/2.0/database/tables",
"description": "Registers a pre-existing PostgreSQL table in Unity Catalog.",
"params": [],
"body": '{\n "name": "catalog.schema.table",\n "database_instance_name": "my-instance",\n "logical_database_name": "postgres"\n}',
},
{
"id": "lakebase-tables-delete",
"name": "Delete Database Table",
"method": "DELETE",
"path": "/api/2.0/database/tables/{name}",
"description": "Deletes a Lakebase database table registration from Unity Catalog.",
"params": [_p("name", "Full three-part table name (catalog.schema.table).", required=True)],
"body": None,
"path_params": ["name"],
},
{
"id": "lakebase-synced-tables-create",
"name": "Create Synced Database Table",
"method": "POST",
"path": "/api/2.0/database/synced-tables",
"description": "Creates a synced table for reverse ETL from a Delta Lake source to Lakebase.",
"params": [],
"body": '{\n "name": "catalog.schema.table",\n "database_instance_name": "my-instance",\n "logical_database_name": "postgres"\n}',
},
{
"id": "lakebase-synced-tables-delete",
"name": "Delete Synced Database Table",
"method": "DELETE",
"path": "/api/2.0/database/synced-tables/{name}",
"description": "Deletes a synced database table.",
"params": [_p("name", "Full three-part synced table name (catalog.schema.table).", required=True)],
"body": None,
"path_params": ["name"],
},
],
},
"Lakebase Autoscaling": {
"icon": "bi-database-add",
"color": "#06b6d4",
"endpoints": [
{
"id": "pg-projects-list",
"name": "List Projects",
"method": "GET",
"path": "/api/2.0/postgres/projects",
"description": "Lists all Lakebase Autoscaling projects in the workspace.",
"params": [
_p("page_size", "Maximum number of results per page.", type_=INT),
_p("page_token", "Pagination token for the next page."),
],
"body": None,
},
{
"id": "pg-projects-get",
"name": "Get Project",
"method": "GET",
"path": "/api/2.0/postgres/projects/{project_id}",
"description": "Gets details for a Lakebase Autoscaling project.",
"params": [_p("project_id", "The project ID (e.g. my-app).", required=True)],
"body": None,
"path_params": ["project_id"],
},
{
"id": "pg-projects-create",
"name": "Create Project",
"method": "POST",
"path": "/api/2.0/postgres/projects",
"description": "Creates a new Lakebase Autoscaling project containing branches and compute endpoints.",
"params": [_p("project_id", "The project ID (1-63 chars, lowercase, letters/numbers/hyphens).", required=True)],
"body": '{\n "status": {\n "display_name": "my-project",\n "pg_version": 17\n }\n}',
},
{
"id": "pg-projects-update",
"name": "Update Project",
"method": "PATCH",
"path": "/api/2.0/postgres/projects/{project_id}",
"description": "Updates a Lakebase Autoscaling project.",
"params": [_p("project_id", "The project ID.", required=True)],
"body": '{\n "status": {\n "default_endpoint_settings": {\n "autoscaling_limit_min_cu": 1,\n "autoscaling_limit_max_cu": 4\n }\n }\n}',
"path_params": ["project_id"],
},
{
"id": "pg-projects-delete",
"name": "Delete Project",
"method": "DELETE",
"path": "/api/2.0/postgres/projects/{project_id}",
"description": "Deletes a Lakebase Autoscaling project and all its branches and endpoints.",
"params": [_p("project_id", "The project ID.", required=True)],
"body": None,
"path_params": ["project_id"],
},
{
"id": "pg-branches-list",
"name": "List Branches",
"method": "GET",
"path": "/api/2.0/postgres/projects/{project_id}/branches",
"description": "Lists all branches in a Lakebase Autoscaling project.",
"params": [
_p("project_id", "The project ID.", required=True),
_p("page_size", "Maximum number of results per page.", type_=INT),
_p("page_token", "Pagination token for the next page."),
],
"body": None,
"path_params": ["project_id"],
},
{
"id": "pg-branches-get",
"name": "Get Branch",
"method": "GET",
"path": "/api/2.0/postgres/projects/{project_id}/branches/{branch_id}",
"description": "Gets details for a branch in a Lakebase Autoscaling project.",
"params": [
_p("project_id", "The project ID.", required=True),
_p("branch_id", "The branch ID (e.g. production, dev).", required=True),
],
"body": None,
"path_params": ["project_id", "branch_id"],
},
{
"id": "pg-branches-create",
"name": "Create Branch",
"method": "POST",
"path": "/api/2.0/postgres/projects/{project_id}/branches",
"description": "Creates a new branch in a Lakebase Autoscaling project.",
"params": [
_p("project_id", "The project ID.", required=True),
_p("branch_id", "The branch ID (1-63 chars, lowercase, letters/numbers/hyphens).", required=True),
],
"body": None,
"path_params": ["project_id"],
},
{
"id": "pg-branches-update",
"name": "Update Branch",
"method": "PATCH",
"path": "/api/2.0/postgres/projects/{project_id}/branches/{branch_id}",
"description": "Updates a branch in a Lakebase Autoscaling project.",
"params": [
_p("project_id", "The project ID.", required=True),
_p("branch_id", "The branch ID.", required=True),
],
"body": '{\n "status": {\n "is_protected": true\n }\n}',
"path_params": ["project_id", "branch_id"],
},
{
"id": "pg-branches-delete",
"name": "Delete Branch",
"method": "DELETE",
"path": "/api/2.0/postgres/projects/{project_id}/branches/{branch_id}",
"description": "Deletes a branch and all its endpoints.",
"params": [
_p("project_id", "The project ID.", required=True),
_p("branch_id", "The branch ID.", required=True),
],
"body": None,
"path_params": ["project_id", "branch_id"],
},
{
"id": "pg-endpoints-list",
"name": "List Endpoints",
"method": "GET",
"path": "/api/2.0/postgres/projects/{project_id}/branches/{branch_id}/endpoints",
"description": "Lists all compute endpoints in a branch.",
"params": [
_p("project_id", "The project ID.", required=True),
_p("branch_id", "The branch ID.", required=True),
_p("page_size", "Maximum number of results per page.", type_=INT),
_p("page_token", "Pagination token for the next page."),
],
"body": None,
"path_params": ["project_id", "branch_id"],
},
{
"id": "pg-endpoints-get",
"name": "Get Endpoint",
"method": "GET",
"path": "/api/2.0/postgres/projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}",
"description": "Gets details for a compute endpoint including its host and autoscaling settings.",
"params": [
_p("project_id", "The project ID.", required=True),
_p("branch_id", "The branch ID.", required=True),
_p("endpoint_id", "The endpoint ID (e.g. primary).", required=True),
],
"body": None,
"path_params": ["project_id", "branch_id", "endpoint_id"],
},
{
"id": "pg-endpoints-create",
"name": "Create Endpoint",
"method": "POST",
"path": "/api/2.0/postgres/projects/{project_id}/branches/{branch_id}/endpoints",
"description": "Creates a new compute endpoint in a branch.",
"params": [
_p("project_id", "The project ID.", required=True),
_p("branch_id", "The branch ID.", required=True),
_p("endpoint_id", "The endpoint ID (1-63 chars, lowercase, letters/numbers/hyphens).", required=True),
],
"body": '{\n "status": {\n "autoscaling_limit_min_cu": 1,\n "autoscaling_limit_max_cu": 4,\n "suspend_timeout_duration": "300s"\n }\n}',
"path_params": ["project_id", "branch_id"],
},
{
"id": "pg-endpoints-update",
"name": "Update Endpoint",
"method": "PATCH",
"path": "/api/2.0/postgres/projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}",
"description": "Updates a compute endpoint's settings (autoscaling, suspend timeout, etc.).",
"params": [
_p("project_id", "The project ID.", required=True),
_p("branch_id", "The branch ID.", required=True),
_p("endpoint_id", "The endpoint ID.", required=True),
],
"body": '{\n "status": {\n "autoscaling_limit_min_cu": 2,\n "autoscaling_limit_max_cu": 8,\n "suspend_timeout_duration": "600s"\n }\n}',
"path_params": ["project_id", "branch_id", "endpoint_id"],
},
{
"id": "pg-endpoints-delete",
"name": "Delete Endpoint",
"method": "DELETE",
"path": "/api/2.0/postgres/projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}",
"description": "Deletes a compute endpoint.",
"params": [
_p("project_id", "The project ID.", required=True),
_p("branch_id", "The branch ID.", required=True),
_p("endpoint_id", "The endpoint ID.", required=True),
],
"body": None,
"path_params": ["project_id", "branch_id", "endpoint_id"],
},
{
"id": "pg-credential-generate",
"name": "Generate Credential",
"method": "POST",
"path": "/api/2.0/postgres/credentials",
"description": "Generates OAuth credentials for connecting to a Lakebase Autoscaling Postgres database.",
"params": [_p("endpoint", "Endpoint resource name (projects/{id}/branches/{id}/endpoints/{id}).")],
"body": None,
},
{
"id": "pg-operations-get",
"name": "Get Operation",
"method": "GET",
"path": "/api/2.0/postgres/projects/{project_id}/operations/{operation_id}",
"description": "Retrieves the status of a long-running operation (create, update, delete).",
"params": [
_p("project_id", "The project ID.", required=True),
_p("operation_id", "The operation ID.", required=True),
],
"body": None,
"path_params": ["project_id", "operation_id"],
},
],
},
}