get_lifecycle_policy.asciidoc 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --
  2. :api: ilm-get-lifecycle-policy
  3. :request: GetLifecyclePolicyRequest
  4. :response: GetLifecyclePolicyResponse
  5. --
  6. [role="xpack"]
  7. [id="{upid}-{api}"]
  8. === Get Lifecycle Policy API
  9. [id="{upid}-{api}-request"]
  10. ==== Request
  11. The Get Lifecycle Policy API allows you to retrieve the definition of an Index
  12. Lifecycle Management Policy from the cluster.
  13. ["source","java",subs="attributes,callouts,macros"]
  14. --------------------------------------------------
  15. include-tagged::{doc-tests-file}[{api}-request]
  16. --------------------------------------------------
  17. <1> Gets all policies.
  18. <2> Gets `my_policy` and `other_policy`
  19. [id="{upid}-{api}-response"]
  20. ==== Response
  21. The returned +{response}+ contains a map of `LifecyclePolicyMetadata`,
  22. accessible by the name of the policy, which contains data about each policy,
  23. as well as the policy definition.
  24. ["source","java",subs="attributes,callouts,macros"]
  25. --------------------------------------------------
  26. include-tagged::{doc-tests-file}[{api}-response]
  27. --------------------------------------------------
  28. <1> The retrieved policies are retrieved by name.
  29. <2> The policy definition itself.
  30. include::../execution.asciidoc[]