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

Add Resolve API #7603

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
94 changes: 94 additions & 0 deletions _api-reference/index-apis/resolve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
layout: default
title: Resolve index
parent: Index APIs
nav_order: 63
---

# Resolve index

Introduced 1.0
{: .label .label-purple }

The Resolve Index API lists the indexes, aliases, and data streams based on the specified name. Multiple patterns and remote clusters are supported.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

## Path and HTTP methods

The Resolve Index API supports the following API method:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this line? We don't have an intro sentence in the template.


```
GET /_resolve/index/<name>
```
{% include copy-curl.html %}

## Permissions

When OpenSearch Security is enabled, you must have the `view_index_metadata` or `manage` index permissions for the target data stream, index, or index alias. <!-----FOLLOW UP, Is there a distinction between index permissions and index privileges?>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we link to the permissions page?

## Path parameters

The following table lists the available path parameters. All path parameters are optional.

| Parameter | Data type | Description |
| :--- | :--- | :--- |
| `<index>` | String | A comma-separated list of indexes, data streams, or index aliases to which the operation is applied. Supports wildcard expressions (`*`). Use `_all` or `*` to specify all indexes and data streams in a cluster. |

## Query parameters

The Resolve Index API supports the following optional query parameters:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

Parameter | Type | Description
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
:--- | :--- | :---
`allow_no_indices` | Boolean | Whether to ignore wildcards that don’t match any indexes. Default is `true`.
allow_partial_search_results | Boolean | Whether to return partial results if the request runs into an error or times out. Default is `true`.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved
`expand_wildcards` | String | Specifies the type of index that wildcard expressions can match. Supports comma-separated values. Valid values are `all` (match any index), `open` (match open, non-hidden indexes), `closed` (match closed, non-hidden indexes), `hidden` (match hidden indexes), and `none` (deny wildcard expressions). Default is `open`.
`ignore_unavailable` | Boolean | Specifies whether to include missing or closed indexes in the response and ignores unavailable shards during the search request. Default is `false`.
`ignore_throttled` | Boolean | Whether to ignore concrete, expanded, or indexes with aliases if indexes are frozen. Default is `true`.

## Example Request

Check failure on line 48 in _api-reference/index-apis/resolve.md

View workflow job for this annotation

GitHub Actions / vale

[vale] _api-reference/index-apis/resolve.md#L48

[OpenSearch.HeadingCapitalization] 'Example Request' is a heading and should be in sentence case.
Raw output
{"message": "[OpenSearch.HeadingCapitalization] 'Example Request' is a heading and should be in sentence case.", "location": {"path": "_api-reference/index-apis/resolve.md", "range": {"start": {"line": 48, "column": 4}}}, "severity": "ERROR"}
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

The following example lists all indexes that start with the letter `h`, from a remote cluster named `bar`, with all wildcards expanded:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

```
GET /_resolve/index/h*,remoteCluster1:bar*?expand_wildcards=all
```

## Example response

The response lists each index, alias, and data stream matching the expression, as shown in the following example:
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved

```
{
"indices": [
{
"name": "hamlet",
"attributes": [
"open"
]
}
],
"aliases": [
{
"name": "h-alias",
"indices": [
"freeze-index",
"my-index-000001"
]
}
],
"data_streams": [
{
"name": "ham",
"backing_indices": [
".ds-ham-2099.02.06-000001"
],
"timestamp_field": "@timestamp"
}
]
}
```

The response lists each index, alias, and data stream matching the expression.
Naarcha-AWS marked this conversation as resolved.
Show resolved Hide resolved



Loading