resolve.asciidoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. [[indices-resolve-index-api]]
  2. === Resolve index API
  3. ++++
  4. <titleabbrev>Resolve index</titleabbrev>
  5. ++++
  6. Resolves the specified name(s) and/or index patterns for indices, index
  7. aliases, and data streams. Multiple patterns and remote clusters are
  8. supported.
  9. ////
  10. [source,console]
  11. ----
  12. PUT /foo_closed
  13. POST /foo_closed/_close
  14. PUT /remotecluster-bar-01
  15. PUT /freeze-index
  16. POST /freeze-index/_freeze
  17. PUT /my-index-000001
  18. PUT /freeze-index/_alias/f-alias
  19. PUT /my-index-000001/_alias/f-alias
  20. PUT /_index_template/foo_data_stream
  21. {
  22. "index_patterns": [ "foo" ],
  23. "data_stream": { }
  24. }
  25. PUT /_data_stream/foo
  26. ----
  27. // TESTSETUP
  28. [source,console]
  29. ----
  30. DELETE /_data_stream/*
  31. DELETE /_index_template/foo_data_stream
  32. ----
  33. // TEARDOWN
  34. ////
  35. [source,console]
  36. ----
  37. GET /_resolve/index/my-index-*
  38. ----
  39. [[resolve-index-api-request]]
  40. ==== {api-request-title}
  41. `GET /_resolve/index/<name>`
  42. [[resolve-index-api-path-params]]
  43. ==== {api-path-parms-title}
  44. `<name>`::
  45. +
  46. --
  47. (Required, string) Comma-separated name(s) or index pattern(s) of the
  48. indices, index aliases, and data streams to resolve. Resources on
  49. <<modules-remote-clusters,remote clusters>> can be specified using the
  50. `<cluster>:<name>` syntax.
  51. --
  52. [[resolve-index-api-query-params]]
  53. ==== {api-query-parms-title}
  54. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=expand-wildcards]
  55. +
  56. Defaults to `open`.
  57. [[resolve-index-api-example]]
  58. ==== {api-examples-title}
  59. [source,console]
  60. ----
  61. GET /_resolve/index/f*,remoteCluster1:bar*?expand_wildcards=all
  62. ----
  63. // TEST[continued]
  64. // TEST[s/remoteCluster1:/remotecluster-/]
  65. The API returns the following response:
  66. [source,console-result]
  67. ----
  68. {
  69. "indices": [ <1>
  70. {
  71. "name": "foo_closed",
  72. "attributes": [
  73. "closed"
  74. ]
  75. },
  76. {
  77. "name": "freeze-index",
  78. "aliases": [
  79. "f-alias"
  80. ],
  81. "attributes": [
  82. "frozen",
  83. "open"
  84. ]
  85. },
  86. {
  87. "name": "remoteCluster1:bar-01",
  88. "attributes": [
  89. "open"
  90. ]
  91. }
  92. ],
  93. "aliases": [ <2>
  94. {
  95. "name": "f-alias",
  96. "indices": [
  97. "freeze-index",
  98. "my-index-000001"
  99. ]
  100. }
  101. ],
  102. "data_streams": [ <3>
  103. {
  104. "name": "foo",
  105. "backing_indices": [
  106. ".ds-foo-000001"
  107. ],
  108. "timestamp_field": "@timestamp"
  109. }
  110. ]
  111. }
  112. ----
  113. // TESTRESPONSE[s/remoteCluster1:/remotecluster-/]
  114. <1> All indices matching the supplied names or expressions
  115. <2> All aliases matching the supplied names or expressions
  116. <3> All data streams matching the supplied names or expressions