tasks.asciidoc 2.9 KB

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