2019-03-14 10:57:12 -04:00
|
|
|
--
|
|
|
|
:api: put-data-frame-transform
|
|
|
|
:request: PutDataFrameTransformRequest
|
|
|
|
:response: AcknowledgedResponse
|
|
|
|
--
|
2019-09-11 14:21:45 -04:00
|
|
|
[role="xpack"]
|
2019-03-14 10:57:12 -04:00
|
|
|
[id="{upid}-{api}"]
|
2019-07-25 13:08:38 -04:00
|
|
|
=== Put {dataframe-transform} API
|
2019-03-14 10:57:12 -04:00
|
|
|
|
2019-07-25 13:08:38 -04:00
|
|
|
Creates a new {dataframe-transform}.
|
2019-03-14 10:57:12 -04:00
|
|
|
|
|
|
|
The API accepts a +{request}+ object as a request and returns a +{response}+.
|
|
|
|
|
|
|
|
[id="{upid}-{api}-request"]
|
2019-07-25 13:08:38 -04:00
|
|
|
==== Put {dataframe-transform} request
|
2019-03-14 10:57:12 -04:00
|
|
|
|
|
|
|
A +{request}+ requires the following argument:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
|
|
|
--------------------------------------------------
|
2019-07-12 12:54:35 -04:00
|
|
|
<1> The configuration of the {dataframe-transform} to create
|
2019-07-22 16:12:55 -04:00
|
|
|
<2> Whether or not to wait to run deferrable validations until `_start` is called.
|
|
|
|
This option should be used with care as the created {dataframe-transform} will run
|
|
|
|
with the privileges of the user creating it. Meaning, if they do not have privileges,
|
|
|
|
such an error will not be visible until `_start` is called.
|
2019-03-14 10:57:12 -04:00
|
|
|
|
|
|
|
[id="{upid}-{api}-config"]
|
2019-07-25 13:08:38 -04:00
|
|
|
==== {dataframe-transform-cap} configuration
|
2019-03-14 10:57:12 -04:00
|
|
|
|
2019-07-25 13:08:38 -04:00
|
|
|
The `DataFrameTransformConfig` object contains all the details about the
|
|
|
|
{dataframe-transform} configuration and contains the following arguments:
|
2019-03-14 10:57:12 -04:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-config]
|
|
|
|
--------------------------------------------------
|
|
|
|
<1> The {dataframe-transform} ID
|
2019-03-25 08:16:41 -04:00
|
|
|
<2> The source indices and query from which to gather data
|
2019-06-19 17:18:27 -04:00
|
|
|
<3> The destination index and optional pipeline
|
2019-07-10 04:35:23 -04:00
|
|
|
<4> How often to check for updates to the source indices
|
|
|
|
<5> The PivotConfig
|
|
|
|
<6> Optional free text description of the transform
|
2019-03-14 10:57:12 -04:00
|
|
|
|
|
|
|
[id="{upid}-{api}-query-config"]
|
2019-03-25 08:16:41 -04:00
|
|
|
|
|
|
|
==== SourceConfig
|
|
|
|
|
|
|
|
The 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]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-06-19 17:18:27 -04:00
|
|
|
==== DestConfig
|
|
|
|
|
|
|
|
The index where to write the data and the optional pipeline
|
|
|
|
through which the docs should be indexed
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-dest-config]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
2019-03-25 08:16:41 -04:00
|
|
|
===== QueryConfig
|
2019-03-14 10:57:12 -04:00
|
|
|
|
|
|
|
The query with which to select data from the source.
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-query-config]
|
|
|
|
--------------------------------------------------
|
|
|
|
|
|
|
|
==== PivotConfig
|
|
|
|
|
|
|
|
Defines 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]
|
|
|
|
--------------------------------------------------
|
2019-05-10 14:22:31 -04:00
|
|
|
<1> The `GroupConfig` to use in the pivot
|
|
|
|
<2> The aggregations to use
|
|
|
|
<3> The maximum paging size for the transform when pulling data
|
|
|
|
from the source. The size dynamically adjusts as the transform
|
|
|
|
is running to recover from and prevent OOM issues.
|
2019-03-14 10:57:12 -04:00
|
|
|
|
|
|
|
===== GroupConfig
|
|
|
|
The grouping terms. Defines the group by and destination fields
|
|
|
|
which are produced by the pivot function. There are 3 types of
|
|
|
|
groups
|
|
|
|
|
|
|
|
* 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
|
|
|
|
|
|
|
|
===== AggregationConfig
|
|
|
|
|
|
|
|
Defines 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 rating
|
|
|
|
|
|
|
|
include::../execution.asciidoc[]
|
|
|
|
|
|
|
|
[id="{upid}-{api}-response"]
|
|
|
|
==== Response
|
|
|
|
|
|
|
|
The returned +{response}+ acknowledges the successful creation of
|
|
|
|
the new {dataframe-transform} or an error if the configuration is invalid.
|