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

71 lines
1.4 KiB
Plaintext

//lcawley: Verified example output 2017-04-11
[[ml-preview-datafeed]]
==== Preview Data Feeds
The preview data feed API enables 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,
"airline": "AAL",
"responsetime": 132.20460510253906
},
{
"@timestamp": 1454803200000,
"airline": "JZA",
"responsetime": 990.4628295898438
},
{
"@timestamp": 1454803200000,
"airline": "JBU",
"responsetime": 877.5927124023438
},
...
]
----