put-autoscaling-policy.asciidoc 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. //////////////////////////
  25. [source,console]
  26. --------------------------------------------------
  27. DELETE /_autoscaling/policy/name
  28. --------------------------------------------------
  29. // TEST[continued]
  30. //////////////////////////
  31. [[autoscaling-put-autoscaling-policy-prereqs]]
  32. ==== {api-prereq-title}
  33. * If the {es} {security-features} are enabled, you must have
  34. `manage_autoscaling` cluster privileges. For more information, see
  35. <<security-privileges>>.
  36. [[autoscaling-put-autoscaling-policy-desc]]
  37. ==== {api-description-title}
  38. This API puts an autoscaling policy with the provided name.
  39. [[autoscaling-put-autoscaling-policy-examples]]
  40. ==== {api-examples-title}
  41. This example puts an autoscaling policy named `my_autoscaling_policy` using the
  42. always autoscaling decider.
  43. [source,console]
  44. --------------------------------------------------
  45. PUT /_autoscaling/policy/my_autoscaling_policy
  46. {
  47. "policy": {
  48. "deciders": {
  49. "always": {
  50. }
  51. }
  52. }
  53. }
  54. --------------------------------------------------
  55. // TEST
  56. The API returns the following result:
  57. [source,console-result]
  58. --------------------------------------------------
  59. {
  60. "acknowledged": true
  61. }
  62. --------------------------------------------------
  63. //////////////////////////
  64. [source,console]
  65. --------------------------------------------------
  66. DELETE /_autoscaling/policy/my_autoscaling_policy
  67. --------------------------------------------------
  68. // TEST[continued]
  69. //////////////////////////