| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 | --:api: put-data-frame-transform:request: PutDataFrameTransformRequest:response: AcknowledgedResponse--[id="{upid}-{api}"]=== Put Data Frame Transform APIThe Put Data Frame Transform API is used to create a new {dataframe-transform}.The API accepts a +{request}+ object as a request and returns a +{response}+.[id="{upid}-{api}-request"]==== Put Data Frame RequestA +{request}+ requires the following argument:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-request]--------------------------------------------------<1> The configuration of the {dataframe-job} to create[id="{upid}-{api}-config"]==== Data Frame Transform ConfigurationThe `DataFrameTransformConfig` object contains all the details about the {dataframe-transform}configuration and contains the following arguments:["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-config]--------------------------------------------------<1> The {dataframe-transform} ID<2> The source indices and query from which to gather data<3> The destination index<4> The PivotConfig<5> Optional free text description of the transform[id="{upid}-{api}-query-config"]==== SourceConfigThe indices and the query from which to collect data.If query is not set, a `match_all` query is used by default.["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-source-config]--------------------------------------------------===== QueryConfigThe query with which to select data from the source.["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-query-config]--------------------------------------------------==== PivotConfigDefines the pivot function `group by` fields and the aggregation to reduce the data.["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-pivot-config]--------------------------------------------------<1> The `GroupConfig` to use in the pivot<2> The aggregations to use<3> The maximum paging size for the transform when pulling datafrom the source. The size dynamically adjusts as the transformis running to recover from and prevent OOM issues.===== GroupConfigThe grouping terms. Defines the group by and destination fieldswhich are produced by the pivot function. There are 3 types ofgroups* Terms* Histogram* Date Histogram["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-group-config]--------------------------------------------------<1> The destination field<2> Group by values of the `user_id` field===== AggregationConfigDefines the aggregations for the group fields.// TODO link to the supported aggregations["source","java",subs="attributes,callouts,macros"]--------------------------------------------------include-tagged::{doc-tests-file}[{api}-agg-config]--------------------------------------------------<1> Aggregate the average star ratinginclude::../execution.asciidoc[][id="{upid}-{api}-response"]==== ResponseThe returned +{response}+ acknowledges the successful creation ofthe new {dataframe-transform} or an error if the configuration is invalid.
 |