// This file is autogenerated, DO NOT EDIT
// snapshot-restore/take-snapshot.asciidoc:557

[source, python]
----
resp = client.slm.put_lifecycle(
    policy_id="hourly-snapshots",
    name="<hourly-snapshot-{now/d}>",
    schedule="0 0 * * * ?",
    repository="my_repository",
    config={
        "indices": "*",
        "include_global_state": True
    },
    retention={
        "expire_after": "1d",
        "min_count": 1,
        "max_count": 24
    },
)
print(resp)
----
