2017-07-21 15:26:23 -04:00
|
|
|
[role="xpack"]
|
2018-06-21 11:19:23 -04:00
|
|
|
[testenv="basic"]
|
2017-07-21 15:26:23 -04:00
|
|
|
[[migration-api-upgrade]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Migration upgrade API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Migration upgrade</titleabbrev>
|
|
|
|
++++
|
2017-07-21 15:26:23 -04:00
|
|
|
|
2017-09-11 17:02:23 -04:00
|
|
|
The Migration Upgrade API performs the upgrade of internal indices to make them
|
|
|
|
compatible with the next major version.
|
2017-07-21 15:26:23 -04:00
|
|
|
|
2017-09-11 17:02:23 -04:00
|
|
|
[float]
|
|
|
|
==== Request
|
|
|
|
|
2018-11-28 15:19:33 -05:00
|
|
|
`POST /_migration/upgrade/<index_name>`
|
2017-09-11 17:02:23 -04:00
|
|
|
|
|
|
|
[float]
|
|
|
|
==== Description
|
|
|
|
|
|
|
|
Indices must be upgraded one at a time.
|
|
|
|
|
|
|
|
[float]
|
|
|
|
==== Path Parameters
|
|
|
|
|
|
|
|
`index_name`::
|
|
|
|
(string) Identifier for the index.
|
|
|
|
|
|
|
|
`wait_for_completion`::
|
|
|
|
(boolean) Defines whether the upgrade call blocks until the upgrade process is
|
|
|
|
finished. The default value is `true`. If set to `false`, the upgrade can be
|
|
|
|
performed asynchronously.
|
|
|
|
|
|
|
|
//==== Query Parameters
|
|
|
|
|
|
|
|
//==== Authorization
|
|
|
|
|
|
|
|
[float]
|
|
|
|
==== Examples
|
|
|
|
|
|
|
|
The following example submits a POST request to the
|
2018-11-28 15:19:33 -05:00
|
|
|
`/_migration/upgrade/<index_name>` endpoint:
|
2017-07-21 15:26:23 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2018-11-28 15:19:33 -05:00
|
|
|
POST /_migration/upgrade/.watches
|
2017-07-21 15:26:23 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:cannot create an old index in docs test]
|
|
|
|
|
|
|
|
A successful call returns the statistics about the upgrade process:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"took" : 127,
|
|
|
|
"timed_out" : false,
|
|
|
|
"total" : 4,
|
|
|
|
"updated" : 0,
|
|
|
|
"created" : 4,
|
|
|
|
"deleted" : 0,
|
|
|
|
"batches" : 1,
|
|
|
|
"version_conflicts" : 0,
|
|
|
|
"noops" : 0,
|
|
|
|
"retries" : {
|
|
|
|
"bulk" : 0,
|
|
|
|
"search" : 0
|
|
|
|
},
|
|
|
|
"throttled_millis" : 0,
|
|
|
|
"failures" : [ ]
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// NOTCONSOLE
|
|
|
|
|
2017-09-11 17:02:23 -04:00
|
|
|
The following example upgrades a large index asynchronously by specifying the
|
|
|
|
`wait_for_completion` parameter:
|
2017-07-21 15:26:23 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2018-11-28 15:19:33 -05:00
|
|
|
POST /_migration/upgrade/.watches?wait_for_completion=false
|
2017-07-21 15:26:23 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:cannot create an old index in docs test]
|
|
|
|
|
|
|
|
This call should return the id of the upgrade process task:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"task" : "PFvgv7T6TGumRyFF3vqTFg:1137"
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// NOTCONSOLE
|
|
|
|
|
2017-09-11 17:02:23 -04:00
|
|
|
The status of the running or finished upgrade requests can be obtained by using
|
|
|
|
the <<tasks,Task API>>:
|
2017-07-21 15:26:23 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET _tasks/PFvgv7T6TGumRyFF3vqTFg:1137?detailed=true
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:cannot create an old index in docs test]
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"completed" : true, <1>
|
|
|
|
"task" : {
|
|
|
|
"node" : "PFvgv7T6TGumRyFF3vqTFg",
|
|
|
|
"id" : 1137,
|
|
|
|
"type" : "transport",
|
|
|
|
"action" : "cluster:admin/xpack/upgrade",
|
|
|
|
"description" : "",
|
|
|
|
"start_time_in_millis" : 1500650625413,
|
|
|
|
"running_time_in_nanos" : 947456819,
|
|
|
|
"cancellable" : true
|
|
|
|
},
|
|
|
|
"response" : { <2>
|
|
|
|
"took" : 212,
|
|
|
|
"timed_out" : false,
|
|
|
|
"total" : 4,
|
|
|
|
"updated" : 0,
|
|
|
|
"created" : 4,
|
|
|
|
"deleted" : 0,
|
|
|
|
"batches" : 1,
|
|
|
|
"version_conflicts" : 0,
|
|
|
|
"noops" : 0,
|
|
|
|
"retries" : {
|
|
|
|
"bulk" : 0,
|
|
|
|
"search" : 0
|
|
|
|
},
|
|
|
|
"throttled_millis" : 0,
|
|
|
|
"failures" : [ ]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// NOTCONSOLE
|
|
|
|
|
2017-09-11 17:02:23 -04:00
|
|
|
<1> If the `completed` field value is `true`, the upgrade request has finished.
|
|
|
|
If it is `false`, the request is still running.
|
2017-07-21 15:26:23 -04:00
|
|
|
|
2017-09-11 17:02:23 -04:00
|
|
|
<2> The `response` field contains the status of the upgrade request.
|