Clean up the snapshot repository
Generally available; Added in 7.4.0
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
POST
/_snapshot/{repository}/_cleanup
Console
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
}
}