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-desc]]
  13. ==== {api-description-title}
  14. The validate detectors API enables you validate the detector configuration
  15. before you create a job.
  16. [[ml-valid-detector-request-body]]
  17. ==== {api-request-body-title}
  18. For a list of the properties that you can specify in the body of this API,
  19. see <<ml-detectorconfig,detector configuration objects>>.
  20. [[ml-valid-detector-prereqs]]
  21. ==== {api-prereq-title}
  22. You must have `manage_ml`, or `manage` cluster privileges to use this API.
  23. For more information, see
  24. {stack-ov}/security-privileges.html[Security privileges].
  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