File
Use the Catalog API to retrieve information about formatting data to a table.
File Object{
"entityType": "file",
"id": "dremio:/Samples/samples.dremio.com/SF weather 2018-2019.csv",
"path": [
"Samples",
"samples.dremio.com",
"SF weather 2018-2019.csv"
]
}
File Attributes
entityType String
Type of the catalog object. For files, the entityType is file
.
Example: 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 String
Path of the file within Dremio, expressed as an array. The path consists of the source or space, followed by any folder 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"]
Retrieving a File by Path
Retrieve information about a file by specifying its path.
Method and URLGET /api/v3/catalog/by-path/{path}
Parameters
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 Requestcurl -X GET 'https://{hostname}/api/v3/catalog/by-path/Samples/samples.dremio.com/SF%20weather%2018-2019.csv' \
--header 'Authorization: Bearer <PersonalAccessToken>' \
--header 'Content-Type: application/json'
{
"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
404 Not Found
403 Forbidden
405 Method Not Allowed
500 Internal Server Error