Create or update an alias
- POST /_aliases
Adds a data stream or index to an alias.
Query Parameters
-
master_timeoutstring Duration · default: 30s Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
-
timeoutstring Duration · default: 30s Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
Request
-
actionsAction -
Actions to perform.
-
addAddAction -
Adds a data stream or index to an alias. If the alias doesn’t exist, the
addaction creates it. -
aliasstring -
Alias for the action. Index alias names support date math.
-
aliasesIndexAlias | IndexAlias -
Aliases for the action. Index alias names support date math.
-
filterQueryContainer -
Query used to limit documents the alias can access.
-
indexstring IndexName -
Data stream or index for the action. Supports wildcards (
*). -
indicesstring Indices -
Data streams or indices for the action. Supports wildcards (
*). -
index_routingstring -
Value used to route indexing operations to a specific shard. If specified, this overwrites the
routingvalue for indexing operations. Data stream aliases don’t support this parameter. -
If
true, the alias is hidden. -
is_write_indexboolean -
If
true, sets the write index or data stream for the alias. -
routingstring -
Value used to route indexing and search operations to a specific shard. Data stream aliases don’t support this parameter.
-
search_routingstring -
Value used to route search operations to a specific shard. If specified, this overwrites the
routingvalue for search operations. Data stream aliases don’t support this parameter. -
must_existboolean · default: false -
If
true, the alias must exist to perform the action. -
removeRemoveAction -
Removes a data stream or index from an alias.
-
aliasstring -
Alias for the action. Index alias names support date math.
-
aliasesIndexAlias | IndexAlias -
Aliases for the action. Index alias names support date math.
-
indexstring IndexName -
Data stream or index for the action. Supports wildcards (
*). -
indicesstring Indices -
Data streams or indices for the action. Supports wildcards (
*). -
must_existboolean · default: false -
If
true, the alias must exist to perform the action. -
remove_indexRemoveIndexAction -
Deletes an index. You cannot use this action on aliases or data streams.
-
indexstring IndexName -
Data stream or index for the action. Supports wildcards (
*). -
indicesstring Indices -
Data streams or indices for the action. Supports wildcards (
*). -
must_existboolean · default: false -
If
true, the alias must exist to perform the action.
Response
-
acknowledgedbooleanrequired -
For a successful response, this value is always true. On failure, an exception is returned instead.