View Manager API
Imply View Manager is an alpha feature that should be considered preview and subject to change or removal at any time. Alpha features are provided "as is," and are not subject to Imply SLAs.
The View Manager lets you define views that expose only a subset of data for a datasource. The view manager is a key feature for Druid's Row and column security model.
Prerequisites
You can use the SQL View Manager API to create, update, list, inspect, and check the load status for a view. To use the API:
- Enable the SQL View Manager. See Load the View Manager extension for instructions.
- You need
READ
andWRITE
access to theCONFIG
resource type with nameCONFIG
, enabled by default for the "admin" role. For example:To use restrict user access using views, you must enable security with druid, see Row and column security and Basic Security. For the permissions that apply to{
"resource": {
"name": ".*",
"type": "CONFIG"
},
"action": "READ"
},
{
"resource": {
"name": ".*",
"type": "CONFIG"
},
"action": "WRITE"
}VIEW
resource types, see Managing view access.
Authentication
Unless protected by an API Gateway, the View Manager API uses basic authentication. For example:
curl --location --request POST 'http://localhost:8081/druid-ext/view-manager/v1/views/english' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Basic <encoded authorization string>' \
--data-raw '{
"viewSql": "SELECT __time, added, channel, page FROM druid.wikipedia WHERE channel = '\''#en.wikipedia'\''"
}'
View Manager Endpoints
The View Manager API includes the following endpoints for view management:
- Create a view:
POST /druid-ext/view-manager/v1/views/{view name}
- Inspect views:
GET /druid-ext/view-manager/v1/views/
- Delete views:
DELETE /druid-ext/view-manager/v1/views/{view name}
- Inspect the load status for a single view:
GET /druid-ext/view-manager/v1/views/loadstatus/{view name}
Learn more
See the following topics for more information:
- Row and column level security to learn how to use views to secure data.
- View Manager for a description of the Imply View Manager.