[source, ruby]
----
response = client.ilm.put_lifecycle(
  policy: 'shrink-index',
  body: {
    policy: {
      phases: {
        warm: {
          min_age: '5d',
          actions: {
            shrink: {
              number_of_shards: 1
            }
          }
        }
      }
    }
  }
)
puts response
----
