OpenSearch/docs/en/rest-api/rollup/delete-job.asciidoc
Zachary Tong bf1550a0b2 Rollups for Elasticsearch (elastic/x-pack-elasticsearch#4002)
This adds a new Rollup module to XPack, which allows users to configure periodic "rollup jobs" to pre-aggregate data.  That data is then available later for search through a special RollupSearch API, which mimics the DSL and functionality of regular search.

Rollups are used to drastically reduce the on-disk footprint of metric-based data (e.g. timestamped document with numeric and keyword fields).  It can also be used to speed up aggregations over large datasets, since the rolled data will be considerably smaller and fewer documents to search.

The PR adds seven new endpoints to interact with Rollups; create/get/delete job, start/stop job, a capabilities API similar to field-caps, and a Rollup-enabled search.

Original commit: elastic/x-pack-elasticsearch@dcde91aacf
2018-02-23 17:10:37 -05:00

85 lines
1.8 KiB
Plaintext

[role="xpack"]
[[rollup-delete-job]]
=== Delete Job API
++++
<titleabbrev>Delete Job</titleabbrev>
++++
This API deletes an existing rollup job. The job can be started or stopped, in both cases it will be deleted. Attempting
to delete a non-existing job will throw an exception
==== Request
`DELETE _xpack/rollup/job/<job_id>`
//===== Description
==== Path Parameters
`job_id` (required)::
(string) Identifier for the job
==== Request Body
There is no request body for the Delete Job API.
==== Authorization
You must have `manage` or `manage_rollup` cluster privileges to use this API.
For more information, see
{xpack-ref}/security-privileges.html[Security Privileges].
==== Examples
If we have a rollup job named `sensor`, it can be deleted with:
[source,js]
--------------------------------------------------
DELETE _xpack/rollup/job/sensor
--------------------------------------------------
// CONSOLE
// TEST[setup:sensor_rollup_job]
Which will return the response:
[source,js]
----
{
"acknowledged": true
}
----
// TESTRESPONSE
If however we try to delete a job which doesn't exist:
[source,js]
--------------------------------------------------
DELETE _xpack/rollup/job/does_not_exist
--------------------------------------------------
// CONSOLE
// TEST[catch:missing]
A 404 `resource_not_found` exception will be thrown:
[source,js]
----
{
"error" : {
"root_cause" : [
{
"type" : "resource_not_found_exception",
"reason" : "the task with id does_not_exist doesn't exist",
"stack_trace": ...
}
],
"type" : "resource_not_found_exception",
"reason" : "the task with id does_not_exist doesn't exist",
"stack_trace": ...
},
"status": 404
}
----
// TESTRESPONSE[s/"stack_trace": .../"stack_trace": $body.$_path/]