Skip to content

Commit 3d96e6b

Browse files
lcawlszabosteve
andauthored
[DOCS] Move datafeed resource definitions into APIs (#50005)
Co-Authored-By: István Zoltán Szabó <[email protected]>
1 parent a3dd2f3 commit 3d96e6b

13 files changed

+415
-377
lines changed

docs/reference/ml/anomaly-detection/apis/datafeedresource.asciidoc

Lines changed: 0 additions & 161 deletions
This file was deleted.

docs/reference/ml/anomaly-detection/apis/delete-datafeed.asciidoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,15 @@ can delete it.
2828
==== {api-path-parms-title}
2929

3030
`<feed_id>`::
31-
(Required, string) Identifier for the {dfeed}.
31+
(Required, string)
32+
include::{docdir}/ml/ml-shared.asciidoc[tag=datafeed-id]
3233

3334
[[ml-delete-datafeed-query-parms]]
3435
==== {api-query-parms-title}
3536

3637
`force`::
37-
(Optional, boolean) Use to forcefully delete a started {dfeed}; this method is
38-
quicker than stopping and deleting the {dfeed}.
38+
(Optional, boolean) Use to forcefully delete a started {dfeed}; this method is
39+
quicker than stopping and deleting the {dfeed}.
3940

4041
[[ml-delete-datafeed-example]]
4142
==== {api-examples-title}

docs/reference/ml/anomaly-detection/apis/get-datafeed-stats.asciidoc

Lines changed: 67 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -45,36 +45,61 @@ IMPORTANT: This API returns a maximum of 10,000 {dfeeds}.
4545
==== {api-path-parms-title}
4646

4747
`<feed_id>`::
48-
(Optional, string) Identifier for the {dfeed}. It can be a {dfeed} identifier
49-
or a wildcard expression. If you do not specify one of these options, the API
50-
returns statistics for all {dfeeds}.
48+
(Optional, string)
49+
include::{docdir}/ml/ml-shared.asciidoc[tag=datafeed-id-wildcard]
50+
If you do not specify one of these options, the API returns information about
51+
all {dfeeds}.
5152

5253
[[ml-get-datafeed-stats-query-parms]]
5354
==== {api-query-parms-title}
5455

5556
`allow_no_datafeeds`::
56-
(Optional, boolean) Specifies what to do when the request:
57-
+
58-
--
59-
* Contains wildcard expressions and there are no {datafeeds} that match.
60-
* Contains the `_all` string or no identifiers and there are no matches.
61-
* Contains wildcard expressions and there are only partial matches.
62-
63-
The default value is `true`, which returns an empty `datafeeds` array when
64-
there are no matches and the subset of results when there are partial matches.
65-
If this parameter is `false`, the request returns a `404` status code when there
66-
are no matches or only partial matches.
67-
--
57+
(Optional, boolean)
58+
include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-datafeeds]
6859

6960

7061
[[ml-get-datafeed-stats-results]]
7162
==== {api-response-body-title}
7263

73-
The API returns the following information:
64+
The API returns an array of {dfeed} count objects. All of these properties are
65+
informational; you cannot update their values.
66+
67+
`assignment_explanation`::
68+
(string) For started {dfeeds} only, contains messages relating to the selection of a node.
69+
70+
`datafeed_id`::
71+
(string)
72+
include::{docdir}/ml/ml-shared.asciidoc[tag=datafeed-id]
73+
74+
`node`::
75+
(object) For started {dfeeds} only, the node upon which the {dfeed} is started. The {dfeed} and job will be on the same node.
76+
`id`::: The unique identifier of the node. For example, "0-o0tOoRTwKFZifatTWKNw".
77+
`name`::: The node name. For example, `0-o0tOo`.
78+
`ephemeral_id`::: The node ephemeral ID.
79+
`transport_address`::: The host and port where transport HTTP connections are
80+
accepted. For example, `127.0.0.1:9300`.
81+
`attributes`::: For example, `{"ml.machine_memory": "17179869184"}`.
82+
83+
`state`::
84+
(string) The status of the {dfeed}, which can be one of the following values:
85+
+
86+
--
87+
* `started`: The {dfeed} is actively receiving data.
88+
* `stopped`: The {dfeed} is stopped and will not receive data until it is
89+
re-started.
90+
--
91+
92+
`timing_stats`::
93+
(object) An object that provides statistical information about timing aspect of
94+
this {dfeed}.
95+
//average_search_time_per_bucket_ms
96+
//bucket_count
97+
//exponential_average_search_time_per_hour_ms
98+
`job_id`:::
99+
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
100+
`search_count`::: Number of searches performed by this {dfeed}.
101+
`total_search_time_ms`::: Total time the {dfeed} spent searching in milliseconds.
74102

75-
`datafeeds`::
76-
(array) An array of {dfeed} count objects.
77-
For more information, see <<ml-datafeed-counts>>.
78103

79104
[[ml-get-datafeed-stats-response-codes]]
80105
==== {api-response-codes-title}
@@ -86,46 +111,46 @@ The API returns the following information:
86111
[[ml-get-datafeed-stats-example]]
87112
==== {api-examples-title}
88113

89-
The following example gets usage information for the
90-
`datafeed-total-requests` {dfeed}:
91-
92114
[source,console]
93115
--------------------------------------------------
94-
GET _ml/datafeeds/datafeed-total-requests/_stats
116+
GET _ml/datafeeds/datafeed-high_sum_total_sales/_stats
95117
--------------------------------------------------
96-
// TEST[skip:setup:server_metrics_startdf]
118+
// TEST[skip:Kibana sample data started datafeed]
97119

98120
The API returns the following results:
99121

100122
[source,console-result]
101123
----
102124
{
103-
"count": 1,
104-
"datafeeds": [
125+
"count" : 1,
126+
"datafeeds" : [
105127
{
106-
"datafeed_id": "datafeed-total-requests",
107-
"state": "started",
108-
"node": {
109-
"id": "2spCyo1pRi2Ajo-j-_dnPX",
110-
"name": "node-0",
111-
"ephemeral_id": "hoXMLZB0RWKfR9UPPUCxXX",
112-
"transport_address": "127.0.0.1:9300",
113-
"attributes": {
114-
"ml.machine_memory": "17179869184",
115-
"ml.max_open_jobs": "20"
128+
"datafeed_id" : "datafeed-high_sum_total_sales",
129+
"state" : "started",
130+
"node" : {
131+
"id" : "7bmMXyWCRs-TuPfGJJ_yMw",
132+
"name" : "node-0",
133+
"ephemeral_id" : "hoXMLZB0RWKfR9UPPUCxXX",
134+
"transport_address" : "127.0.0.1:9300",
135+
"attributes" : {
136+
"ml.machine_memory" : "17179869184",
137+
"ml.max_open_jobs" : "20"
116138
}
117139
},
118-
"assignment_explanation": "",
119-
"timing_stats": {
120-
"job_id": "job-total-requests",
121-
"search_count": 20,
122-
"total_search_time_ms": 120.5
140+
"assignment_explanation" : "",
141+
"timing_stats" : {
142+
"job_id" : "high_sum_total_sales",
143+
"search_count" : 7,
144+
"bucket_count" : 743,
145+
"total_search_time_ms" : 134.0,
146+
"average_search_time_per_bucket_ms" : 0.180349932705249,
147+
"exponential_average_search_time_per_hour_ms" : 11.514712961628677
123148
}
124149
}
125150
]
126151
}
127152
----
128-
// TESTRESPONSE[s/"2spCyo1pRi2Ajo-j-_dnPX"/$body.$_path/]
153+
// TESTRESPONSE[s/"7bmMXyWCRs-TuPfGJJ_yMw"/$body.$_path/]
129154
// TESTRESPONSE[s/"node-0"/$body.$_path/]
130155
// TESTRESPONSE[s/"hoXMLZB0RWKfR9UPPUCxXX"/$body.$_path/]
131156
// TESTRESPONSE[s/"127.0.0.1:9300"/$body.$_path/]

0 commit comments

Comments
 (0)