elasticsearch/docs/reference/cat/tasks.asciidoc
Liam Thompson 33a71e3289
[DOCS] Refactor book-scoped variables in docs/reference/index.asciidoc (#107413)
* Remove `es-test-dir` book-scoped variable

* Remove `plugins-examples-dir` book-scoped variable

* Remove `:dependencies-dir:` and `:xes-repo-dir:` book-scoped variables

- In `index.asciidoc`, two variables (`:dependencies-dir:` and `:xes-repo-dir:`) were removed.
- In `sql/index.asciidoc`, the `:sql-tests:` path was updated to fuller path
- In `esql/index.asciidoc`, the `:esql-tests:` path was updated idem

* Replace `es-repo-dir` with `es-ref-dir`

* Move `:include-xpack: true` to few files that use it, remove from index.asciidoc
2024-04-17 14:37:07 +02:00

92 lines
2.7 KiB
Text

[[cat-tasks]]
=== cat task management API
++++
<titleabbrev>cat task management</titleabbrev>
++++
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]
[IMPORTANT]
====
cat APIs are only intended for human consumption using the command line or {kib}
console. They are _not_ intended for use by applications. For application
consumption, use the <<tasks,task management API>>.
====
Returns information about tasks currently executing in the cluster,
similar to the <<tasks,task management>> API.
[[cat-tasks-api-request]]
==== {api-request-title}
`GET /_cat/tasks`
[[cat-tasks-api-prereqs]]
==== {api-prereq-title}
* If the {es} {security-features} are enabled, you must have the `monitor` or
`manage` <<privileges-list-cluster,cluster privilege>> to use this API.
[[cat-tasks-api-desc]]
==== {api-description-title}
The cat task management API returns information
about tasks currently executing
on one or more nodes in the cluster.
It is a more compact view
of the JSON <<tasks,task management>> API.
[[cat-tasks-api-query-params]]
==== {api-query-parms-title}
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=detailed]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=http-format]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=cat-h]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=help]
`nodes`::
(Optional, string)
Comma-separated list of node IDs or names used to limit the response. Supports
wildcard (`*`) expressions.
`parent_task_id`::
(Optional, string)
Parent task ID used to limit the response.
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=cat-s]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=time]
include::{es-ref-dir}/rest-api/common-parms.asciidoc[tag=cat-v]
[[cat-tasks-api-response-codes]]
==== {api-response-codes-title}
include::{es-ref-dir}/cluster/tasks.asciidoc[tag=tasks-api-404]
[[cat-tasks-api-examples]]
==== {api-examples-title}
[source,console]
----
GET _cat/tasks?v=true
----
// TEST[skip:No tasks to retrieve]
The API returns the following response:
[source,console-result]
----
action task_id parent_task_id type start_time timestamp running_time ip node
cluster:monitor/tasks/lists[n] oTUltX4IQMOUUVeiohTt8A:124 oTUltX4IQMOUUVeiohTt8A:123 direct 1458585884904 01:48:24 44.1micros 127.0.0.1:9300 oTUltX4IQMOUUVeiohTt8A
cluster:monitor/tasks/lists oTUltX4IQMOUUVeiohTt8A:123 - transport 1458585884904 01:48:24 186.2micros 127.0.0.1:9300 oTUltX4IQMOUUVeiohTt8A
----
// TESTRESPONSE[skip:No tasks to retrieve]
// TESTRESPONSE[non_json]