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] Separate and reformat close index API docs #45922

Merged
merged 3 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions docs/reference/indices.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ index settings, aliases, mappings, and index templates.
* <<indices-delete-index>>
* <<indices-get-index>>
* <<indices-exists>>
* <<indices-close>>
* <<indices-open-close>>
* <<indices-shrink-index>>
* <<indices-split-index>>
Expand Down Expand Up @@ -67,6 +68,8 @@ include::indices/get-index.asciidoc[]

include::indices/indices-exists.asciidoc[]

include::indices/close.asciidoc[]

include::indices/open-close.asciidoc[]

include::indices/shrink-index.asciidoc[]
Expand Down
85 changes: 85 additions & 0 deletions docs/reference/indices/close.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
[[indices-close]]
=== Close index API
++++
<titleabbrev>Close index</titleabbrev>
++++

Closes an index.

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


[[close-index-api-request]]
==== {api-request-title}

`POST /<index>/_close`


[[close-index-api-desc]]
==== {api-description-title}

You use the close index API to close open indices.

include::{docdir}/indices/open-close.asciidoc[tag=closed-index]


[[close-index-api-path-params]]
==== {api-path-parms-title}

include::{docdir}/rest-api/common-parms.asciidoc[tag=index]
+
To close all indices, use `_all` or `*`.
To disallow the closing of indices with `_all` or wildcard expressions,
change the `action.destructive_requires_name` cluster setting to `true`.
You can update this setting in the `elasticsearch.yml` file
or using the <<cluster-update-settings,cluster update settings>> API.


[[close-index-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=index-ignore-unavailable]

include::{docdir}/rest-api/common-parms.asciidoc[tag=doc-wait-for-active-shards]

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


[[close-index-api-example]]
==== {api-examples-title}

The following example shows how to close an index:

[source,js]
--------------------------------------------------
POST /my_index/_close
--------------------------------------------------
// CONSOLE
// TEST[s/^/PUT my_index\n/]

The API returns following response:

[source,js]
--------------------------------------------------
{
"acknowledged" : true,
"shards_acknowledged" : true,
"indices" : {
"my_index" : {
"closed" : true
}
}
}
--------------------------------------------------
// TESTRESPONSE
4 changes: 2 additions & 2 deletions docs/reference/indices/open-close.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ POST /twitter/_open

You use the open index API to re-open closed indices.

// tag:closed-index
// tag::closed-index[]

A closed index is blocked for read/write operations and does not allow
all operations that opened indices allow. It is not possible to index
Expand Down Expand Up @@ -62,7 +62,7 @@ Because opening or closing an index allocates its shards, the
<<create-index-wait-for-active-shards,`wait_for_active_shards`>> setting on
index creation applies to the `_open` and `_close` index actions as well.

// end:closed-index
// end::closed-index[]


[[open-index-api-path-params]]
Expand Down