Skip to main content

File

Use the Catalog API to retrieve information about formatting data to a table.

File Object
{
"id": "dremio:/Samples/samples.dremio.com/SF weather 2018-2019.csv",
"path": [
"Samples",
"samples.dremio.com",
"SF weather 2018-2019.csv"
],
"type": "FILE"
}

File Attributes

type String

Type of the object. For files, the type is FILE.


id String

Unique identifier of the file. For files, the ID is the text path of the file within Dremio.

Example: dremio:/Samples/samples.dremio.com/SF weather 2018-2019.csv


path Array of Strings

Path of the file within Dremio, expressed as an array. The path consists of the source or space, followed by any folders and subfolders, followed by the target file itself as the last item in the array.

Example: ["Samples","samples.dremio.com","SF weather 2018-2019.csv"]

Retrieve a File by Path

Method and URL
GET /v0/projects/{project_id}/catalog/by-path/{path}

Parameters

project_id Path   String (UUID)


path Path   String

Path of the file that you want to retrieve, with a forward slash to separate each level of nesting. If the name of any component in the path includes special characters for URLs, such as spaces, use URL encoding to replace the special characters with their UTF-8-equivalent characters. For example, replace colons with %3A and replace spaces with %20.

Example: Samples/samples.dremio.com/SF%20weather%202018-2019.csv

Example

Request
curl -X GET "https://api.dremio.cloud/v0/projects/$PROJECT_ID/catalog/by-path/Samples/samples.dremio.com/SF%20weather%202018-2019.csv" \
-H "Authorization: Bearer $DREMIO_TOKEN" \
-H 'Content-Type: application/json'
Response
{
"entityType": "file",
"id": "dremio:/Samples/samples.dremio.com/SF weather 2018-2019.csv",
"path": [
"Samples",
"samples.dremio.com",
"SF weather 2018-2019.csv"
]
}

Response Status Codes

200   OK

401   Unauthorized

403   Forbidden

404   Not Found

405   Method Not Allowed

500   Internal Server Error