This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Execute snapshot retention policy API
editExecute snapshot retention policy API
editDeletes any snapshots that are expired according to the policy’s retention rules.
Request
editPOST /_slm/_execute_retention
Prerequisites
editIf the Elasticsearch security features are enabled, you must have the manage_slm
cluster privilege to use this API. For more information, see
Security privileges.
Description
editManually applies the retention policy to force immediate removal of expired snapshots. The retention policy is normally applied according to its schedule.
Examples
editTo force removal of expired snapshots:
resp = client.slm.execute_retention() print(resp)
response = client.slm.execute_retention puts response
const response = await client.slm.executeRetention(); console.log(response);
POST /_slm/_execute_retention
Retention runs asynchronously in the background.