Skip to main content

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 and WRITE access to the CONFIG resource type with name CONFIG, enabled by default for the "admin" role. For example:
    {
    "resource": {
    "name": ".*",
    "type": "CONFIG"
    },
    "action": "READ"
    },
    {
    "resource": {
    "name": ".*",
    "type": "CONFIG"
    },
    "action": "WRITE"
    }
    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 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:

Learn more

See the following topics for more information: