put_lifecycle_policy.asciidoc 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. --
  2. :api: ilm-put-lifecycle-policy
  3. :request: PutLifecyclePolicyRequest
  4. :response: AcknowledgedResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Create or update lifecycle policy API
  9. [id="{upid}-{api}-request"]
  10. ==== Request
  11. Creates or updates an index lifecycle management policy.
  12. ["source","java",subs="attributes,callouts,macros"]
  13. --------------------------------------------------
  14. include-tagged::{doc-tests-file}[{api}-request]
  15. --------------------------------------------------
  16. <1> Adds a hot phase with a rollover action
  17. <2> Adds a delete phase that will delete in the index 90 days after rollover
  18. <3> Creates the policy with the defined phases and the name `my_policy`
  19. [id="{upid}-{api}-response"]
  20. ==== Response
  21. The +{response}+ indicates if the request was received.
  22. ["source","java",subs="attributes,callouts,macros"]
  23. --------------------------------------------------
  24. include-tagged::{doc-tests-file}[{api}-response]
  25. --------------------------------------------------
  26. <1> Whether or not the request was acknowledged.
  27. include::../execution.asciidoc[]