validate-job.asciidoc 1.4 KB

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