2017-04-11 21:52:47 -04:00
|
|
|
//lcawley Verified example output 2017-04-11
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-valid-job]]
|
|
|
|
==== Validate Jobs
|
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
The validate jobs API validates job configuration information.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
===== Request
|
|
|
|
|
|
|
|
`POST _xpack/ml/anomaly_detectors/_validate`
|
|
|
|
|
|
|
|
===== Description
|
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
This API enables you validate the job configuration before you create the job.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-18 18:13:21 -04:00
|
|
|
You must have `manage_ml`, or `manage` cluster privileges to use this API.
|
|
|
|
For more information, see <<privileges-list-cluster>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
////
|
|
|
|
===== Path Parameters
|
|
|
|
|
|
|
|
////
|
|
|
|
===== Request Body
|
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
For a list of the properties that you can specify in the body of this API,
|
|
|
|
see <<ml-job-resource,Job Resources>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
////
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Responses
|
|
|
|
|
|
|
|
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)
|
2017-04-06 10:56:46 -04:00
|
|
|
////
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Examples
|
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
The following example validates job configuration information:
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2017-04-06 10:56:46 -04:00
|
|
|
POST _xpack/ml/anomaly_detectors/_validate
|
2017-04-04 18:26:39 -04:00
|
|
|
{
|
2017-04-06 10:56:46 -04:00
|
|
|
"description" : "Unusual response times by airlines",
|
|
|
|
"analysis_config" : {
|
|
|
|
"bucket_span": "300S",
|
|
|
|
"detectors" :[
|
|
|
|
{
|
2017-04-11 21:52:47 -04:00
|
|
|
"function": "metric",
|
|
|
|
"field_name": "responsetime",
|
|
|
|
"by_field_name": "airline"}],
|
|
|
|
"influencers": [ "airline" ]
|
2017-04-06 10:56:46 -04:00
|
|
|
},
|
|
|
|
"data_description" : {
|
2017-04-11 21:52:47 -04:00
|
|
|
"time_field": "time",
|
|
|
|
"time_format": "yyyy-MM-dd'T'HH:mm:ssX"
|
2017-04-06 10:56:46 -04:00
|
|
|
}
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
When the validation is complete, you receive the following results:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
2017-04-06 10:56:46 -04:00
|
|
|
"acknowledged": true
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
----
|