API Gateway 10.11 | Administering API Gateway | Operating API Gateway | Data Management | Data Housekeeping | Archive and Purge using API | Creating Rollover of indexes that exceed the maximum size
 
Creating Rollover of indexes that exceed the maximum size
This section explains the steps to find out the indexes exceeding maximum size and roll them over using REST APIs.
For information about the roll over process using the apigatewayUtil script and the roll over conditions, see Creating Rollover of an Index.
*To create rollover of an index that has exceeded the given size
1. Run the following command with the required index name:
 curl -X POST
"http://localhost:9240/gateway_tenant_index_name/_rollover/new_index_name"
-d '{"settings": {"index.number_of_shards":1,
"index.number_of_replicas":1},"conditions":{"max_size" : "max_index_size"}}'
For example, you can run the following command to roll over the analytics transactional events index once it exceeds 12.5 GB:
 curl -X POST
"http://localhost:9240/gateway_tenant_analytics_transactionalevents/_rollover/new_index_name"
-d '{"settings": {"index.number_of_shards":1,
"index.number_of_replicas":1},"conditions":{"max_size" : "13421772800b"}}'
or, run the following command to roll over the gateway_default_mediatortracespan tracer index once it exceed 2.5 GB.
 curl -X POST
"http://localhost:9240/gateway_tenant_mediatortracespan/_rollover/new_index_name"
-d '{"settings": {"index.number_of_shards":1,
"index.number_of_replicas":1},"conditions":{"max_size" : "2684354560b"}}'
Sample output:
{
"acknowledged": false,
"shards_acknowledged": false,
"old_index": "gateway_default_analytics_transactionalevents_202106091512",
"new_index": "gateway_default_analytics_transactionalevents_202106091514",
"rolled_over": false,
"dry_run": false,
"conditions": {
"[max_size: 12gb]": false
}
}