Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding documentation for dangling index api #1370

Merged
merged 2 commits into from
Oct 4, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions _opensearch/rest-api/index-apis/dangling-index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
layout: default
title: Dangling indices
parent: index-apis
grand_parent: REST API reference
nav_order: 84
---

# Dangling indices API
ariamarble marked this conversation as resolved.
Show resolved Hide resolved
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

Dangling indices occur if any shards exist in a node's local directory that do not already exist in the cluster, after a node joins a cluster. Dangling indices can be listed, deleted, or imported.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

## Path and HTTP methods

List dangling indices:

```
GET /_dangling
```

Import dangling index:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

```
POST /_dangling/<index-uuid>
```

Delete dangling index:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

```
DELETE /_dangling/<index-uuid>
```

## Path parameters

Path parameters are required.

Path parameter | Description
:--- | :---
index-uuid | UUID of index.

## Query parameters

Query parameters are optional.

Query parameter | Data Type | Description
:--- | :--- | :---
accept_data_loss | boolean | Must be set to `true` for an `import` or `delete`, as Opensearch is unaware of where the dangling index data came from.
ariamarble marked this conversation as resolved.
Show resolved Hide resolved
timeout | time units | The amount of time to wait for a response. If no response is received in the defined time period, an error is returned. Default is `30` seconds.
master_timeout | time units | The amount of time to wait for the connection to the cluster manager. If no response is received in the defined time period, an error is returned. Default is `30` seconds.

## Examples

Example requests and response:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

#### Sample list:
ariamarble marked this conversation as resolved.
Show resolved Hide resolved

````bash
GET /_dangling
````

#### Sample import:

````bash
POST /_dangling/msdjernajxAT23RT-BupMB?accept_data_loss=true
````

#### Sample delete:

````bash
DELETE /_dangling/msdjernajxAT23RT-BupMB?accept_data_loss=true
````

#### Sample response body:

````json
{
"_nodes": {
"total": 1,
"successful": 1,
"failed": 0
},
"cluster_name": "opensearch-cluster",
"dangling_indices": [msdjernajxAT23RT-BupMB]
}
````