validate-detector.asciidoc 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. {stack-ov}/security-privileges.html[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,js]
  29. --------------------------------------------------
  30. POST _ml/anomaly_detectors/_validate/detector
  31. {
  32. "function": "metric",
  33. "field_name": "responsetime",
  34. "by_field_name": "airline"
  35. }
  36. --------------------------------------------------
  37. // CONSOLE
  38. // TEST[skip:needs-licence]
  39. When the validation completes, you receive the following results:
  40. [source,js]
  41. ----
  42. {
  43. "acknowledged": true
  44. }
  45. ----
  46. // TESTRESPONSE