stop-job.asciidoc 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. [role="xpack"]
  2. [[rollup-stop-job]]
  3. === Stop {rollup-jobs} API
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>Stop {rollup-jobs}</titleabbrev>
  7. ++++
  8. Stops an existing, started {rollup-job}.
  9. experimental[]
  10. NOTE: For version 8.5 and above we recommend <<downsampling,downsampling>> over
  11. rollups as a way to reduce your storage costs for time series data.
  12. [[rollup-stop-job-request]]
  13. ==== {api-request-title}
  14. `POST _rollup/job/<job_id>/_stop`
  15. [[rollup-stop-job-prereqs]]
  16. ==== {api-prereq-title}
  17. * If the {es} {security-features} are enabled, you must have `manage` or
  18. `manage_rollup` cluster privileges to use this API. For more information, see
  19. <<security-privileges>>.
  20. [[rollup-stop-job-desc]]
  21. ===== {api-description-title}
  22. If you try to stop a job that does not exist, an exception occurs. If you try
  23. to stop a job that is already stopped, nothing happens.
  24. [[rollup-stop-job-path-parms]]
  25. ==== {api-path-parms-title}
  26. `<job_id>`::
  27. (Required, string) Identifier for the {rollup-job}.
  28. [[rollup-stop-job-query-parms]]
  29. ==== {api-query-parms-title}
  30. `timeout`::
  31. (Optional, TimeValue) If `wait_for_completion` is `true`, the API blocks for
  32. (at maximum) the specified duration while waiting for the job to stop. If more
  33. than `timeout` time has passed, the API throws a timeout exception. Defaults
  34. to `30s`.
  35. +
  36. --
  37. NOTE: Even if a timeout exception is thrown, the stop request is still
  38. processing and eventually moves the job to `STOPPED`. The timeout simply means
  39. the API call itself timed out while waiting for the status change.
  40. --
  41. `wait_for_completion`::
  42. (Optional, Boolean) If set to `true`, causes the API to block until the
  43. indexer state completely stops. If set to `false`, the API returns immediately
  44. and the indexer is stopped asynchronously in the background. Defaults to
  45. `false`.
  46. [[rollup-stop-job-response-codes]]
  47. ==== {api-response-codes-title}
  48. `404` (Missing resources)::
  49. This code indicates that there are no resources that match the request. It
  50. occurs if you try to stop a job that doesn't exist.
  51. [[rollup-stop-job-examples]]
  52. ==== {api-examples-title}
  53. Since only a stopped job can be deleted, it can be useful to block the API until
  54. the indexer has fully stopped. This is accomplished with the
  55. `wait_for_completion` query parameter, and optionally a `timeout`:
  56. [source,console]
  57. --------------------------------------------------
  58. POST _rollup/job/sensor/_stop?wait_for_completion=true&timeout=10s
  59. --------------------------------------------------
  60. // TEST[setup:sensor_started_rollup_job]
  61. The parameter blocks the API call from returning until either the job has moved
  62. to `STOPPED` or the specified time has elapsed. If the specified time elapses
  63. without the job moving to `STOPPED`, a timeout exception is thrown.