123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- [[put-snapshot-repo-api]]
- === Create or update snapshot repository API
- ++++
- <titleabbrev>Create or update snapshot repository</titleabbrev>
- ++++
- Registers or updates a <<snapshots-register-repository,snapshot repository>>.
- [source,console]
- ----
- PUT /_snapshot/my_repository
- {
- "type": "fs",
- "settings": {
- "location": "my_backup_location"
- }
- }
- ----
- IMPORTANT: If you're migrating {ref}/searchable-snapshots.html[searchable snapshots], the repository's name must be identical in the source and destination clusters.
- [[put-snapshot-repo-api-request]]
- ==== {api-request-title}
- `PUT /_snapshot/<repository>`
- `POST /_snapshot/<repository>`
- [[put-snapshot-repo-api-prereqs]]
- ==== {api-prereq-title}
- * If the {es} {security-features} are enabled, you must have the `manage`
- <<privileges-list-cluster,cluster privilege>> to use this API.
- // tag::put-repo-api-prereqs[]
- * To register a snapshot repository, the cluster's global metadata must be
- writeable. Ensure there aren't any <<cluster-read-only,cluster blocks>> that
- prevent write access.
- // end::put-repo-api-prereqs[]
- [[put-snapshot-repo-api-path-params]]
- ==== {api-path-parms-title}
- `<repository>`::
- (Required, string)
- Name of the snapshot repository to register or update.
- [[put-snapshot-repo-api-query-params]]
- ==== {api-query-parms-title}
- IMPORTANT: Several options for this API can be specified using a query parameter
- or a request body parameter. If both parameters are specified, only the query
- parameter is used.
- include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
- `verify`::
- (Optional, Boolean)
- If `true`, the request verifies the repository is functional on all master and
- data nodes in the cluster. If `false`, this verification is skipped. Defaults to
- `true`.
- +
- You can manually perform this verification using the
- <<verify-snapshot-repo-api,verify snapshot repository API>>.
- [role="child_attributes"]
- [[put-snapshot-repo-api-request-body]]
- ==== {api-request-body-title}
- [[put-snapshot-repo-api-request-type]]
- `type`::
- (Required, string)
- Repository type.
- +
- .Valid values for `type`
- [%collapsible%open]
- ====
- `azure`:: <<repository-azure>>
- `gcs`:: <<repository-gcs>>
- `s3`:: <<repository-s3>>
- `fs`:: <<snapshots-filesystem-repository>>
- `source`:: <<snapshots-source-only-repository>>
- `url`:: <<snapshots-read-only-repository>>
- Other repository types are available through official plugins:
- `hdfs`:: {plugins}/repository-hdfs.html[Hadoop Distributed File System (HDFS) repository]
- ====
- [[put-snapshot-repo-api-settings-param]]
- `settings`::
- (Required, object)
- Settings for the repository. Supported settings vary based on the repository
- type:
- +
- --
- * <<repository-azure>>
- * <<repository-gcs>>
- * <<repository-s3>>
- * <<snapshots-filesystem-repository>>
- * <<snapshots-read-only-repository>>
- * <<snapshots-source-only-repository>>
- Other repository types are available through official plugins:
- * {plugins}/repository-hdfs.html[Hadoop Distributed File System (HDFS) repository]
- --
- `verify`::
- (Optional, Boolean)
- If `true`, the request verifies the repository is functional on all master and
- data nodes in the cluster. If `false`, this verification is skipped. Defaults to
- `true`.
- +
- You can manually perform this verification using the
- <<snapshots-repository-verification,verify snapshot repository API>>.
|