update policy of an existing index
POST _plugins/_ism/change_policy/.ds-nginx-prod-access-000003 { "policy_id": "shard1gb-90days" }
note sometimes you may have to delete it first then add
POST _plugins/_ism/remove/.ds-nginx-test-access-000001 POST _plugins/_ism/add/.ds-nginx-test-access-000001 { "policy_id": "shard1gb-90days" }
that is another flavor
PUT .ds-nginx-prod-access-000003 { "settings": { "index.lifecycle.name": "shrink-index" } }
elastic doesn’t have the same syntax e.g.
"rollover": { "max_primary_shard_size": "5gb", "max_age": "1m" }
and the mgmt policy isn’t setup at the same place – it is done with the template
{ "template": { "settings": { "index": { "lifecycle": { "name": "delete-7d", "rollover_alias": "test-alias" } } }, "mappings": { }, "aliases": {} } }
https://opensearch.org/docs/latest/im-plugin/ism/api/#update-managed-index-policy
https://opensearch.org/docs/latest/im-plugin/ism/api/#remove-policy-from-index
https://opensearch.org/docs/latest/im-plugin/ism/api/#add-policy