Mount snapshot API

Mount snapshot API

New API reference

For the most up-to-date API details, refer to Searchable snapshots APIs.

Mount a snapshot as a searchable snapshot index.

Request

POST /_snapshot/<repository>/<snapshot>/_mount

Prerequisites

If 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

This API mounts a snapshot as a searchable snapshot index.

Don’t use this API for snapshots managed by ILM. Manually mounting ILM-managed snapshots can interfere with ILM processes.

Path parameters

<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

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 to false.

storage

(Optional, string) Mount option for the searchable snapshot index. Possible values are:

Request body

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

Mounts the index my_docs from an existing snapshot named my_snapshot stored in the my_repository as a new index docs:

  1. resp = client.searchable_snapshots.mount(
  2. repository="my_repository",
  3. snapshot="my_snapshot",
  4. wait_for_completion=True,
  5. index="my_docs",
  6. renamed_index="docs",
  7. index_settings={
  8. "index.number_of_replicas": 0
  9. },
  10. ignore_index_settings=[
  11. "index.refresh_interval"
  12. ],
  13. )
  14. print(resp)
  1. const response = await client.searchableSnapshots.mount({
  2. repository: "my_repository",
  3. snapshot: "my_snapshot",
  4. wait_for_completion: "true",
  5. index: "my_docs",
  6. renamed_index: "docs",
  7. index_settings: {
  8. "index.number_of_replicas": 0,
  9. },
  10. ignore_index_settings: ["index.refresh_interval"],
  11. });
  12. console.log(response);
  1. POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
  2. {
  3. "index": "my_docs",
  4. "renamed_index": "docs",
  5. "index_settings": {
  6. "index.number_of_replicas": 0
  7. },
  8. "ignore_index_settings": [ "index.refresh_interval" ]
  9. }

The name of the index in the snapshot to mount

The name of the index to create

Any index settings to add to the new index

List of index settings to ignore when mounting the snapshotted index