GET /catalog/{id}
Retrieves information about a specific catalog entity (source, space, folder, file or dataset) using it's ID. Child information (if applicable) of the catalog entity are also retrieved along with their ID, path, type, and containerType.
Syntax
GET /api/v3/catalog/{id}
Response Output
The CatalogEntity is one of the following:
403
- User does not have permission to view the catalog entity.404
- A catalog entity with the specified ID could not be found.
Example: Get VDS by ID
After requesting the entity by path, we can use its catalog ID in subsequent queries.
In the following example, the virtual dataset passenger_counts is retrieved by its ID,
28bb8400-6f7f-4807-9e7f-cbf0bb21d204
.
Curl
curl -X GET \
http://localhost:9047/api/v3/catalog/28bb8400-6f7f-4807-9e7f-cbf0bb21d204 \
-H "Content-Type: application/json" \
-H "Authorization: _dremiohs85l11k2mh0b10l51ett9fsca"
Response
For a virtual dataset like this, the response body includes the defining SQL query along with information about the resulting columns/fields.
{
"entityType": "dataset",
"id": "28bb8400-6f7f-4807-9e7f-cbf0bb21d204",
"type": "VIRTUAL_DATASET",
"path": [
"sandbox",
"taxi_queries",
"passenger_counts"
],
"createdAt": "2019-01-10T16:44:05.323Z",
"tag": "0",
"sql": "SELECT COUNT(*) as four_passenger_count\nFROM \"DEV HDFS\".data.nyctaxi.\"yellow_tripdata_2009-01.csv\"\nWHERE \"Passenger_Count\" >= 4",
"sqlContext": [
"sandbox",
"taxi_queries"
],
"accessControlList": {
"version": 0
},
"fields": [
{
"name": "four_passenger_count",
"type": {
"name": "BIGINT"
}
}
]
}
Example: Get Source by ID
In this example, information about a source, my_hdfs, and it's children are retrieved. To obtain the source ID, use GET /catalog.
[info] Postman was used to generate samples.
HTTP
GET localhost:9047/api/v3/catalog/d4ca9cf9-f225-4da1-95fe-5539cdb1dfc3
Curl
curl -X GET \
http://localhost:9047/api/v3/catalog/d4ca9cf9-f225-4da1-95fe-5539cdb1dfc3 \
-H 'Authorization: _dremioo8opojj6vn4ughkvcpalpr46d6' \
-H 'Content-Type: application/json' \
-H 'Postman-Token: b0d91002-7b5a-434a-a579-e170a5910b52' \
-H 'cache-control: no-cache'
Python
import requests
url = "http://localhost:9047/api/v3/catalog/d4ca9cf9-f225-4da1-95fe-5539cdb1dfc3"
payload = ""
headers = {
'Authorization': "_dremioo8opojj6vn4ughkvcpalpr46d6",
'Content-Type': "application/json",
'cache-control': "no-cache",
'Postman-Token': "532d77f5-e939-4b50-bc0b-f9bd0e7b2296"
}
response = requests.request("GET", url, data=payload, headers=headers)
print(response.text)
Response
{
"entityType": "source",
"config": {
"hostname": "172.25.0.94",
"port": 8020,
"enableImpersonation": false,
"rootPath": "/",
"shortCircuitFlag": "SYSTEM",
"allowCreateDrop": false
},
"state": {
"status": "good",
"messages": []
},
"id": "d4ca9cf9-f225-4da1-95fe-5539cdb1dfc3",
"tag": "0",
"type": "HDFS",
"name": "my_hdfs",
"createdAt": "2019-03-26T18:26:53.761Z",
"metadataPolicy": {
"authTTLMs": 86400000,
"namesRefreshMs": 3600000,
"datasetRefreshAfterMs": 3600000,
"datasetExpireAfterMs": 10800000,
"datasetUpdateMode": "PREFETCH_QUERIED",
"deleteUnavailableDatasets": true,
"autoPromoteDatasets": false
},
"accelerationGracePeriodMs": 10800000,
"accelerationRefreshPeriodMs": 3600000,
"accelerationNeverExpire": false,
"accelerationNeverRefresh": false,
"children": [
{
"id": "dremio:/my_hdfs/\"data\"",
"path": [
"my_hdfs",
"\"data\""
],
"type": "CONTAINER",
"containerType": "FOLDER"
},
{
"id": "dremio:/my_hdfs/\"mr-history\"",
"path": [
"my_hdfs",
"\"mr-history\""
],
"type": "CONTAINER",
"containerType": "FOLDER"
},
{
"id": "dremio:/my_hdfs/\"tmp\"",
"path": [
"my_hdfs",
"\"tmp\""
],
"type": "CONTAINER",
"containerType": "FOLDER"
},
{
"id": "dremio:/my_hdfs/\"user\"",
"path": [
"my_hdfs",
"\"user\""
],
"type": "CONTAINER",
"containerType": "FOLDER"
},
{
"id": "dremio:/my_hdfs/\"var\"",
"path": [
"my_hdfs",
"\"var\""
],
"type": "CONTAINER",
"containerType": "FOLDER"
}
],
"accessControlList": {
"version": "1"
}
}