get-job.asciidoc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-get-job]]
  4. === Get jobs API
  5. ++++
  6. <titleabbrev>Get jobs</titleabbrev>
  7. ++++
  8. Retrieves configuration information for jobs.
  9. ==== Request
  10. `GET _ml/anomaly_detectors/<job_id>` +
  11. `GET _ml/anomaly_detectors/<job_id>,<job_id>` +
  12. `GET _ml/anomaly_detectors/` +
  13. `GET _ml/anomaly_detectors/_all`
  14. ===== Description
  15. You can get information for multiple jobs in a single API request by using a
  16. group name, a comma-separated list of jobs, or a wildcard expression. You can
  17. get information for all jobs by using `_all`, by specifying `*` as the
  18. `<job_id>`, or by omitting the `<job_id>`.
  19. IMPORTANT: This API returns a maximum of 10,000 jobs.
  20. ==== Path Parameters
  21. `job_id`::
  22. (string) Identifier for the job. It can be a job identifier, a group name,
  23. or a wildcard expression. If you do not specify one of these options, the API
  24. returns information for all jobs.
  25. ==== Results
  26. The API returns the following information:
  27. `jobs`::
  28. (array) An array of job resources.
  29. For more information, see <<ml-job-resource,Job Resources>>.
  30. ==== Authorization
  31. You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
  32. privileges to use this API. For more information, see
  33. {xpack-ref}/security-privileges.html[Security Privileges].
  34. ==== Examples
  35. The following example gets configuration information for the `total-requests` job:
  36. [source,js]
  37. --------------------------------------------------
  38. GET _ml/anomaly_detectors/total-requests
  39. --------------------------------------------------
  40. // CONSOLE
  41. // TEST[skip:setup:server_metrics_job]
  42. The API returns the following results:
  43. [source,js]
  44. ----
  45. {
  46. "count": 1,
  47. "jobs": [
  48. {
  49. "job_id": "total-requests",
  50. "job_type": "anomaly_detector",
  51. "job_version": "7.0.0-alpha1",
  52. "description": "Total sum of requests",
  53. "create_time": 1517011406091,
  54. "analysis_config": {
  55. "bucket_span": "10m",
  56. "detectors": [
  57. {
  58. "detector_description": "Sum of total",
  59. "function": "sum",
  60. "field_name": "total",
  61. "detector_index": 0
  62. }
  63. ],
  64. "influencers": [ ]
  65. },
  66. "analysis_limits": {
  67. "model_memory_limit": "1024mb",
  68. "categorization_examples_limit": 4
  69. },
  70. "data_description": {
  71. "time_field": "timestamp",
  72. "time_format": "epoch_ms"
  73. },
  74. "model_snapshot_retention_days": 1,
  75. "results_index_name": "shared"
  76. }
  77. ]
  78. }
  79. ----
  80. // TESTRESPONSE[s/"7.0.0-alpha1"/$body.$_path/]
  81. // TESTRESPONSE[s/1517011406091/$body.$_path/]