Mount snapshot API
editMount snapshot API
editMount a snapshot as a searchable snapshot index.
Request
editPOST /_snapshot/<repository>/<snapshot>/_mount
Prerequisites
editIf the Elasticsearch 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.
Description
editPath parameters
edit-
<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.
Query parameters
edit-
master_timeout
-
(Optional, time units)
Period to wait for the master node. If the master node is not available before
the timeout expires, the request fails and returns an error. Defaults to
30s
. Can also be set to-1
to indicate that the request should never timeout. -
wait_for_completion
-
(Optional, Boolean) If
true
, the request blocks until the operation is complete. Defaults tofalse
. -
storage
-
(Optional, string) Mount option for the searchable snapshot index. Possible values are:
-
full_copy
(Default) - Fully mounted index.
-
shared_cache
- Partially mounted index.
-
Request body
edit-
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.
Examples
editMounts the index my_docs
from an existing snapshot named my_snapshot
stored
in the my_repository
as a new index docs
:
resp = client.searchable_snapshots.mount( repository="my_repository", snapshot="my_snapshot", wait_for_completion=True, index="my_docs", renamed_index="docs", index_settings={ "index.number_of_replicas": 0 }, ignore_index_settings=[ "index.refresh_interval" ], ) print(resp)
const response = await client.searchableSnapshots.mount({ repository: "my_repository", snapshot: "my_snapshot", wait_for_completion: "true", index: "my_docs", renamed_index: "docs", index_settings: { "index.number_of_replicas": 0, }, ignore_index_settings: ["index.refresh_interval"], }); console.log(response);