Update data streams Generally available

POST /_data_stream/_modify

Performs one or more data stream modification actions in a single atomic operation.

application/json

Body Required

  • actions array[object] Required

    Actions to perform.

    Hide actions attributes Show actions attributes object
    • add_backing_index object
      Hide add_backing_index attributes Show add_backing_index attributes object
      • data_stream string Required
      • index string Required
    • remove_backing_index object
      Hide remove_backing_index attributes Show remove_backing_index attributes object
      • data_stream string Required
      • index string Required

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • acknowledged boolean Required

      For a successful response, this value is always true. On failure, an exception is returned instead.

POST _data_stream/_modify { "actions": [ { "remove_backing_index": { "data_stream": "my-data-stream", "index": ".ds-my-data-stream-2023.07.26-000001" } }, { "add_backing_index": { "data_stream": "my-data-stream", "index": ".ds-my-data-stream-2023.07.26-000001-downsample" } } ] }
resp = client.indices.modify_data_stream( actions=[ { "remove_backing_index": { "data_stream": "my-data-stream", "index": ".ds-my-data-stream-2023.07.26-000001" } }, { "add_backing_index": { "data_stream": "my-data-stream", "index": ".ds-my-data-stream-2023.07.26-000001-downsample" } } ], )
const response = await client.indices.modifyDataStream({ actions: [ { remove_backing_index: { data_stream: "my-data-stream", index: ".ds-my-data-stream-2023.07.26-000001", }, }, { add_backing_index: { data_stream: "my-data-stream", index: ".ds-my-data-stream-2023.07.26-000001-downsample", }, }, ], });
response = client.indices.modify_data_stream( body: { "actions": [ { "remove_backing_index": { "data_stream": "my-data-stream", "index": ".ds-my-data-stream-2023.07.26-000001" } }, { "add_backing_index": { "data_stream": "my-data-stream", "index": ".ds-my-data-stream-2023.07.26-000001-downsample" } } ] } )
$resp = $client->indices()->modifyDataStream([ "body" => [ "actions" => array( [ "remove_backing_index" => [ "data_stream" => "my-data-stream", "index" => ".ds-my-data-stream-2023.07.26-000001", ], ], [ "add_backing_index" => [ "data_stream" => "my-data-stream", "index" => ".ds-my-data-stream-2023.07.26-000001-downsample", ], ], ), ], ]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"actions":[{"remove_backing_index":{"data_stream":"my-data-stream","index":".ds-my-data-stream-2023.07.26-000001"}},{"add_backing_index":{"data_stream":"my-data-stream","index":".ds-my-data-stream-2023.07.26-000001-downsample"}}]}' "$ELASTICSEARCH_URL/_data_stream/_modify"
Request example
An example body for a `POST _data_stream/_modify` request.
{ "actions": [ { "remove_backing_index": { "data_stream": "my-data-stream", "index": ".ds-my-data-stream-2023.07.26-000001" } }, { "add_backing_index": { "data_stream": "my-data-stream", "index": ".ds-my-data-stream-2023.07.26-000001-downsample" } } ] }