upgrade.asciidoc 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[migration-api-upgrade]]
  4. === Migration upgrade API
  5. ++++
  6. <titleabbrev>Migration upgrade</titleabbrev>
  7. ++++
  8. The Migration Upgrade API performs the upgrade of internal indices to make them
  9. compatible with the next major version.
  10. [float]
  11. ==== Request
  12. `POST /_migration/upgrade/<index_name>`
  13. [float]
  14. ==== Description
  15. Indices must be upgraded one at a time.
  16. [float]
  17. ==== Path Parameters
  18. `index_name`::
  19. (string) Identifier for the index.
  20. `wait_for_completion`::
  21. (boolean) Defines whether the upgrade call blocks until the upgrade process is
  22. finished. The default value is `true`. If set to `false`, the upgrade can be
  23. performed asynchronously.
  24. //==== Query Parameters
  25. //==== Authorization
  26. [float]
  27. ==== Examples
  28. The following example submits a POST request to the
  29. `/_migration/upgrade/<index_name>` endpoint:
  30. [source,js]
  31. --------------------------------------------------
  32. POST /_migration/upgrade/.watches
  33. --------------------------------------------------
  34. // CONSOLE
  35. // TEST[skip:cannot create an old index in docs test]
  36. A successful call returns the statistics about the upgrade process:
  37. [source,js]
  38. --------------------------------------------------
  39. {
  40. "took" : 127,
  41. "timed_out" : false,
  42. "total" : 4,
  43. "updated" : 0,
  44. "created" : 4,
  45. "deleted" : 0,
  46. "batches" : 1,
  47. "version_conflicts" : 0,
  48. "noops" : 0,
  49. "retries" : {
  50. "bulk" : 0,
  51. "search" : 0
  52. },
  53. "throttled_millis" : 0,
  54. "failures" : [ ]
  55. }
  56. --------------------------------------------------
  57. // NOTCONSOLE
  58. The following example upgrades a large index asynchronously by specifying the
  59. `wait_for_completion` parameter:
  60. [source,js]
  61. --------------------------------------------------
  62. POST /_migration/upgrade/.watches?wait_for_completion=false
  63. --------------------------------------------------
  64. // CONSOLE
  65. // TEST[skip:cannot create an old index in docs test]
  66. This call should return the id of the upgrade process task:
  67. [source,js]
  68. --------------------------------------------------
  69. {
  70. "task" : "PFvgv7T6TGumRyFF3vqTFg:1137"
  71. }
  72. --------------------------------------------------
  73. // NOTCONSOLE
  74. The status of the running or finished upgrade requests can be obtained by using
  75. the <<tasks,Task API>>:
  76. [source,js]
  77. --------------------------------------------------
  78. GET _tasks/PFvgv7T6TGumRyFF3vqTFg:1137?detailed=true
  79. --------------------------------------------------
  80. // CONSOLE
  81. // TEST[skip:cannot create an old index in docs test]
  82. [source,js]
  83. --------------------------------------------------
  84. {
  85. "completed" : true, <1>
  86. "task" : {
  87. "node" : "PFvgv7T6TGumRyFF3vqTFg",
  88. "id" : 1137,
  89. "type" : "transport",
  90. "action" : "cluster:admin/xpack/upgrade",
  91. "description" : "",
  92. "start_time_in_millis" : 1500650625413,
  93. "running_time_in_nanos" : 947456819,
  94. "cancellable" : true
  95. },
  96. "response" : { <2>
  97. "took" : 212,
  98. "timed_out" : false,
  99. "total" : 4,
  100. "updated" : 0,
  101. "created" : 4,
  102. "deleted" : 0,
  103. "batches" : 1,
  104. "version_conflicts" : 0,
  105. "noops" : 0,
  106. "retries" : {
  107. "bulk" : 0,
  108. "search" : 0
  109. },
  110. "throttled_millis" : 0,
  111. "failures" : [ ]
  112. }
  113. }
  114. --------------------------------------------------
  115. // NOTCONSOLE
  116. <1> If the `completed` field value is `true`, the upgrade request has finished.
  117. If it is `false`, the request is still running.
  118. <2> The `response` field contains the status of the upgrade request.