Cleanup Snapshot Repository API
Introduced 1.0
The Cleanup Snapshot Repository API clears a snapshot repository of data no longer referenced by any existing snapshot.
Endpoints
POST /_snapshot/<repository>/_cleanup
Path parameters
| Parameter | Data type | Description |
|---|---|---|
repository | String | The name of the snapshot repository. |
Query parameters
The following table lists the available query parameters. All query parameters are optional.
| Parameter | Data type | Description |
|---|---|---|
cluster_manager_timeout | Time | The amount of time to wait for a response from the cluster manager node. Formerly called master_timeout. Optional. Default is 30 seconds. |
timeout | Time | The 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:
POST /_snapshot/my_backup/_cleanupresponse = client.snapshot.cleanup_repository(
repository = "my_backup"
)Example response
{
"results":{
"deleted_bytes":40,
"deleted_blobs":8
}
}
Response body fields
| Field | Data type | Description |
|---|---|---|
deleted_bytes | Integer | The number of bytes made available in the snapshot after data deletion. |
deleted_blobs | Integer | The number of binary large objects (BLOBs) cleared from the repository by the request. |