| <!doctype html> |
| <html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-api-reference/data-management-api" data-has-hydrated="false"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="generator" content="Docusaurus v3.7.0"> |
| <title data-rh="true">Data management API | Apache® Druid</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://druid.apache.org/img/druid_nav.png"><meta data-rh="true" name="twitter:image" content="https://druid.apache.org/img/druid_nav.png"><meta data-rh="true" property="og:url" content="https://druid.apache.org/docs/34.0.0/api-reference/data-management-api"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Data management API | Apache® Druid"><meta data-rh="true" name="description" content="<!--"><meta data-rh="true" property="og:description" content="<!--"><link data-rh="true" rel="icon" href="/img/favicon.png"><link data-rh="true" rel="canonical" href="https://druid.apache.org/docs/34.0.0/api-reference/data-management-api"><link data-rh="true" rel="alternate" href="https://druid.apache.org/docs/34.0.0/api-reference/data-management-api" hreflang="en"><link data-rh="true" rel="alternate" href="https://druid.apache.org/docs/34.0.0/api-reference/data-management-api" hreflang="x-default"><link rel="stylesheet" href="/css/all.css"> |
| <script src="/js/clipboard.min.js"></script><link rel="stylesheet" href="/assets/css/styles.f3140859.css"> |
| <script src="/assets/js/runtime~main.9b5d81eb.js" defer="defer"></script> |
| <script src="/assets/js/main.0aff4030.js" defer="defer"></script> |
| </head> |
| <body class="navigation-with-keyboard"> |
| <script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return window.localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"light")}(),function(){try{const n=new URLSearchParams(window.location.search).entries();for(var[t,e]of n)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top navbar--dark"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/druid_nav.png" alt="Apache® Druid" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/druid_nav.png" alt="Apache® Druid" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div></a></div><div class="navbar__items navbar__items--right"><a class="navbar__item navbar__link" href="/technology">Technology</a><a class="navbar__item navbar__link" href="/use-cases">Use Cases</a><a class="navbar__item navbar__link" href="/druid-powered">Powered By</a><a class="navbar__item navbar__link" href="/docs/34.0.0/design/">Docs</a><a class="navbar__item navbar__link" href="/community/">Community</a><div class="navbar__item dropdown dropdown--hoverable dropdown--right"><a href="#" aria-haspopup="true" aria-expanded="false" role="button" class="navbar__link">Apache®</a><ul class="dropdown__menu"><li><a href="https://www.apache.org/" target="_blank" rel="noopener noreferrer" class="dropdown__link">Foundation<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://apachecon.com/?ref=druid.apache.org" target="_blank" rel="noopener noreferrer" class="dropdown__link">Events<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/licenses/" target="_blank" rel="noopener noreferrer" class="dropdown__link">License<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/foundation/thanks.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Thanks<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/security/" target="_blank" rel="noopener noreferrer" class="dropdown__link">Security<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li><li><a href="https://www.apache.org/foundation/sponsorship.html" target="_blank" rel="noopener noreferrer" class="dropdown__link">Sponsorship<svg width="12" height="12" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a></li></ul></div><a class="navbar__item navbar__link" href="/downloads/">Download</a><div class="navbarSearchContainer_Bca1"><div class="navbar__search"><span aria-label="expand searchbar" role="button" class="search-icon" tabindex="0"></span><input id="search_input_react" type="search" placeholder="Loading..." aria-label="Search" class="navbar__search-input search-bar" disabled=""></div></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="docsWrapper_hBAB"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docRoot_UBD9"><aside class="theme-doc-sidebar-container docSidebarContainer_YfHR"><div class="sidebarViewport_aRkj"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/34.0.0/design/">Introduction to Apache Druid</a></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/34.0.0/tutorials/">Getting started</a><button aria-label="Expand sidebar category 'Getting started'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/34.0.0/design/architecture">Design</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/34.0.0/ingestion/">Ingestion</a><button aria-label="Expand sidebar category 'Ingestion'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/34.0.0/data-management/">Data management</a><button aria-label="Expand sidebar category 'Data management'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/34.0.0/querying/sql">Querying</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--active" href="/docs/34.0.0/api-reference/">API reference</a><button aria-label="Collapse sidebar category 'API reference'" aria-expanded="true" type="button" class="clean-btn menu__caret"></button></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret menu__link--active" role="button" aria-expanded="true" tabindex="0" href="/docs/34.0.0/api-reference/sql-api">HTTP APIs</a></div><ul style="display:block;overflow:visible;height:auto" class="menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/sql-api">Druid SQL</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/sql-ingestion-api">SQL-based ingestion</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/json-querying-api">JSON querying</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/tasks-api">Tasks</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/supervisor-api">Supervisors</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/retention-rules-api">Retention rules</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" tabindex="0" href="/docs/34.0.0/api-reference/data-management-api">Data management</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/automatic-compaction-api">Automatic compaction</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/lookups-api">Lookups</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/service-status-api">Service status</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/dynamic-configuration-api">Dynamic configuration</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-3 menu__list-item"><a class="menu__link" tabindex="0" href="/docs/34.0.0/api-reference/legacy-metadata-api">Legacy metadata</a></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-2 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" tabindex="0" href="/docs/34.0.0/api-reference/sql-jdbc">Java APIs</a></div></li></ul></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/34.0.0/configuration/">Configuration</a><button aria-label="Expand sidebar category 'Configuration'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/34.0.0/api-reference/automatic-compaction-api">Operations</a></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist" href="/docs/34.0.0/development/overview">Development</a><button aria-label="Expand sidebar category 'Development'" aria-expanded="false" type="button" class="clean-btn menu__caret"></button></div></li><li class="theme-doc-sidebar-item-category theme-doc-sidebar-item-category-level-1 menu__list-item menu__list-item--collapsed"><div class="menu__list-item-collapsible"><a class="menu__link menu__link--sublist menu__link--sublist-caret" role="button" aria-expanded="false" href="/docs/34.0.0/release-info/release-notes">Release info</a></div></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/34.0.0/misc/papers-and-talks">Papers</a></li></ul></nav></div></div></aside><main class="docMainContainer_TBSr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item"><a class="breadcrumbs__link" itemprop="item" href="/docs/34.0.0/api-reference/"><span itemprop="name">API reference</span></a><meta itemprop="position" content="1"></li><li class="breadcrumbs__item"><span class="breadcrumbs__link">HTTP APIs</span><meta itemprop="position" content="2"></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Data management</span><meta itemprop="position" content="3"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Data management API</h1></header><p>This topic describes the data management API endpoints for Apache Druid. |
| This includes information on how to mark segments as used or unused and delete them from Druid.</p> |
| <p>In this topic, <code>http://ROUTER_IP:ROUTER_PORT</code> is a placeholder for your Router service address and port. |
| Replace it with the information for your deployment. |
| For example, use <code>http://localhost:8888</code> for quickstart deployments.</p> |
| <div class="theme-admonition theme-admonition-info admonition_xJq3 alert alert--info"><div class="admonitionHeading_Gvgb"><span class="admonitionIcon_Rf37"><svg viewBox="0 0 14 16"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg></span>info</div><div class="admonitionContent_BuS1"><ul> |
| <li>Coordinator APIs for data management are now deprecated. Use new APIs served by the Overlord instead.</li> |
| <li>Do not use these APIs while an indexing task or kill task is in progress for the same datasource and interval.</li> |
| </ul></div></div> |
| <h2 class="anchor anchorWithStickyNavbar_LWe7" id="segment-management">Segment management<a href="#segment-management" class="hash-link" aria-label="Direct link to Segment management" title="Direct link to Segment management"></a></h2> |
| <p>You can mark segments as used by sending POST requests to the datasource, but the Coordinator may subsequently mark segments as unused if they meet any configured <a href="/docs/34.0.0/operations/rule-configuration#drop-rules">drop rules</a>. |
| Even if these API requests update segments to used, you still need to configure a <a href="/docs/34.0.0/operations/rule-configuration#load-rules">load rule</a> to load them onto Historical processes.</p> |
| <p>When you use these APIs concurrently with an indexing task or a kill task, the behavior is undefined. |
| Druid terminates some segments and marks others as used. |
| Furthermore, it is possible that all segments could be unused, yet an indexing task might still be able to read data from these segments and complete successfully.</p> |
| <p>All of the following APIs, except <a href="#segment-deletion">Segment deletion</a> are served by the Overlord as it is the service responsible for performing actions on segment metadata on behalf of indexing tasks. |
| This makes it the single source of truth for segment metadata, thus ensuring a consistent view across the Druid cluster and allowing the Overlord to cache metadata to improve performance.</p> |
| <h3 class="anchor anchorWithStickyNavbar_LWe7" id="segment-ids">Segment IDs<a href="#segment-ids" class="hash-link" aria-label="Direct link to Segment IDs" title="Direct link to Segment IDs"></a></h3> |
| <p>You must provide segment IDs when using many of the endpoints described in this topic. |
| For information on segment IDs, see <a href="/docs/34.0.0/design/segments#segment-identification">Segment identification</a>. |
| For information on finding segment IDs in the web console, see <a href="/docs/34.0.0/operations/web-console#segments">Segments</a>.</p> |
| <h3 class="anchor anchorWithStickyNavbar_LWe7" id="mark-a-single-segment-unused">Mark a single segment unused<a href="#mark-a-single-segment-unused" class="hash-link" aria-label="Direct link to Mark a single segment unused" title="Direct link to Mark a single segment unused"></a></h3> |
| <p>Marks the state of a segment as unused, using the segment ID. |
| This is a "soft delete" of the segment from Historicals. |
| To undo this action, <a href="#mark-a-single-segment-as-used">mark the segment used</a>.</p> |
| <p>Note that this endpoint returns an HTTP <code>200 OK</code> response code even if the segment ID or datasource doesn't exist. |
| Check the response payload to confirm if any segment was actually updated.</p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="url">URL<a href="#url" class="hash-link" aria-label="Direct link to URL" title="Direct link to URL"></a></h4> |
| <p><code>DELETE</code> <code>/druid/indexer/v1/datasources/{datasource}/segments/{segmentId}</code></p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="header">Header<a href="#header" class="hash-link" aria-label="Direct link to Header" title="Direct link to Header"></a></h4> |
| <p>The following headers are required for this request:</p> |
| <div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Type</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> application/json</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Accept</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> application/json</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> text/plain</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="responses">Responses<a href="#responses" class="hash-link" aria-label="Direct link to Responses" title="Direct link to Responses"></a></h4> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">200 SUCCESS</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p><em>Successfully updated segment</em></p></div></div></div> |
| <hr> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-request">Sample request<a href="#sample-request" class="hash-link" aria-label="Direct link to Sample request" title="Direct link to Sample request"></a></h4> |
| <p>The following example updates the segment <code>wikipedia_hour_2015-09-12T16:00:00.000Z_2015-09-12T17:00:00.000Z_2023-08-10T04:12:03.860Z</code> from datasource <code>wikipedia_hour</code> as <code>unused</code>.</p> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">cURL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">HTTP</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">curl --request DELETE "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/datasources/wikipedia_hour/segments/wikipedia_hour_2015-09-12T16:00:00.000Z_2015-09-12T17:00:00.000Z_2023-08-10T04:12:03.860Z" \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--header 'Content-Type: application/json' \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--header 'Accept: application/json, text/plain'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-HTTP language-http codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-http codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">DELETE /druid/indexer/v1/datasources/wikipedia_hour/segments/wikipedia_hour_2015-09-12T16:00:00.000Z_2015-09-12T17:00:00.000Z_2023-08-10T04:12:03.860Z HTTP/1.1</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Host: http://ROUTER_IP:ROUTER_PORT</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Type: application/json</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Accept: application/json, text/plain</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-response">Sample response<a href="#sample-response" class="hash-link" aria-label="Direct link to Sample response" title="Direct link to Sample response"></a></h4> |
| <details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View the response</summary><div><div class="collapsibleContent_i85q"><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"segmentStateChanged"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"numChangedSegments"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details> |
| <h3 class="anchor anchorWithStickyNavbar_LWe7" id="mark-a-single-segment-as-used">Mark a single segment as used<a href="#mark-a-single-segment-as-used" class="hash-link" aria-label="Direct link to Mark a single segment as used" title="Direct link to Mark a single segment as used"></a></h3> |
| <p>Marks the state of a segment as used, using the segment ID.</p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="url-1">URL<a href="#url-1" class="hash-link" aria-label="Direct link to URL" title="Direct link to URL"></a></h4> |
| <p><code>POST</code> <code>/druid/indexer/v1/datasources/{datasource}/segments/{segmentId}</code></p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="header-1">Header<a href="#header-1" class="hash-link" aria-label="Direct link to Header" title="Direct link to Header"></a></h4> |
| <p>The following headers are required for this request:</p> |
| <div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Type</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> application/json</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Accept</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> application/json</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> text/plain</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="responses-1">Responses<a href="#responses-1" class="hash-link" aria-label="Direct link to Responses" title="Direct link to Responses"></a></h4> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">200 SUCCESS</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p><em>Successfully updated segments</em></p></div></div></div> |
| <hr> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-request-1">Sample request<a href="#sample-request-1" class="hash-link" aria-label="Direct link to Sample request" title="Direct link to Sample request"></a></h4> |
| <p>The following example updates the segment with ID <code>wikipedia_hour_2015-09-12T18:00:00.000Z_2015-09-12T19:00:00.000Z_2023-08-10T04:12:03.860Z</code> to used.</p> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">cURL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">HTTP</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/datasources/wikipedia_hour/segments/wikipedia_hour_2015-09-12T18:00:00.000Z_2015-09-12T19:00:00.000Z_2023-08-10T04:12:03.860Z" \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--header 'Content-Type: application/json' \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--header 'Accept: application/json, text/plain'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-HTTP language-http codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-http codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">POST /druid/indexer/v1/datasources/wikipedia_hour/segments/wikipedia_hour_2015-09-12T18:00:00.000Z_2015-09-12T19:00:00.000Z_2023-08-10T04:12:03.860Z HTTP/1.1</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Host: http://ROUTER_IP:ROUTER_PORT</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Type: application/json</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Accept: application/json, text/plain</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-response-1">Sample response<a href="#sample-response-1" class="hash-link" aria-label="Direct link to Sample response" title="Direct link to Sample response"></a></h4> |
| <details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View the response</summary><div><div class="collapsibleContent_i85q"><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"segmentStateChanged"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token boolean" style="color:rgb(255, 88, 116)">true</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"numChangedSegments"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details> |
| <h3 class="anchor anchorWithStickyNavbar_LWe7" id="mark-a-group-of-segments-unused">Mark a group of segments unused<a href="#mark-a-group-of-segments-unused" class="hash-link" aria-label="Direct link to Mark a group of segments unused" title="Direct link to Mark a group of segments unused"></a></h3> |
| <p>Marks the state of a group of segments as unused, using an array of segment IDs or an interval. |
| Pass the array of segment IDs or interval as a JSON object in the request body.</p> |
| <p>For the interval, specify the start and end times as ISO 8601 strings to identify segments inclusive of the start time and exclusive of the end time. |
| Optionally, specify an array of segment versions with interval. Druid updates only the segments completely contained |
| within the specified interval that match the optional list of versions; partially overlapping segments are not affected.</p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="url-2">URL<a href="#url-2" class="hash-link" aria-label="Direct link to URL" title="Direct link to URL"></a></h4> |
| <p><code>POST</code> <code>/druid/indexer/v1/datasources/{datasource}/markUnused</code></p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="request-body">Request body<a href="#request-body" class="hash-link" aria-label="Direct link to Request body" title="Direct link to Request body"></a></h4> |
| <p>The group of segments is sent as a JSON request payload that accepts the following properties:</p> |
| <table><thead><tr><th>Property</th><th>Description</th><th>Required</th><th>Example</th></tr></thead><tbody><tr><td><code>interval</code></td><td>ISO 8601 segments interval.</td><td>Yes, if <code>segmentIds</code> is not specified.</td><td><code>"2015-09-12T03:00:00.000Z/2015-09-12T05:00:00.000Z"</code></td></tr><tr><td><code>segmentIds</code></td><td>List of segment IDs.</td><td>Yes, if <code>interval</code> is not specified.</td><td><code>["segmentId1", "segmentId2"]</code></td></tr><tr><td><code>versions</code></td><td>List of segment versions. Must be provided with <code>interval</code>.</td><td>No.</td><td><code>["2024-03-14T16:00:04.086Z", ""2024-03-12T16:00:04.086Z"]</code></td></tr></tbody></table> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="responses-2">Responses<a href="#responses-2" class="hash-link" aria-label="Direct link to Responses" title="Direct link to Responses"></a></h4> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">200 SUCCESS</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">204 NO CONTENT</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">400 BAD REQUEST</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p><em>Successfully updated segments</em></p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p><em>Invalid datasource name</em></p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p><em>Invalid request payload</em></p></div></div></div> |
| <hr> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-request-2">Sample request<a href="#sample-request-2" class="hash-link" aria-label="Direct link to Sample request" title="Direct link to Sample request"></a></h4> |
| <p>The following example marks two segments from the <code>wikipedia_hour</code> datasource unused based on their segment IDs.</p> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">cURL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">HTTP</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/datasources/wikipedia_hour/markUnused" \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--header 'Content-Type: application/json' \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--data '{</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "segmentIds": [</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "wikipedia_hour_2015-09-12T14:00:00.000Z_2015-09-12T15:00:00.000Z_2023-08-10T04:12:03.860Z",</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "wikipedia_hour_2015-09-12T04:00:00.000Z_2015-09-12T05:00:00.000Z_2023-08-10T04:12:03.860Z"</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> ]</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-HTTP language-http codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-http codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">POST /druid/indexer/v1/datasources/wikipedia_hour/markUnused HTTP/1.1</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Host: http://ROUTER_IP:ROUTER_PORT</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Type: application/json</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Length: 230</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">{</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "segmentIds": [</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "wikipedia_hour_2015-09-12T14:00:00.000Z_2015-09-12T15:00:00.000Z_2023-08-10T04:12:03.860Z",</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "wikipedia_hour_2015-09-12T04:00:00.000Z_2015-09-12T05:00:00.000Z_2023-08-10T04:12:03.860Z"</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> ]</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-response-2">Sample response<a href="#sample-response-2" class="hash-link" aria-label="Direct link to Sample response" title="Direct link to Sample response"></a></h4> |
| <details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View the response</summary><div><div class="collapsibleContent_i85q"><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"numChangedSegments"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details> |
| <h3 class="anchor anchorWithStickyNavbar_LWe7" id="mark-a-group-of-segments-used">Mark a group of segments used<a href="#mark-a-group-of-segments-used" class="hash-link" aria-label="Direct link to Mark a group of segments used" title="Direct link to Mark a group of segments used"></a></h3> |
| <p>Marks the state of a group of segments as used, using an array of segment IDs or an interval. |
| Pass the array of segment IDs or interval as a JSON object in the request body.</p> |
| <p>For the interval, specify the start and end times as ISO 8601 strings to identify segments inclusive of the start time and exclusive of the end time. |
| Optionally, specify an array of segment versions with interval. Druid updates only the segments completely contained |
| within the specified interval that match the optional list of versions; partially overlapping segments are not affected.</p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="url-3">URL<a href="#url-3" class="hash-link" aria-label="Direct link to URL" title="Direct link to URL"></a></h4> |
| <p><code>POST</code> <code>/druid/indexer/v1/datasources/{datasource}/markUsed</code></p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="request-body-1">Request body<a href="#request-body-1" class="hash-link" aria-label="Direct link to Request body" title="Direct link to Request body"></a></h4> |
| <p>The group of segments is sent as a JSON request payload that accepts the following properties:</p> |
| <table><thead><tr><th>Property</th><th>Description</th><th>Required</th><th>Example</th></tr></thead><tbody><tr><td><code>interval</code></td><td>ISO 8601 segments interval.</td><td>Yes, if <code>segmentIds</code> is not specified.</td><td><code>"2015-09-12T03:00:00.000Z/2015-09-12T05:00:00.000Z"</code></td></tr><tr><td><code>segmentIds</code></td><td>List of segment IDs.</td><td>Yes, if <code>interval</code> is not specified.</td><td><code>["segmentId1", "segmentId2"]</code></td></tr><tr><td><code>versions</code></td><td>List of segment versions. Must be provided with <code>interval</code>.</td><td>No.</td><td><code>["2024-03-14T16:00:04.086Z", ""2024-03-12T16:00:04.086Z"]</code></td></tr></tbody></table> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="responses-3">Responses<a href="#responses-3" class="hash-link" aria-label="Direct link to Responses" title="Direct link to Responses"></a></h4> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">200 SUCCESS</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">204 NO CONTENT</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">400 BAD REQUEST</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p><em>Successfully updated segments</em></p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p><em>Invalid datasource name</em></p></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><p><em>Invalid request payload</em></p></div></div></div> |
| <hr> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-request-3">Sample request<a href="#sample-request-3" class="hash-link" aria-label="Direct link to Sample request" title="Direct link to Sample request"></a></h4> |
| <p>The following example marks two segments from the <code>wikipedia_hour</code> datasource used based on their segment IDs.</p> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">cURL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">HTTP</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">curl "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/datasources/wikipedia_hour/markUsed" \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--header 'Content-Type: application/json' \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--data '{</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "segmentIds": [</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "wikipedia_hour_2015-09-12T14:00:00.000Z_2015-09-12T15:00:00.000Z_2023-08-10T04:12:03.860Z",</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "wikipedia_hour_2015-09-12T04:00:00.000Z_2015-09-12T05:00:00.000Z_2023-08-10T04:12:03.860Z"</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> ]</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">}'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-HTTP language-http codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-http codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">POST /druid/indexer/v1/datasources/wikipedia_hour/markUsed HTTP/1.1</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Host: http://ROUTER_IP:ROUTER_PORT</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Type: application/json</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Length: 230</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">{</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "segmentIds": [</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "wikipedia_hour_2015-09-12T14:00:00.000Z_2015-09-12T15:00:00.000Z_2023-08-10T04:12:03.860Z",</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> "wikipedia_hour_2015-09-12T04:00:00.000Z_2015-09-12T05:00:00.000Z_2023-08-10T04:12:03.860Z"</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> ]</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-response-3">Sample response<a href="#sample-response-3" class="hash-link" aria-label="Direct link to Sample response" title="Direct link to Sample response"></a></h4> |
| <details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View the response</summary><div><div class="collapsibleContent_i85q"><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"numChangedSegments"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">2</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details> |
| <h3 class="anchor anchorWithStickyNavbar_LWe7" id="mark-all-segments-unused">Mark all segments unused<a href="#mark-all-segments-unused" class="hash-link" aria-label="Direct link to Mark all segments unused" title="Direct link to Mark all segments unused"></a></h3> |
| <p>Marks the state of all segments of a datasource as unused. |
| This action performs a "soft delete" of the segments from Historicals.</p> |
| <p>Note that this endpoint returns an HTTP <code>200 OK</code> response code even if the datasource doesn't exist. |
| Check the response payload to confirm if any segment was actually updated.</p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="url-4">URL<a href="#url-4" class="hash-link" aria-label="Direct link to URL" title="Direct link to URL"></a></h4> |
| <p><code>DELETE</code> <code>/druid/indexer/v1/datasources/{datasource}</code></p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="responses-4">Responses<a href="#responses-4" class="hash-link" aria-label="Direct link to Responses" title="Direct link to Responses"></a></h4> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">200 SUCCESS</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p><em>Successfully updated segments</em></p></div></div></div> |
| <hr> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-request-4">Sample request<a href="#sample-request-4" class="hash-link" aria-label="Direct link to Sample request" title="Direct link to Sample request"></a></h4> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">cURL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">HTTP</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">curl --request DELETE "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/datasources/wikipedia_hour"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-HTTP language-http codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-http codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">DELETE /druid/indexer/v1/datasources/wikipedia_hour HTTP/1.1</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Host: http://ROUTER_IP:ROUTER_PORT</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-response-4">Sample response<a href="#sample-response-4" class="hash-link" aria-label="Direct link to Sample response" title="Direct link to Sample response"></a></h4> |
| <details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View the response</summary><div><div class="collapsibleContent_i85q"><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"numChangedSegments"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">24</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details> |
| <h3 class="anchor anchorWithStickyNavbar_LWe7" id="mark-all-non-overshadowed-segments-used">Mark all non-overshadowed segments used<a href="#mark-all-non-overshadowed-segments-used" class="hash-link" aria-label="Direct link to Mark all non-overshadowed segments used" title="Direct link to Mark all non-overshadowed segments used"></a></h3> |
| <p>Marks the state of all unused segments of a datasource as used given that they are not already overshadowed by other segments. |
| The endpoint returns the number of changed segments.</p> |
| <p>Note that this endpoint returns an HTTP <code>200 OK</code> response code even if the datasource doesn't exist. |
| Check the response payload to get the number of segments actually updated.</p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="url-5">URL<a href="#url-5" class="hash-link" aria-label="Direct link to URL" title="Direct link to URL"></a></h4> |
| <p><code>POST</code> <code>/druid/indexer/v1/datasources/{datasource}</code></p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="header-2">Header<a href="#header-2" class="hash-link" aria-label="Direct link to Header" title="Direct link to Header"></a></h4> |
| <p>The following headers are required for this request:</p> |
| <div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Type</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> application/json</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Accept</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> application/json</span><span class="token punctuation" style="color:rgb(199, 146, 234)">,</span><span class="token plain"> text/plain</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="responses-5">Responses<a href="#responses-5" class="hash-link" aria-label="Direct link to Responses" title="Direct link to Responses"></a></h4> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">200 SUCCESS</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p><em>Successfully updated segments</em></p></div></div></div> |
| <hr> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-request-5">Sample request<a href="#sample-request-5" class="hash-link" aria-label="Direct link to Sample request" title="Direct link to Sample request"></a></h4> |
| <p>The following example updates all unused segments of <code>wikipedia_hour</code> to used. |
| <code>wikipedia_hour</code> contains one unused segment eligible to be marked as used.</p> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">cURL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">HTTP</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">curl --request POST "http://ROUTER_IP:ROUTER_PORT/druid/indexer/v1/datasources/wikipedia_hour" \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--header 'Content-Type: application/json' \</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">--header 'Accept: application/json, text/plain'</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-HTTP language-http codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-http codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">POST /druid/indexer/v1/datasources/wikipedia_hour HTTP/1.1</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Host: http://ROUTER_IP:ROUTER_PORT</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Content-Type: application/json</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Accept: application/json, text/plain</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-response-5">Sample response<a href="#sample-response-5" class="hash-link" aria-label="Direct link to Sample response" title="Direct link to Sample response"></a></h4> |
| <details class="details_lb9f alert alert--info details_b_Ee" data-collapsed="true"><summary>View the response</summary><div><div class="collapsibleContent_i85q"><div class="language-json codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-json codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token punctuation" style="color:rgb(199, 146, 234)">{</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"> </span><span class="token property">"numChangedSegments"</span><span class="token operator" style="color:rgb(137, 221, 255)">:</span><span class="token plain"> </span><span class="token number" style="color:rgb(247, 140, 108)">1</span><span class="token plain"></span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain"></span><span class="token punctuation" style="color:rgb(199, 146, 234)">}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></details> |
| <h2 class="anchor anchorWithStickyNavbar_LWe7" id="segment-deletion">Segment deletion<a href="#segment-deletion" class="hash-link" aria-label="Direct link to Segment deletion" title="Direct link to Segment deletion"></a></h2> |
| <h3 class="anchor anchorWithStickyNavbar_LWe7" id="permanently-delete-segments">Permanently delete segments<a href="#permanently-delete-segments" class="hash-link" aria-label="Direct link to Permanently delete segments" title="Direct link to Permanently delete segments"></a></h3> |
| <p>The DELETE endpoint sends a <a href="/docs/34.0.0/ingestion/tasks">kill task</a> for a given interval and datasource. The interval value is an ISO 8601 string delimited by <code>_</code>. This request permanently deletes all metadata for unused segments and removes them from deep storage.</p> |
| <p>Note that this endpoint returns an HTTP <code>200 OK</code> response code even if the datasource doesn't exist.</p> |
| <p>This endpoint supersedes the deprecated endpoint: <code>DELETE /druid/coordinator/v1/datasources/{datasource}?kill=true&interval={interval}</code></p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="url-6">URL<a href="#url-6" class="hash-link" aria-label="Direct link to URL" title="Direct link to URL"></a></h4> |
| <p><code>DELETE</code> <code>/druid/coordinator/v1/datasources/{datasource}/intervals/{interval}</code></p> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="responses-6">Responses<a href="#responses-6" class="hash-link" aria-label="Direct link to Responses" title="Direct link to Responses"></a></h4> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">200 SUCCESS</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><p><em>Successfully sent kill task</em></p></div></div></div> |
| <hr> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-request-6">Sample request<a href="#sample-request-6" class="hash-link" aria-label="Direct link to Sample request" title="Direct link to Sample request"></a></h4> |
| <p>The following example sends a kill task to permanently delete segments in the datasource <code>wikipedia_hour</code> from the interval <code>2015-09-12</code> to <code>2015-09-13</code>.</p> |
| <div class="tabs-container tabList__CuJ"><ul role="tablist" aria-orientation="horizontal" class="tabs"><li role="tab" tabindex="0" aria-selected="true" class="tabs__item tabItem_LNqP tabs__item--active">cURL</li><li role="tab" tabindex="-1" aria-selected="false" class="tabs__item tabItem_LNqP">HTTP</li></ul><div class="margin-top--md"><div role="tabpanel" class="tabItem_Ymn6"><div class="language-shell codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-shell codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">curl --request DELETE "http://ROUTER_IP:ROUTER_PORT/druid/coordinator/v1/datasources/wikipedia_hour/intervals/2015-09-12_2015-09-13"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div><div role="tabpanel" class="tabItem_Ymn6" hidden=""><div class="language-HTTP language-http codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#bfc7d5;--prism-background-color:#292d3e"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-http codeBlock_bY9V thin-scrollbar" style="color:#bfc7d5;background-color:#292d3e"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#bfc7d5"><span class="token plain">DELETE /druid/coordinator/v1/datasources/wikipedia_hour/intervals/2015-09-12_2015-09-13 HTTP/1.1</span><br></span><span class="token-line" style="color:#bfc7d5"><span class="token plain">Host: http://ROUTER_IP:ROUTER_PORT</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div></div></div></div> |
| <h4 class="anchor anchorWithStickyNavbar_LWe7" id="sample-response-6">Sample response<a href="#sample-response-6" class="hash-link" aria-label="Direct link to Sample response" title="Direct link to Sample response"></a></h4> |
| <p>A successful request returns an HTTP <code>200 OK</code> and an empty response body.</p></div></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/34.0.0/api-reference/retention-rules-api"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Retention rules</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/34.0.0/api-reference/automatic-compaction-api"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Automatic compaction</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#segment-management" class="table-of-contents__link toc-highlight">Segment management</a><ul><li><a href="#segment-ids" class="table-of-contents__link toc-highlight">Segment IDs</a></li><li><a href="#mark-a-single-segment-unused" class="table-of-contents__link toc-highlight">Mark a single segment unused</a></li><li><a href="#mark-a-single-segment-as-used" class="table-of-contents__link toc-highlight">Mark a single segment as used</a></li><li><a href="#mark-a-group-of-segments-unused" class="table-of-contents__link toc-highlight">Mark a group of segments unused</a></li><li><a href="#mark-a-group-of-segments-used" class="table-of-contents__link toc-highlight">Mark a group of segments used</a></li><li><a href="#mark-all-segments-unused" class="table-of-contents__link toc-highlight">Mark all segments unused</a></li><li><a href="#mark-all-non-overshadowed-segments-used" class="table-of-contents__link toc-highlight">Mark all non-overshadowed segments used</a></li></ul></li><li><a href="#segment-deletion" class="table-of-contents__link toc-highlight">Segment deletion</a><ul><li><a href="#permanently-delete-segments" class="table-of-contents__link toc-highlight">Permanently delete segments</a></li></ul></li></ul></div></div></div></div></main></div></div></div><footer class="footer"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="margin-bottom--sm"><img src="/img/favicon.png" class="footer__logo themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/favicon.png" class="footer__logo themedComponent_mlkZ themedComponent--dark_xIcU"></div><div class="footer__copyright">Copyright © 2025 Apache Software Foundation. Except where otherwise noted, licensed under CC BY-SA 4.0. 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></div></footer></div> |
| </body> |
| </html> |