Tanguy Leroux 4d36917e52
Merge feature/searchable-snapshots branch into 7.x (#54803) (#54825)
This is a backport of #54803 for 7.x.

This pull request cherry picks the squashed commit from #54803 with the additional commits:

    6f50c92 which adjusts master code to 7.x
    a114549 to mute a failing ILM test (#54818)
    48cbca1 and 50186b2 that cleans up and fixes the previous test
    aae12bb that adds a missing feature flag (#54861)
    6f330e3 that adds missing serialization bits (#54864)
    bf72c02 that adjust the version in YAML tests
    a51955f that adds some plumbing for the transport client used in integration tests

Co-authored-by: David Turner <david.turner@elastic.co>
Co-authored-by: Yannick Welsch <yannick@welsch.lu>
Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
Co-authored-by: Andrei Dan <andrei.dan@elastic.co>
2020-04-07 13:28:53 +02:00

127 lines
2.9 KiB
Plaintext

[role="xpack"]
[testenv="basic"]
[[searchable-snapshots-api-mount-snapshot]]
=== Mount snapshot API
++++
<titleabbrev>Mount snapshot</titleabbrev>
++++
experimental[]
Mount a snapshot as a searchable index.
[[searchable-snapshots-api-mount-request]]
==== {api-request-title}
`POST /_snapshot/<repository>/<snapshot>/_mount`
[[searchable-snapshots-api-mount-prereqs]]
==== {api-prereq-title}
If the {es} {security-features} are enabled, you must have the
`manage` cluster privilege and the `manage` index privilege
for any included indices to use this API.
For more information, see <<security-privileges>>.
[[searchable-snapshots-api-mount-desc]]
==== {api-description-title}
[[searchable-snapshots-api-mount-path-params]]
==== {api-path-parms-title}
`<repository>`::
(Required, string)
The name of the repository containing
the snapshot of the index to mount.
`<snapshot>`::
(Required, string)
The name of the snapshot of the index
to mount.
[[searchable-snapshots-api-mount-query-params]]
==== {api-query-parms-title}
include::{docdir}/rest-api/common-parms.asciidoc[tag=master-timeout]
include::{docdir}/rest-api/common-parms.asciidoc[tag=wait_for_completion]
[[searchable-snapshots-api-mount-request-body]]
==== {api-request-body-title}
`index`::
(Required, string)
Name of the index contained in the snapshot
whose data is to be mounted.
If no `renamed_index` is specified this name
will also be used to create the new index.
`renamed_index`::
+
--
(Optional, string)
Name of the index that will be created.
--
`index_settings`::
+
--
(Optional, object)
Settings that should be added to the index when it is mounted.
--
`ignore_index_settings`::
+
--
(Optional, array of strings)
Names of settings that should be removed from the index when it is mounted.
--
[[searchable-snapshots-api-mount-example]]
==== {api-examples-title}
////
[source,console]
-----------------------------------
PUT /my_docs
{
"settings" : {
"index.number_of_shards" : 1,
"index.number_of_replicas" : 0
}
}
PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
{
"include_global_state": false,
"indices": "my_docs"
}
DELETE /my_docs
-----------------------------------
// TEST[setup:setup-repository]
////
Mounts the index `my_docs` from an existing snapshot named `my_snapshot` stored
in the `my_repository` as a new index `docs`:
[source,console]
--------------------------------------------------
POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
{
"index": "my_docs", <1>
"renamed_index": "docs", <2>
"index_settings": { <3>
"index.number_of_replicas": 0
},
"ignored_index_settings": [ "index.refresh_interval" ] <4>
}
--------------------------------------------------
// TEST[continued]
<1> The name of the index in the snapshot to mount
<2> The name of the index to create
<3> Any index settings to add to the new index
<4> List of indices to ignore when mounting the snapshotted index