start-job.asciidoc 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. [role="xpack"]
  2. [[rollup-start-job]]
  3. === Start Job API
  4. ++++
  5. <titleabbrev>Start Job</titleabbrev>
  6. ++++
  7. experimental[]
  8. This API starts an existing, stopped rollup job. If the job does not exist an exception will be thrown.
  9. Starting an already started job has no action.
  10. ==== Request
  11. `POST _xpack/rollup/job/<job_id>/_start`
  12. //===== Description
  13. ==== Path Parameters
  14. `job_id` (required)::
  15. (string) Identifier for the job
  16. ==== Request Body
  17. There is no request body for the Start Job API.
  18. ==== Authorization
  19. You must have `manage` or `manage_rollup` cluster privileges to use this API.
  20. For more information, see
  21. {xpack-ref}/security-privileges.html[Security Privileges].
  22. ==== Examples
  23. If we have already created a rollup job named `sensor`, it can be started with:
  24. [source,js]
  25. --------------------------------------------------
  26. POST _xpack/rollup/job/sensor/_start
  27. --------------------------------------------------
  28. // CONSOLE
  29. // TEST[setup:sensor_rollup_job]
  30. Which will return the response:
  31. [source,js]
  32. ----
  33. {
  34. "started": true
  35. }
  36. ----
  37. // TESTRESPONSE
  38. If however we try to start a job which doesn't exist:
  39. [source,js]
  40. --------------------------------------------------
  41. POST _xpack/rollup/job/does_not_exist/_start
  42. --------------------------------------------------
  43. // CONSOLE
  44. // TEST[catch:missing]
  45. A 404 `resource_not_found` exception will be thrown:
  46. [source,js]
  47. ----
  48. {
  49. "error" : {
  50. "root_cause" : [
  51. {
  52. "type" : "resource_not_found_exception",
  53. "reason" : "Task for Rollup Job [does_not_exist] not found",
  54. "stack_trace": ...
  55. }
  56. ],
  57. "type" : "resource_not_found_exception",
  58. "reason" : "Task for Rollup Job [does_not_exist] not found",
  59. "stack_trace": ...
  60. },
  61. "status": 404
  62. }
  63. ----
  64. // TESTRESPONSE[s/"stack_trace": \.\.\./"stack_trace": $body.$_path/]