upgrade.asciidoc 3.3 KB

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