mount-snapshot.asciidoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. [role="xpack"]
  2. [testenv="enterprise"]
  3. [[searchable-snapshots-api-mount-snapshot]]
  4. === Mount snapshot API
  5. ++++
  6. <titleabbrev>Mount snapshot</titleabbrev>
  7. ++++
  8. experimental[]
  9. Mount a snapshot as a snapshot backed 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. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=wait_for_completion]
  35. [[searchable-snapshots-api-mount-request-body]]
  36. ==== {api-request-body-title}
  37. `index`::
  38. (Required, string)
  39. Name of the index contained in the snapshot
  40. whose data is to be mounted.
  41. If no `renamed_index` is specified this name
  42. will also be used to create the new index.
  43. `renamed_index`::
  44. +
  45. --
  46. (Optional, string)
  47. Name of the index that will be created.
  48. --
  49. `index_settings`::
  50. +
  51. --
  52. (Optional, object)
  53. Settings that should be added to the index when it is mounted.
  54. --
  55. `ignore_index_settings`::
  56. +
  57. --
  58. (Optional, array of strings)
  59. Names of settings that should be removed from the index when it is mounted.
  60. --
  61. [[searchable-snapshots-api-mount-example]]
  62. ==== {api-examples-title}
  63. ////
  64. [source,console]
  65. -----------------------------------
  66. PUT /my_docs
  67. {
  68. "settings" : {
  69. "index.number_of_shards" : 1,
  70. "index.number_of_replicas" : 0
  71. }
  72. }
  73. PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true
  74. {
  75. "include_global_state": false,
  76. "indices": "my_docs"
  77. }
  78. DELETE /my_docs
  79. -----------------------------------
  80. // TEST[setup:setup-repository]
  81. ////
  82. Mounts the index `my_docs` from an existing snapshot named `my_snapshot` stored
  83. in the `my_repository` as a new index `docs`:
  84. [source,console]
  85. --------------------------------------------------
  86. POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true
  87. {
  88. "index": "my_docs", <1>
  89. "renamed_index": "docs", <2>
  90. "index_settings": { <3>
  91. "index.number_of_replicas": 0
  92. },
  93. "ignored_index_settings": [ "index.refresh_interval" ] <4>
  94. }
  95. --------------------------------------------------
  96. // TEST[continued]
  97. <1> The name of the index in the snapshot to mount
  98. <2> The name of the index to create
  99. <3> Any index settings to add to the new index
  100. <4> List of indices to ignore when mounting the snapshotted index