OpenSearch/docs/reference/rollup/apis/start-job.asciidoc
Nik Everett 03daad9812
Re-deprecate xpack rollup endpoints (#36451)
Redeprecates the `/_xpack/rollup` endpoints in favor of `/_rollup`.

When we cleanup the rollup in a cluster containing 6.x nodes we need to
use `/_xpack/rollup` instead of `/_rollup` because the 6.x nodes don't
know about `/_rollup`. In those cases we must ignore the deprecation
warnings that the 7.0 node will return for the end point.

Closes #36044
2018-12-11 19:43:17 -05:00

87 lines
1.8 KiB
Plaintext

[role="xpack"]
[testenv="basic"]
[[rollup-start-job]]
=== Start Job API
++++
<titleabbrev>Start Job</titleabbrev>
++++
experimental[]
This API starts an existing, stopped rollup job. If the job does not exist an exception will be thrown.
Starting an already started job has no action.
==== Request
`POST _rollup/job/<job_id>/_start`
//===== Description
==== Path Parameters
`job_id` (required)::
(string) Identifier for the job
==== Request Body
There is no request body for the Start 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 already created a rollup job named `sensor`, it can be started with:
[source,js]
--------------------------------------------------
POST _rollup/job/sensor/_start
--------------------------------------------------
// CONSOLE
// TEST[setup:sensor_rollup_job]
Which will return the response:
[source,js]
----
{
"started": true
}
----
// TESTRESPONSE
If however we try to start a job which doesn't exist:
[source,js]
--------------------------------------------------
POST _rollup/job/does_not_exist/_start
--------------------------------------------------
// CONSOLE
// TEST[catch:missing]
A 404 `resource_not_found` exception will be thrown:
[source,js]
----
{
"error" : {
"root_cause" : [
{
"type" : "resource_not_found_exception",
"reason" : "Task for Rollup Job [does_not_exist] not found",
"stack_trace": ...
}
],
"type" : "resource_not_found_exception",
"reason" : "Task for Rollup Job [does_not_exist] not found",
"stack_trace": ...
},
"status": 404
}
----
// TESTRESPONSE[s/"stack_trace": \.\.\./"stack_trace": $body.$_path/]