validate-job.asciidoc 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-valid-job]]
  4. = Validate {anomaly-jobs} API
  5. ++++
  6. <titleabbrev>Validate jobs</titleabbrev>
  7. ++++
  8. Validates {anomaly-job} configuration information.
  9. [[ml-valid-job-request]]
  10. == {api-request-title}
  11. `POST _ml/anomaly_detectors/_validate`
  12. [[ml-valid-job-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>> and {ml-docs-setup-privileges}.
  17. [[ml-valid-job-desc]]
  18. == {api-description-title}
  19. This API enables you to validate the {anomaly-job} configuration before you
  20. create the job.
  21. [[ml-valid-job-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-put-job-request-body>>.
  25. [[ml-valid-job-example]]
  26. == {api-examples-title}
  27. [source,console]
  28. --------------------------------------------------
  29. POST _ml/anomaly_detectors/_validate
  30. {
  31. "description": "Unusual response times by airlines",
  32. "analysis_config": {
  33. "bucket_span": "300S",
  34. "detectors": [
  35. {
  36. "function": "metric",
  37. "field_name": "responsetime",
  38. "by_field_name": "airline" } ],
  39. "influencers": [ "airline" ]
  40. },
  41. "data_description": {
  42. "time_field": "time",
  43. "time_format": "yyyy-MM-dd'T'HH:mm:ssX"
  44. }
  45. }
  46. --------------------------------------------------
  47. // TEST[skip:needs-licence]
  48. When the validation is complete, you receive the following results:
  49. [source,console-result]
  50. ----
  51. {
  52. "acknowledged": true
  53. }
  54. ----