123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- [role="xpack"]
- [testenv="basic"]
- [[ilm-remove-policy]]
- === Remove Policy from Index API
- ++++
- <titleabbrev>Remove Policy</titleabbrev>
- ++++
- beta[]
- Removes the assigned lifecycle policy from an index.
- ==== Request
- `POST <index>/_ilm/remove`
- ==== Description
- Removes the assigned lifecycle policy and stops managing the specified index.
- If an index pattern is specified, removes the assigned policies from all matching
- indices.
- ==== Path Parameters
- `index` (required)::
- (string) Identifier for the index.
- ==== Request Parameters
- include::{docdir}/rest-api/timeoutparms.asciidoc[]
- ==== Authorization
- You must have the `manage_ilm` privileges on the indices being managed to use this API.
- For more information, see {stack-ov}/security-privileges.html[Security Privileges].
- ==== Examples
- The following example removes the assigned policy from `my_index`.
- //////////////////////////
- [source,js]
- --------------------------------------------------
- PUT _ilm/policy/my_policy
- {
- "policy": {
- "phases": {
- "warm": {
- "min_age": "10d",
- "actions": {
- "forcemerge": {
- "max_num_segments": 1
- }
- }
- },
- "delete": {
- "min_age": "30d",
- "actions": {
- "delete": {}
- }
- }
- }
- }
- }
- PUT my_index
- {
- "settings": {
- "index.lifecycle.name": "my_policy"
- }
- }
- --------------------------------------------------
- // CONSOLE
- // TEST
- //////////////////////////
- [source,js]
- --------------------------------------------------
- POST my_index/_ilm/remove
- --------------------------------------------------
- // CONSOLE
- // TEST[continued]
- If the request succeeds, you receive the following result:
- [source,js]
- --------------------------------------------------
- {
- "has_failures" : false,
- "failed_indexes" : []
- }
- --------------------------------------------------
- // CONSOLE
- // TESTRESPONSE
|