validate-job.asciidoc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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>>.
  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. The following example validates job configuration information:
  28. [source,console]
  29. --------------------------------------------------
  30. POST _ml/anomaly_detectors/_validate
  31. {
  32. "description" : "Unusual response times by airlines",
  33. "analysis_config" : {
  34. "bucket_span": "300S",
  35. "detectors" :[
  36. {
  37. "function": "metric",
  38. "field_name": "responsetime",
  39. "by_field_name": "airline"}],
  40. "influencers": [ "airline" ]
  41. },
  42. "data_description" : {
  43. "time_field": "time",
  44. "time_format": "yyyy-MM-dd'T'HH:mm:ssX"
  45. }
  46. }
  47. --------------------------------------------------
  48. // TEST[skip:needs-licence]
  49. When the validation is complete, you receive the following results:
  50. [source,console-result]
  51. ----
  52. {
  53. "acknowledged": true
  54. }
  55. ----