get-data-stream.asciidoc 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. [[indices-get-data-stream]]
  2. === Get data stream API
  3. ++++
  4. <titleabbrev>Get data stream</titleabbrev>
  5. ++++
  6. Retrieves information about one or more <<data-streams,data streams>>.
  7. See <<get-info-about-a-data-stream>>.
  8. ////
  9. [source,console]
  10. ----
  11. PUT _index_template/template
  12. {
  13. "index_patterns": ["my-data-stream*"],
  14. "template": {
  15. "mappings": {
  16. "properties": {
  17. "@timestamp": {
  18. "type": "date"
  19. }
  20. }
  21. }
  22. },
  23. "data_stream": {
  24. "timestamp_field": "@timestamp"
  25. }
  26. }
  27. PUT /_data_stream/my-data-stream
  28. ----
  29. // TESTSETUP
  30. ////
  31. ////
  32. [source,console]
  33. ----
  34. DELETE /_data_stream/my-data-stream
  35. DELETE /_index_template/template
  36. ----
  37. // TEARDOWN
  38. ////
  39. [source,console]
  40. ----
  41. GET /_data_stream/my-data-stream
  42. ----
  43. // TEST[skip_shard_failures]
  44. [[get-data-stream-api-request]]
  45. ==== {api-request-title}
  46. `GET /_data_stream/<data-stream>`
  47. [[get-data-stream-api-path-params]]
  48. ==== {api-path-parms-title}
  49. `<data-stream>`::
  50. (Required, string)
  51. Name of the data stream to retrieve.
  52. Wildcard (`*`) expressions are supported.
  53. [[get-data-stream-api-example]]
  54. ==== {api-examples-title}
  55. [source,console]
  56. ----
  57. GET _data_stream/my-data-stream*
  58. ----
  59. // TEST[continued]
  60. // TEST[skip_shard_failures]
  61. The API returns the following response:
  62. [source,console-result]
  63. ----
  64. [
  65. {
  66. "name" : "my-data-stream", <1>
  67. "timestamp_field" : "@timestamp", <2>
  68. "indices" : [ <3>
  69. {
  70. "index_name" : ".ds-my-data-stream-000001",
  71. "index_uuid" : "DXAE-xcCQTKF93bMm9iawA"
  72. },
  73. {
  74. "index_name" : ".ds-my-data-stream-000002",
  75. "index_uuid" : "Wzxq0VhsQKyPxHhaK3WYAg"
  76. }
  77. ],
  78. "generation" : 2 <4>
  79. }
  80. ]
  81. ----
  82. // TESTRESPONSE[skip:unable to assert responses with top level array]
  83. <1> Name of the data stream
  84. <2> The name of the timestamp field for the data stream
  85. <3> List of backing indices
  86. <4> Current generation for the data stream