validate-detector.asciidoc 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-valid-detector]]
  4. === Validate detectors API
  5. ++++
  6. <titleabbrev>Validate detectors</titleabbrev>
  7. ++++
  8. Validates detector configuration information.
  9. [[ml-valid-detector-request]]
  10. ==== {api-request-title}
  11. `POST _ml/anomaly_detectors/_validate/detector`
  12. [[ml-valid-detector-prereqs]]
  13. ==== {api-prereq-title}
  14. * If the {es} {security-features} are enabled, you must have `manage_ml` or
  15. `manage` cluster privileges to use this API. See
  16. <<security-privileges>>.
  17. [[ml-valid-detector-desc]]
  18. ==== {api-description-title}
  19. This API enables you validate the detector configuration
  20. before you create an {anomaly-job}.
  21. [[ml-valid-detector-request-body]]
  22. ==== {api-request-body-title}
  23. For a list of the properties that you can specify in the body of this API,
  24. see <<ml-detectorconfig,detector configuration objects>>.
  25. [[ml-valid-detector-example]]
  26. ==== {api-examples-title}
  27. The following example validates detector configuration information:
  28. [source,console]
  29. --------------------------------------------------
  30. POST _ml/anomaly_detectors/_validate/detector
  31. {
  32. "function": "metric",
  33. "field_name": "responsetime",
  34. "by_field_name": "airline"
  35. }
  36. --------------------------------------------------
  37. // TEST[skip:needs-licence]
  38. When the validation completes, you receive the following results:
  39. [source,console-result]
  40. ----
  41. {
  42. "acknowledged": true
  43. }
  44. ----