1
0

put-repo-api.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. [[put-snapshot-repo-api]]
  2. === Create or update snapshot repository API
  3. ++++
  4. <titleabbrev>Create or update snapshot repository</titleabbrev>
  5. ++++
  6. Registers or updates a <<snapshots-register-repository,snapshot repository>>.
  7. [source,console]
  8. ----
  9. PUT /_snapshot/my_repository
  10. {
  11. "type": "fs",
  12. "settings": {
  13. "location": "my_backup_location"
  14. }
  15. }
  16. ----
  17. IMPORTANT: If you're migrating {ref}/searchable-snapshots.html[searchable snapshots], the repository's name must be identical in the source and destination clusters.
  18. [[put-snapshot-repo-api-request]]
  19. ==== {api-request-title}
  20. `PUT /_snapshot/<repository>`
  21. `POST /_snapshot/<repository>`
  22. [[put-snapshot-repo-api-prereqs]]
  23. ==== {api-prereq-title}
  24. * If the {es} {security-features} are enabled, you must have the `manage`
  25. <<privileges-list-cluster,cluster privilege>> to use this API.
  26. // tag::put-repo-api-prereqs[]
  27. * To register a snapshot repository, the cluster's global metadata must be
  28. writeable. Ensure there aren't any <<cluster-read-only,cluster blocks>> that
  29. prevent write access.
  30. // end::put-repo-api-prereqs[]
  31. [[put-snapshot-repo-api-path-params]]
  32. ==== {api-path-parms-title}
  33. `<repository>`::
  34. (Required, string)
  35. Name of the snapshot repository to register or update.
  36. [[put-snapshot-repo-api-query-params]]
  37. ==== {api-query-parms-title}
  38. IMPORTANT: Several options for this API can be specified using a query parameter
  39. or a request body parameter. If both parameters are specified, only the query
  40. parameter is used.
  41. include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
  42. `verify`::
  43. (Optional, Boolean)
  44. If `true`, the request verifies the repository is functional on all master and
  45. data nodes in the cluster. If `false`, this verification is skipped. Defaults to
  46. `true`.
  47. +
  48. You can manually perform this verification using the
  49. <<verify-snapshot-repo-api,verify snapshot repository API>>.
  50. [role="child_attributes"]
  51. [[put-snapshot-repo-api-request-body]]
  52. ==== {api-request-body-title}
  53. [[put-snapshot-repo-api-request-type]]
  54. `type`::
  55. (Required, string)
  56. Repository type.
  57. +
  58. .Valid values for `type`
  59. [%collapsible%open]
  60. ====
  61. `azure`:: <<repository-azure>>
  62. `gcs`:: <<repository-gcs>>
  63. `s3`:: <<repository-s3>>
  64. `fs`:: <<snapshots-filesystem-repository>>
  65. `source`:: <<snapshots-source-only-repository>>
  66. `url`:: <<snapshots-read-only-repository>>
  67. Other repository types are available through official plugins:
  68. `hdfs`:: {plugins}/repository-hdfs.html[Hadoop Distributed File System (HDFS) repository]
  69. ====
  70. [[put-snapshot-repo-api-settings-param]]
  71. `settings`::
  72. (Required, object)
  73. Settings for the repository. Supported settings vary based on the repository
  74. type:
  75. +
  76. --
  77. * <<repository-azure>>
  78. * <<repository-gcs>>
  79. * <<repository-s3>>
  80. * <<snapshots-filesystem-repository>>
  81. * <<snapshots-read-only-repository>>
  82. * <<snapshots-source-only-repository>>
  83. Other repository types are available through official plugins:
  84. * {plugins}/repository-hdfs.html[Hadoop Distributed File System (HDFS) repository]
  85. --
  86. `verify`::
  87. (Optional, Boolean)
  88. If `true`, the request verifies the repository is functional on all master and
  89. data nodes in the cluster. If `false`, this verification is skipped. Defaults to
  90. `true`.
  91. +
  92. You can manually perform this verification using the
  93. <<snapshots-repository-verification,verify snapshot repository API>>.