2017-06-20 09:23:58 +08:00
|
|
|
[role="xpack"]
|
2018-09-01 07:49:24 +08:00
|
|
|
[testenv="platinum"]
|
2017-04-05 06:26:39 +08:00
|
|
|
[[ml-valid-job]]
|
2020-07-21 03:38:09 +08:00
|
|
|
= Validate {anomaly-jobs} API
|
2017-12-15 02:52:49 +08:00
|
|
|
++++
|
2018-12-21 02:23:28 +08:00
|
|
|
<titleabbrev>Validate jobs</titleabbrev>
|
2017-12-15 02:52:49 +08:00
|
|
|
++++
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-08-07 02:05:01 +08:00
|
|
|
Validates {anomaly-job} configuration information.
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-valid-job-request]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-request-title}
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2018-12-08 04:34:11 +08:00
|
|
|
`POST _ml/anomaly_detectors/_validate`
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 04:58:42 +08:00
|
|
|
[[ml-valid-job-prereqs]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-prereq-title}
|
2019-06-28 04:58:42 +08:00
|
|
|
|
|
|
|
* If the {es} {security-features} are enabled, you must have `manage_ml` or
|
|
|
|
`manage` cluster privileges to use this API. See
|
2020-07-24 03:14:56 +08:00
|
|
|
<<security-privileges>> and {ml-docs-setup-privileges}.
|
2019-06-28 04:58:42 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-valid-job-desc]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-description-title}
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-12-24 03:38:37 +08:00
|
|
|
This API enables you to validate the {anomaly-job} configuration before you
|
2018-01-16 00:44:08 +08:00
|
|
|
create the job.
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-valid-job-request-body]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-request-body-title}
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2017-04-12 09:52:47 +08:00
|
|
|
For a list of the properties that you can specify in the body of this API,
|
2019-12-07 07:32:07 +08:00
|
|
|
see <<ml-put-job-request-body>>.
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-06-28 00:42:47 +08:00
|
|
|
[[ml-valid-job-example]]
|
2020-07-21 03:38:09 +08:00
|
|
|
== {api-examples-title}
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2019-09-09 22:45:37 +08:00
|
|
|
[source,console]
|
2017-04-05 06:26:39 +08:00
|
|
|
--------------------------------------------------
|
2018-12-08 04:34:11 +08:00
|
|
|
POST _ml/anomaly_detectors/_validate
|
2017-04-05 06:26:39 +08:00
|
|
|
{
|
2020-07-22 00:24:26 +08:00
|
|
|
"description": "Unusual response times by airlines",
|
|
|
|
"analysis_config": {
|
|
|
|
"bucket_span": "300S",
|
|
|
|
"detectors": [
|
|
|
|
{
|
|
|
|
"function": "metric",
|
|
|
|
"field_name": "responsetime",
|
|
|
|
"by_field_name": "airline" } ],
|
|
|
|
"influencers": [ "airline" ]
|
|
|
|
},
|
|
|
|
"data_description": {
|
|
|
|
"time_field": "time",
|
|
|
|
"time_format": "yyyy-MM-dd'T'HH:mm:ssX"
|
|
|
|
}
|
2017-04-05 06:26:39 +08:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2018-09-01 07:49:24 +08:00
|
|
|
// TEST[skip:needs-licence]
|
2017-04-05 06:26:39 +08:00
|
|
|
|
2017-04-06 22:56:46 +08:00
|
|
|
When the validation is complete, you receive the following results:
|
2019-09-06 04:47:18 +08:00
|
|
|
|
|
|
|
[source,console-result]
|
2017-04-05 06:26:39 +08:00
|
|
|
----
|
|
|
|
{
|
2017-04-06 22:56:46 +08:00
|
|
|
"acknowledged": true
|
2017-04-05 06:26:39 +08:00
|
|
|
}
|
|
|
|
----
|