Modify data streams API

Modify data streams API

New API reference

For the most up-to-date API details, refer to Data stream APIs.

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

  1. resp = client.indices.modify_data_stream(
  2. actions=[
  3. {
  4. "remove_backing_index": {
  5. "data_stream": "my-logs",
  6. "index": ".ds-my-logs-2099.01.01-000001"
  7. }
  8. },
  9. {
  10. "add_backing_index": {
  11. "data_stream": "my-logs",
  12. "index": "index-to-add"
  13. }
  14. }
  15. ],
  16. )
  17. print(resp)
  1. const response = await client.indices.modifyDataStream({
  2. actions: [
  3. {
  4. remove_backing_index: {
  5. data_stream: "my-logs",
  6. index: ".ds-my-logs-2099.01.01-000001",
  7. },
  8. },
  9. {
  10. add_backing_index: {
  11. data_stream: "my-logs",
  12. index: "index-to-add",
  13. },
  14. },
  15. ],
  16. });
  17. console.log(response);
  1. POST _data_stream/_modify
  2. {
  3. "actions": [
  4. {
  5. "remove_backing_index": {
  6. "data_stream": "my-logs",
  7. "index": ".ds-my-logs-2099.01.01-000001"
  8. }
  9. },
  10. {
  11. "add_backing_index": {
  12. "data_stream": "my-logs",
  13. "index": "index-to-add"
  14. }
  15. }
  16. ]
  17. }

Request

POST /_data_stream/_modify

Request body

actions

(Required, array of objects) Actions to perform.

Properties of actions objects

  • <action>

    (Required, object) The key is the action type. At least one action is required.

    Valid <action> keys

    • add_backing_index

      Adds an existing index as a backing index for a data stream. The index is hidden as part of this operation.

    Adding indices with the add_backing_index action can potentially result in improper data stream behavior. This should be considered an expert level API.

    • remove_backing_index

      Removes a backing index from a data stream. The index is unhidden as part of this operation. A data stream’s write index cannot be removed.

    The object body contains options for the action.

    Properties of <action>

    • data_stream

      (Required*, string) Data stream targeted by the action.

      index

      (Required*, string) Index for the action.