tasks.asciidoc 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. [[cat-tasks]]
  2. === cat task management API
  3. ++++
  4. <titleabbrev>cat task management</titleabbrev>
  5. ++++
  6. beta::["The cat task management API is new and should still be considered a beta feature. The API may change in ways that are not backwards compatible.",{es-issue}51628]
  7. [IMPORTANT]
  8. ====
  9. cat APIs are only intended for human consumption using the command line or {kib}
  10. console. They are _not_ intended for use by applications. For application
  11. consumption, use the <<tasks,task management API>>.
  12. ====
  13. Returns information about tasks currently executing in the cluster,
  14. similar to the <<tasks,task management>> API.
  15. [[cat-tasks-api-request]]
  16. ==== {api-request-title}
  17. `GET /_cat/tasks`
  18. [[cat-tasks-api-prereqs]]
  19. ==== {api-prereq-title}
  20. * If the {es} {security-features} are enabled, you must have the `monitor` or
  21. `manage` <<privileges-list-cluster,cluster privilege>> to use this API.
  22. [[cat-tasks-api-desc]]
  23. ==== {api-description-title}
  24. The cat task management API returns information
  25. about tasks currently executing
  26. on one or more nodes in the cluster.
  27. It is a more compact view
  28. of the JSON <<tasks,task management>> API.
  29. [[cat-tasks-api-query-params]]
  30. ==== {api-query-parms-title}
  31. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=detailed]
  32. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=http-format]
  33. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-h]
  34. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=help]
  35. `nodes`::
  36. (Optional, string)
  37. Comma-separated list of node IDs or names used to limit the response. Supports
  38. wildcard (`*`) expressions.
  39. `parent_task_id`::
  40. (Optional, string)
  41. Parent task ID used to limit the response.
  42. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-s]
  43. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=time]
  44. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-v]
  45. [[cat-tasks-api-response-codes]]
  46. ==== {api-response-codes-title}
  47. include::{es-repo-dir}/cluster/tasks.asciidoc[tag=tasks-api-404]
  48. [[cat-tasks-api-examples]]
  49. ==== {api-examples-title}
  50. [source,console]
  51. ----
  52. GET _cat/tasks?v=true
  53. ----
  54. // TEST[skip:No tasks to retrieve]
  55. The API returns the following response:
  56. [source,console-result]
  57. ----
  58. action task_id parent_task_id type start_time timestamp running_time ip node
  59. cluster:monitor/tasks/lists[n] oTUltX4IQMOUUVeiohTt8A:124 oTUltX4IQMOUUVeiohTt8A:123 direct 1458585884904 01:48:24 44.1micros 127.0.0.1:9300 oTUltX4IQMOUUVeiohTt8A
  60. cluster:monitor/tasks/lists oTUltX4IQMOUUVeiohTt8A:123 - transport 1458585884904 01:48:24 186.2micros 127.0.0.1:9300 oTUltX4IQMOUUVeiohTt8A
  61. ----
  62. // TESTRESPONSE[skip:No tasks to retrieve]
  63. // TESTRESPONSE[non_json]