elasticsearch/docs/reference/indices/add-alias.asciidoc
debadair 777598d602
[DOCS] Remove redirect pages (#88738)
* [DOCS] Remove manual redirects

* [DOCS] Removed refs to modules-discovery-hosts-providers

* [DOCS] Fixed broken internal refs

* Fixing bad cross links in ES book, and adding redirects.asciidoc[] back into docs/reference/index.asciidoc.

* Update docs/reference/search/point-in-time-api.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update docs/reference/setup/restart-cluster.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update docs/reference/sql/endpoints/translate.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update docs/reference/snapshot-restore/restore-snapshot.asciidoc

Co-authored-by: James Rodewig <james.rodewig@elastic.co>

* Update repository-azure.asciidoc

* Update node-tool.asciidoc

* Update repository-azure.asciidoc

---------

Co-authored-by: amyjtechwriter <61687663+amyjtechwriter@users.noreply.github.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Co-authored-by: Amy Jonsson <amy.jonsson@elastic.co>
Co-authored-by: James Rodewig <james.rodewig@elastic.co>
2023-05-24 12:32:46 +01:00

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-repo-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
[[add-alias-api-request-body]]
==== {api-request-body-title}
include::aliases.asciidoc[tag=alias-options]