Get snapshot repository API

edit

Gets information about one or more registered snapshot repositories.

resp = client.snapshot.get_repository(
    name="my_repository",
)
print(resp)
response = client.snapshot.get_repository(
  repository: 'my_repository'
)
puts response
const response = await client.snapshot.getRepository({
  name: "my_repository",
});
console.log(response);
GET /_snapshot/my_repository

Request

edit

GET /_snapshot/<repository>

GET /_snapshot

Prerequisites

edit
  • If the Elasticsearch security features are enabled, you must have the monitor_snapshot, create_snapshot, or manage cluster privilege to use this API.

Path parameters

edit
<repository>

(Optional, string) Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported including combining wildcards with exclude patterns starting with -.

To get information about all snapshot repositories registered in the cluster, omit this parameter or use * or _all.

Query parameters

edit
local
(Optional, Boolean) If true, the request gets information from the local node only. If false, the request gets information from the master node. Defaults to false.
master_timeout
(Optional, time units) Period to wait for the master node. If the master node is not available before the timeout expires, the request fails and returns an error. Defaults to 30s. Can also be set to -1 to indicate that the request should never timeout.

Response body

edit
<repository>

(object) Contains information about the snapshot repository. Key is the name of the snapshot repository.

Properties of <repository>
type

(string) Repository type.

Values for type
fs
Shared file system repository. See Shared file system repository.
source
Source-only repository. See Source-only repository.
url
URL repository. See Read-only URL repository.

More repository types are available through these official plugins:

settings

(object) Contains settings for the repository. Valid properties for the settings object depend on the repository type, set using the type parameter.

For properties, see the create or update snapshot repository API's settings parameter.

Examples

edit
resp = client.snapshot.get_repository(
    name="my_repository",
)
print(resp)
response = client.snapshot.get_repository(
  repository: 'my_repository'
)
puts response
const response = await client.snapshot.getRepository({
  name: "my_repository",
});
console.log(response);
GET /_snapshot/my_repository

The API returns the following response:

{
  "my_repository" : {
    "type" : "fs",
    "uuid" : "0JLknrXbSUiVPuLakHjBrQ",
    "settings" : {
      "location" : "my_backup_location"
    }
  }
}