Retention rules API

This document describes the API endpoints for managing retention rules in Apache Druid.

Retention rules

Note that all interval URL parameters are ISO 8601 strings delimited by a _ instead of a / as in 2016-06-27_2016-06-28.

GET /druid/coordinator/v1/rules

Returns all rules as JSON objects for all datasources in the cluster including the default datasource.

GET /druid/coordinator/v1/rules/{dataSourceName}

Returns all rules for a specified datasource.

GET /druid/coordinator/v1/rules/{dataSourceName}?full

Returns all rules for a specified datasource and includes default datasource.

GET /druid/coordinator/v1/rules/history?interval=<interval>

Returns audit history of rules for all datasources. Default value of interval can be specified by setting druid.audit.manager.auditHistoryMillis (1 week if not configured) in Coordinator runtime.properties.

GET /druid/coordinator/v1/rules/history?count=<n>

Returns last n entries of audit history of rules for all datasources.

GET /druid/coordinator/v1/rules/{dataSourceName}/history?interval=<interval>

Returns audit history of rules for a specified datasource. Default value of interval can be specified by setting druid.audit.manager.auditHistoryMillis (1 week if not configured) in Coordinator runtime.properties.

GET /druid/coordinator/v1/rules/{dataSourceName}/history?count=<n>

Returns last n entries of audit history of rules for a specified datasource.

POST /druid/coordinator/v1/rules/{dataSourceName}

POST with a list of rules in JSON form to update rules.

Optional Header Parameters for auditing the config change can also be specified.

Header Param NameDescriptionDefault
X-Druid-AuthorAuthor making the config change“”
X-Druid-CommentComment describing the change being done“”