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

[DOCS] Reformat indices exists API docs #45918

Merged
merged 1 commit into from
Aug 26, 2019
Merged
Changes from all commits
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
54 changes: 48 additions & 6 deletions docs/reference/indices/indices-exists.asciidoc
Original file line number Diff line number Diff line change
@@ -1,17 +1,59 @@
[[indices-exists]]
=== Indices Exists
=== Indices exists API
++++
<titleabbrev>Indices exists</titleabbrev>
++++

Used to check if the index (indices) exists or not. For example:
Checks if an index exists.
The returned HTTP status code indicates if the index exists or not.
A `404` means it does not exist, and `200` means it does.

[source,js]
--------------------------------------------------
HEAD twitter
HEAD /twitter
--------------------------------------------------
// CONSOLE
// TEST[setup:twitter]

The HTTP status code indicates if the index exists or not. A `404` means
it does not exist, and `200` means it does.

IMPORTANT: This request does not distinguish between an index and an alias,
[[indices-exists-api-request]]
==== {api-request-title}

`HEAD /<index>`


[[indices-exists-api-path-params]]
==== {api-path-parms-title}

include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
+
IMPORTANT: This parameter does not distinguish between an index name and <<indices-aliases,alias>>,
i.e. status code `200` is also returned if an alias exists with that name.


[[indices-exists-api-query-params]]
==== {api-query-parms-title}

include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-indices]

include::{docdir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
+
Defaults to `open`.

include::{docdir}/rest-api/common-parms.asciidoc[tag=flat-settings]

include::{docdir}/rest-api/common-parms.asciidoc[tag=include-defaults]

include::{docdir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]

include::{docdir}/rest-api/common-parms.asciidoc[tag=local]


[[indices-exists-api-response-codes]]
==== {api-response-codes-title}

`200`::
Indicates all specified indices or index aliases exist.

`404`::
Indicates one or more specified indices or index aliases **do not** exist.