// 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.indices.putIndexTemplate({
  name: "dsl-data-stream-template",
  index_patterns: ["dsl-data-stream*"],
  data_stream: {},
  priority: 500,
  template: {
    settings: {
      "index.lifecycle.name": "pre-dsl-ilm-policy",
      "index.lifecycle.prefer_ilm": false,
    },
    lifecycle: {
      data_retention: "7d",
    },
  },
});
console.log(response);
----
