modify-data-streams-api.asciidoc 1.9 KB

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