Revert "[DOCS] Update get data stream API response (#59197)" (#59227)

This reverts commit db3852898f.
This commit is contained in:
James Rodewig 2020-07-08 09:39:16 -04:00 committed by GitHub
parent 3d40b35b97
commit 678f9e3413
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 120 additions and 237 deletions

View file

@ -84,8 +84,6 @@ PUT /_index_template/new_logs_data_stream
PUT /_data_stream/logs
POST /logs/_rollover/
PUT /_data_stream/new_logs
----
// TESTSETUP
@ -567,46 +565,33 @@ data stream, including a list of its backing indices.
----
GET /_data_stream/logs
----
// TEST[skip: shard failures]
The API returns the following response. Note the `indices` property contains an
array of the stream's current backing indices. The first item in the array
contains information about the stream's oldest backing index, `.ds-logs-000001`.
array of the stream's current backing indices. The oldest backing index,
`.ds-logs-000001`, is the first item in the array.
[source,console-result]
----
{
"data_streams": [
{
"name": "logs",
"timestamp_field": {
"name": "@timestamp",
"mapping": {
"type": "date"
}
[
{
"name": "logs",
"timestamp_field": "@timestamp",
"indices": [
{
"index_name": ".ds-logs-000001",
"index_uuid": "DXAE-xcCQTKF93bMm9iawA"
},
"indices": [
{
"index_name": ".ds-logs-000001", <1>
"index_uuid": "Gpdiyq8sRuK9WuthvAdFbw"
},
{
"index_name": ".ds-logs-000002",
"index_uuid": "_eEfRrFHS9OyhqWntkgHAQ"
}
],
"generation": 2,
"status": "GREEN",
"template": "logs_data_stream"
}
]
}
{
"index_name": ".ds-logs-000002",
"index_uuid": "Wzxq0VhsQKyPxHhaK3WYAg"
}
],
"generation": 2
}
]
----
// TESTRESPONSE[s/"index_uuid": "Gpdiyq8sRuK9WuthvAdFbw"/"index_uuid": $body.data_streams.0.indices.0.index_uuid/]
// TESTRESPONSE[s/"index_uuid": "_eEfRrFHS9OyhqWntkgHAQ"/"index_uuid": $body.data_streams.0.indices.1.index_uuid/]
// TESTRESPONSE[s/"status": "GREEN"/"status": "YELLOW"/]
<1> First item in the `indices` array for the `logs` data stream. This item
contains information about the stream's oldest backing index, `.ds-logs-000001`.
// TESTRESPONSE[skip:unable to assert responses with top level array]
The following <<docs-reindex,reindex API>> request copies documents from
`.ds-logs-000001` to the `new_logs` data stream. Note the request's `op_type` is

View file

@ -276,6 +276,20 @@ PUT /_data_stream/logs_alt
====
--
////
[source,console]
----
DELETE /_data_stream/logs
DELETE /_data_stream/logs_alt
DELETE /_index_template/logs_data_stream
DELETE /_ilm/policy/logs_policy
----
// TEST[continued]
////
[discrete]
[[get-info-about-a-data-stream]]
=== Get information about a data stream
@ -283,77 +297,51 @@ PUT /_data_stream/logs_alt
You can use the <<indices-get-data-stream,get data stream API>> to get
information about one or more data streams, including:
* The timestamp field and its mapping
* The timestamp field
* The current backing indices, which is returned as an array. The last item in
the array contains information about the stream's current write index.
* The current generation
* The data stream's health status
* The index template used to create the stream's backing indices
* The current {ilm-init} lifecycle policy in the stream's matching index
template
This is also handy way to verify that a recently created data stream exists.
.*Example*
[%collapsible]
====
The following get data stream API request retrieves information about the
`logs` data stream.
////
[source,console]
----
POST /logs/_rollover/
----
// TEST[continued]
////
The following get data stream API request retrieves information about any data
streams starting with `logs`.
[source,console]
----
GET /_data_stream/logs
GET /_data_stream/logs*
----
// TEST[continued]
// TEST[skip: shard failures]
The API returns the following response. Note the `indices` property contains an
array of the stream's current backing indices. The last item in this array
contains information about the stream's write index, `.ds-logs-000002`.
The API returns the following response, which includes information about the
`logs` data stream. Note the `indices` property contains an array of the
stream's current backing indices. The last item in this array contains
information for the `logs` stream's write index, `.ds-logs-000002`.
[source,console-result]
----
{
"data_streams": [
{
"name": "logs",
"timestamp_field": {
"name": "@timestamp",
"mapping": {
"type": "date"
}
[
{
"name": "logs",
"timestamp_field": "@timestamp",
"indices": [
{
"index_name": ".ds-logs-000001",
"index_uuid": "DXAE-xcCQTKF93bMm9iawA"
},
"indices": [
{
"index_name": ".ds-logs-000001",
"index_uuid": "krR78LfvTOe6gr5dj2_1xQ"
},
{
"index_name": ".ds-logs-000002", <1>
"index_uuid": "C6LWyNJHQWmA08aQGvqRkA"
}
],
"generation": 2,
"status": "GREEN",
"template": "logs_data_stream",
"ilm_policy": "logs_policy"
}
]
}
{
"index_name": ".ds-logs-000002",
"index_uuid": "Wzxq0VhsQKyPxHhaK3WYAg"
}
],
"generation": 2
}
]
----
// TESTRESPONSE[s/"index_uuid": "krR78LfvTOe6gr5dj2_1xQ"/"index_uuid": $body.data_streams.0.indices.0.index_uuid/]
// TESTRESPONSE[s/"index_uuid": "C6LWyNJHQWmA08aQGvqRkA"/"index_uuid": $body.data_streams.0.indices.1.index_uuid/]
// TESTRESPONSE[s/"status": "GREEN"/"status": "YELLOW"/]
<1> Last item in the `indices` array for the `logs` data stream. This item
contains information about the stream's current write index, `.ds-logs-000002`.
// TESTRESPONSE[skip:unable to assert responses with top level array]
====
[discrete]
@ -369,6 +357,30 @@ a data stream and its backing indices.
The following delete data stream API request deletes the `logs` data stream. This
request also deletes the stream's backing indices and any data they contain.
////
[source,console]
----
PUT /_index_template/logs_data_stream
{
"index_patterns": [ "logs*" ],
"data_stream": {
"timestamp_field": "@timestamp"
},
"template": {
"mappings": {
"properties": {
"@timestamp": {
"type": "date"
}
}
}
}
}
PUT /_data_stream/logs
----
////
[source,console]
----
DELETE /_data_stream/logs
@ -379,9 +391,7 @@ DELETE /_data_stream/logs
////
[source,console]
----
DELETE /_data_stream/*
DELETE /_index_template/*
DELETE /_ilm/policy/logs_policy
DELETE /_index_template/logs_data_stream
----
// TEST[continued]
////