|
@@ -6,14 +6,25 @@
|
|
|
<titleabbrev>Create policy</titleabbrev>
|
|
|
++++
|
|
|
|
|
|
-Creates or updates lifecycle policy. See <<ilm-policy-definition,Policy phases and actions>>
|
|
|
-for definitions of policy components.
|
|
|
+Creates or updates lifecycle policy. See <<ilm-policy-definition>> for
|
|
|
+definitions of policy components.
|
|
|
|
|
|
-==== Request
|
|
|
+[[ilm-put-lifecycle-request]]
|
|
|
+==== {api-request-title}
|
|
|
|
|
|
`PUT _ilm/policy/<policy_id>`
|
|
|
|
|
|
-==== Description
|
|
|
+[[ilm-put-lifecycle-prereqs]]
|
|
|
+==== {api-prereq-title}
|
|
|
+
|
|
|
+* If the {es} {security-features} are enabled, you must have the `manage_ilm`
|
|
|
+cluster privilege to use this API. You must also have the `manage` index
|
|
|
+privilege on all indices being managed by `policy`. All operations executed by
|
|
|
+{ilm} for a policy are executed as the user that put the latest version of a
|
|
|
+policy. For more information, see <<security-privileges>>.
|
|
|
+
|
|
|
+[[ilm-put-lifecycle-desc]]
|
|
|
+==== {api-description-title}
|
|
|
|
|
|
Creates a lifecycle policy. If the specified policy exists, the policy is
|
|
|
replaced and the policy version is incremented.
|
|
@@ -21,24 +32,19 @@ replaced and the policy version is incremented.
|
|
|
NOTE: Only the latest version of the policy is stored, you cannot revert to
|
|
|
previous versions.
|
|
|
|
|
|
-==== Path Parameters
|
|
|
+[[ilm-put-lifecycle-path-params]]
|
|
|
+==== {api-path-parms-title}
|
|
|
|
|
|
-`policy` (required)::
|
|
|
- (string) Identifier for the policy.
|
|
|
+`<policy_id>`::
|
|
|
+ (Required, string) Identifier for the policy.
|
|
|
|
|
|
-==== Request Parameters
|
|
|
+[[ilm-put-lifecycle-query-params]]
|
|
|
+==== {api-query-parms-title}
|
|
|
|
|
|
include::{docdir}/rest-api/common-parms.asciidoc[tag=timeoutparms]
|
|
|
|
|
|
-==== Authorization
|
|
|
-
|
|
|
-You must have the `manage_ilm` cluster privilege to use this API. You must
|
|
|
-also have the `manage` index privilege on all indices being managed by `policy`.
|
|
|
-All operations executed by {ilm} for a policy are executed as the user that
|
|
|
-put the latest version of a policy.
|
|
|
-For more information, see <<security-privileges>>.
|
|
|
-
|
|
|
-==== Examples
|
|
|
+[[ilm-put-lifecycle-example]]
|
|
|
+==== {api-examples-title}
|
|
|
|
|
|
The following example creates a new policy named `my_policy`:
|
|
|
|