2018-02-23 17:10:37 -05:00
|
|
|
[role="xpack"]
|
2018-08-31 13:50:43 -04:00
|
|
|
[testenv="basic"]
|
2018-02-23 17:10:37 -05:00
|
|
|
[[rollup-delete-job]]
|
2019-07-10 18:12:32 -04:00
|
|
|
=== Delete {rollup-jobs} API
|
|
|
|
[subs="attributes"]
|
2018-02-23 17:10:37 -05:00
|
|
|
++++
|
2019-07-10 18:12:32 -04:00
|
|
|
<titleabbrev>Delete {rollup-jobs}</titleabbrev>
|
2018-02-23 17:10:37 -05:00
|
|
|
++++
|
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
Deletes an existing {rollup-job}.
|
|
|
|
|
2018-06-13 15:42:20 -04:00
|
|
|
experimental[]
|
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-delete-job-request]]
|
|
|
|
==== {api-request-title}
|
|
|
|
|
|
|
|
`DELETE _rollup/job/<job_id>`
|
|
|
|
|
|
|
|
[[rollup-delete-job-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
* If the {es} {security-features} are enabled, you must have `manage` or
|
|
|
|
`manage_rollup` cluster privileges to use this API. For more information, see
|
2019-10-07 18:23:19 -04:00
|
|
|
<<security-privileges>>.
|
2018-06-13 15:42:20 -04:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-delete-job-desc]]
|
|
|
|
==== {api-description-title}
|
2018-06-13 15:42:20 -04:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
A job must be *stopped* first before it can be deleted. If you attempt to delete
|
|
|
|
a started job, an error occurs. Similarly, if you attempt to delete a
|
|
|
|
nonexistent job, an exception occurs.
|
|
|
|
|
|
|
|
[IMPORTANT]
|
|
|
|
===============================
|
|
|
|
When a job is deleted, that only removes the process that is actively monitoring
|
|
|
|
and rolling up data. It does not delete any previously rolled up data. This is
|
|
|
|
by design; a user may wish to roll up a static dataset. Because the dataset is
|
|
|
|
static, once it has been fully rolled up there is no need to keep the indexing
|
|
|
|
rollup job around (as there will be no new data). So the job can be deleted,
|
|
|
|
leaving behind the rolled up data for analysis.
|
|
|
|
|
|
|
|
If you wish to also remove the rollup data, and the rollup index only contains
|
|
|
|
the data for a single job, you can simply delete the whole rollup index. If the
|
|
|
|
rollup index stores data from several jobs, you must issue a delete-by-query
|
|
|
|
that targets the rollup job's ID in the rollup index.
|
2018-06-13 15:42:20 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
POST my_rollup_index/_delete_by_query
|
|
|
|
{
|
|
|
|
"query": {
|
|
|
|
"term": {
|
|
|
|
"_rollup.id": "the_rollup_job_id"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// NOTCONSOLE
|
2019-07-10 18:12:32 -04:00
|
|
|
===============================
|
2018-06-13 15:42:20 -04:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-delete-job-path-params]]
|
|
|
|
==== {api-path-parms-title}
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
`<job_id>`::
|
2019-07-12 11:26:31 -04:00
|
|
|
(Required, string) Identifier for the job.
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-delete-job-response-codes]]
|
|
|
|
==== {api-response-codes-title}
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
`404` (Missing resources)::
|
|
|
|
This code indicates that there are no resources that match the request. It
|
|
|
|
occurs if you try to delete a job that doesn't exist.
|
2018-02-23 17:10:37 -05:00
|
|
|
|
2019-07-10 18:12:32 -04:00
|
|
|
[[rollup-delete-job-example]]
|
|
|
|
==== {api-example-title}
|
2018-02-23 17:10:37 -05:00
|
|
|
|
|
|
|
If we have a rollup job named `sensor`, it can be deleted with:
|
|
|
|
|
2019-09-09 12:35:50 -04:00
|
|
|
[source,console]
|
2018-02-23 17:10:37 -05:00
|
|
|
--------------------------------------------------
|
2018-12-11 19:43:17 -05:00
|
|
|
DELETE _rollup/job/sensor
|
2018-02-23 17:10:37 -05:00
|
|
|
--------------------------------------------------
|
|
|
|
// TEST[setup:sensor_rollup_job]
|
|
|
|
|
|
|
|
Which will return the response:
|
|
|
|
|
2019-09-06 09:22:08 -04:00
|
|
|
[source,console-result]
|
2018-02-23 17:10:37 -05:00
|
|
|
----
|
|
|
|
{
|
|
|
|
"acknowledged": true
|
|
|
|
}
|
|
|
|
----
|