2020-04-01 07:35:45 -04:00
|
|
|
[role="xpack"]
|
|
|
|
[testenv="platinum"]
|
|
|
|
[[autoscaling-put-autoscaling-policy]]
|
|
|
|
=== Put autoscaling policy API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Put autoscaling policy</titleabbrev>
|
|
|
|
++++
|
|
|
|
|
|
|
|
Put autoscaling policy.
|
|
|
|
|
|
|
|
[[autoscaling-put-autoscaling-policy-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
|
|
|
PUT /_autoscaling/policy/<name>
|
|
|
|
{
|
|
|
|
"policy": {
|
|
|
|
"deciders": {
|
|
|
|
"always": {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[s/<name>/name/]
|
|
|
|
|
|
|
|
[[autoscaling-put-autoscaling-policy-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have
|
|
|
|
`manage_autoscaling` cluster privileges. For more information, see
|
|
|
|
<<security-privileges>>.
|
|
|
|
|
|
|
|
[[autoscaling-put-autoscaling-policy-desc]]
|
|
|
|
==== {api-description-title}
|
|
|
|
|
|
|
|
This API puts an autoscaling policy with the provided name.
|
|
|
|
|
|
|
|
[[autoscaling-put-autoscaling-policy-examples]]
|
|
|
|
==== {api-examples-title}
|
|
|
|
|
2020-04-01 16:30:26 -04:00
|
|
|
This example puts an autoscaling policy named `my_autoscaling_policy` using the
|
|
|
|
always autoscaling decider.
|
2020-04-01 07:35:45 -04:00
|
|
|
|
|
|
|
[source,console]
|
|
|
|
--------------------------------------------------
|
2020-04-01 16:30:26 -04:00
|
|
|
PUT /_autoscaling/policy/my_autoscaling_policy
|
2020-04-01 07:35:45 -04:00
|
|
|
{
|
|
|
|
"policy": {
|
|
|
|
"deciders": {
|
|
|
|
"always": {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// TEST
|
|
|
|
|
|
|
|
The API returns the following result:
|
|
|
|
|
|
|
|
[source,console-result]
|
|
|
|
--------------------------------------------------
|
|
|
|
{
|
|
|
|
"acknowledged": true
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|