OpenSearch/docs/en/rest-api/ml/preview-datafeed.asciidoc

68 lines
1.3 KiB
Plaintext
Raw Normal View History

[[ml-preview-datafeed]]
==== Preview Data Feeds
The preview data feed API allows you to preview a data feed.
===== Request
`GET _xpack/ml/datafeeds/<feed_id>/_preview`
===== Description
TBD
//How much data does it return?
The API returns example data by using the current data feed settings.
===== Path Parameters
`feed_id` (required)::
(+string+) Identifier for the data feed
////
===== Request Body
None
===== Responses
TBD
////
////
200
(EmptyResponse) The cluster has been successfully deleted
404
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found (code: clusters.cluster_not_found)
412
(BasicFailedReply) The Elasticsearch cluster has not been shutdown yet (code: clusters.cluster_plan_state_error)
////
===== Examples
The following example obtains a previews of the `datafeed-farequote` data feed:
[source,js]
--------------------------------------------------
GET _xpack/ml/datafeeds/datafeed-farequote/_preview
--------------------------------------------------
// CONSOLE
// TEST[skip:todo]
The data that is returned for this example is as follows:
----
[
{
"@timestamp": 1454803200000,
"responsetime": 132.20460510253906
},
{
"@timestamp": 1454803200000,
"responsetime": 990.4628295898438
},
{
"@timestamp": 1454803200000,
"responsetime": 877.5927124023438
},
...
]
----