get-job.asciidoc 2.5 KB

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