[[reference-ml-update_job]]

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    This file is autogenerated, DO NOT send pull requests that changes this file directly.                             ||
||    You should update the script that does the generation, which can be found in:                                      ||
||    https://github.com/elastic/elastic-client-generator-js                                                             ||
||                                                                                                                       ||
||    You can run the script with the following command:                                                                 ||
||       npm run elasticsearch -- --version <version>                                                                    ||
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
===========================================================================================================================
////////

[discrete]
=== client.ml.updateJob

Update an anomaly detection job. Updates certain properties of an anomaly detection job.

{ref}/ml-update-job.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(MlUpdateJobRequest, options?): Promise<MlUpdateJobResponse>
----

[discrete]
===== `MlUpdateJobRequest`

[source,ts]
----
interface MlUpdateJobRequest extends <<shared-type-request-base, RequestBase>> {
  job_id: <<shared-type-id, Id>>
  allow_lazy_open?: boolean
  analysis_limits?: MlAnalysisMemoryLimit
  background_persist_interval?: <<shared-type-duration, Duration>>
  custom_settings?: Record<string, any>
  categorization_filters?: string[]
  description?: string
  model_plot_config?: MlModelPlotConfig
  model_prune_window?: <<shared-type-duration, Duration>>
  daily_model_snapshot_retention_after_days?: <<shared-type-long, long>>
  model_snapshot_retention_days?: <<shared-type-long, long>>
  renormalization_window_days?: <<shared-type-long, long>>
  results_retention_days?: <<shared-type-long, long>>
  groups?: string[]
  detectors?: MlDetector[]
  per_partition_categorization?: MlPerPartitionCategorization
}
----

[discrete]
===== `MlUpdateJobResponse`

[source,ts]
----
interface MlUpdateJobResponse {
  allow_lazy_open: boolean
  analysis_config: MlAnalysisConfigRead
  analysis_limits: MlAnalysisLimits
  background_persist_interval?: <<shared-type-duration, Duration>>
  create_time: <<shared-type-epoch-time, EpochTime>><<<shared-type-unit-millis, UnitMillis>>>
  finished_time?: <<shared-type-epoch-time, EpochTime>><<<shared-type-unit-millis, UnitMillis>>>
  custom_settings?: Record<string, string>
  daily_model_snapshot_retention_after_days: <<shared-type-long, long>>
  data_description: MlDataDescription
  datafeed_config?: MlDatafeed
  description?: string
  groups?: string[]
  job_id: <<shared-type-id, Id>>
  job_type: string
  job_version: <<shared-type-version-string, VersionString>>
  model_plot_config?: MlModelPlotConfig
  model_snapshot_id?: <<shared-type-id, Id>>
  model_snapshot_retention_days: <<shared-type-long, long>>
  renormalization_window_days?: <<shared-type-long, long>>
  results_index_name: <<shared-type-index-name, IndexName>>
  results_retention_days?: <<shared-type-long, long>>
}
----

