Link Search Menu Expand Document Documentation Menu

Get Snapshot Repository API

Introduced 1.0

Retrieves information about a snapshot repository.

To learn more about repositories, see Register repository.

You can also get details about a snapshot during and after snapshot creation. See Get snapshot status.

Endpoints

GET /_snapshot/{repository}

Path parameters

The following table lists the available path parameters. All path parameters are optional.

Parameter Data type Description
repository String A comma-separated list of snapshot repository names to retrieve. Wildcard (*) expressions are supported including combining wildcards with exclude patterns starting with -.

Query parameters

The following table lists the available query parameters. All query parameters are optional.

Parameter Data type Description
local Boolean Whether to get information from the local node. Optional, defaults to false.
cluster_manager_timeout Time Amount of time to wait for a connection to the cluster manager node. Optional, defaults to 30 seconds.

Example request

The following request retrieves information for the my-opensearch-repo repository:

GET /_snapshot/my-opensearch-repo
response = client.snapshot.get_repository(
  repository = "my-opensearch-repo"
)

Example response

Upon success, the response returns repositry information. This sample is for an s3 repository type.

{
  "my-opensearch-repo" : {
    "type" : "s3",
    "settings" : {
      "bucket" : "my-open-search-bucket",
      "base_path" : "snapshots"
    }
  }
}

Response body fields

The following table lists all response body fields.

Field Data type Description
type String Bucket type: fs (file system) or s3 (s3 bucket)
bucket String S3 bucket name.
base_path String Folder within the bucket where snapshots are stored.

Required permissions

If you use the Security plugin, make sure you have the appropriate permissions: cluster:admin/repository/get.

350 characters left

Have a question? .

Want to contribute? or .