Cleanup Snapshot Repository

Introduced 1.0

The Cleanup Snapshot Repository API clears a snapshot repository of data no longer referenced by any existing snapshot.

Path and HTTP methods

  1. POST /_snapshot/<repository>/_cleanup

Path parameters

ParameterData typeDescription
repositoryStringThe name of the snapshot repository.

Query parameters

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

ParameterData typeDescription
cluster_manager_timeoutTimeThe amount of time to wait for a response from the cluster manager node. Formerly called master_timeout. Optional. Default is 30 seconds.
timeoutTimeThe amount of time to wait for the operation to complete. Optional.

Example request

The following request removes all stale data from the repository my_backup:

  1. POST /_snapshot/my_backup/_cleanup

copy

Example response

  1. {
  2. "results":{
  3. "deleted_bytes":40,
  4. "deleted_blobs":8
  5. }
  6. }

Response body fields

FieldData typeDescription
deleted_bytesIntegerThe number of bytes made available in the snapshot after data deletion.
deleted_blobsIntegerThe number of binary large objects (BLOBs) cleared from the repository by the request.