From 31651dc6c0eeae33835244f1d0e4dcbb26d87c53 Mon Sep 17 00:00:00 2001 From: James Rodewig Date: Tue, 27 Aug 2019 20:58:11 -0400 Subject: [PATCH] [DOCS] Add delete index alias API docs --- docs/reference/indices.asciidoc | 3 + docs/reference/indices/aliases.asciidoc | 139 ------------------ docs/reference/indices/delete-alias.asciidoc | 49 ++++++ docs/reference/rest-api/common-parms.asciidoc | 5 + 4 files changed, 57 insertions(+), 139 deletions(-) create mode 100644 docs/reference/indices/delete-alias.asciidoc diff --git a/docs/reference/indices.asciidoc b/docs/reference/indices.asciidoc index 6769d786a6917..85bc55c63d915 100644 --- a/docs/reference/indices.asciidoc +++ b/docs/reference/indices.asciidoc @@ -34,6 +34,7 @@ index settings, aliases, mappings, and index templates. [float] [[alias-management]] === Alias management: +* <> * <> * <> @@ -93,6 +94,8 @@ include::indices/get-field-mapping.asciidoc[] include::indices/types-exists.asciidoc[] +include::indices/delete-alias.asciidoc[] + include::indices/alias-exists.asciidoc[] include::indices/aliases.asciidoc[] diff --git a/docs/reference/indices/aliases.asciidoc b/docs/reference/indices/aliases.asciidoc index bc207b9f226b0..2236478978460 100644 --- a/docs/reference/indices/aliases.asciidoc +++ b/docs/reference/indices/aliases.asciidoc @@ -436,142 +436,3 @@ PUT /logs_20162801 } -------------------------------------------------- // CONSOLE - -[float] -[[deleting]] -==== Delete aliases - - -The rest endpoint is: `/{index}/_alias/{name}` - -where - -[horizontal] -`index`:: `* | _all | glob pattern | name1, name2, …` -`name`:: `* | _all | glob pattern | name1, name2, …` - -Alternatively you can use the plural `_aliases`. Example: - -[source,js] --------------------------------------------------- -DELETE /logs_20162801/_alias/current_day --------------------------------------------------- -// CONSOLE -// TEST[continued] - -[float] -[[alias-retrieving]] -==== Retrieving existing aliases - -The get index alias API allows to filter by -alias name and index name. This api redirects to the master and fetches -the requested index aliases, if available. This api only serialises the -found index aliases. - -Possible options: -[horizontal] -`index`:: - The index name to get aliases for. Partial names are - supported via wildcards, also multiple index names can be specified - separated with a comma. Also the alias name for an index can be used. - -`alias`:: - The name of alias to return in the response. Like the index - option, this option supports wildcards and the option the specify - multiple alias names separated by a comma. - -`ignore_unavailable`:: - What to do if an specified index name doesn't - exist. If set to `true` then those indices are ignored. - -The rest endpoint is: `/{index}/_alias/{alias}`. - -[float] -===== Examples: - -All aliases for the index `logs_20162801`: - -[source,js] --------------------------------------------------- -GET /logs_20162801/_alias/* --------------------------------------------------- -// CONSOLE -// TEST[continued] - -Response: - -[source,js] --------------------------------------------------- -{ - "logs_20162801" : { - "aliases" : { - "2016" : { - "filter" : { - "term" : { - "year" : 2016 - } - } - } - } - } -} --------------------------------------------------- -// TESTRESPONSE - -All aliases with the name 2016 in any index: - -[source,js] --------------------------------------------------- -GET /_alias/2016 --------------------------------------------------- -// CONSOLE -// TEST[continued] - -Response: - -[source,js] --------------------------------------------------- -{ - "logs_20162801" : { - "aliases" : { - "2016" : { - "filter" : { - "term" : { - "year" : 2016 - } - } - } - } - } -} --------------------------------------------------- -// TESTRESPONSE - -All aliases that start with 20 in any index: - -[source,js] --------------------------------------------------- -GET /_alias/20* --------------------------------------------------- -// CONSOLE -// TEST[continued] - -Response: - -[source,js] --------------------------------------------------- -{ - "logs_20162801" : { - "aliases" : { - "2016" : { - "filter" : { - "term" : { - "year" : 2016 - } - } - } - } - } -} --------------------------------------------------- -// TESTRESPONSE diff --git a/docs/reference/indices/delete-alias.asciidoc b/docs/reference/indices/delete-alias.asciidoc new file mode 100644 index 0000000000000..e7ef772cbbd64 --- /dev/null +++ b/docs/reference/indices/delete-alias.asciidoc @@ -0,0 +1,49 @@ +[[indices-delete-alias]] +=== Delete index alias API +++++ +Delete index alias +++++ + +Deletes an existing index alias. + +include::alias-exists.asciidoc[tag=index-alias-def] + +[source,js] +---- +DELETE /twitter/_alias/alias1 +---- +// CONSOLE +// TEST[setup:twitter] +// TEST[s/^/PUT twitter\/_alias\/alias1\n/] + +[[delete-alias-api-request]] +==== {api-request-title} + +`DELETE //_alias/` + +`DELETE //_aliases/` + + +[[delete-alias-api-path-params]] +==== {api-path-parms-title} + +``:: +(Required, string) +Comma-separated list or wildcard expression of index names +used to limit the request. ++ +To include all indices in the cluster, +use a value of `_all` or `*`. + +``:: +(Required, string) +include::{docdir}/rest-api/common-parms.asciidoc[tag=index-alias] ++ +To delete all aliases, +use a value of `_all` or `*`. + + +[[delete-alias-api-query-params]] +==== {api-query-parms-title} + +include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms] diff --git a/docs/reference/rest-api/common-parms.asciidoc b/docs/reference/rest-api/common-parms.asciidoc index 82023b70f890a..897d2a4c41f5a 100644 --- a/docs/reference/rest-api/common-parms.asciidoc +++ b/docs/reference/rest-api/common-parms.asciidoc @@ -1,4 +1,9 @@ +tag::index-alias[] +Comma-separated list or wildcard expression of index alias names +used to limit the request. +end::index-alias[] + tag::allow-no-indices[] `allow_no_indices`:: (Optional, boolean) If `true`, the request returns an error if a wildcard