[source, ruby]
----
response = client.indices.put_index_template(
  name: 'my-index-template',
  body: {
    index_patterns: [
      'my-data-stream*'
    ],
    data_stream: {},
    priority: 500,
    template: {
      lifecycle: {
        data_retention: '7d'
      }
    },
    _meta: {
      description: 'Template with data stream lifecycle'
    }
  }
)
puts response
----
