2020-04-07 07:28:53 -04:00
|
|
|
[role="xpack"]
|
2020-04-14 08:12:48 -04:00
|
|
|
[testenv="platinum"]
|
2020-04-07 07:28:53 -04:00
|
|
|
[[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
|