get-global-checkpoints.asciidoc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. [role="xpack"]
  2. [[get-global-checkpoints]]
  3. === Get global checkpoints API
  4. ++++
  5. <titleabbrev>Get global checkpoints</titleabbrev>
  6. ++++
  7. The purpose of the get global checkpoints api is to return the current global
  8. checkpoints for an index. This API allows users to know the what sequence numbers
  9. have been safely persisted in Elasticsearch.
  10. [discrete]
  11. [[polling-on-global-checkpoint]]
  12. == Polling on global checkpoint advance
  13. The API has an optional polling mode enabled by the `wait_for_advance` query
  14. parameter. In polling mode, the API will only return after the global checkpoints
  15. advance past the provided `checkpoints`. By default, `checkpoints` is an empty
  16. array, which will lead to the API returning immediately.
  17. If a timeout occurs before the global checkpoints advance past the provided
  18. `checkpoints`, Elasticsearch will return the current global checkpoints and a
  19. boolean indicating that the request timed out.
  20. Currently the `wait_for_advance` parameter is only supported for one shard indices.
  21. [discrete]
  22. [[polling-on-index]]
  23. == Polling on index ready
  24. By default in polling mode, an exception will be returned if the index does not
  25. exist or all the primary shards are not active. In polling mode, the
  26. `wait_for_index` parameter can be used to modify this behavior. If `wait_for_index`
  27. is set to true, the API will wait for the index to be created and all primary
  28. shards to be active.
  29. If a timeout occurs before these conditions are met, the relevant exception will be
  30. returned.
  31. Currently the `wait_for_index` parameter is only supported when `wait_for_advance`
  32. is true.
  33. [[get-global-checkpoints-api-request]]
  34. ==== {api-request-title}
  35. `GET /<index>/_fleet/global_checkpoints`
  36. [[get-global-checkpoints-api-path-params]]
  37. ==== {api-path-parms-title}
  38. `<index>`::
  39. (Required, string)
  40. A single index or index alias that resolves to a single index.
  41. [role="child_attributes"]
  42. [[get-global-checkpoints-api-query-parms]]
  43. ==== {api-query-parms-title}
  44. `wait_for_advance`::
  45. (Optional, Boolean) A boolean value which controls whether to wait (until the
  46. `timeout`) for the global checkpoints to advance past the provided
  47. `checkpoints`. Defaults to `false`.
  48. `wait_for_index`::
  49. (Optional, Boolean) A boolean value which controls whether to wait (until the
  50. `timeout`) for the target index to exist and all primary shards be active. Can
  51. only be `true` when `wait_for_advance` is `true`. Defaults to `false`.
  52. `checkpoints`::
  53. (Optional, list) A comma separated list of previous global checkpoints.
  54. When used in combination with `wait_for_advance`, the API will only return once
  55. the global checkpoints advances past the `checkpoints`. Defaults to an empty list
  56. which will cause Elasticsearch to immediately return the current global
  57. checkpoints.
  58. `timeout`::
  59. (Optional, <<time-units, time units>>)
  60. Period to wait for a global checkpoints to advance past `checkpoints`.
  61. Defaults to `30s`.
  62. [role="child_attributes"]
  63. [[get-global-checkpoints-api-response-body]]
  64. ==== {api-response-body-title}
  65. `global_checkpoints`::
  66. (array of integers) The global checkpoints for the index.
  67. `timed_out`::
  68. (Boolean) If `false` the global checkpoints did not advance past the
  69. `checkpoints` within the specified `timeout`.