delete-job.asciidoc 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. [role="xpack"]
  2. [[rollup-delete-job]]
  3. === Delete {rollup-jobs} API
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>Delete {rollup-jobs}</titleabbrev>
  7. ++++
  8. Deletes an existing {rollup-job}.
  9. experimental[]
  10. [[rollup-delete-job-request]]
  11. ==== {api-request-title}
  12. `DELETE _rollup/job/<job_id>`
  13. [[rollup-delete-job-prereqs]]
  14. ==== {api-prereq-title}
  15. * If the {es} {security-features} are enabled, you must have `manage` or
  16. `manage_rollup` cluster privileges to use this API. For more information, see
  17. <<security-privileges>>.
  18. [[rollup-delete-job-desc]]
  19. ==== {api-description-title}
  20. A job must be *stopped* first before it can be deleted. If you attempt to delete
  21. a started job, an error occurs. Similarly, if you attempt to delete a
  22. nonexistent job, an exception occurs.
  23. [IMPORTANT]
  24. ===============================
  25. When a job is deleted, that only removes the process that is actively monitoring
  26. and rolling up data. It does not delete any previously rolled up data. This is
  27. by design; a user may wish to roll up a static dataset. Because the dataset is
  28. static, once it has been fully rolled up there is no need to keep the indexing
  29. rollup job around (as there will be no new data). So the job can be deleted,
  30. leaving behind the rolled up data for analysis.
  31. If you wish to also remove the rollup data, and the rollup index only contains
  32. the data for a single job, you can simply delete the whole rollup index. If the
  33. rollup index stores data from several jobs, you must issue a delete-by-query
  34. that targets the rollup job's ID in the rollup index.
  35. [source,js]
  36. --------------------------------------------------
  37. POST my_rollup_index/_delete_by_query
  38. {
  39. "query": {
  40. "term": {
  41. "_rollup.id": "the_rollup_job_id"
  42. }
  43. }
  44. }
  45. --------------------------------------------------
  46. // NOTCONSOLE
  47. ===============================
  48. [[rollup-delete-job-path-params]]
  49. ==== {api-path-parms-title}
  50. `<job_id>`::
  51. (Required, string) Identifier for the job.
  52. [[rollup-delete-job-response-codes]]
  53. ==== {api-response-codes-title}
  54. `404` (Missing resources)::
  55. This code indicates that there are no resources that match the request. It
  56. occurs if you try to delete a job that doesn't exist.
  57. [[rollup-delete-job-example]]
  58. ==== {api-example-title}
  59. If we have a rollup job named `sensor`, it can be deleted with:
  60. [source,console]
  61. --------------------------------------------------
  62. DELETE _rollup/job/sensor
  63. --------------------------------------------------
  64. // TEST[setup:sensor_rollup_job]
  65. Which will return the response:
  66. [source,console-result]
  67. ----
  68. {
  69. "acknowledged": true
  70. }
  71. ----