validate-job.asciidoc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. Requires the `manage_ml` cluster privilege. This privilege is included in the
  15. `machine_learning_admin` built-in role.
  16. [[ml-valid-job-desc]]
  17. == {api-description-title}
  18. This API enables you to validate the {anomaly-job} configuration before you
  19. create the job.
  20. [[ml-valid-job-request-body]]
  21. == {api-request-body-title}
  22. For a list of the properties that you can specify in the body of this API,
  23. see <<ml-put-job-request-body>>.
  24. [[ml-valid-job-example]]
  25. == {api-examples-title}
  26. [source,console]
  27. --------------------------------------------------
  28. POST _ml/anomaly_detectors/_validate
  29. {
  30. "description": "Unusual response times by airlines",
  31. "analysis_config": {
  32. "bucket_span": "300S",
  33. "detectors": [
  34. {
  35. "function": "metric",
  36. "field_name": "responsetime",
  37. "by_field_name": "airline" } ],
  38. "influencers": [ "airline" ]
  39. },
  40. "data_description": {
  41. "time_field": "time",
  42. "time_format": "yyyy-MM-dd'T'HH:mm:ssX"
  43. }
  44. }
  45. --------------------------------------------------
  46. // TEST[skip:needs-licence]
  47. When the validation is complete, you receive the following results:
  48. [source,console-result]
  49. ----
  50. {
  51. "acknowledged": true
  52. }
  53. ----