Function for rotating an Elasticsearch index and associated current index alias.

This code requires an appropriate index template setup in Elasticsearch.

Required for time series setup task.