OpenSearch/docs/reference/indices/get-data-stream.asciidoc

98 lines
2.1 KiB
Plaintext
Raw Normal View History

2020-05-15 10:37:45 -04:00
[[indices-get-data-stream]]
=== Get data stream API
++++
<titleabbrev>Get data stream</titleabbrev>
++++
Returns information about one or more data streams.
////
[source,console]
-----------------------------------
PUT _index_template/template
2020-05-15 10:37:45 -04:00
{
"index_patterns": ["my-data-stream*"],
"data_stream": {
"timestamp_field": "@timestamp"
}
2020-05-15 10:37:45 -04:00
}
PUT /_data_stream/my-data-stream
2020-05-15 10:37:45 -04:00
-----------------------------------
// TESTSETUP
////
////
[source,console]
-----------------------------------
DELETE /_data_stream/my-data-stream
DELETE /_index_template/template
2020-05-15 10:37:45 -04:00
-----------------------------------
// TEARDOWN
////
[source,console]
--------------------------------------------------
GET _data_stream/my-data-stream
2020-05-15 10:37:45 -04:00
--------------------------------------------------
// TEST[skip_shard_failures]
[[get-data-stream-api-request]]
==== {api-request-title}
`GET _data_stream/<data-stream>`
2020-05-15 10:37:45 -04:00
[[get-data-stream-api-path-params]]
==== {api-path-parms-title}
`<data-stream>`::
+
--
(Required, string) Name or wildcard expression of the data stream(s) to
retrieve.
--
[[get-data-stream-api-example]]
==== {api-examples-title}
[[get-data-stream-basic-example]]
===== Basic example
[source,console]
--------------------------------------------------
GET _data_stream/my-data-stream*
2020-05-15 10:37:45 -04:00
--------------------------------------------------
// TEST[continued]
// TEST[skip_shard_failures]
The API returns the following response:
[source,console-result]
--------------------------------------------------
[
{
"name" : "my-data-stream", <1>
"timestamp_field" : "@timestamp", <2>
"indices" : [ <3>
{
"index_name" : ".ds-my-data-stream-000001",
2020-05-15 10:37:45 -04:00
"index_uuid" : "DXAE-xcCQTKF93bMm9iawA"
},
{
"index_name" : ".ds-my-data-stream-000002",
2020-05-15 10:37:45 -04:00
"index_uuid" : "Wzxq0VhsQKyPxHhaK3WYAg"
}
],
"generation" : 2 <4>
}
]
--------------------------------------------------
// TESTRESPONSE[skip:unable to assert responses with top level array]
<1> Name of the data stream
<2> The name of the timestamp field for the data stream
<3> List of backing indices
<4> Current generation for the data stream