update-dfanalytics.asciidoc 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. [role="xpack"]
  2. [[update-dfanalytics]]
  3. = Update {dfanalytics-jobs} API
  4. [subs="attributes"]
  5. ++++
  6. <titleabbrev>Update {dfanalytics-jobs}</titleabbrev>
  7. ++++
  8. Updates an existing {dfanalytics-job}.
  9. [[ml-update-dfanalytics-request]]
  10. == {api-request-title}
  11. `POST _ml/data_frame/analytics/<data_frame_analytics_id>/_update`
  12. [[ml-update-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. NOTE: The {dfanalytics-job} remembers which roles the user who updated it had at
  20. the time of the update. When you start the job, it performs the analysis using
  21. those same roles. If you provide
  22. <<http-clients-secondary-authorization,secondary authorization headers>>,
  23. those credentials are used instead.
  24. [[ml-update-dfanalytics-desc]]
  25. == {api-description-title}
  26. This API updates an existing {dfanalytics-job} that performs an analysis on the source
  27. indices and stores the outcome in a destination index.
  28. [[ml-update-dfanalytics-path-params]]
  29. == {api-path-parms-title}
  30. `<data_frame_analytics_id>`::
  31. (Required, string)
  32. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-data-frame-analytics-define]
  33. [role="child_attributes"]
  34. [[ml-update-dfanalytics-request-body]]
  35. == {api-request-body-title}
  36. `allow_lazy_start`::
  37. (Optional, Boolean)
  38. Specifies whether this job can start when there is insufficient {ml} node
  39. capacity for it to be immediately assigned to a node. The default is `false`; if
  40. a {ml} node with capacity to run the job cannot immediately be found, the API
  41. returns an error. However, this is also subject to the cluster-wide
  42. `xpack.ml.max_lazy_ml_nodes` setting. See <<advanced-ml-settings>>. If this
  43. option is set to `true`, the API does not return an error and the job waits in
  44. the `starting` state until sufficient {ml} node capacity is available.
  45. `description`::
  46. (Optional, string)
  47. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=description-dfa]
  48. `max_num_threads`::
  49. (Optional, integer)
  50. The maximum number of threads to be used by the analysis.
  51. The default value is `1`. Using more threads may decrease the time
  52. necessary to complete the analysis at the cost of using more CPU.
  53. Note that the process may use additional threads for operational
  54. functionality other than the analysis itself.
  55. `model_memory_limit`::
  56. (Optional, string)
  57. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-memory-limit-dfa]
  58. [[ml-update-dfanalytics-example]]
  59. == {api-examples-title}
  60. [[ml-update-dfanalytics-example-preprocess]]
  61. === Updating model memory limit example
  62. The following example shows how to update the model memory limit for the existing {dfanalytics} configuration.
  63. [source,console]
  64. --------------------------------------------------
  65. POST _ml/data_frame/analytics/loganalytics/_update
  66. {
  67. "model_memory_limit": "200mb"
  68. }
  69. --------------------------------------------------
  70. // TEST[skip:setup kibana sample data]
  71. When the job is updated, the response contains its configuration with
  72. the updated values. For example:
  73. [source,console-result]
  74. ----
  75. {
  76. "id" : "loganalytics",
  77. "create_time" : 1656364565517,
  78. "version" : "8.4.0",
  79. "authorization" : {
  80. "roles" : [
  81. "superuser"
  82. ]
  83. },
  84. "description" : "Outlier detection on log data",
  85. "source" : {
  86. "index" : [
  87. "logdata"
  88. ],
  89. "query" : {
  90. "match_all" : { }
  91. }
  92. },
  93. "dest" : {
  94. "index" : "logdata_out",
  95. "results_field" : "ml"
  96. },
  97. "analysis" : {
  98. "outlier_detection" : {
  99. "compute_feature_influence" : true,
  100. "outlier_fraction" : 0.05,
  101. "standardization_enabled" : true
  102. }
  103. },
  104. "model_memory_limit" : "200mb",
  105. "allow_lazy_start" : false,
  106. "max_num_threads" : 1
  107. }
  108. ----