dremiojs 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.eslintrc.json +14 -0
  2. package/.prettierrc +7 -0
  3. package/README.md +59 -0
  4. package/dremiodocs/dremio-cloud/cloud-api-reference.md +748 -0
  5. package/dremiodocs/dremio-cloud/dremio-cloud-about.md +225 -0
  6. package/dremiodocs/dremio-cloud/dremio-cloud-admin.md +3754 -0
  7. package/dremiodocs/dremio-cloud/dremio-cloud-bring-data.md +6098 -0
  8. package/dremiodocs/dremio-cloud/dremio-cloud-changelog.md +32 -0
  9. package/dremiodocs/dremio-cloud/dremio-cloud-developer.md +1147 -0
  10. package/dremiodocs/dremio-cloud/dremio-cloud-explore-analyze.md +2522 -0
  11. package/dremiodocs/dremio-cloud/dremio-cloud-get-started.md +300 -0
  12. package/dremiodocs/dremio-cloud/dremio-cloud-help-support.md +869 -0
  13. package/dremiodocs/dremio-cloud/dremio-cloud-manage-govern.md +800 -0
  14. package/dremiodocs/dremio-cloud/dremio-cloud-overview.md +36 -0
  15. package/dremiodocs/dremio-cloud/dremio-cloud-security.md +1844 -0
  16. package/dremiodocs/dremio-cloud/sql-docs.md +7180 -0
  17. package/dremiodocs/dremio-software/dremio-software-acceleration.md +1575 -0
  18. package/dremiodocs/dremio-software/dremio-software-admin.md +884 -0
  19. package/dremiodocs/dremio-software/dremio-software-client-applications.md +3277 -0
  20. package/dremiodocs/dremio-software/dremio-software-data-products.md +560 -0
  21. package/dremiodocs/dremio-software/dremio-software-data-sources.md +8701 -0
  22. package/dremiodocs/dremio-software/dremio-software-deploy-dremio.md +3446 -0
  23. package/dremiodocs/dremio-software/dremio-software-get-started.md +848 -0
  24. package/dremiodocs/dremio-software/dremio-software-monitoring.md +422 -0
  25. package/dremiodocs/dremio-software/dremio-software-reference.md +677 -0
  26. package/dremiodocs/dremio-software/dremio-software-security.md +2074 -0
  27. package/dremiodocs/dremio-software/dremio-software-v25-api.md +32637 -0
  28. package/dremiodocs/dremio-software/dremio-software-v26-api.md +36757 -0
  29. package/jest.config.js +10 -0
  30. package/package.json +25 -0
  31. package/src/api/catalog.ts +74 -0
  32. package/src/api/jobs.ts +105 -0
  33. package/src/api/reflection.ts +77 -0
  34. package/src/api/source.ts +61 -0
  35. package/src/api/user.ts +32 -0
  36. package/src/client/base.ts +66 -0
  37. package/src/client/cloud.ts +37 -0
  38. package/src/client/software.ts +73 -0
  39. package/src/index.ts +16 -0
  40. package/src/types/catalog.ts +31 -0
  41. package/src/types/config.ts +18 -0
  42. package/src/types/job.ts +18 -0
  43. package/src/types/reflection.ts +29 -0
  44. package/tests/integration_manual.ts +95 -0
  45. package/tsconfig.json +19 -0
@@ -0,0 +1,748 @@
1
+ # Dremio Cloud API Reference
2
+
3
+ The Dremio REST API provides programmatic access to manage your data infrastructure, execute queries, and configure data sources.
4
+
5
+ ## Base URLs
6
+
7
+ All REST endpoints build on one of the supported base URLs:
8
+
9
+ * **Dremio API**: `https://api.dremio.cloud/v0/`
10
+ * **Dremio Login**: `https://login.dremio.cloud/`
11
+ * **Iceberg Catalog REST**: `https://catalog.dremio.cloud/api/iceberg/v1/`
12
+
13
+ ## Prerequisites
14
+
15
+ * **Access Token**: Create a personal access token (PAT) for authenticating each of your API calls.
16
+ * **Project ID**: Most Dremio API operations manage or use project resources. You can find your Project ID in the Project Settings.
17
+
18
+ ## Common Concepts
19
+
20
+ * **UUIDs**: Many Dremio entities use Universally Unique Identifiers (UUIDs) as identifiers (36 characters).
21
+ * **Idempotent Requests**: Add a `requestId` parameter (unique UUID) to POST requests to safely retry them.
22
+ * **Timestamps**: Dremio timestamps use ISO 8601 format in UTC: `YYYY-MM-DDTHH:mm:ss.sssZ`.
23
+
24
+ ## Query Parameters
25
+
26
+ Common query parameters supported by many endpoints:
27
+
28
+ * `pageToken`: Token for retrieving the next page of results.
29
+ * `maxChildren` / `maxResults`: Maximum number of items to return.
30
+ * `include`: Include non-default response fields (e.g., `permissions`).
31
+ * `exclude`: Exclude fields from the response (e.g., `children`).
32
+ * `filter`: Filter results.
33
+ * `orderBy`: Sort results.
34
+
35
+ ---
36
+
37
+ ## Catalog
38
+
39
+ ### Catalog Attributes
40
+
41
+ * `data`: Array of container objects in the catalog.
42
+ * `id`: UUID of the object.
43
+ * `path`: Array of strings representing the path.
44
+ * `tag`: UUID version tag.
45
+ * `type`: `CONTAINER`.
46
+ * `containerType`: `SOURCE`, `FOLDER`, or `FUNCTION`.
47
+ * `stats`: Object containing `datasetCount` and `datasetCountBounded`.
48
+
49
+ ### Retrieve a Catalog
50
+
51
+ ```http
52
+ GET /v0/projects/{project_id}/catalog
53
+ ```
54
+
55
+ #### Example
56
+
57
+ ```bash
58
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog" \
59
+ -H "Authorization: Bearer $DREMIO_TOKEN"
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Source
65
+
66
+ ### Source Attributes
67
+
68
+ * `entityType`: `source`.
69
+ * `id`: UUID of the source.
70
+ * `type`: Source type (e.g., `AWSGLUE`, `S3`, `SNOWFLAKE`).
71
+ * `name`: User-defined name.
72
+ * `config`: Configuration options for the source.
73
+ * `metadataPolicy`: Metadata update policies.
74
+
75
+ ### Create a Source
76
+
77
+ ```http
78
+ POST /v0/projects/{project_id}/catalog
79
+ ```
80
+
81
+ #### Example
82
+
83
+ ```bash
84
+ curl -X POST "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog" \
85
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
86
+ -H "Content-Type: application/json" \
87
+ -d '{
88
+ "entityType": "source",
89
+ "name": "MySource",
90
+ "type": "S3",
91
+ "config": {
92
+ "bucketName": "my-bucket",
93
+ "authenticationType": "ACCESS_KEY",
94
+ "accessKey": "MY_ACCESS_KEY",
95
+ "accessSecret": "MY_SECRET_KEY"
96
+ }
97
+ }'
98
+ ```
99
+
100
+ ### Retrieve a Source
101
+
102
+ **By ID:**
103
+ ```http
104
+ GET /v0/projects/{project_id}/catalog/{id}
105
+ ```
106
+
107
+ #### Example (By ID)
108
+
109
+ ```bash
110
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$SOURCE_ID" \
111
+ -H "Authorization: Bearer $DREMIO_TOKEN"
112
+ ```
113
+
114
+ **By Path:**
115
+ ```http
116
+ GET /v0/projects/{project_id}/catalog/by-path/{path}
117
+ ```
118
+
119
+ #### Example (By Path)
120
+
121
+ ```bash
122
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/by-path/MySource" \
123
+ -H "Authorization: Bearer $DREMIO_TOKEN"
124
+ ```
125
+
126
+ ### Update a Source
127
+
128
+ ```http
129
+ PUT /v0/projects/{project_id}/catalog/{id}
130
+ ```
131
+
132
+ #### Example
133
+
134
+ ```bash
135
+ curl -X PUT "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$SOURCE_ID" \
136
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
137
+ -H "Content-Type: application/json" \
138
+ -d '{
139
+ "entityType": "source",
140
+ "id": "'"$SOURCE_ID"'",
141
+ "type": "S3",
142
+ "name": "MySourceRenamed",
143
+ "tag": "'"$TAG_VERSION"'",
144
+ "config": {
145
+ "bucketName": "my-new-bucket"
146
+ }
147
+ }'
148
+ ```
149
+
150
+ ### Delete a Source
151
+
152
+ ```http
153
+ DELETE /v0/projects/{project_id}/catalog/{id}
154
+ ```
155
+
156
+ #### Example
157
+
158
+ ```bash
159
+ curl -X DELETE "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$SOURCE_ID" \
160
+ -H "Authorization: Bearer $DREMIO_TOKEN"
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Folder
166
+
167
+ ### Folder Attributes
168
+
169
+ * `entityType`: `folder`.
170
+ * `id`: UUID of the folder.
171
+ * `path`: Array of strings.
172
+ * `children`: List of items inside the folder.
173
+ * `accessControlList`: User/role privileges.
174
+
175
+ ### Add a Folder
176
+
177
+ ```http
178
+ POST /v0/projects/{project_id}/catalog
179
+ ```
180
+ **Body:** `{"entityType": "folder", "path": ["source", "newFolder"]}`
181
+
182
+ #### Example
183
+
184
+ ```bash
185
+ curl -X POST "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog" \
186
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
187
+ -H "Content-Type: application/json" \
188
+ -d '{
189
+ "entityType": "folder",
190
+ "path": ["MySource", "MyNewFolder"]
191
+ }'
192
+ ```
193
+
194
+ ### Retrieve a Folder
195
+
196
+ **By ID:**
197
+ ```http
198
+ GET /v0/projects/{project_id}/catalog/{id}
199
+ ```
200
+
201
+ #### Example (By ID)
202
+
203
+ ```bash
204
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$FOLDER_ID" \
205
+ -H "Authorization: Bearer $DREMIO_TOKEN"
206
+ ```
207
+
208
+ **By Path:**
209
+ ```http
210
+ GET /v0/projects/{project_id}/catalog/by-path/{path}
211
+ ```
212
+
213
+ #### Example (By Path)
214
+
215
+ ```bash
216
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/by-path/MySource/MyFolder" \
217
+ -H "Authorization: Bearer $DREMIO_TOKEN"
218
+ ```
219
+
220
+ ### Update a Folder
221
+
222
+ ```http
223
+ PUT /v0/projects/{project_id}/catalog/{id}
224
+ ```
225
+
226
+ #### Example
227
+
228
+ ```bash
229
+ curl -X PUT "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$FOLDER_ID" \
230
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
231
+ -H "Content-Type: application/json" \
232
+ -d '{
233
+ "entityType": "folder",
234
+ "id": "'"$FOLDER_ID"'",
235
+ "path": ["MySource", "MyRenamedFolder"],
236
+ "tag": "'"$TAG_VERSION"'"
237
+ }'
238
+ ```
239
+
240
+ ### Delete a Folder
241
+
242
+ ```http
243
+ DELETE /v0/projects/{project_id}/catalog/{id}
244
+ ```
245
+
246
+ #### Example
247
+
248
+ ```bash
249
+ curl -X DELETE "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$FOLDER_ID" \
250
+ -H "Authorization: Bearer $DREMIO_TOKEN"
251
+ ```
252
+
253
+ ---
254
+
255
+ ## File
256
+
257
+ ### File Attributes
258
+
259
+ * `type`: `FILE`.
260
+ * `id`: Text path of the file (e.g., `dremio:/path/to/file.csv`).
261
+ * `path`: Array of strings.
262
+
263
+ ### Retrieve a File by Path
264
+
265
+ ```http
266
+ GET /v0/projects/{project_id}/catalog/by-path/{path}
267
+ ```
268
+
269
+ #### Example
270
+
271
+ ```bash
272
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/by-path/MySource/path/to/file.csv" \
273
+ -H "Authorization: Bearer $DREMIO_TOKEN"
274
+ ```
275
+
276
+ ---
277
+
278
+ ## Table
279
+
280
+ ### Table Attributes
281
+
282
+ * `entityType`: `dataset`.
283
+ * `type`: `PHYSICAL_DATASET`.
284
+ * `id`: UUID of the table.
285
+ * `path`: Array of strings.
286
+ * `format`: Table format attributes (e.g., Parquet, Text).
287
+ * `accelerationRefreshPolicy`: Reflection refresh policy.
288
+ * `fields`: Table schema.
289
+
290
+ ### Format a File or Folder as a Table
291
+
292
+ ```http
293
+ POST /v0/projects/{project_id}/catalog
294
+ ```
295
+ **Body:** `{"entityType": "dataset", "type": "PHYSICAL_DATASET", ...}`
296
+
297
+ #### Example
298
+
299
+ ```bash
300
+ curl -X POST "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog" \
301
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
302
+ -H "Content-Type: application/json" \
303
+ -d '{
304
+ "entityType": "dataset",
305
+ "type": "PHYSICAL_DATASET",
306
+ "path": ["MySource", "path", "to", "file.csv"],
307
+ "format": {
308
+ "type": "Text",
309
+ "fieldDelimiter": ","
310
+ }
311
+ }'
312
+ ```
313
+
314
+ ### Retrieve a Table
315
+
316
+ **By ID:**
317
+ ```http
318
+ GET /v0/projects/{project_id}/catalog/{id}
319
+ ```
320
+
321
+ #### Example (By ID)
322
+
323
+ ```bash
324
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$TABLE_ID" \
325
+ -H "Authorization: Bearer $DREMIO_TOKEN"
326
+ ```
327
+
328
+ **By Path:**
329
+ ```http
330
+ GET /v0/projects/{project_id}/catalog/by-path/{path}
331
+ ```
332
+
333
+ #### Example (By Path)
334
+
335
+ ```bash
336
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/by-path/MySource/MyTable" \
337
+ -H "Authorization: Bearer $DREMIO_TOKEN"
338
+ ```
339
+
340
+ ### Update a Table
341
+
342
+ ```http
343
+ PUT /v0/projects/{project_id}/catalog/{id}
344
+ ```
345
+
346
+ #### Example
347
+
348
+ ```bash
349
+ curl -X PUT "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$TABLE_ID" \
350
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
351
+ -H "Content-Type: application/json" \
352
+ -d '{
353
+ "entityType": "dataset",
354
+ "id": "'"$TABLE_ID"'",
355
+ "type": "PHYSICAL_DATASET",
356
+ "path": ["MySource", "MyTable"],
357
+ "tag": "'"$TAG_VERSION"'",
358
+ "accelerationRefreshPolicy": {
359
+ "refreshPeriodMs": 3600000,
360
+ "gracePeriodMs": 10800000
361
+ }
362
+ }'
363
+ ```
364
+
365
+ ### Refresh Reflections on a Table
366
+
367
+ ```http
368
+ POST /v0/projects/{project_id}/catalog/{id}/refresh
369
+ ```
370
+
371
+ #### Example
372
+
373
+ ```bash
374
+ curl -X POST "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$TABLE_ID/refresh" \
375
+ -H "Authorization: Bearer $DREMIO_TOKEN"
376
+ ```
377
+
378
+ ### Revert a Table to a File or Folder
379
+
380
+ ```http
381
+ DELETE /v0/projects/{project_id}/catalog/{id}
382
+ ```
383
+
384
+ #### Example
385
+
386
+ ```bash
387
+ curl -X DELETE "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$TABLE_ID" \
388
+ -H "Authorization: Bearer $DREMIO_TOKEN"
389
+ ```
390
+
391
+ ---
392
+
393
+ ## Lineage
394
+
395
+ ### Lineage Attributes
396
+
397
+ * `sources`: Array of source objects used by the dataset.
398
+ * `parents`: Array of parent objects (e.g., joined datasets).
399
+ * `children`: Array of child objects referencing the dataset.
400
+
401
+ ### Retrieve Lineage
402
+
403
+ ```http
404
+ GET /v0/projects/{project_id}/catalog/{id}/graph
405
+ ```
406
+
407
+ #### Example
408
+
409
+ ```bash
410
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$DATASET_ID/graph" \
411
+ -H "Authorization: Bearer $DREMIO_TOKEN"
412
+ ```
413
+
414
+ ---
415
+
416
+ ## User-Defined Function (UDF)
417
+
418
+ ### UDF Attributes
419
+
420
+ * `entityType`: `function`.
421
+ * `id`: UUID of the function.
422
+ * `functionBody`: The SQL statement of the function.
423
+ * `functionArgList`: Arguments and data types.
424
+ * `returnType`: Return data type(s).
425
+ * `isScalar`: Boolean (true for scalar, false for tabular).
426
+
427
+ ### Create a UDF
428
+
429
+ ```http
430
+ POST /v0/projects/{project_id}/catalog
431
+ ```
432
+ **Body:** `{"entityType": "function", ...}`
433
+
434
+ #### Example
435
+
436
+ ```bash
437
+ curl -X POST "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog" \
438
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
439
+ -H "Content-Type: application/json" \
440
+ -d '{
441
+ "entityType": "function",
442
+ "path": ["MySource", "my_udf"],
443
+ "functionBody": "SELECT 1",
444
+ "returnType": "INTEGER",
445
+ "functionArgList": []
446
+ }'
447
+ ```
448
+
449
+ ### Retrieve a UDF
450
+
451
+ **By ID:**
452
+ ```http
453
+ GET /v0/projects/{project_id}/catalog/{id}
454
+ ```
455
+
456
+ #### Example (By ID)
457
+
458
+ ```bash
459
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$UDF_ID" \
460
+ -H "Authorization: Bearer $DREMIO_TOKEN"
461
+ ```
462
+
463
+ **By Path:**
464
+ ```http
465
+ GET /v0/projects/{project_id}/catalog/by-path/{path}
466
+ ```
467
+
468
+ #### Example (By Path)
469
+
470
+ ```bash
471
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/by-path/MySource/my_udf" \
472
+ -H "Authorization: Bearer $DREMIO_TOKEN"
473
+ ```
474
+
475
+ ### Update a UDF
476
+
477
+ ```http
478
+ PUT /v0/projects/{project_id}/catalog/{id}
479
+ ```
480
+
481
+ #### Example
482
+
483
+ ```bash
484
+ curl -X PUT "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$UDF_ID" \
485
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
486
+ -H "Content-Type: application/json" \
487
+ -d '{
488
+ "entityType": "function",
489
+ "id": "'"$UDF_ID"'",
490
+ "tag": "'"$TAG_VERSION"'",
491
+ "path": ["MySource", "my_udf"],
492
+ "functionBody": "SELECT 2",
493
+ "returnType": "INTEGER",
494
+ "functionArgList": []
495
+ }'
496
+ ```
497
+
498
+ ### Delete a UDF
499
+
500
+ ```http
501
+ DELETE /v0/projects/{project_id}/catalog/{id}
502
+ ```
503
+
504
+ #### Example
505
+
506
+ ```bash
507
+ curl -X DELETE "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$UDF_ID" \
508
+ -H "Authorization: Bearer $DREMIO_TOKEN"
509
+ ```
510
+
511
+ ---
512
+
513
+ ## Tag
514
+
515
+ ### Tag Attributes
516
+
517
+ * `tags`: Array of strings.
518
+ * `version`: UUID version of the tag set.
519
+
520
+ ### Create/Modify Tags
521
+
522
+ ```http
523
+ POST /v0/projects/{project_id}/catalog/{id}/collaboration/tag
524
+ ```
525
+
526
+ #### Example
527
+
528
+ ```bash
529
+ curl -X POST "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$DATASET_ID/collaboration/tag" \
530
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
531
+ -H "Content-Type: application/json" \
532
+ -d '{
533
+ "tags": ["tag1", "tag2"]
534
+ }'
535
+ ```
536
+
537
+ ### Retrieve Tags
538
+
539
+ ```http
540
+ GET /v0/projects/{project_id}/catalog/{id}/collaboration/tag
541
+ ```
542
+
543
+ #### Example
544
+
545
+ ```bash
546
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$DATASET_ID/collaboration/tag" \
547
+ -H "Authorization: Bearer $DREMIO_TOKEN"
548
+ ```
549
+
550
+ ### Delete Tags
551
+
552
+ Send an empty array to the create/modify endpoint.
553
+
554
+ ---
555
+
556
+ ## Wiki
557
+
558
+ ### Wiki Attributes
559
+
560
+ * `text`: Markdown text content.
561
+ * `version`: Version number.
562
+
563
+ ### Create/Update Wiki
564
+
565
+ ```http
566
+ POST /v0/projects/{project_id}/catalog/{id}/collaboration/wiki
567
+ ```
568
+
569
+ #### Example
570
+
571
+ ```bash
572
+ curl -X POST "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$DATASET_ID/collaboration/wiki" \
573
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
574
+ -H "Content-Type: application/json" \
575
+ -d '{
576
+ "text": "# My Wiki Content\nThis is a description."
577
+ }'
578
+ ```
579
+
580
+ ### Retrieve Wiki
581
+
582
+ ```http
583
+ GET /v0/projects/{project_id}/catalog/{id}/collaboration/wiki
584
+ ```
585
+
586
+ #### Example
587
+
588
+ ```bash
589
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$DATASET_ID/collaboration/wiki" \
590
+ -H "Authorization: Bearer $DREMIO_TOKEN"
591
+ ```
592
+
593
+ ### Delete Wiki
594
+
595
+ Send an empty string to the create/update endpoint.
596
+
597
+ ---
598
+
599
+ ## View
600
+
601
+ ### View Attributes
602
+
603
+ * `entityType`: `dataset`.
604
+ * `type`: `VIRTUAL_DATASET`.
605
+ * `id`: UUID of the view.
606
+ * `sql`: SQL query defining the view.
607
+ * `sqlContext`: Context for the SQL query.
608
+ * `fields`: View schema.
609
+
610
+ ### Create a View
611
+
612
+ ```http
613
+ POST /v0/projects/{project_id}/catalog
614
+ ```
615
+ **Body:** `{"entityType": "dataset", "type": "VIRTUAL_DATASET", ...}`
616
+
617
+ #### Example
618
+
619
+ ```bash
620
+ curl -X POST "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog" \
621
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
622
+ -H "Content-Type: application/json" \
623
+ -d '{
624
+ "entityType": "dataset",
625
+ "type": "VIRTUAL_DATASET",
626
+ "path": ["MySpace", "MyView"],
627
+ "sql": "SELECT * FROM MySource.MyTable"
628
+ }'
629
+ ```
630
+
631
+ ### Retrieve a View
632
+
633
+ **By ID:**
634
+ ```http
635
+ GET /v0/projects/{project_id}/catalog/{id}
636
+ ```
637
+
638
+ #### Example (By ID)
639
+
640
+ ```bash
641
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$VIEW_ID" \
642
+ -H "Authorization: Bearer $DREMIO_TOKEN"
643
+ ```
644
+
645
+ **By Path:**
646
+ ```http
647
+ GET /v0/projects/{project_id}/catalog/by-path/{path}
648
+ ```
649
+
650
+ #### Example (By Path)
651
+
652
+ ```bash
653
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/by-path/MySpace/MyView" \
654
+ -H "Authorization: Bearer $DREMIO_TOKEN"
655
+ ```
656
+
657
+ ### Update a View
658
+
659
+ ```http
660
+ PUT /v0/projects/{project_id}/catalog/{id}
661
+ ```
662
+
663
+ #### Example
664
+
665
+ ```bash
666
+ curl -X PUT "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$VIEW_ID" \
667
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
668
+ -H "Content-Type: application/json" \
669
+ -d '{
670
+ "entityType": "dataset",
671
+ "id": "'"$VIEW_ID"'",
672
+ "type": "VIRTUAL_DATASET",
673
+ "path": ["MySpace", "MyView"],
674
+ "tag": "'"$TAG_VERSION"'",
675
+ "sql": "SELECT * FROM MySource.MyTable WHERE id > 100"
676
+ }'
677
+ ```
678
+
679
+ ### Refresh Reflections on a View
680
+
681
+ ```http
682
+ POST /v0/projects/{project_id}/catalog/{id}/refresh
683
+ ```
684
+
685
+ #### Example
686
+
687
+ ```bash
688
+ curl -X POST "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$VIEW_ID/refresh" \
689
+ -H "Authorization: Bearer $DREMIO_TOKEN"
690
+ ```
691
+
692
+ ### Delete a View
693
+
694
+ ```http
695
+ DELETE /v0/projects/{project_id}/catalog/{id}
696
+ ```
697
+
698
+ #### Example
699
+
700
+ ```bash
701
+ curl -X DELETE "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$VIEW_ID" \
702
+ -H "Authorization: Bearer $DREMIO_TOKEN"
703
+ ```
704
+
705
+ ---
706
+
707
+ ## Grants
708
+
709
+ ### Grants Attributes
710
+
711
+ * `availablePrivileges`: List of available privileges.
712
+ * `grants`: Array of grant objects (privileges, granteeType, id).
713
+
714
+ ### Create or Update Grants
715
+
716
+ ```http
717
+ PUT /v0/projects/{project_id}/catalog/{id}/grants
718
+ ```
719
+
720
+ #### Example
721
+
722
+ ```bash
723
+ curl -X PUT "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$CATALOG_ID/grants" \
724
+ -H "Authorization: Bearer $DREMIO_TOKEN" \
725
+ -H "Content-Type: application/json" \
726
+ -d '{
727
+ "grants": [
728
+ {
729
+ "granteeType": "USER",
730
+ "id": "'"$USER_ID"'",
731
+ "privileges": ["SELECT", "ALTER"]
732
+ }
733
+ ]
734
+ }'
735
+ ```
736
+
737
+ ### Retrieve Grants
738
+
739
+ ```http
740
+ GET /v0/projects/{project_id}/catalog/{id}/grants
741
+ ```
742
+
743
+ #### Example
744
+
745
+ ```bash
746
+ curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/$CATALOG_ID/grants" \
747
+ -H "Authorization: Bearer $DREMIO_TOKEN"
748
+ ```