[DOCS] Add data streams to API conventions (#58695) (#58785)

Updates the existing API conventions docs to make them aware of data
streams.

Co-authored-by: debadair <debadair@elastic.co>
This commit is contained in:
James Rodewig 2020-06-30 17:33:35 -04:00 committed by GitHub
parent 046d9eeb41
commit 3aa08fbcde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 29 additions and 21 deletions

View File

@ -13,14 +13,21 @@ API, unless otherwise specified.
* <<url-access-control>> * <<url-access-control>>
[[multi-index]] [[multi-index]]
=== Multiple indices === Multi-target syntax
Most APIs that refer to an `index` parameter support execution across multiple indices, Most APIs that accept a `<data-stream>`, `<index>`, or `<target>` request path
using simple `test1,test2,test3` notation (or `_all` for all indices). It also parameter also support _multi-target syntax_.
supports wildcards, for example: `test*` or `*test` or `te*t` or `*test*`, and the
ability to "exclude" (`-`), for example: `test*,-test3`.
All multi index APIs support the following url query string parameters: In multi-target syntax, you can use a comma-separated list to execute a request across multiple resources, such as
data streams, indices, or index aliases: `test1,test2,test3`. You can also use
https://en.wikipedia.org/wiki/Glob_(programming)[glob-like] wildcard (`*`)
expressions to target any
resources that match the pattern: `test*` or `*test` or `te*t` or `*test*.
You can exclude targets using the `-` character: `test*,-test3`.
Multi-target APIs that can target indices support the following query
string parameters:
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable] include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-ignore-unavailable]
@ -30,12 +37,14 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
The defaults settings for the above parameters depend on the API being used. The defaults settings for the above parameters depend on the API being used.
Some multi index APIs also support the following url query string parameter: Some multi-target APIs that can target indices also support the following query
string parameter:
include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=ignore_throttled] include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=ignore_throttled]
NOTE: Single index APIs such as the <<docs>> and the NOTE: Single index APIs, such as the <<docs>> and
<<indices-aliases,single-index `alias` APIs>> do not support multiple indices. <<indices-aliases,single-index `alias` APIs>>, do not support multi-target
syntax.
[[date-math-index-names]] [[date-math-index-names]]
=== Date math support in index names === Date math support in index names
@ -660,15 +669,14 @@ string parameter.
=== URL-based access control === URL-based access control
Many users use a proxy with URL-based access control to secure access to Many users use a proxy with URL-based access control to secure access to
Elasticsearch indices. For <<search-multi-search,multi-search>>, {es} data streams and indices. For <<search-multi-search,multi-search>>,
<<docs-multi-get,multi-get>>, and <<docs-bulk,bulk>> requests, the user has <<docs-multi-get,multi-get>>, and <<docs-bulk,bulk>> requests, the user has
the choice of specifying an index in the URL and on each individual request the choice of specifying a data stream or index in the URL and on each individual request
within the request body. This can make URL-based access control challenging. within the request body. This can make URL-based access control challenging.
To prevent the user from overriding the index which has been specified in the To prevent the user from overriding the data stream or index specified in the
URL, add this setting to the `elasticsearch.yml` file: URL, set `rest.action.multi.allow_explicit_index` to `false` in `elasticsearch.yml`.
rest.action.multi.allow_explicit_index: false
The default value is `true`, but when set to `false`, Elasticsearch will This causes {es} to
reject requests that have an explicit index specified in the request body. reject requests that explicitly specfiy a data stream or index in the request body.

View File

@ -1,7 +1,7 @@
[[search]] [[search]]
== Search APIs == Search APIs
Most search APIs are <<search-multi-index,multi-index>>, with the Most search APIs support <<search-multi-index,multi-target syntax>>, with the
exception of the <<search-explain>> endpoints. exception of the <<search-explain>> endpoints.
[float] [float]

View File

@ -33,7 +33,7 @@ By default, all indices in the snapshot are restored, and the cluster state is
*not* restored. It's possible to select indices that should be restored as well *not* restored. It's possible to select indices that should be restored as well
as to allow the global cluster state from being restored by using `indices` and as to allow the global cluster state from being restored by using `indices` and
`include_global_state` options in the restore request body. The list of indices `include_global_state` options in the restore request body. The list of indices
supports <<multi-index,multi index syntax>>. The `rename_pattern` supports <<multi-index,multi-target syntax>>. The `rename_pattern`
and `rename_replacement` options can be also used to rename indices on restore and `rename_replacement` options can be also used to rename indices on restore
using regular expression that supports referencing the original text as using regular expression that supports referencing the original text as
explained explained

View File

@ -52,7 +52,7 @@ PUT /_snapshot/my_backup/snapshot_2?wait_for_completion=true
// TEST[skip:cannot complete subsequent snapshot] // TEST[skip:cannot complete subsequent snapshot]
The list of indices that should be included into the snapshot can be specified using the `indices` parameter that The list of indices that should be included into the snapshot can be specified using the `indices` parameter that
supports <<multi-index,multi index syntax>>, although the options which control the behavior of multi index syntax supports <<multi-index,multi-target syntax>>, although the options which control the behavior of multi index syntax
must be supplied in the body of the request, rather than as request parameters. The snapshot request also supports the must be supplied in the body of the request, rather than as request parameters. The snapshot request also supports the
`ignore_unavailable` option. Setting it to `true` will cause indices that do not exist to be ignored during snapshot `ignore_unavailable` option. Setting it to `true` will cause indices that do not exist to be ignored during snapshot
creation. By default, when `ignore_unavailable` option is not set and an index is missing the snapshot request will fail. creation. By default, when `ignore_unavailable` option is not set and an index is missing the snapshot request will fail.

View File

@ -9,7 +9,7 @@
[float] [float]
==== {es} multi-index ==== {es} multi-index
The {es} notation for enumerating, including or excluding <<multi-index,multi index syntax>> The {es} notation for enumerating, including or excluding <<multi-index,multi-target syntax>>
is supported _as long_ as it is quoted or escaped as a table identifier. is supported _as long_ as it is quoted or escaped as a table identifier.
For example: For example:

View File

@ -27,7 +27,7 @@ patterns.
include-tagged::{sql-specs}/docs/docs.csv-spec[showTables] include-tagged::{sql-specs}/docs/docs.csv-spec[showTables]
---- ----
Match multiple indices by using {es} <<multi-index,multi index syntax>> Match multiple indices by using {es} <<multi-index,multi-target syntax>>
notation: notation:
[source, sql] [source, sql]