validate-detector.asciidoc 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 to validate the detector configuration
  20. before you create an {anomaly-job}.
  21. [[ml-valid-detector-request-body]]
  22. ==== {api-request-body-title}
  23. include::{docdir}/ml/ml-shared.asciidoc[tag=detector]
  24. [[ml-valid-detector-example]]
  25. ==== {api-examples-title}
  26. The following example validates detector configuration information:
  27. [source,console]
  28. --------------------------------------------------
  29. POST _ml/anomaly_detectors/_validate/detector
  30. {
  31. "function": "metric",
  32. "field_name": "responsetime",
  33. "by_field_name": "airline"
  34. }
  35. --------------------------------------------------
  36. // TEST[skip:needs-licence]
  37. When the validation completes, you receive the following results:
  38. [source,console-result]
  39. ----
  40. {
  41. "acknowledged": true
  42. }
  43. ----