start-dfanalytics.asciidoc 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. [role="xpack"]
  2. [[start-dfanalytics]]
  3. = Start {dfanalytics-jobs} API
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>Start {dfanalytics-jobs}</titleabbrev>
  7. ++++
  8. Starts a {dfanalytics-job}.
  9. [[ml-start-dfanalytics-request]]
  10. == {api-request-title}
  11. `POST _ml/data_frame/analytics/<data_frame_analytics_id>/_start`
  12. [[ml-start-dfanalytics-prereq]]
  13. == {api-prereq-title}
  14. Requires the following privileges:
  15. * cluster: `manage_ml` (the `machine_learning_admin` built-in role grants this
  16. privilege)
  17. * source indices: `read`, `view_index_metadata`
  18. * destination index: `read`, `create_index`, `manage` and `index`
  19. [[ml-start-dfanalytics-desc]]
  20. == {api-description-title}
  21. A {dfanalytics-job} can be started and stopped multiple times throughout its
  22. lifecycle.
  23. If the destination index does not exist, it is created automatically the first
  24. time you start the {dfanalytics-job}. The `index.number_of_shards` and
  25. `index.number_of_replicas` settings for the destination index are copied from
  26. the source index. If there are multiple source indices, the destination index
  27. copies the highest setting values. The mappings for the destination index are
  28. also copied from the source indices. If there are any mapping conflicts, the job
  29. fails to start.
  30. If the destination index exists, it is used as is. You can therefore set up the
  31. destination index in advance with custom settings and mappings.
  32. IMPORTANT: When {es} {security-features} are enabled, the {dfanalytics-job}
  33. remembers which user created it and runs the job using those credentials. If you
  34. provided <<http-clients-secondary-authorization,secondary authorization headers>>
  35. when you created the job, those credentials are used.
  36. [[ml-start-dfanalytics-path-params]]
  37. == {api-path-parms-title}
  38. `<data_frame_analytics_id>`::
  39. (Required, string)
  40. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics-define]
  41. [[ml-start-dfanalytics-query-params]]
  42. == {api-query-parms-title}
  43. `timeout`::
  44. (Optional, <<time-units,time units>>)
  45. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=timeout-start]
  46. [[ml-start-dfanalytics-response-body]]
  47. == {api-response-body-title}
  48. `acknowledged`::
  49. (Boolean) For a successful response, this value is always `true`. On failure, an
  50. exception is returned instead.
  51. `node`::
  52. (string) The ID of the node that the job was started on.
  53. If the job is allowed to open lazily and has not yet been assigned to a node, this value is an empty string.
  54. [[ml-start-dfanalytics-example]]
  55. == {api-examples-title}
  56. The following example starts the `loganalytics` {dfanalytics-job}:
  57. [source,console]
  58. --------------------------------------------------
  59. POST _ml/data_frame/analytics/loganalytics/_start
  60. --------------------------------------------------
  61. // TEST[skip:setup:logdata_job]
  62. When the {dfanalytics-job} starts, you receive the following results:
  63. [source,console-result]
  64. ----
  65. {
  66. "acknowledged" : true,
  67. "node" : "node-1"
  68. }
  69. ----