elasticsearch/docs/reference/data-streams/promote-data-stream-api.asciidoc
Luke Whiting 37f03dc40d
#111893 Add Warnings For Missing Index Templates (#114589)
* Add data stream template validation

to snapshot restore

* Add data stream template validation

to data stream promotion endpoint

* Add new assertion for response headers

Add a new assertion to synchronously execute a request and check the
response contains a specific warning header

* Test for warning header on snapshot restore

When missing templates

* Test for promotion warnings

* Add documentation for the potential error states

* PR changes

* Spotless reformatting

* Add logic to look in snapshot global metadata

This checks if the snapshot contains a matching template for the DS

* Comment on test cleanup to explain it was copied

* Removed cluster service field
2024-10-15 15:00:53 +01:00

47 lines
1.6 KiB
Text

[role="xpack"]
[[promote-data-stream-api]]
=== Promote data stream API
++++
<titleabbrev>Promote data stream</titleabbrev>
++++
The purpose of the promote <<data-streams,data stream>> API is to turn
a data stream that is replicated by CCR into a regular
data stream.
Via CCR Auto Following, a data stream from a remote cluster
can be replicated to the local cluster. These data streams
can't be rolled over in the local cluster. Only if the upstream
data stream rolls over then these replicated data streams roll
over as well. In the event that the remote cluster is no longer
available, the data stream in the local cluster can be promoted
to a regular data stream, which allows these data streams to
be rolled over in the local cluster.
NOTE: When promoting a data stream, ensure the local cluster has a data stream enabled index template that matches the data stream.
If this is missing, the data stream will not be able to roll over until a matching index template is created.
This will affect the lifecycle management of the data stream and interfere with the data stream size and retention.
[source,console]
----
POST /_data_stream/_promote/my-data-stream
----
// TEST[catch:missing]
[[promote-data-stream-api-request]]
==== {api-request-title}
`POST /_data_stream/_promote/<data-stream>`
[[promote-data-stream-api-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have the `manage_follow_index`
<<privileges-list-cluster,cluster privilege>> to use this API.
[[promote-data-stream-api-path-params]]
==== {api-path-parms-title}
`<data-stream>`::
(Required, string)
The name of the data stream to promote.