mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-30 10:23:41 -04:00
* [ML] adding for_export flag for ml plugin GET resource APIs (#63092) This adds the new `for_export` flag to the following APIs: - GET _ml/anomaly_detection/<job_id> - GET _ml/datafeeds/<datafeed_id> - GET _ml/data_frame/analytics/<analytics_id> The flag is designed for cloning or exporting configuration objects to later be put into the same cluster or a separate cluster. The following fields are not returned in the objects: - any field that is not user settable (e.g. version, create_time) - any field that is a calculated default value (e.g. datafeed chunking_config) - any field that would effectively require changing to be of use (e.g. datafeed job_id) - any field that is automatically set via another Elastic stack process (e.g. anomaly job custom_settings.created_by) closes https://github.com/elastic/elasticsearch/issues/63055 * [ML] adding new flag exclude_generated that removes generated fields in GET config APIs (#63899) When exporting and cloning ml configurations in a cluster it can be frustrating to remove all the fields that were generated by the plugin. Especially as the number of these fields change from version to version. This flag, exclude_generated, allows the GET config APIs to return configurations with these generated fields removed. APIs supporting this flag: - GET _ml/anomaly_detection/<job_id> - GET _ml/datafeeds/<datafeed_id> - GET _ml/data_frame/analytics/<analytics_id> The following fields are not returned in the objects: - any field that is not user settable (e.g. version, create_time) - any field that is a calculated default value (e.g. datafeed chunking_config) - any field that is automatically set via another Elastic stack process (e.g. anomaly job custom_settings.created_by) relates to #63055
42 lines
1.5 KiB
Text
42 lines
1.5 KiB
Text
--
|
|
:api: get-job
|
|
:request: GetJobRequest
|
|
:response: GetJobResponse
|
|
--
|
|
[role="xpack"]
|
|
[id="{upid}-{api}"]
|
|
=== Get {anomaly-jobs} API
|
|
|
|
Retrieves configuration information for {anomaly-jobs} in the cluster.
|
|
It accepts a +{request}+ object and responds with a +{response}+ object.
|
|
|
|
[id="{upid}-{api}-request"]
|
|
==== Get {anomaly-jobs} request
|
|
|
|
A +{request}+ object gets can have any number of `jobId` or `groupName`
|
|
entries. However, they all must be non-null. An empty list is the same as
|
|
requesting for all {anomaly-jobs}.
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
--------------------------------------------------
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
|
--------------------------------------------------
|
|
<1> Constructing a new request referencing existing `jobIds`. It can contain
|
|
wildcards.
|
|
<2> Whether to ignore if a wildcard expression matches no {anomaly-jobs}.
|
|
(This includes `_all` string or when no jobs have been specified).
|
|
<3> Optional boolean value for requesting the job in a format that can
|
|
then be put into another cluster. Certain fields that can only be set when
|
|
the job is created are removed.
|
|
|
|
[id="{upid}-{api}-response"]
|
|
==== Get {anomaly-jobs} response
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
--------------------------------------------------
|
|
include-tagged::{doc-tests-file}[{api}-response]
|
|
--------------------------------------------------
|
|
<1> `getCount()` from the +{response}+ indicates the number of jobs found.
|
|
<2> `getJobs()` is the collection of {ml} `Job` objects found.
|
|
|
|
include::../execution.asciidoc[]
|