validate-job.asciidoc 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-valid-job]]
  4. === Validate Jobs API
  5. ++++
  6. <titleabbrev>Validate Jobs</titleabbrev>
  7. ++++
  8. Validates job configuration information.
  9. ==== Request
  10. `POST _xpack/ml/anomaly_detectors/_validate`
  11. ==== Description
  12. The validate jobs API enables you validate the job configuration before you
  13. create the job.
  14. ==== Request Body
  15. For a list of the properties that you can specify in the body of this API,
  16. see <<ml-job-resource,Job Resources>>.
  17. ==== Authorization
  18. You must have `manage_ml`, or `manage` cluster privileges to use this API.
  19. For more information, see
  20. {xpack-ref}/security-privileges.html[Security Privileges].
  21. ==== Examples
  22. The following example validates job configuration information:
  23. [source,js]
  24. --------------------------------------------------
  25. POST _xpack/ml/anomaly_detectors/_validate
  26. {
  27. "description" : "Unusual response times by airlines",
  28. "analysis_config" : {
  29. "bucket_span": "300S",
  30. "detectors" :[
  31. {
  32. "function": "metric",
  33. "field_name": "responsetime",
  34. "by_field_name": "airline"}],
  35. "influencers": [ "airline" ]
  36. },
  37. "data_description" : {
  38. "time_field": "time",
  39. "time_format": "yyyy-MM-dd'T'HH:mm:ssX"
  40. }
  41. }
  42. --------------------------------------------------
  43. // CONSOLE
  44. // TEST[skip:needs-licence]
  45. When the validation is complete, you receive the following results:
  46. [source,js]
  47. ----
  48. {
  49. "acknowledged": true
  50. }
  51. ----
  52. // TESTRESPONSE