# Elastic rest high level api RolloverRequest

**URL:** <https://discuss.elastic.co/t/elastic-rest-high-level-api-rolloverrequest/156733>\
**Category:** Elasticsearch\
**Created:** [November 14, 2018, 7:54pm UTC](https://discuss.elastic.co/t/elastic-rest-high-level-api-rolloverrequest/156733 "2018-11-14T19:54:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sensei-wu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sensei-wu/32/46499_2.png) [@sensei-wu](https://discuss.elastic.co/u/sensei-wu)\
**Post date:** [November 14, 2018, 7:54pm UTC](https://discuss.elastic.co/t/elastic-rest-high-level-api-rolloverrequest/156733/1 "2018-11-14T19:54:52Z")

</div>

I am trying to use `RolloverRequest` to automatically rollover a time based index.

My index format is log-000001, log-000002 etc. and alias is `log`

If i'm using REST API, then I do not have to supply the new index name as rollover happens automatically. But I do not see a way of getting the same behaviour using high level rest api

```
RolloverRequest request = new RolloverRequest(aliasName, newIndexname);

```

Even though [documentation](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/java-rest-high-rollover-index.html) says that `newIndexName` is optional, there is no constructor which takes only one param, there is no default constructor either.

My question is, is there a way to pass just alias name to RolloverRequest for automatic rollover? If not, is there something like that planned or is the documentation misleading?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [December 12, 2018, 7:54pm UTC](https://discuss.elastic.co/t/elastic-rest-high-level-api-rolloverrequest/156733/2 "2018-12-12T19:54:54Z")

</div>

Closed on December 12, 2018, 7:54pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
