validate-detector.asciidoc 3.2 KB

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