90 lines
2.1 KiB
Plaintext
90 lines
2.1 KiB
Plaintext
[role="xpack"]
|
|
[testenv="enterprise"]
|
|
[[autoscaling-put-autoscaling-policy]]
|
|
=== Put autoscaling policy API
|
|
++++
|
|
<titleabbrev>Put autoscaling policy</titleabbrev>
|
|
++++
|
|
|
|
include::../autoscaling-designed-for-note.asciidoc[]
|
|
|
|
Put autoscaling policy.
|
|
|
|
[[autoscaling-put-autoscaling-policy-request]]
|
|
==== {api-request-title}
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
PUT /_autoscaling/policy/<name>
|
|
{
|
|
"roles": [],
|
|
"deciders": {
|
|
"fixed": {
|
|
}
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// TEST[s/<name>/name/]
|
|
|
|
//////////////////////////
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
DELETE /_autoscaling/policy/name
|
|
--------------------------------------------------
|
|
// TEST[continued]
|
|
|
|
//////////////////////////
|
|
|
|
[[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.
|
|
See <<autoscaling-deciders,Autoscaling Deciders>> for available deciders.
|
|
|
|
[[autoscaling-put-autoscaling-policy-examples]]
|
|
==== {api-examples-title}
|
|
|
|
This example puts an autoscaling policy named `my_autoscaling_policy` using the
|
|
fixed autoscaling decider, applying to the set of nodes having (only) the
|
|
"data_hot" role.
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
PUT /_autoscaling/policy/my_autoscaling_policy
|
|
{
|
|
"roles" : [ "data_hot" ],
|
|
"deciders": {
|
|
"fixed": {
|
|
}
|
|
}
|
|
}
|
|
--------------------------------------------------
|
|
// TEST
|
|
|
|
The API returns the following result:
|
|
|
|
[source,console-result]
|
|
--------------------------------------------------
|
|
{
|
|
"acknowledged": true
|
|
}
|
|
--------------------------------------------------
|
|
|
|
//////////////////////////
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
DELETE /_autoscaling/policy/my_autoscaling_policy
|
|
--------------------------------------------------
|
|
// TEST[continued]
|
|
|
|
//////////////////////////
|