get-job.asciidoc 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-get-job]]
  4. = Get {anomaly-jobs} API
  5. ++++
  6. <titleabbrev>Get jobs</titleabbrev>
  7. ++++
  8. Retrieves configuration information for {anomaly-jobs}.
  9. [[ml-get-job-request]]
  10. == {api-request-title}
  11. `GET _ml/anomaly_detectors/<job_id>` +
  12. `GET _ml/anomaly_detectors/<job_id>,<job_id>` +
  13. `GET _ml/anomaly_detectors/` +
  14. `GET _ml/anomaly_detectors/_all`
  15. [[ml-get-job-prereqs]]
  16. == {api-prereq-title}
  17. * If the {es} {security-features} are enabled, you must have `monitor_ml`,
  18. `monitor`, `manage_ml`, or `manage` cluster privileges to use this API. See
  19. <<security-privileges>> and {ml-docs-setup-privileges}.
  20. [[ml-get-job-desc]]
  21. == {api-description-title}
  22. You can get information for multiple {anomaly-jobs} in a single API request by
  23. using a group name, a comma-separated list of jobs, or a wildcard expression.
  24. You can get information for all {anomaly-jobs} by using `_all`, by specifying
  25. `*` as the `<job_id>`, or by omitting the `<job_id>`.
  26. IMPORTANT: This API returns a maximum of 10,000 jobs.
  27. [[ml-get-job-path-parms]]
  28. == {api-path-parms-title}
  29. `<job_id>`::
  30. (Optional, string)
  31. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection-default]
  32. [[ml-get-job-query-parms]]
  33. == {api-query-parms-title}
  34. `allow_no_match`::
  35. (Optional, boolean)
  36. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=allow-no-jobs]
  37. `exclude_generated`::
  38. (Optional, boolean)
  39. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=exclude-generated]
  40. [[ml-get-job-results]]
  41. == {api-response-body-title}
  42. The API returns an array of {anomaly-job} resources. For the full list of
  43. properties, see <<ml-put-job-request-body,create {anomaly-jobs} API>>.
  44. `create_time`::
  45. (string) The time the job was created. For example, `1491007356077`. This
  46. property is informational; you cannot change its value.
  47. `finished_time`::
  48. (string) If the job closed or failed, this is the time the job finished,
  49. otherwise it is `null`. This property is informational; you cannot change its
  50. value.
  51. `job_type`::
  52. (string) Reserved for future use, currently set to `anomaly_detector`.
  53. `job_version`::
  54. (string) The version of {es} that existed on the node when the job was created.
  55. `model_snapshot_id`::
  56. (string)
  57. include::{es-repo-dir}/ml/ml-shared.asciidoc[tag=model-snapshot-id]
  58. [[ml-get-job-response-codes]]
  59. == {api-response-codes-title}
  60. `404` (Missing resources)::
  61. If `allow_no_match` is `false`, this code indicates that there are no
  62. resources that match the request or only partial matches for the request.
  63. [[ml-get-job-example]]
  64. == {api-examples-title}
  65. [source,console]
  66. --------------------------------------------------
  67. GET _ml/anomaly_detectors/high_sum_total_sales
  68. --------------------------------------------------
  69. // TEST[skip:Kibana sample data]
  70. The API returns the following results:
  71. [source,js]
  72. ----
  73. {
  74. "count": 1,
  75. "jobs": [
  76. {
  77. "job_id" : "high_sum_total_sales",
  78. "job_type" : "anomaly_detector",
  79. "job_version" : "8.0.0",
  80. "groups" : [
  81. "kibana_sample_data",
  82. "kibana_sample_ecommerce"
  83. ],
  84. "description" : "Find customers spending an unusually high amount in an hour",
  85. "create_time" : 1575402224732,
  86. "finished_time" : 1575402238311,
  87. "analysis_config" : {
  88. "bucket_span" : "1h",
  89. "detectors" : [
  90. {
  91. "detector_description" : "High total sales",
  92. "function" : "high_sum",
  93. "field_name" : "taxful_total_price",
  94. "over_field_name" : "customer_full_name.keyword",
  95. "detector_index" : 0
  96. }
  97. ],
  98. "influencers" : [
  99. "customer_full_name.keyword",
  100. "category.keyword"
  101. ]
  102. },
  103. "analysis_limits" : {
  104. "model_memory_limit" : "10mb",
  105. "categorization_examples_limit" : 4
  106. },
  107. "data_description" : {
  108. "time_field" : "order_date",
  109. "time_format" : "epoch_ms"
  110. },
  111. "model_plot_config" : {
  112. "enabled" : true
  113. },
  114. "model_snapshot_retention_days" : 10,
  115. "daily_model_snapshot_retention_after_days" : 1,
  116. "custom_settings" : {
  117. "created_by" : "ml-module-sample",
  118. ...
  119. },
  120. "model_snapshot_id" : "1575402237",
  121. "results_index_name" : "shared",
  122. "allow_lazy_open" : false
  123. }
  124. ]
  125. }
  126. ----