put-autoscaling-policy.asciidoc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[autoscaling-put-autoscaling-policy]]
  4. === Put autoscaling policy API
  5. ++++
  6. <titleabbrev>Put autoscaling policy</titleabbrev>
  7. ++++
  8. Put autoscaling policy.
  9. [[autoscaling-put-autoscaling-policy-request]]
  10. ==== {api-request-title}
  11. [source,console]
  12. --------------------------------------------------
  13. PUT /_autoscaling/policy/<name>
  14. {
  15. "policy": {
  16. "deciders": {
  17. "always": {
  18. }
  19. }
  20. }
  21. }
  22. --------------------------------------------------
  23. // TEST[s/<name>/name/]
  24. [[autoscaling-put-autoscaling-policy-prereqs]]
  25. ==== {api-prereq-title}
  26. * If the {es} {security-features} are enabled, you must have
  27. `manage_autoscaling` cluster privileges. For more information, see
  28. <<security-privileges>>.
  29. [[autoscaling-put-autoscaling-policy-desc]]
  30. ==== {api-description-title}
  31. This API puts an autoscaling policy with the provided name.
  32. [[autoscaling-put-autoscaling-policy-examples]]
  33. ==== {api-examples-title}
  34. This example puts an autoscaling policy named `my_autoscaling_policy` using the
  35. always autoscaling decider.
  36. [source,console]
  37. --------------------------------------------------
  38. PUT /_autoscaling/policy/my_autoscaling_policy
  39. {
  40. "policy": {
  41. "deciders": {
  42. "always": {
  43. }
  44. }
  45. }
  46. }
  47. --------------------------------------------------
  48. // TEST
  49. The API returns the following result:
  50. [source,console-result]
  51. --------------------------------------------------
  52. {
  53. "acknowledged": true
  54. }
  55. --------------------------------------------------