Clean up the snapshot repository Generally available; Added in 7.4.0

POST /_snapshot/{repository}/_cleanup

Trigger the review of the contents of a snapshot repository and delete any stale data not referenced by existing snapshots.

Required authorization

  • Cluster privileges: manage
External documentation

Path parameters

  • repository string Required

    Snapshot repository to clean up.

Query parameters

  • master_timeout string

    Period to wait for a connection to the master node.

    Values are -1 or 0.

  • timeout string

    Period to wait for a response.

    Values are -1 or 0.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • results object Required
      Hide results attributes Show results attributes object
      • deleted_blobs number Required

        Number of binary large objects (blobs) removed during cleanup.

      • deleted_bytes number Required

        Number of bytes freed by cleanup operations.

POST /_snapshot/{repository}/_cleanup
POST /_snapshot/my_repository/_cleanup
resp = client.snapshot.cleanup_repository(
    name="my_repository",
)
const response = await client.snapshot.cleanupRepository({
  name: "my_repository",
});
response = client.snapshot.cleanup_repository(
  repository: "my_repository"
)
$resp = $client->snapshot()->cleanupRepository([
    "repository" => "my_repository",
]);
curl -X POST -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_snapshot/my_repository/_cleanup"
Response examples (200)
A successful response from `POST /_snapshot/my_repository/_cleanup`.
{
  "results": {
    "deleted_bytes": 20,
    "deleted_blobs": 5
  }
}