modify-data-streams-api.asciidoc 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. [[modify-data-streams-api]]
  2. === Modify data streams API
  3. ++++
  4. <titleabbrev>Modify data streams</titleabbrev>
  5. ++++
  6. Performs one or more data stream modification actions in a single atomic
  7. operation.
  8. [source,console]
  9. ----
  10. POST _data_stream/_modify
  11. {
  12. "actions": [
  13. {
  14. "remove_backing_index": {
  15. "data_stream": "my-logs",
  16. "index": ".ds-my-logs-2099.01.01-000001"
  17. }
  18. },
  19. {
  20. "add_backing_index": {
  21. "data_stream": "my-logs",
  22. "index": "index-to-add"
  23. }
  24. }
  25. ]
  26. }
  27. ----
  28. // TEST[skip:cannot determine backing index name]
  29. [[modify-data-streams-api-request]]
  30. ==== {api-request-title}
  31. `POST /_data_stream/_modify`
  32. [role="child_attributes"]
  33. [[modify-data-streams-api-request-body]]
  34. ==== {api-request-body-title}
  35. `actions`::
  36. (Required, array of objects) Actions to perform.
  37. +
  38. .Properties of `actions` objects
  39. [%collapsible%open]
  40. ====
  41. `<action>`::
  42. (Required, object) The key is the action type. At least one action is required.
  43. +
  44. .Valid `<action>` keys
  45. [%collapsible%open]
  46. =====
  47. `add_backing_index`::
  48. Adds an existing index as a backing index for a data stream. The index is
  49. hidden as part of this operation.
  50. WARNING: Adding indices with the `add_backing_index` action
  51. can potentially result in improper data stream behavior.
  52. This should be considered an expert level API.
  53. `remove_backing_index`::
  54. Removes a backing index from a data stream. The index is unhidden
  55. as part of this operation. A data stream's write index cannot be removed.
  56. =====
  57. +
  58. The object body contains options for the action.
  59. +
  60. .Properties of `<action>`
  61. [%collapsible%open]
  62. =====
  63. `data_stream`::
  64. (Required*, string) Data stream targeted by the action.
  65. `index`::
  66. (Required*, string) Index for the action.
  67. =====
  68. ====