put-repo-api.asciidoc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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. [[put-snapshot-repo-api-request]]
  18. ==== {api-request-title}
  19. `PUT /_snapshot/<repository>`
  20. `POST /_snapshot/<repository>`
  21. [[put-snapshot-repo-api-prereqs]]
  22. ==== {api-prereq-title}
  23. * If the {es} {security-features} are enabled, you must have the `manage`
  24. <<privileges-list-cluster,cluster privilege>> to use this API.
  25. // tag::put-repo-api-prereqs[]
  26. * To register a snapshot repository, the cluster's global metadata must be
  27. writeable. Ensure there aren't any <<cluster-read-only,cluster blocks>> that
  28. prevent write access.
  29. // end::put-repo-api-prereqs[]
  30. [[put-snapshot-repo-api-path-params]]
  31. ==== {api-path-parms-title}
  32. `<repository>`::
  33. (Required, string)
  34. Name of the snapshot repository to register or update.
  35. [[put-snapshot-repo-api-query-params]]
  36. ==== {api-query-parms-title}
  37. IMPORTANT: Several options for this API can be specified using a query parameter
  38. or a request body parameter. If both parameters are specified, only the query
  39. parameter is used.
  40. `master_timeout`::
  41. (Optional, <<time-units, time units>>) Specifies the period of time to wait for
  42. a connection to the master node. If no response is received before the timeout
  43. expires, the request fails and returns an error. Defaults to `30s`.
  44. `timeout`::
  45. (Optional, <<time-units, time units>>) Specifies the period of time to wait for
  46. a response. If no response is received before the timeout expires, the request
  47. fails and returns an error. Defaults to `30s`.
  48. `verify`::
  49. (Optional, Boolean)
  50. If `true`, the request verifies the repository is functional on all master and
  51. data nodes in the cluster. If `false`, this verification is skipped. Defaults to
  52. `true`.
  53. +
  54. You can manually perform this verification using the
  55. <<verify-snapshot-repo-api,verify snapshot repository API>>.
  56. [role="child_attributes"]
  57. [[put-snapshot-repo-api-request-body]]
  58. ==== {api-request-body-title}
  59. [[put-snapshot-repo-api-request-type]]
  60. `type`::
  61. (Required, string)
  62. Repository type.
  63. +
  64. .Valid values for `type`
  65. [%collapsible%open]
  66. ====
  67. `azure`:: <<repository-azure>>
  68. `gcs`:: <<repository-gcs>>
  69. `s3`:: <<repository-s3>>
  70. `fs`:: <<snapshots-filesystem-repository>>
  71. `source`:: <<snapshots-source-only-repository>>
  72. `url`:: <<snapshots-read-only-repository>>
  73. Other repository types are available through official plugins:
  74. `hdfs`:: {plugins}/repository-hdfs.html[Hadoop Distributed File System (HDFS) repository]
  75. ====
  76. [[put-snapshot-repo-api-settings-param]]
  77. `settings`::
  78. (Required, object)
  79. Settings for the repository. Supported settings vary based on the repository
  80. type:
  81. +
  82. --
  83. * <<repository-azure>>
  84. * <<repository-gcs>>
  85. * <<repository-s3>>
  86. * <<snapshots-filesystem-repository>>
  87. * <<snapshots-read-only-repository>>
  88. * <<snapshots-source-only-repository>>
  89. Other repository types are available through official plugins:
  90. * {plugins}/repository-hdfs.html[Hadoop Distributed File System (HDFS) repository]
  91. --
  92. `verify`::
  93. (Optional, Boolean)
  94. If `true`, the request verifies the repository is functional on all master and
  95. data nodes in the cluster. If `false`, this verification is skipped. Defaults to
  96. `true`.
  97. +
  98. You can manually perform this verification using the
  99. <<snapshots-repository-verification,verify snapshot repository API>>.