mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 09:28:55 -04:00
* Remove `es-test-dir` book-scoped variable * Remove `plugins-examples-dir` book-scoped variable * Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables - In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed. - In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path - In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem * Replace `es-repo-dir` with `es-ref-dir` * Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
54 lines
1.3 KiB
Text
54 lines
1.3 KiB
Text
[[indices-add-alias]]
|
|
=== Create or update alias API
|
|
++++
|
|
<titleabbrev>Create or update alias</titleabbrev>
|
|
++++
|
|
|
|
Adds a data stream or index to an <<aliases,alias>>.
|
|
|
|
[source,console]
|
|
----
|
|
PUT my-data-stream/_alias/my-alias
|
|
----
|
|
// TEST[setup:my_data_stream]
|
|
// TEST[teardown:data_stream_cleanup]
|
|
|
|
[[add-alias-api-request]]
|
|
==== {api-request-title}
|
|
|
|
`POST <target>/_alias/<alias>`
|
|
|
|
`POST <target>/_aliases/<alias>`
|
|
|
|
`PUT <target>/_alias/<alias>`
|
|
|
|
`PUT <target>/_aliases/<alias>`
|
|
|
|
[[add-alias-api-prereqs]]
|
|
==== {api-prereq-title}
|
|
|
|
* If the {es} {security-features} are enabled, you must have the `manage`
|
|
<<privileges-list-indices,index privilege>> for the alias and its data streams
|
|
or indices.
|
|
|
|
[[add-alias-api-path-params]]
|
|
==== {api-path-parms-title}
|
|
|
|
`<alias>`::
|
|
(Required, string) Alias to update. If the alias doesn't exist, the request
|
|
creates it. Index alias names support <<api-date-math-index-names,date math>>.
|
|
|
|
`<target>`::
|
|
(Required, string) Comma-separated list of data streams or indices to add.
|
|
Supports wildcards (`*`). Wildcard patterns that match both data streams and
|
|
indices return an error.
|
|
|
|
[[add-alias-api-query-params]]
|
|
==== {api-query-parms-title}
|
|
|
|
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
|
|
|
[[add-alias-api-request-body]]
|
|
==== {api-request-body-title}
|
|
|
|
include::aliases.asciidoc[tag=alias-options]
|