OpenSearch/docs/reference/autoscaling/apis/put-autoscaling-policy.asciidoc
Jason Tedor f670ae0bc8
Introduce autoscaling policies ()
This commit is the first in a series of commits that introduces
autoscaling policies, and APIs for working with them. For now, we
introduce the basic infrastructure, and a single API for putting an
autoscaling policy. We will follow in rapid succession with APIs for
getting, and deleting autoscaling policies.
2020-04-01 08:12:26 -04:00

68 lines
1.4 KiB
Plaintext

[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}
This example puts an autoscaling policy named `hot` using the always
autoscaling decider.
[source,console]
--------------------------------------------------
PUT /_autoscaling/policy/hot
{
"policy": {
"deciders": {
"always": {
}
}
}
}
--------------------------------------------------
// TEST
The API returns the following result:
[source,console-result]
--------------------------------------------------
{
"acknowledged": true
}
--------------------------------------------------