rollover.asciidoc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. --
  2. :api: rollover-index
  3. :request: RolloverRequest
  4. :response: RolloverResponse
  5. --
  6. [id="{upid}-{api}"]
  7. === Rollover Index API
  8. [id="{upid}-{api}-request"]
  9. ==== Rollover Request
  10. The Rollover Index API requires a +{request}+ instance.
  11. A +{request}+ requires two string arguments at construction time, and
  12. one or more conditions that determine when the index has to be rolled over:
  13. ["source","java",subs="attributes,callouts,macros"]
  14. --------------------------------------------------
  15. include-tagged::{doc-tests-file}[{api}-request]
  16. --------------------------------------------------
  17. <1> The alias (first argument) that points to the index to rollover, and
  18. optionally the name of the new index in case the rollover operation is performed
  19. <2> Condition on the age of the index
  20. <3> Condition on the number of documents in the index
  21. <4> Condition on the size of the index
  22. ==== Optional arguments
  23. The following arguments can optionally be provided:
  24. ["source","java",subs="attributes,callouts,macros"]
  25. --------------------------------------------------
  26. include-tagged::{doc-tests-file}[{api}-request-dryRun]
  27. --------------------------------------------------
  28. <1> Whether the rollover should be performed (default) or only simulated
  29. ["source","java",subs="attributes,callouts,macros"]
  30. --------------------------------------------------
  31. include-tagged::{doc-tests-file}[{api}-request-timeout]
  32. --------------------------------------------------
  33. <1> Timeout to wait for the all the nodes to acknowledge the index is opened
  34. as a `TimeValue`
  35. <2> Timeout to wait for the all the nodes to acknowledge the index is opened
  36. as a `String`
  37. ["source","java",subs="attributes,callouts,macros"]
  38. --------------------------------------------------
  39. include-tagged::{doc-tests-file}[{api}-request-masterTimeout]
  40. --------------------------------------------------
  41. <1> Timeout to connect to the master node as a `TimeValue`
  42. <2> Timeout to connect to the master node as a `String`
  43. ["source","java",subs="attributes,callouts,macros"]
  44. --------------------------------------------------
  45. include-tagged::{doc-tests-file}[{api}-request-waitForActiveShards]
  46. --------------------------------------------------
  47. <1> The number of active shard copies to wait for before the rollover index API
  48. returns a response, as an `int`
  49. <2> The number of active shard copies to wait for before the rollover index API
  50. returns a response, as an `ActiveShardCount`
  51. ["source","java",subs="attributes,callouts,macros"]
  52. --------------------------------------------------
  53. include-tagged::{doc-tests-file}[{api}-request-settings]
  54. --------------------------------------------------
  55. <1> Add the settings to apply to the new index, which include the number of
  56. shards to create for it
  57. ["source","java",subs="attributes,callouts,macros"]
  58. --------------------------------------------------
  59. include-tagged::{doc-tests-file}[{api}-request-mapping]
  60. --------------------------------------------------
  61. <1> Add the mappings to associate the new index with. See <<java-rest-high-create-index-request-mappings>>
  62. for examples on the different ways to provide mappings
  63. ["source","java",subs="attributes,callouts,macros"]
  64. --------------------------------------------------
  65. include-tagged::{doc-tests-file}[{api}-request-alias]
  66. --------------------------------------------------
  67. <1> Add the aliases to associate the new index with
  68. include::../execution.asciidoc[]
  69. [id="{upid}-{api}-response"]
  70. ==== Rollover Response
  71. The returned +{response}+ allows to retrieve information about the
  72. executed operation as follows:
  73. ["source","java",subs="attributes,callouts,macros"]
  74. --------------------------------------------------
  75. include-tagged::{doc-tests-file}[{api}-response]
  76. --------------------------------------------------
  77. <1> Indicates whether all of the nodes have acknowledged the request
  78. <2> Indicates whether the requisite number of shard copies were started for
  79. each shard in the index before timing out
  80. <3> The name of the old index, eventually rolled over
  81. <4> The name of the new index
  82. <5> Whether the index has been rolled over
  83. <6> Whether the operation was performed or it was a dry run
  84. <7> The different conditions and whether they were matched or not