delete-job.asciidoc 2.9 KB

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