validate-detector.asciidoc 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. [role="xpack"]
  2. [[ml-valid-detector]]
  3. = Validate detectors API
  4. ++++
  5. <titleabbrev>Validate detectors</titleabbrev>
  6. ++++
  7. Validates detector configuration information.
  8. [[ml-valid-detector-request]]
  9. == {api-request-title}
  10. `POST _ml/anomaly_detectors/_validate/detector`
  11. [[ml-valid-detector-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-detector-desc]]
  16. == {api-description-title}
  17. This API enables you to validate the detector configuration
  18. before you create an {anomaly-job}.
  19. [[ml-valid-detector-request-body]]
  20. == {api-request-body-title}
  21. `by_field_name`::
  22. (string)
  23. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=by-field-name]
  24. `custom_rules`::
  25. +
  26. --
  27. (array)
  28. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules]
  29. `analysis_config`.`detectors`.`custom_rules`.`actions`:::
  30. (array)
  31. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-actions]
  32. `analysis_config`.`detectors`.`custom_rules`.`scope`:::
  33. (object)
  34. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-scope]
  35. `analysis_config`.`detectors`.`custom_rules`.`scope`.`filter_id`::::
  36. (string)
  37. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-id]
  38. `analysis_config`.`detectors`.`custom_rules`.`scope`.`filter_type`::::
  39. (string)
  40. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-scope-filter-type]
  41. `analysis_config`.`detectors`.`custom_rules`.`conditions`:::
  42. (array)
  43. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions]
  44. `analysis_config`.`detectors`.`custom_rules`.`conditions`.`applies_to`::::
  45. (string)
  46. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-applies-to]
  47. `analysis_config`.`detectors`.`custom_rules`.`conditions`.`operator`::::
  48. (string)
  49. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-operator]
  50. `analysis_config`.`detectors`.`custom_rules`.`conditions`.`value`::::
  51. (double)
  52. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=custom-rules-conditions-value]
  53. --
  54. `detector_description`::
  55. (string)
  56. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=detector-description]
  57. `detector_index`::
  58. (integer)
  59. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=detector-index]
  60. `exclude_frequent`::
  61. (string)
  62. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=exclude-frequent]
  63. `field_name`::
  64. (string)
  65. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=detector-field-name]
  66. `function`::
  67. (string)
  68. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=function]
  69. `over_field_name`::
  70. (string)
  71. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=over-field-name]
  72. `partition_field_name`::
  73. (string)
  74. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=partition-field-name]
  75. `use_null`::
  76. (Boolean)
  77. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=use-null]
  78. [[ml-valid-detector-example]]
  79. == {api-examples-title}
  80. [source,console]
  81. --------------------------------------------------
  82. POST _ml/anomaly_detectors/_validate/detector
  83. {
  84. "function": "metric",
  85. "field_name": "responsetime",
  86. "by_field_name": "airline"
  87. }
  88. --------------------------------------------------
  89. // TEST[skip:needs-licence]
  90. When the validation completes, you receive the following results:
  91. [source,console-result]
  92. ----
  93. {
  94. "acknowledged": true
  95. }
  96. ----