mount-snapshot.asciidoc 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. [role="xpack"]
  2. [testenv="enterprise"]
  3. [[searchable-snapshots-api-mount-snapshot]]
  4. === Mount snapshot API
  5. ++++
  6. <titleabbrev>Mount snapshot</titleabbrev>
  7. ++++
  8. beta::[]
  9. Mount a snapshot as a searchable snapshot index.
  10. [[searchable-snapshots-api-mount-request]]
  11. ==== {api-request-title}
  12. `POST /_snapshot/<repository>/<snapshot>/_mount`
  13. [[searchable-snapshots-api-mount-prereqs]]
  14. ==== {api-prereq-title}
  15. If the {es} {security-features} are enabled, you must have the
  16. `manage` cluster privilege and the `manage` index privilege
  17. for any included indices to use this API.
  18. For more information, see <<security-privileges>>.
  19. [[searchable-snapshots-api-mount-desc]]
  20. ==== {api-description-title}
  21. [[searchable-snapshots-api-mount-path-params]]
  22. ==== {api-path-parms-title}
  23. `<repository>`::
  24. (Required, string)
  25. The name of the repository containing
  26. the snapshot of the index to mount.
  27. `<snapshot>`::
  28. (Required, string)
  29. The name of the snapshot of the index
  30. to mount.
  31. [[searchable-snapshots-api-mount-query-params]]
  32. ==== {api-query-parms-title}
  33. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  34. `wait_for_completion`::
  35. (Optional, Boolean) If `true`, the request blocks until the operation is complete.
  36. Defaults to `false`.
  37. [[searchable-snapshots-api-mount-request-body]]
  38. ==== {api-request-body-title}
  39. `index`::
  40. (Required, string)
  41. Name of the index contained in the snapshot
  42. whose data is to be mounted.
  43. If no `renamed_index` is specified this name
  44. will also be used to create the new index.
  45. `renamed_index`::
  46. +
  47. --
  48. (Optional, string)
  49. Name of the index that will be created.
  50. --
  51. `index_settings`::
  52. +
  53. --
  54. (Optional, object)
  55. Settings that should be added to the index when it is mounted.
  56. --
  57. `ignore_index_settings`::
  58. +
  59. --
  60. (Optional, array of strings)
  61. Names of settings that should be removed from the index when it is mounted.
  62. --
  63. [[searchable-snapshots-api-mount-example]]
  64. ==== {api-examples-title}
  65. ////
  66. [source,console]
  67. -----------------------------------
  68. PUT /my_docs
  69. {
  70. "settings" : {
  71. "index.number_of_shards" : 1,
  72. "index.number_of_replicas" : 0
  73. }
  74. }
  75. PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
  76. {
  77. "include_global_state": false,
  78. "indices": "my_docs"
  79. }
  80. DELETE /my_docs
  81. -----------------------------------
  82. // TEST[setup:setup-repository]
  83. ////
  84. Mounts the index `my_docs` from an existing snapshot named `my_snapshot` stored
  85. in the `my_repository` as a new index `docs`:
  86. [source,console]
  87. --------------------------------------------------
  88. POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
  89. {
  90. "index": "my_docs", <1>
  91. "renamed_index": "docs", <2>
  92. "index_settings": { <3>
  93. "index.number_of_replicas": 0
  94. },
  95. "ignored_index_settings": [ "index.refresh_interval" ] <4>
  96. }
  97. --------------------------------------------------
  98. // TEST[continued]
  99. <1> The name of the index in the snapshot to mount
  100. <2> The name of the index to create
  101. <3> Any index settings to add to the new index
  102. <4> List of indices to ignore when mounting the snapshotted index