start-dfanalytics.asciidoc 3.0 KB

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