Snapshot Lifecycle Management (SLM)
- class elasticsearch.client.SlmClient(client)
- Parameters:
client (BaseClient)
- delete_lifecycle(*, policy_id, error_trace=None, filter_path=None, human=None, pretty=None)
Deletes an existing snapshot lifecycle policy.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-delete-policy.html
- execute_lifecycle(*, policy_id, error_trace=None, filter_path=None, human=None, pretty=None)
Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-execute-lifecycle.html
- execute_retention(*, error_trace=None, filter_path=None, human=None, pretty=None)
Deletes any snapshots that are expired according to the policy’s retention rules.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-execute-retention.html
- get_lifecycle(*, policy_id=None, error_trace=None, filter_path=None, human=None, pretty=None)
Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-get-policy.html
- get_stats(*, error_trace=None, filter_path=None, human=None, pretty=None)
Returns global and policy-level statistics about actions taken by snapshot lifecycle management.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-get-stats.html
- get_status(*, error_trace=None, filter_path=None, human=None, pretty=None)
Retrieves the status of snapshot lifecycle management (SLM).
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-get-status.html
- put_lifecycle(*, policy_id, config=None, error_trace=None, filter_path=None, human=None, master_timeout=None, name=None, pretty=None, repository=None, retention=None, schedule=None, timeout=None, body=None)
Creates or updates a snapshot lifecycle policy.
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-put-policy.html
- Parameters:
policy_id (str) – ID for the snapshot lifecycle policy you want to create or update.
config (Mapping[str, Any] | None) – Configuration for each snapshot created by the policy.
master_timeout (str | Literal[-1] | ~typing.Literal[0] | None) – Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
name (str | None) – Name automatically assigned to each snapshot created by the policy. Date math is supported. To prevent conflicting snapshot names, a UUID is automatically appended to each snapshot name.
repository (str | None) – Repository used to store snapshots created by this policy. This repository must exist prior to the policy’s creation. You can create a repository using the snapshot repository API.
retention (Mapping[str, Any] | None) – Retention rules used to retain and delete snapshots created by the policy.
schedule (str | None) – Periodic or absolute schedule at which the policy creates snapshots. SLM applies schedule changes immediately.
timeout (str | Literal[-1] | ~typing.Literal[0] | None) – Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
error_trace (bool | None)
human (bool | None)
pretty (bool | None)
- Return type:
- start(*, error_trace=None, filter_path=None, human=None, pretty=None)
Turns on snapshot lifecycle management (SLM).
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-start.html
- stop(*, error_trace=None, filter_path=None, human=None, pretty=None)
Turns off snapshot lifecycle management (SLM).
https://www.elastic.co/guide/en/elasticsearch/reference/8.16/slm-api-stop.html