put_lifecycle_policy.asciidoc 1.1 KB

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