get-job.asciidoc 2.5 KB

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