// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.slm.putLifecycle({
  policy_id: "daily-snapshots",
  name: "<daily-snapshot-{now/d}>",
  schedule: "0 45 23 * * ?",
  repository: "my_repository",
  config: {
    indices: "*",
    include_global_state: true,
  },
  retention: {
    expire_after: "30d",
    min_count: 1,
    max_count: 31,
  },
});
console.log(response);
----
