blob: 8d9c7e6fba2732fbab2cf9cf20562bb32907a477 [file] [log] [blame]
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Apache Druid">
<meta name="keywords" content="druid,kafka,database,analytics,streaming,real-time,real time,apache,open source">
<meta name="author" content="Apache Software Foundation">
<title>Druid | Apache Druid (incubating) API Reference</title>
<link rel="alternate" type="application/atom+xml" href="/feed">
<link rel="shortcut icon" href="/img/favicon.png">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<link href='//fonts.googleapis.com/css?family=Open+Sans+Condensed:300,700,300italic|Open+Sans:300italic,400italic,600italic,400,300,600,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="/css/bootstrap-pure.css?v=1.1">
<link rel="stylesheet" href="/css/base.css?v=1.1">
<link rel="stylesheet" href="/css/header.css?v=1.1">
<link rel="stylesheet" href="/css/footer.css?v=1.1">
<link rel="stylesheet" href="/css/syntax.css?v=1.1">
<link rel="stylesheet" href="/css/docs.css?v=1.1">
<script>
(function() {
var cx = '000162378814775985090:molvbm0vggm';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
</head>
<body>
<!-- Start page_header include -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<div class="top-navigator">
<div class="container">
<div class="left-cont">
<a class="logo" href="/"><span class="druid-logo"></span></a>
</div>
<div class="right-cont">
<ul class="links">
<li class=""><a href="/technology">Technology</a></li>
<li class=""><a href="/use-cases">Use Cases</a></li>
<li class=""><a href="/druid-powered">Powered By</a></li>
<li class=""><a href="/docs/latest/design/">Docs</a></li>
<li class=""><a href="/community/">Community</a></li>
<li class="header-dropdown">
<a>Apache</a>
<div class="header-dropdown-menu">
<a href="https://www.apache.org/" target="_blank">Foundation</a>
<a href="https://www.apache.org/events/current-event" target="_blank">Events</a>
<a href="https://www.apache.org/licenses/" target="_blank">License</a>
<a href="https://www.apache.org/foundation/thanks.html" target="_blank">Thanks</a>
<a href="https://www.apache.org/security/" target="_blank">Security</a>
<a href="https://www.apache.org/foundation/sponsorship.html" target="_blank">Sponsorship</a>
</div>
</li>
<li class=" button-link"><a href="/downloads.html">Download</a></li>
</ul>
</div>
</div>
<div class="action-button menu-icon">
<span class="fa fa-bars"></span> MENU
</div>
<div class="action-button menu-icon-close">
<span class="fa fa-times"></span> MENU
</div>
</div>
<script type="text/javascript">
var $menu = $('.right-cont');
var $menuIcon = $('.menu-icon');
var $menuIconClose = $('.menu-icon-close');
function showMenu() {
$menu.fadeIn(100);
$menuIcon.fadeOut(100);
$menuIconClose.fadeIn(100);
}
$menuIcon.click(showMenu);
function hideMenu() {
$menu.fadeOut(100);
$menuIconClose.fadeOut(100);
$menuIcon.fadeIn(100);
}
$menuIconClose.click(hideMenu);
$(window).resize(function() {
if ($(window).width() >= 840) {
$menu.fadeIn(100);
$menuIcon.fadeOut(100);
$menuIconClose.fadeOut(100);
}
else {
$menu.fadeOut(100);
$menuIcon.fadeIn(100);
$menuIconClose.fadeOut(100);
}
});
</script>
<!-- Stop page_header include -->
<div class="container doc-container">
<p> Looking for the <a href="/docs/0.23.0/">latest stable documentation</a>?</p>
<div class="row">
<div class="col-md-9 doc-content">
<p>
<a class="btn btn-default btn-xs visible-xs-inline-block visible-sm-inline-block" href="#toc">Table of Contents</a>
</p>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<h1 id="apache-druid-incubating-api-reference">Apache Druid (incubating) API Reference</h1>
<p>This page documents all of the API endpoints for each Druid service type.</p>
<h2 id="table-of-contents">Table of Contents</h2>
<ul>
<li><a href="#common">Common</a></li>
<li><a href="#master-server">Master Server</a>
<ul>
<li><a href="#coordinator">Coordinator</a></li>
<li><a href="#overlord">Overlord</a></li>
</ul></li>
<li><a href="#data-server">Data Server</a>
<ul>
<li><a href="#middlemanager">MiddleManager</a></li>
<li><a href="#peon">Peon</a></li>
<li><a href="#historical">Historical</a></li>
</ul></li>
<li><a href="#query-server">Query Server</a>
<ul>
<li><a href="#broker">Broker</a></li>
</ul></li>
</ul>
<h2 id="common">Common</h2>
<p>The following endpoints are supported by all processes.</p>
<h3 id="process-information">Process information</h3>
<h4 id="get">GET</h4>
<ul>
<li><code>/status</code></li>
</ul>
<p>Returns the Druid version, loaded extensions, memory used, total memory and other useful information about the process.</p>
<ul>
<li><code>/status/health</code></li>
</ul>
<p>An endpoint that always returns a boolean &quot;true&quot; value with a 200 OK response, useful for automated health checks.</p>
<ul>
<li><code>/status/properties</code></li>
</ul>
<p>Returns the current configuration properties of the process.</p>
<h2 id="master-server">Master Server</h2>
<p>This section documents the API endpoints for the processes that reside on Master servers (Coordinators and Overlords) in the suggested <a href="../design/processes.html#server-types">three-server configuration</a>.</p>
<h3 id="coordinator">Coordinator</h3>
<h4 id="leadership">Leadership</h4>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/coordinator/v1/leader</code></li>
</ul>
<p>Returns the current leader Coordinator of the cluster.</p>
<ul>
<li><code>/druid/coordinator/v1/isLeader</code></li>
</ul>
<p>Returns a JSON object with field &quot;leader&quot;, either true or false, indicating if this server is the current leader
Coordinator of the cluster. In addition, returns HTTP 200 if the server is the current leader and HTTP 404 if not.
This is suitable for use as a load balancer status check if you only want the active leader to be considered in-service
at the load balancer.</p>
<h4 id="segment-loading">Segment Loading</h4>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/coordinator/v1/loadstatus</code></li>
</ul>
<p>Returns the percentage of segments actually loaded in the cluster versus segments that should be loaded in the cluster.</p>
<ul>
<li><code>/druid/coordinator/v1/loadstatus?simple</code></li>
</ul>
<p>Returns the number of segments left to load until segments that should be loaded in the cluster are available for queries. This does not include replication.</p>
<ul>
<li><code>/druid/coordinator/v1/loadstatus?full</code></li>
</ul>
<p>Returns the number of segments left to load in each tier until segments that should be loaded in the cluster are all available. This includes replication.</p>
<ul>
<li><code>/druid/coordinator/v1/loadqueue</code></li>
</ul>
<p>Returns the ids of segments to load and drop for each Historical process.</p>
<ul>
<li><code>/druid/coordinator/v1/loadqueue?simple</code></li>
</ul>
<p>Returns the number of segments to load and drop, as well as the total segment load and drop size in bytes for each Historical process.</p>
<ul>
<li><code>/druid/coordinator/v1/loadqueue?full</code></li>
</ul>
<p>Returns the serialized JSON of segments to load and drop for each Historical process.</p>
<h4 id="metadata-store-information">Metadata store information</h4>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/coordinator/v1/metadata/datasources</code></li>
</ul>
<p>Returns a list of the names of enabled datasources in the cluster.</p>
<ul>
<li><code>/druid/coordinator/v1/metadata/datasources?includeDisabled</code></li>
</ul>
<p>Returns a list of the names of enabled and disabled datasources in the cluster.</p>
<ul>
<li><code>/druid/coordinator/v1/metadata/datasources?full</code></li>
</ul>
<p>Returns a list of all enabled datasources with all metadata about those datasources as stored in the metadata store.</p>
<ul>
<li><code>/druid/coordinator/v1/metadata/datasources/{dataSourceName}</code></li>
</ul>
<p>Returns full metadata for a datasource as stored in the metadata store.</p>
<ul>
<li><code>/druid/coordinator/v1/metadata/datasources/{dataSourceName}/segments</code></li>
</ul>
<p>Returns a list of all segments for a datasource as stored in the metadata store.</p>
<ul>
<li><code>/druid/coordinator/v1/metadata/datasources/{dataSourceName}/segments?full</code></li>
</ul>
<p>Returns a list of all segments for a datasource with the full segment metadata as stored in the metadata store.</p>
<ul>
<li><code>/druid/coordinator/v1/metadata/datasources/{dataSourceName}/segments/{segmentId}</code></li>
</ul>
<p>Returns full segment metadata for a specific segment as stored in the metadata store.</p>
<h5 id="post">POST</h5>
<ul>
<li><code>/druid/coordinator/v1/metadata/datasources/{dataSourceName}/segments</code></li>
</ul>
<p>Returns a list of all segments, overlapping with any of given intervals, for a datasource as stored in the metadata store. Request body is array of string IS0 8601 intervals like [interval1, interval2,...] for example [&quot;2012-01-01T00:00:00.000/2012-01-03T00:00:00.000&quot;, &quot;2012-01-05T00:00:00.000/2012-01-07T00:00:00.000&quot;]</p>
<ul>
<li><code>/druid/coordinator/v1/metadata/datasources/{dataSourceName}/segments?full</code></li>
</ul>
<p>Returns a list of all segments, overlapping with any of given intervals, for a datasource with the full segment metadata as stored in the metadata store. Request body is array of string ISO 8601 intervals like [interval1, interval2,...] for example [&quot;2012-01-01T00:00:00.000/2012-01-03T00:00:00.000&quot;, &quot;2012-01-05T00:00:00.000/2012-01-07T00:00:00.000&quot;]</p>
<h4 id="datasources">Datasources</h4>
<p>Note that all <em>interval</em> URL parameters are ISO 8601 strings delimited by a <code>_</code> instead of a <code>/</code>
(e.g., 2016-06-27_2016-06-28).</p>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/coordinator/v1/datasources</code></li>
</ul>
<p>Returns a list of datasource names found in the cluster.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources?simple</code></li>
</ul>
<p>Returns a list of JSON objects containing the name and properties of datasources found in the cluster. Properties include segment count, total segment byte size, minTime, and maxTime.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources?full</code></li>
</ul>
<p>Returns a list of datasource names found in the cluster with all metadata about those datasources.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}</code></li>
</ul>
<p>Returns a JSON object containing the name and properties of a datasource. Properties include segment count, total segment byte size, minTime, and maxTime.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}?full</code></li>
</ul>
<p>Returns full metadata for a datasource .</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/intervals</code></li>
</ul>
<p>Returns a set of segment intervals.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/intervals?simple</code></li>
</ul>
<p>Returns a map of an interval to a JSON object containing the total byte size of segments and number of segments for that interval.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/intervals?full</code></li>
</ul>
<p>Returns a map of an interval to a map of segment metadata to a set of server names that contain the segment for that interval.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/intervals/{interval}</code></li>
</ul>
<p>Returns a set of segment ids for an interval.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/intervals/{interval}?simple</code></li>
</ul>
<p>Returns a map of segment intervals contained within the specified interval to a JSON object containing the total byte size of segments and number of segments for an interval.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/intervals/{interval}?full</code></li>
</ul>
<p>Returns a map of segment intervals contained within the specified interval to a map of segment metadata to a set of server names that contain the segment for an interval.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/intervals/{interval}/serverview</code></li>
</ul>
<p>Returns a map of segment intervals contained within the specified interval to information about the servers that contain the segment for an interval.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/segments</code></li>
</ul>
<p>Returns a list of all segments for a datasource in the cluster.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/segments?full</code></li>
</ul>
<p>Returns a list of all segments for a datasource in the cluster with the full segment metadata.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/segments/{segmentId}</code></li>
</ul>
<p>Returns full segment metadata for a specific segment in the cluster.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/tiers</code></li>
</ul>
<p>Return the tiers that a datasource exists in.</p>
<h5 id="post">POST</h5>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}</code></li>
</ul>
<p>Enables all segments of datasource which are not overshadowed by others.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/segments/{segmentId}</code></li>
</ul>
<p>Enables a segment of a datasource.</p>
<h5 id="delete">DELETE<a name="coordinator-delete"></a></h5>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}</code></li>
</ul>
<p>Disables a datasource.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/intervals/{interval}</code></li>
<li><code>@Deprecated. /druid/coordinator/v1/datasources/{dataSourceName}?kill=true&amp;interval={myInterval}</code></li>
</ul>
<p>Runs a <a href="../ingestion/tasks.html">Kill task</a> for a given interval and datasource.</p>
<ul>
<li><code>/druid/coordinator/v1/datasources/{dataSourceName}/segments/{segmentId}</code></li>
</ul>
<p>Disables a segment.</p>
<h4 id="retention-rules">Retention Rules</h4>
<p>Note that all <em>interval</em> URL parameters are ISO 8601 strings delimited by a <code>_</code> instead of a <code>/</code>
(e.g., 2016-06-27_2016-06-28).</p>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/coordinator/v1/rules</code></li>
</ul>
<p>Returns all rules as JSON objects for all datasources in the cluster including the default datasource.</p>
<ul>
<li><code>/druid/coordinator/v1/rules/{dataSourceName}</code></li>
</ul>
<p>Returns all rules for a specified datasource.</p>
<ul>
<li><code>/druid/coordinator/v1/rules/{dataSourceName}?full</code></li>
</ul>
<p>Returns all rules for a specified datasource and includes default datasource.</p>
<ul>
<li><code>/druid/coordinator/v1/rules/history?interval=&lt;interval&gt;</code></li>
</ul>
<p>Returns audit history of rules for all datasources. default value of interval can be specified by setting <code>druid.audit.manager.auditHistoryMillis</code> (1 week if not configured) in Coordinator runtime.properties</p>
<ul>
<li><code>/druid/coordinator/v1/rules/history?count=&lt;n&gt;</code></li>
</ul>
<p>Returns last <n> entries of audit history of rules for all datasources.</p>
<ul>
<li><code>/druid/coordinator/v1/rules/{dataSourceName}/history?interval=&lt;interval&gt;</code></li>
</ul>
<p>Returns audit history of rules for a specified datasource. default value of interval can be specified by setting <code>druid.audit.manager.auditHistoryMillis</code> (1 week if not configured) in Coordinator runtime.properties</p>
<ul>
<li><code>/druid/coordinator/v1/rules/{dataSourceName}/history?count=&lt;n&gt;</code></li>
</ul>
<p>Returns last <n> entries of audit history of rules for a specified datasource.</p>
<h5 id="post">POST</h5>
<ul>
<li><code>/druid/coordinator/v1/rules/{dataSourceName}</code></li>
</ul>
<p>POST with a list of rules in JSON form to update rules.</p>
<p>Optional Header Parameters for auditing the config change can also be specified.</p>
<table><thead>
<tr>
<th>Header Param Name</th>
<th>Description</th>
<th>Default</th>
</tr>
</thead><tbody>
<tr>
<td><code>X-Druid-Author</code></td>
<td>author making the config change</td>
<td>&quot;&quot;</td>
</tr>
<tr>
<td><code>X-Druid-Comment</code></td>
<td>comment describing the change being done</td>
<td>&quot;&quot;</td>
</tr>
</tbody></table>
<h4 id="intervals">Intervals</h4>
<p>Note that all <em>interval</em> URL parameters are ISO 8601 strings delimited by a <code>_</code> instead of a <code>/</code>
(e.g., 2016-06-27_2016-06-28).</p>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/coordinator/v1/intervals</code></li>
</ul>
<p>Returns all intervals for all datasources with total size and count.</p>
<ul>
<li><code>/druid/coordinator/v1/intervals/{interval}</code></li>
</ul>
<p>Returns aggregated total size and count for all intervals that intersect given isointerval.</p>
<ul>
<li><code>/druid/coordinator/v1/intervals/{interval}?simple</code></li>
</ul>
<p>Returns total size and count for each interval within given isointerval.</p>
<ul>
<li><code>/druid/coordinator/v1/intervals/{interval}?full</code></li>
</ul>
<p>Returns total size and count for each datasource for each interval within given isointerval.</p>
<h4 id="compaction-configuration">Compaction Configuration</h4>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/coordinator/v1/config/compaction</code></li>
</ul>
<p>Returns all compaction configs.</p>
<ul>
<li><code>/druid/coordinator/v1/config/compaction/{dataSource}</code></li>
</ul>
<p>Returns a compaction config of a dataSource.</p>
<h5 id="post">POST</h5>
<ul>
<li><code>/druid/coordinator/v1/config/compaction/taskslots?ratio={someRatio}&amp;max={someMaxSlots}</code></li>
</ul>
<p>Update the capacity for compaction tasks. <code>ratio</code> and <code>max</code> are used to limit the max number of compaction tasks.
They mean the ratio of the total task slots to the copmaction task slots and the maximum number of task slots for compaction tasks, respectively.
The actual max number of compaction tasks is <code>min(max, ratio * total task slots)</code>.
Note that <code>ratio</code> and <code>max</code> are optional and can be omitted. If they are omitted, default values (0.1 and unbounded)
will be set for them.</p>
<ul>
<li><code>/druid/coordinator/v1/config/compaction</code></li>
</ul>
<p>Creates or updates the compaction config for a dataSource.
See <a href="../configuration/index.html#compaction-dynamic-configuration">Compaction Configuration</a> for configuration details.</p>
<h5 id="delete">DELETE</h5>
<ul>
<li><code>/druid/coordinator/v1/config/compaction/{dataSource}</code></li>
</ul>
<p>Removes the compaction config for a dataSource.</p>
<h4 id="server-information">Server Information</h4>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/coordinator/v1/servers</code></li>
</ul>
<p>Returns a list of servers URLs using the format <code>{hostname}:{port}</code>. Note that
processes that run with different types will appear multiple times with different
ports.</p>
<ul>
<li><code>/druid/coordinator/v1/servers?simple</code></li>
</ul>
<p>Returns a list of server data objects in which each object has the following keys:
* <code>host</code>: host URL include (<code>{hostname}:{port}</code>)
* <code>type</code>: process type (<code>indexer-executor</code>, <code>historical</code>)
* <code>currSize</code>: storage size currently used
* <code>maxSize</code>: maximum storage size
* <code>priority</code>
* <code>tier</code></p>
<h3 id="overlord">Overlord</h3>
<h4 id="leadership">Leadership</h4>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/indexer/v1/leader</code> </li>
</ul>
<p>Returns the current leader Overlord of the cluster. If you have multiple Overlords, just one is leading at any given time. The others are on standby.</p>
<ul>
<li><code>/druid/indexer/v1/isLeader</code></li>
</ul>
<p>This returns a JSON object with field &quot;leader&quot;, either true or false. In addition, this call returns HTTP 200 if the
server is the current leader and HTTP 404 if not. This is suitable for use as a load balancer status check if you
only want the active leader to be considered in-service at the load balancer.</p>
<h4 id="tasks">Tasks<a name="overlord-tasks"></a></h4>
<p>Note that all <em>interval</em> URL parameters are ISO 8601 strings delimited by a <code>_</code> instead of a <code>/</code>
(e.g., 2016-06-27_2016-06-28).</p>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/indexer/v1/tasks</code></li>
</ul>
<p>Retrieve list of tasks. Accepts query string parameters <code>state</code>, <code>datasource</code>, <code>createdTimeInterval</code>, <code>max</code>, and <code>type</code>.</p>
<table><thead>
<tr>
<th>Query Parameter</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>state</code></td>
<td>filter list of tasks by task state, valid options are <code>running</code>, <code>complete</code>, <code>waiting</code>, and <code>pending</code>.</td>
</tr>
<tr>
<td><code>datasource</code></td>
<td>return tasks filtered by Druid datasource.</td>
</tr>
<tr>
<td><code>createdTimeInterval</code></td>
<td>return tasks created within the specified interval.</td>
</tr>
<tr>
<td><code>max</code></td>
<td>maximum number of <code>&quot;complete&quot;</code> tasks to return. Only applies when <code>state</code> is set to <code>&quot;complete&quot;</code>.</td>
</tr>
<tr>
<td><code>type</code></td>
<td>filter tasks by task type. See <a href="../ingestion/tasks.html">task documentation</a> for more details.</td>
</tr>
</tbody></table>
<ul>
<li><code>/druid/indexer/v1/completeTasks</code></li>
</ul>
<p>Retrieve list of complete tasks. Equivalent to <code>/druid/indexer/v1/tasks?state=complete</code>.</p>
<ul>
<li><code>/druid/indexer/v1/runningTasks</code></li>
</ul>
<p>Retrieve list of running tasks. Equivalent to <code>/druid/indexer/v1/tasks?state=running</code>.</p>
<ul>
<li><code>/druid/indexer/v1/waitingTasks</code></li>
</ul>
<p>Retrieve list of waiting tasks. Equivalent to <code>/druid/indexer/v1/tasks?state=waiting</code>.</p>
<ul>
<li><code>/druid/indexer/v1/pendingTasks</code></li>
</ul>
<p>Retrieve list of pending tasks. Equivalent to <code>/druid/indexer/v1/tasks?state=pending</code>.</p>
<ul>
<li><code>/druid/indexer/v1/task/{taskId}</code></li>
</ul>
<p>Retrieve the &#39;payload&#39; of a task.</p>
<ul>
<li><code>/druid/indexer/v1/task/{taskId}/status</code></li>
</ul>
<p>Retrieve the status of a task.</p>
<ul>
<li><code>/druid/indexer/v1/task/{taskId}/segments</code></li>
</ul>
<p>Retrieve information about the segments of a task.</p>
<div class="note caution">
This API is deprecated and will be removed in future releases.
</div>
<ul>
<li><code>/druid/indexer/v1/task/{taskId}/reports</code></li>
</ul>
<p>Retrieve a <a href="../ingestion/reports.html">task completion report</a> for a task. Only works for completed tasks.</p>
<h5 id="post">POST</h5>
<ul>
<li><code>/druid/indexer/v1/task</code> </li>
</ul>
<p>Endpoint for submitting tasks and supervisor specs to the Overlord. Returns the taskId of the submitted task.</p>
<ul>
<li><code>/druid/indexer/v1/task/{taskId}/shutdown</code></li>
</ul>
<p>Shuts down a task.</p>
<ul>
<li><code>/druid/indexer/v1/datasources/{dataSource}/shutdownAllTasks</code></li>
</ul>
<p>Shuts down all tasks for a dataSource.</p>
<ul>
<li><code>/druid/indexer/v1/taskStatus</code></li>
</ul>
<p>Retrieve list of task status objects for list of task id strings in request body.</p>
<h5 id="delete">DELETE</h5>
<ul>
<li><code>/druid/indexer/v1/pendingSegments/{dataSource}</code></li>
</ul>
<p>Manually clean up pending segments table in metadata storage for <code>datasource</code>. Returns a JSON object response with
<code>numDeleted</code> and count of rows deleted from the pending segments table. This API is used by the
<code>druid.coordinator.kill.pendingSegments.on</code> <a href="../configuration/index.html#coordinator-operation">coordinator setting</a>
which automates this operation to perform periodically.</p>
<h4 id="supervisors">Supervisors</h4>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/indexer/v1/supervisor</code></li>
</ul>
<p>Returns a list of strings of the currently active supervisor ids.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor?full</code></li>
</ul>
<p>Returns a list of objects of the currently active supervisors.</p>
<table><thead>
<tr>
<th>Field</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead><tbody>
<tr>
<td><code>id</code></td>
<td>String</td>
<td>supervisor unique identifier</td>
</tr>
<tr>
<td><code>spec</code></td>
<td>SupervisorSpec</td>
<td>json specification of supervisor (See Supervisor Configuration for details)</td>
</tr>
</tbody></table>
<ul>
<li><code>/druid/indexer/v1/supervisor/&lt;supervisorId&gt;</code></li>
</ul>
<p>Returns the current spec for the supervisor with the provided ID.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/&lt;supervisorId&gt;/status</code></li>
</ul>
<p>Returns the current status of the supervisor with the provided ID.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/history</code></li>
</ul>
<p>Returns an audit history of specs for all supervisors (current and past).</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/&lt;supervisorId&gt;/history</code></li>
</ul>
<p>Returns an audit history of specs for the supervisor with the provided ID.</p>
<h5 id="post">POST</h5>
<ul>
<li><code>/druid/indexer/v1/supervisor</code></li>
</ul>
<p>Create a new supervisor or update an existing one.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/&lt;supervisorId&gt;/suspend</code></li>
</ul>
<p>Suspend the current running supervisor of the provided ID. Responds with updated SupervisorSpec.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/suspendAll</code></li>
</ul>
<p>Suspend all supervisors at once.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/&lt;supervisorId&gt;/resume</code></li>
</ul>
<p>Resume indexing tasks for a supervisor. Responds with updated SupervisorSpec.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/resumeAll</code></li>
</ul>
<p>Resume all supervisors at once.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/&lt;supervisorId&gt;/reset</code></li>
</ul>
<p>Reset the specified supervisor.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/&lt;supervisorId&gt;/terminate</code></li>
</ul>
<p>Terminate a supervisor of the provided ID.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/terminateAll</code></li>
</ul>
<p>Terminate all supervisors at once.</p>
<ul>
<li><code>/druid/indexer/v1/supervisor/&lt;supervisorId&gt;/shutdown</code></li>
</ul>
<p>Shutdown a supervisor.</p>
<div class="note caution">
This API is deprecated and will be removed in future releases.
Please use the equivalent 'terminate' instead.
</div>
<h4 id="dynamic-configuration">Dynamic Configuration</h4>
<p>See <a href="../configuration/index.html#overlord-dynamic-configuration">Overlord Dynamic Configuration</a> for details.</p>
<p>Note that all <em>interval</em> URL parameters are ISO 8601 strings delimited by a <code>_</code> instead of a <code>/</code>
(e.g., 2016-06-27_2016-06-28).</p>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/indexer/v1/worker</code></li>
</ul>
<p>Retreives current overlord dynamic configuration.</p>
<ul>
<li><code>/druid/indexer/v1/worker/history?interval={interval}&amp;counter={count}</code></li>
</ul>
<p>Retrieves history of changes to overlord dynamic configuration. Accepts <code>interval</code> and <code>count</code> query string parameters
to filter by interval and limit the number of results respectively.</p>
<ul>
<li><code>/druid/indexer/v1/scaling</code></li>
</ul>
<p>Retrieves overlord scaling events if auto-scaling runners are in use.</p>
<h5 id="post">POST</h5>
<ul>
<li>/druid/indexer/v1/worker</li>
</ul>
<p>Update overlord dynamic worker configuration.</p>
<h2 id="data-server">Data Server</h2>
<p>This section documents the API endpoints for the processes that reside on Data servers (MiddleManagers/Peons and Historicals)
in the suggested <a href="../design/processes.html#server-types">three-server configuration</a>.</p>
<h3 id="middlemanager">MiddleManager</h3>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/worker/v1/enabled</code></li>
</ul>
<p>Check whether a MiddleManager is in an enabled or disabled state. Returns JSON object keyed by the combined <code>druid.host</code>
and <code>druid.port</code> with the boolean state as the value.</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span></span><span class="p">{</span><span class="nt">&quot;localhost:8091&quot;</span><span class="p">:</span><span class="kc">true</span><span class="p">}</span>
</code></pre></div>
<ul>
<li><code>/druid/worker/v1/tasks</code></li>
</ul>
<p>Retrieve a list of active tasks being run on MiddleManager. Returns JSON list of taskid strings. Normal usage should
prefer to use the <code>/druid/indexer/v1/tasks</code> <a href="#overlord">Overlord API</a> or one of it&#39;s task state specific variants instead.</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span></span><span class="p">[</span><span class="s2">&quot;index_wikiticker_2019-02-11T02:20:15.316Z&quot;</span><span class="p">]</span>
</code></pre></div>
<ul>
<li><code>/druid/worker/v1/task/{taskid}/log</code></li>
</ul>
<p>Retrieve task log output stream by task id. Normal usage should prefer to use the <code>/druid/indexer/v1/task/{taskId}/log</code>
<a href="#overlord">Overlord API</a> instead.</p>
<h5 id="post">POST</h5>
<ul>
<li><code>/druid/worker/v1/disable</code></li>
</ul>
<p>&#39;Disable&#39; a MiddleManager, causing it to stop accepting new tasks but complete all existing tasks. Returns JSON object
keyed by the combined <code>druid.host</code> and <code>druid.port</code>:</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span></span><span class="p">{</span><span class="nt">&quot;localhost:8091&quot;</span><span class="p">:</span><span class="s2">&quot;disabled&quot;</span><span class="p">}</span>
</code></pre></div>
<ul>
<li><code>/druid/worker/v1/enable</code></li>
</ul>
<p>&#39;Enable&#39; a MiddleManager, allowing it to accept new tasks again if it was previously disabled. Returns JSON object
keyed by the combined <code>druid.host</code> and <code>druid.port</code>:</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span></span><span class="p">{</span><span class="nt">&quot;localhost:8091&quot;</span><span class="p">:</span><span class="s2">&quot;enabled&quot;</span><span class="p">}</span>
</code></pre></div>
<ul>
<li><code>/druid/worker/v1/task/{taskid}/shutdown</code></li>
</ul>
<p>Shutdown a running task by <code>taskid</code>. Normal usage should prefer to use the <code>/druid/indexer/v1/task/{taskId}/shutdown</code>
<a href="#overlord">Overlord API</a> instead. Returns JSON:</p>
<div class="highlight"><pre><code class="language-json" data-lang="json"><span></span><span class="p">{</span><span class="nt">&quot;task&quot;</span><span class="p">:</span><span class="s2">&quot;index_kafka_wikiticker_f7011f8ffba384b_fpeclode&quot;</span><span class="p">}</span>
</code></pre></div>
<h3 id="peon">Peon</h3>
<h4 id="get">GET</h4>
<ul>
<li><code>/druid/worker/v1/chat/{taskId}/rowStats</code></li>
</ul>
<p>Retrieve a live row stats report from a Peon. See <a href="../ingestion/reports.html">task reports</a> for more details.</p>
<ul>
<li><code>/druid/worker/v1/chat/{taskId}/unparseableEvents</code></li>
</ul>
<p>Retrieve an unparseable events report from a Peon. See <a href="../ingestion/reports.html">task reports</a> for more details.</p>
<h3 id="historical">Historical</h3>
<h4 id="segment-loading">Segment Loading</h4>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/historical/v1/loadstatus</code></li>
</ul>
<p>Returns JSON of the form <code>{&quot;cacheInitialized&quot;:&lt;value&gt;}</code>, where value is either <code>true</code> or <code>false</code> indicating if all
segments in the local cache have been loaded. This can be used to know when a Historical process is ready
to be queried after a restart.</p>
<ul>
<li><code>/druid/historical/v1/readiness</code></li>
</ul>
<p>Similar to <code>/druid/historical/v1/loadstatus</code>, but instead of returning JSON with a flag, responses 200 OK if segments
in the local cache have been loaded, and 503 SERVICE UNAVAILABLE, if they haven&#39;t.</p>
<h2 id="query-server">Query Server</h2>
<p>This section documents the API endpoints for the processes that reside on Query servers (Brokers) in the suggested <a href="../design/processes.html#server-types">three-server configuration</a>.</p>
<h3 id="broker">Broker</h3>
<h4 id="datasource-information">Datasource Information</h4>
<p>Note that all <em>interval</em> URL parameters are ISO 8601 strings delimited by a <code>_</code> instead of a <code>/</code>
(e.g., 2016-06-27_2016-06-28).</p>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/v2/datasources</code></li>
</ul>
<p>Returns a list of queryable datasources.</p>
<ul>
<li><code>/druid/v2/datasources/{dataSourceName}</code></li>
</ul>
<p>Returns the dimensions and metrics of the datasource. Optionally, you can provide request parameter &quot;full&quot; to get list of served intervals with dimensions and metrics being served for those intervals. You can also provide request param &quot;interval&quot; explicitly to refer to a particular interval.</p>
<p>If no interval is specified, a default interval spanning a configurable period before the current time will be used. The default duration of this interval is specified in ISO 8601 duration format via:</p>
<p>druid.query.segmentMetadata.defaultHistory</p>
<ul>
<li><code>/druid/v2/datasources/{dataSourceName}/dimensions</code></li>
</ul>
<p>Returns the dimensions of the datasource.</p>
<div class="note caution">
This API is deprecated and will be removed in future releases. Please use <a href="/querying/segmentmetadataquery.html">SegmentMetadataQuery</a> instead
which provides more comprehensive information and supports all dataSource types including streaming dataSources. It's also encouraged to use <a href="/querying/sql.html#retrieving-metadata">INFORMATION_SCHEMA tables</a>
if you're using SQL.
</div>
<ul>
<li><code>/druid/v2/datasources/{dataSourceName}/metrics</code></li>
</ul>
<p>Returns the metrics of the datasource.</p>
<div class="note caution">
This API is deprecated and will be removed in future releases. Please use <a href="../querying/segmentmetadataquery.html">SegmentMetadataQuery</a> instead
which provides more comprehensive information and supports all dataSource types including streaming dataSources. It's also encouraged to use [INFORMATION_SCHEMA tables](../querying/sql.html#retrieving-metadata)
if you're using SQL.
</div>
<ul>
<li><code>/druid/v2/datasources/{dataSourceName}/candidates?intervals={comma-separated-intervals}&amp;numCandidates={numCandidates}</code></li>
</ul>
<p>Returns segment information lists including server locations for the given datasource and intervals. If &quot;numCandidates&quot; is not specified, it will return all servers for each interval.</p>
<h4 id="load-status">Load Status</h4>
<h5 id="get">GET</h5>
<ul>
<li><code>/druid/broker/v1/loadstatus</code></li>
</ul>
<p>Returns a flag indicating if the Broker knows about all segments in Zookeeper. This can be used to know when a Broker process is ready to be queried after a restart.</p>
<h4 id="queries">Queries</h4>
<h5 id="post">POST</h5>
<ul>
<li><code>/druid/v2/</code></li>
</ul>
<p>The endpoint for submitting queries. Accepts an option <code>?pretty</code> that pretty prints the results.</p>
<ul>
<li><code>/druid/v2/candidates/</code></li>
</ul>
<p>Returns segment information lists including server locations for the given query..</p>
</div>
<div class="col-md-3">
<div class="searchbox">
<gcse:searchbox-only></gcse:searchbox-only>
</div>
<div id="toc" class="nav toc hidden-print">
</div>
</div>
</div>
</div>
<!-- Start page_footer include -->
<footer class="druid-footer">
<div class="container">
<div class="text-center">
<p>
<a href="/technology">Technology</a>&ensp;·&ensp;
<a href="/use-cases">Use Cases</a>&ensp;·&ensp;
<a href="/druid-powered">Powered by Druid</a>&ensp;·&ensp;
<a href="/docs/latest/">Docs</a>&ensp;·&ensp;
<a href="/community/">Community</a>&ensp;·&ensp;
<a href="/downloads.html">Download</a>&ensp;·&ensp;
<a href="/faq">FAQ</a>
</p>
</div>
<div class="text-center">
<a title="Join the user group" href="https://groups.google.com/forum/#!forum/druid-user" target="_blank"><span class="fa fa-comments"></span></a>&ensp;·&ensp;
<a title="Follow Druid" href="https://twitter.com/druidio" target="_blank"><span class="fab fa-twitter"></span></a>&ensp;·&ensp;
<a title="GitHub" href="https://github.com/apache/druid" target="_blank"><span class="fab fa-github"></span></a>
</div>
<div class="text-center license">
Copyright © 2020 <a href="https://www.apache.org/" target="_blank">Apache Software Foundation</a>.<br>
Except where otherwise noted, licensed under <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>.<br>
Apache Druid, Druid, and the Druid logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and other countries.
</div>
</div>
</footer>
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-131010415-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-131010415-1');
</script>
<script>
function trackDownload(type, url) {
ga('send', 'event', 'download', type, url);
}
</script>
<script src="//code.jquery.com/jquery.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="/assets/js/druid.js"></script>
<!-- stop page_footer include -->
<script>
$(function() {
$(".toc").load("/docs/0.14.2-incubating/toc.html");
// There is no way to tell when .gsc-input will be async loaded into the page so just try to set a placeholder until it works
var tries = 0;
var timer = setInterval(function() {
tries++;
if (tries > 300) clearInterval(timer);
var searchInput = $('input.gsc-input');
if (searchInput.length) {
searchInput.attr('placeholder', 'Search');
clearInterval(timer);
}
}, 100);
});
</script>
</body>
</html>