[[reference-ml-put_data_frame_analytics]]

////////
===========================================================================================================================
||                                                                                                                       ||
||                                                                                                                       ||
||                                                                                                                       ||
||        ██████╗ ███████╗ █████╗ ██████╗ ███╗   ███╗███████╗                                                            ||
||        ██╔══██╗██╔════╝██╔══██╗██╔══██╗████╗ ████║██╔════╝                                                            ||
||        ██████╔╝█████╗  ███████║██║  ██║██╔████╔██║█████╗                                                              ||
||        ██╔══██╗██╔══╝  ██╔══██║██║  ██║██║╚██╔╝██║██╔══╝                                                              ||
||        ██║  ██║███████╗██║  ██║██████╔╝██║ ╚═╝ ██║███████╗                                                            ||
||        ╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚═════╝ ╚═╝     ╚═╝╚══════╝                                                            ||
||                                                                                                                       ||
||                                                                                                                       ||
||    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.putDataFrameAnalytics]]
=== client.ml.putDataFrameAnalytics

Create a data frame analytics job. This API creates a data frame analytics job that performs an analysis on the source indices and stores the outcome in a destination index.

{ref}/put-dfanalytics.html[{es} documentation]

[discrete]
==== Function signature

[source,ts]
----
(MlPutDataFrameAnalyticsRequest, options?): Promise<MlPutDataFrameAnalyticsResponse>
----

[discrete]
==== Request

[pass]
++++
<pre>
++++
interface MlPutDataFrameAnalyticsRequest extends <<RequestBase>> {
  id: <<Id>>
  allow_lazy_start?: boolean
  analysis: <<MlDataframeAnalysisContainer>>
  analyzed_fields?: <<MlDataframeAnalysisAnalyzedFields>> | string[]
  description?: string
  dest: <<MlDataframeAnalyticsDestination>>
  max_num_threads?: <<integer>>
  model_memory_limit?: string
  source: <<MlDataframeAnalyticsSource>>
  headers?: <<HttpHeaders>>
  version?: <<VersionString>>
}

[pass]
++++
</pre>
++++
[discrete]
==== Response

[pass]
++++
<pre>
++++
interface MlPutDataFrameAnalyticsResponse {
  authorization?: <<MlDataframeAnalyticsAuthorization>>
  allow_lazy_start: boolean
  analysis: <<MlDataframeAnalysisContainer>>
  analyzed_fields?: <<MlDataframeAnalysisAnalyzedFields>> | string[]
  create_time: <<EpochTime>><<<UnitMillis>>>
  description?: string
  dest: <<MlDataframeAnalyticsDestination>>
  id: <<Id>>
  max_num_threads: <<integer>>
  model_memory_limit: string
  source: <<MlDataframeAnalyticsSource>>
  version: <<VersionString>>
}

[pass]
++++
</pre>
++++
