elasticsearch/docs/reference/ml/anomaly-detection/apis/get-datafeed.asciidoc
Liam Thompson 33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00

127 lines
No EOL
3 KiB
Text

[role="xpack"]
[[ml-get-datafeed]]
= Get {dfeeds} API
[subs="attributes"]
++++
<titleabbrev>Get {dfeeds}</titleabbrev>
++++
Retrieves configuration information for {dfeeds}.
[[ml-get-datafeed-request]]
== {api-request-title}
`GET _ml/datafeeds/<feed_id>` +
`GET _ml/datafeeds/<feed_id>,<feed_id>` +
`GET _ml/datafeeds/` +
`GET _ml/datafeeds/_all`
[[ml-get-datafeed-prereqs]]
== {api-prereq-title}
Requires the `monitor_ml` cluster privilege. This privilege is included in the
`machine_learning_user` built-in role.
[[ml-get-datafeed-desc]]
== {api-description-title}
IMPORTANT: This API returns a maximum of 10,000 {dfeeds}.
[[ml-get-datafeed-path-parms]]
== {api-path-parms-title}
`<feed_id>`::
(Optional, string)
include::{es-ref-dir}/ml/ml-shared.asciidoc[tag=datafeed-id-wildcard]
+
You can get information for multiple {dfeeds} in a single API request by using a
comma-separated list of {dfeeds} or a wildcard expression. You can get
information for all {dfeeds} by using `_all`, by specifying `*` as the
{dfeed} identifier, or by omitting the identifier.
[[ml-get-datafeed-query-parms]]
== {api-query-parms-title}
`allow_no_match`::
(Optional, Boolean)
include::{es-ref-dir}/ml/ml-shared.asciidoc[tag=allow-no-match-datafeeds]
`exclude_generated`::
(Optional, Boolean)
include::{es-ref-dir}/ml/ml-shared.asciidoc[tag=exclude-generated]
[[ml-get-datafeed-results]]
== {api-response-body-title}
The API returns an array of {dfeed} resources. For the full list of properties,
see <<ml-put-datafeed-request-body,create {dfeeds} API>>.
[[ml-get-datafeed-response-codes]]
== {api-response-codes-title}
`404` (Missing resources)::
If `allow_no_match` is `false`, this code indicates that there are no
resources that match the request or only partial matches for the request.
[[ml-get-datafeed-example]]
== {api-examples-title}
[source,console]
--------------------------------------------------
GET _ml/datafeeds/datafeed-high_sum_total_sales
--------------------------------------------------
// TEST[skip:kibana sample data]
The API returns the following results:
[source,console-result]
----
{
"count" : 1,
"datafeeds" : [
{
"datafeed_id" : "datafeed-high_sum_total_sales",
"job_id" : "high_sum_total_sales",
"authorization" : {
"roles" : [
"superuser"
]
},
"query_delay" : "93169ms",
"chunking_config" : {
"mode" : "auto"
},
"indices_options" : {
"expand_wildcards" : [
"open"
],
"ignore_unavailable" : false,
"allow_no_indices" : true,
"ignore_throttled" : true
},
"query" : {
"bool" : {
"filter" : [
{
"term" : {
"event.dataset" : "sample_ecommerce"
}
}
]
}
},
"indices" : [
"kibana_sample_data_ecommerce"
],
"scroll_size" : 1000,
"delayed_data_check_config" : {
"enabled" : true
}
}
]
}
----