diff --git a/docs/overlays/elasticsearch-openapi-overlays.yaml b/docs/overlays/elasticsearch-openapi-overlays.yaml index 17e63ff46d..90c707d8e7 100644 --- a/docs/overlays/elasticsearch-openapi-overlays.yaml +++ b/docs/overlays/elasticsearch-openapi-overlays.yaml @@ -141,7 +141,7 @@ actions: application/json: examples: getTasksResponseExample1: - $ref: "../../specification/tasks/get/examples/response/GetTaskResponseExample1.yaml" + $ref: "../../specification/tasks/get/examples/200_response/GetTaskResponseExample1.yaml" - target: "$.components['responses']['nodes.info#200']" description: "Add response examples for nodes info" update: diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 453cadb413..dc8b7beb04 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -35708,7 +35708,7 @@ "tasks" ], "summary": "Cancel a task", - "description": "A task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away.\nIt is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation.\nThe get task information API will continue to list these cancelled tasks until they complete.\nThe cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible.\n\nTo troubleshoot why a cancelled task does not complete promptly, use the get task information API with the `?detailed` parameter to identify the other tasks the system is running.\nYou can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task.", + "description": "WARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nA task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away.\nIt is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation.\nThe get task information API will continue to list these cancelled tasks until they complete.\nThe cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible.\n\nTo troubleshoot why a cancelled task does not complete promptly, use the get task information API with the `?detailed` parameter to identify the other tasks the system is running.\nYou can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task.", "operationId": "tasks-cancel", "parameters": [ { @@ -35738,7 +35738,7 @@ "tasks" ], "summary": "Cancel a task", - "description": "A task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away.\nIt is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation.\nThe get task information API will continue to list these cancelled tasks until they complete.\nThe cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible.\n\nTo troubleshoot why a cancelled task does not complete promptly, use the get task information API with the `?detailed` parameter to identify the other tasks the system is running.\nYou can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task.", + "description": "WARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nA task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away.\nIt is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation.\nThe get task information API will continue to list these cancelled tasks until they complete.\nThe cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible.\n\nTo troubleshoot why a cancelled task does not complete promptly, use the get task information API with the `?detailed` parameter to identify the other tasks the system is running.\nYou can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task.", "operationId": "tasks-cancel-1", "parameters": [ { @@ -35771,13 +35771,13 @@ "tasks" ], "summary": "Get task information", - "description": "Get information about a task currently running in the cluster.", + "description": "Get information about a task currently running in the cluster.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nIf the task identifier is not found, a 404 response code indicates that there are no resources that match the request.", "operationId": "tasks-get", "parameters": [ { "in": "path", "name": "task_id", - "description": "ID of the task.", + "description": "The task identifier.", "required": true, "deprecated": false, "schema": { @@ -35788,7 +35788,7 @@ { "in": "query", "name": "timeout", - "description": "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "description": "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types:Duration" @@ -35845,13 +35845,13 @@ "tasks" ], "summary": "Get all tasks", - "description": "Get information about the tasks currently running on one or more nodes in the cluster.", + "description": "Get information about the tasks currently running on one or more nodes in the cluster.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\n**Identifying running tasks**\n\nThe `X-Opaque-Id header`, when provided on the HTTP request header, is going to be returned as a header in the response as well as in the headers field for in the task information.\nThis enables you to track certain calls or associate certain tasks with the client that started them.\nFor example:\n\n```\ncurl -i -H \"X-Opaque-Id: 123456\" \"http://localhost:9200/_tasks?group_by=parents\"\n```\n\nThe API returns the following result:\n\n```\nHTTP/1.1 200 OK\nX-Opaque-Id: 123456\ncontent-type: application/json; charset=UTF-8\ncontent-length: 831\n\n{\n \"tasks\" : {\n \"u5lcZHqcQhu-rUoFaqDphA:45\" : {\n \"node\" : \"u5lcZHqcQhu-rUoFaqDphA\",\n \"id\" : 45,\n \"type\" : \"transport\",\n \"action\" : \"cluster:monitor/tasks/lists\",\n \"start_time_in_millis\" : 1513823752749,\n \"running_time_in_nanos\" : 293139,\n \"cancellable\" : false,\n \"headers\" : {\n \"X-Opaque-Id\" : \"123456\"\n },\n \"children\" : [\n {\n \"node\" : \"u5lcZHqcQhu-rUoFaqDphA\",\n \"id\" : 46,\n \"type\" : \"direct\",\n \"action\" : \"cluster:monitor/tasks/lists[n]\",\n \"start_time_in_millis\" : 1513823752750,\n \"running_time_in_nanos\" : 92133,\n \"cancellable\" : false,\n \"parent_task_id\" : \"u5lcZHqcQhu-rUoFaqDphA:45\",\n \"headers\" : {\n \"X-Opaque-Id\" : \"123456\"\n }\n }\n ]\n }\n }\n }\n```\nIn this example, `X-Opaque-Id: 123456` is the ID as a part of the response header.\nThe `X-Opaque-Id` in the task `headers` is the ID for the task that was initiated by the REST request.\nThe `X-Opaque-Id` in the children `headers` is the child task of the task that was initiated by the REST request.", "operationId": "tasks-list", "parameters": [ { "in": "query", "name": "actions", - "description": "Comma-separated list or wildcard expression of actions used to limit the request.", + "description": "A comma-separated list or wildcard expression of actions used to limit the request.\nFor example, you can use `cluser:*` to retrieve all cluster-related tasks.", "deprecated": false, "schema": { "oneOf": [ @@ -35871,7 +35871,7 @@ { "in": "query", "name": "detailed", - "description": "If `true`, the response includes detailed information about shard recoveries.\nThis information is useful to distinguish tasks from each other but is more costly to run.", + "description": "If `true`, the response includes detailed information about the running tasks.\nThis information is useful to distinguish tasks from each other but is more costly to run.", "deprecated": false, "schema": { "type": "boolean" @@ -35881,7 +35881,7 @@ { "in": "query", "name": "group_by", - "description": "Key used to group tasks in the response.", + "description": "A key that is used to group tasks in the response.\nThe task lists can be grouped either by nodes or by parent tasks.", "deprecated": false, "schema": { "$ref": "#/components/schemas/tasks._types:GroupBy" @@ -35891,7 +35891,7 @@ { "in": "query", "name": "nodes", - "description": "Comma-separated list of node IDs or names used to limit returned information.", + "description": "A comma-separated list of node IDs or names that is used to limit the returned information.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types:NodeIds" @@ -35901,7 +35901,7 @@ { "in": "query", "name": "parent_task_id", - "description": "Parent task ID used to limit returned information. To return all tasks, omit this parameter or use a value of `-1`.", + "description": "A parent task identifier that is used to limit returned information.\nTo return all tasks, omit this parameter or use a value of `-1`.\nIf the parent task is not found, the API does not return a 404 response code.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types:Id" @@ -35911,7 +35911,7 @@ { "in": "query", "name": "timeout", - "description": "Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.", + "description": "The period to wait for each node to respond.\nIf a node does not respond before its timeout expires, the response does not include its information.\nHowever, timed out nodes are included in the `node_failures` property.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types:Duration" @@ -106237,7 +106237,7 @@ "tasks.cancel#task_id": { "in": "path", "name": "task_id", - "description": "ID of the task.", + "description": "The task identifier.", "required": true, "deprecated": false, "schema": { @@ -106248,7 +106248,7 @@ "tasks.cancel#actions": { "in": "query", "name": "actions", - "description": "Comma-separated list or wildcard expression of actions used to limit the request.", + "description": "A comma-separated list or wildcard expression of actions that is used to limit the request.", "deprecated": false, "schema": { "oneOf": [ @@ -106268,7 +106268,7 @@ "tasks.cancel#nodes": { "in": "query", "name": "nodes", - "description": "Comma-separated list of node IDs or names used to limit the request.", + "description": "A comma-separated list of node IDs or names that is used to limit the request.", "deprecated": false, "schema": { "type": "array", @@ -106281,7 +106281,7 @@ "tasks.cancel#parent_task_id": { "in": "query", "name": "parent_task_id", - "description": "Parent task ID used to limit the tasks.", + "description": "A parent task ID that is used to limit the tasks.", "deprecated": false, "schema": { "type": "string" @@ -106291,7 +106291,7 @@ "tasks.cancel#wait_for_completion": { "in": "query", "name": "wait_for_completion", - "description": "Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false", + "description": "If true, the request blocks until all found tasks are complete.", "deprecated": false, "schema": { "type": "boolean" diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index f2becfe1f1..15f1dd3317 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -18515,13 +18515,13 @@ "tasks" ], "summary": "Get task information", - "description": "Get information about a task currently running in the cluster.", + "description": "Get information about a task currently running in the cluster.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nIf the task identifier is not found, a 404 response code indicates that there are no resources that match the request.", "operationId": "tasks-get", "parameters": [ { "in": "path", "name": "task_id", - "description": "ID of the task.", + "description": "The task identifier.", "required": true, "deprecated": false, "schema": { @@ -18532,7 +18532,7 @@ { "in": "query", "name": "timeout", - "description": "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "description": "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types:Duration" diff --git a/output/schema/schema.json b/output/schema/schema.json index 112c3aacfd..805c365ece 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -20289,10 +20289,15 @@ "stability": "experimental" } }, - "description": "Cancel a task.\nA task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away.\nIt is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation.\nThe get task information API will continue to list these cancelled tasks until they complete.\nThe cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible.\n\nTo troubleshoot why a cancelled task does not complete promptly, use the get task information API with the `?detailed` parameter to identify the other tasks the system is running.\nYou can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task.", + "description": "Cancel a task.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nA task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away.\nIt is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation.\nThe get task information API will continue to list these cancelled tasks until they complete.\nThe cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible.\n\nTo troubleshoot why a cancelled task does not complete promptly, use the get task information API with the `?detailed` parameter to identify the other tasks the system is running.\nYou can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task.", "docId": "tasks", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/tasks.html", "name": "tasks.cancel", + "privileges": { + "cluster": [ + "manage" + ] + }, "request": { "name": "Request", "namespace": "tasks.cancel" @@ -20331,10 +20336,15 @@ "stability": "experimental" } }, - "description": "Get task information.\nGet information about a task currently running in the cluster.", + "description": "Get task information.\nGet information about a task currently running in the cluster.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nIf the task identifier is not found, a 404 response code indicates that there are no resources that match the request.", "docId": "tasks", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/tasks.html", "name": "tasks.get", + "privileges": { + "cluster": [ + "monitor" + ] + }, "request": { "name": "Request", "namespace": "tasks.get" @@ -20367,7 +20377,7 @@ "stability": "experimental" } }, - "description": "Get all tasks.\nGet information about the tasks currently running on one or more nodes in the cluster.", + "description": "Get all tasks.\nGet information about the tasks currently running on one or more nodes in the cluster.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\n**Identifying running tasks**\n\nThe `X-Opaque-Id header`, when provided on the HTTP request header, is going to be returned as a header in the response as well as in the headers field for in the task information.\nThis enables you to track certain calls or associate certain tasks with the client that started them.\nFor example:\n\n```\ncurl -i -H \"X-Opaque-Id: 123456\" \"http://localhost:9200/_tasks?group_by=parents\"\n```\n\nThe API returns the following result:\n\n```\nHTTP/1.1 200 OK\nX-Opaque-Id: 123456\ncontent-type: application/json; charset=UTF-8\ncontent-length: 831\n\n{\n \"tasks\" : {\n \"u5lcZHqcQhu-rUoFaqDphA:45\" : {\n \"node\" : \"u5lcZHqcQhu-rUoFaqDphA\",\n \"id\" : 45,\n \"type\" : \"transport\",\n \"action\" : \"cluster:monitor/tasks/lists\",\n \"start_time_in_millis\" : 1513823752749,\n \"running_time_in_nanos\" : 293139,\n \"cancellable\" : false,\n \"headers\" : {\n \"X-Opaque-Id\" : \"123456\"\n },\n \"children\" : [\n {\n \"node\" : \"u5lcZHqcQhu-rUoFaqDphA\",\n \"id\" : 46,\n \"type\" : \"direct\",\n \"action\" : \"cluster:monitor/tasks/lists[n]\",\n \"start_time_in_millis\" : 1513823752750,\n \"running_time_in_nanos\" : 92133,\n \"cancellable\" : false,\n \"parent_task_id\" : \"u5lcZHqcQhu-rUoFaqDphA:45\",\n \"headers\" : {\n \"X-Opaque-Id\" : \"123456\"\n }\n }\n ]\n }\n }\n }\n```\nIn this example, `X-Opaque-Id: 123456` is the ID as a part of the response header.\nThe `X-Opaque-Id` in the task `headers` is the ID for the task that was initiated by the REST request.\nThe `X-Opaque-Id` in the children `headers` is the child task of the task that was initiated by the REST request.", "docId": "tasks", "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/tasks.html", "name": "tasks.list", @@ -214302,11 +214312,11 @@ "kind": "enum", "members": [ { - "description": "Node ID", + "description": "Group tasks by node ID.", "name": "nodes" }, { - "description": "Parent task ID", + "description": "Group tasks by parent task ID.", "name": "parents" }, { @@ -214768,7 +214778,7 @@ "body": { "kind": "no_body" }, - "description": "Cancel a task.\nA task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away.\nIt is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation.\nThe get task information API will continue to list these cancelled tasks until they complete.\nThe cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible.\n\nTo troubleshoot why a cancelled task does not complete promptly, use the get task information API with the `?detailed` parameter to identify the other tasks the system is running.\nYou can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task.", + "description": "Cancel a task.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nA task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away.\nIt is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation.\nThe get task information API will continue to list these cancelled tasks until they complete.\nThe cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible.\n\nTo troubleshoot why a cancelled task does not complete promptly, use the get task information API with the `?detailed` parameter to identify the other tasks the system is running.\nYou can also use the node hot threads API to obtain detailed information about the work the system is doing instead of completing the cancelled task.", "inherits": { "type": { "name": "RequestBase", @@ -214781,7 +214791,7 @@ }, "path": [ { - "description": "ID of the task.", + "description": "The task identifier.", "name": "task_id", "required": false, "type": { @@ -214795,7 +214805,7 @@ ], "query": [ { - "description": "Comma-separated list or wildcard expression of actions used to limit the request.", + "description": "A comma-separated list or wildcard expression of actions that is used to limit the request.", "name": "actions", "required": false, "type": { @@ -214822,7 +214832,7 @@ } }, { - "description": "Comma-separated list of node IDs or names used to limit the request.", + "description": "A comma-separated list of node IDs or names that is used to limit the request.", "name": "nodes", "required": false, "type": { @@ -214837,7 +214847,7 @@ } }, { - "description": "Parent task ID used to limit the tasks.", + "description": "A parent task ID that is used to limit the tasks.", "name": "parent_task_id", "required": false, "type": { @@ -214849,9 +214859,10 @@ } }, { - "description": "Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false", + "description": "If true, the request blocks until all found tasks are complete.", "name": "wait_for_completion", "required": false, + "serverDefault": false, "type": { "kind": "instance_of", "type": { @@ -214861,7 +214872,7 @@ } } ], - "specLocation": "tasks/cancel/CancelTasksRequest.ts#L23-L69" + "specLocation": "tasks/cancel/CancelTasksRequest.ts#L23-L78" }, { "kind": "response", @@ -214889,7 +214900,7 @@ "body": { "kind": "no_body" }, - "description": "Get task information.\nGet information about a task currently running in the cluster.", + "description": "Get task information.\nGet information about a task currently running in the cluster.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\nIf the task identifier is not found, a 404 response code indicates that there are no resources that match the request.", "inherits": { "type": { "name": "RequestBase", @@ -214902,7 +214913,7 @@ }, "path": [ { - "description": "ID of the task.", + "description": "The task identifier.", "name": "task_id", "required": true, "type": { @@ -214916,7 +214927,7 @@ ], "query": [ { - "description": "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "description": "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", "name": "timeout", "required": false, "serverDefault": "30s", @@ -214942,7 +214953,7 @@ } } ], - "specLocation": "tasks/get/GetTaskRequest.ts#L24-L58" + "specLocation": "tasks/get/GetTaskRequest.ts#L24-L64" }, { "kind": "response", @@ -215005,7 +215016,7 @@ "body": { "kind": "no_body" }, - "description": "Get all tasks.\nGet information about the tasks currently running on one or more nodes in the cluster.", + "description": "Get all tasks.\nGet information about the tasks currently running on one or more nodes in the cluster.\n\nWARNING: The task management API is new and should still be considered a beta feature.\nThe API may change in ways that are not backwards compatible.\n\n**Identifying running tasks**\n\nThe `X-Opaque-Id header`, when provided on the HTTP request header, is going to be returned as a header in the response as well as in the headers field for in the task information.\nThis enables you to track certain calls or associate certain tasks with the client that started them.\nFor example:\n\n```\ncurl -i -H \"X-Opaque-Id: 123456\" \"http://localhost:9200/_tasks?group_by=parents\"\n```\n\nThe API returns the following result:\n\n```\nHTTP/1.1 200 OK\nX-Opaque-Id: 123456\ncontent-type: application/json; charset=UTF-8\ncontent-length: 831\n\n{\n \"tasks\" : {\n \"u5lcZHqcQhu-rUoFaqDphA:45\" : {\n \"node\" : \"u5lcZHqcQhu-rUoFaqDphA\",\n \"id\" : 45,\n \"type\" : \"transport\",\n \"action\" : \"cluster:monitor/tasks/lists\",\n \"start_time_in_millis\" : 1513823752749,\n \"running_time_in_nanos\" : 293139,\n \"cancellable\" : false,\n \"headers\" : {\n \"X-Opaque-Id\" : \"123456\"\n },\n \"children\" : [\n {\n \"node\" : \"u5lcZHqcQhu-rUoFaqDphA\",\n \"id\" : 46,\n \"type\" : \"direct\",\n \"action\" : \"cluster:monitor/tasks/lists[n]\",\n \"start_time_in_millis\" : 1513823752750,\n \"running_time_in_nanos\" : 92133,\n \"cancellable\" : false,\n \"parent_task_id\" : \"u5lcZHqcQhu-rUoFaqDphA:45\",\n \"headers\" : {\n \"X-Opaque-Id\" : \"123456\"\n }\n }\n ]\n }\n }\n }\n```\nIn this example, `X-Opaque-Id: 123456` is the ID as a part of the response header.\nThe `X-Opaque-Id` in the task `headers` is the ID for the task that was initiated by the REST request.\nThe `X-Opaque-Id` in the children `headers` is the child task of the task that was initiated by the REST request.", "inherits": { "type": { "name": "RequestBase", @@ -215019,7 +215030,7 @@ "path": [], "query": [ { - "description": "Comma-separated list or wildcard expression of actions used to limit the request.", + "description": "A comma-separated list or wildcard expression of actions used to limit the request.\nFor example, you can use `cluser:*` to retrieve all cluster-related tasks.", "name": "actions", "required": false, "type": { @@ -215046,7 +215057,7 @@ } }, { - "description": "If `true`, the response includes detailed information about shard recoveries.\nThis information is useful to distinguish tasks from each other but is more costly to run.", + "description": "If `true`, the response includes detailed information about the running tasks.\nThis information is useful to distinguish tasks from each other but is more costly to run.", "name": "detailed", "required": false, "serverDefault": false, @@ -215059,7 +215070,7 @@ } }, { - "description": "Key used to group tasks in the response.", + "description": "A key that is used to group tasks in the response.\nThe task lists can be grouped either by nodes or by parent tasks.", "name": "group_by", "required": false, "type": { @@ -215071,7 +215082,7 @@ } }, { - "description": "Comma-separated list of node IDs or names used to limit returned information.", + "description": "A comma-separated list of node IDs or names that is used to limit the returned information.", "name": "nodes", "required": false, "type": { @@ -215083,7 +215094,7 @@ } }, { - "description": "Parent task ID used to limit returned information. To return all tasks, omit this parameter or use a value of `-1`.", + "description": "A parent task identifier that is used to limit returned information.\nTo return all tasks, omit this parameter or use a value of `-1`.\nIf the parent task is not found, the API does not return a 404 response code.", "name": "parent_task_id", "required": false, "type": { @@ -215095,7 +215106,7 @@ } }, { - "description": "Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.", + "description": "The period to wait for each node to respond.\nIf a node does not respond before its timeout expires, the response does not include its information.\nHowever, timed out nodes are included in the `node_failures` property.", "name": "timeout", "required": false, "serverDefault": "30s", @@ -215121,7 +215132,7 @@ } } ], - "specLocation": "tasks/list/ListTasksRequest.ts#L25-L75" + "specLocation": "tasks/list/ListTasksRequest.ts#L25-L138" }, { "kind": "response", diff --git a/specification/tasks/_types/GroupBy.ts b/specification/tasks/_types/GroupBy.ts index 9939d09d44..3b5ca93fa0 100644 --- a/specification/tasks/_types/GroupBy.ts +++ b/specification/tasks/_types/GroupBy.ts @@ -18,9 +18,9 @@ */ export enum GroupBy { - /** Node ID */ + /** Group tasks by node ID. */ nodes, - /** Parent task ID */ + /** Group tasks by parent task ID. */ parents, /** Do not group tasks. */ none diff --git a/specification/tasks/cancel/CancelTasksRequest.ts b/specification/tasks/cancel/CancelTasksRequest.ts index dff80ba820..a400c36f95 100644 --- a/specification/tasks/cancel/CancelTasksRequest.ts +++ b/specification/tasks/cancel/CancelTasksRequest.ts @@ -22,6 +22,10 @@ import { TaskId } from '@_types/common' /** * Cancel a task. + * + * WARNING: The task management API is new and should still be considered a beta feature. + * The API may change in ways that are not backwards compatible. + * * A task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away. * It is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation. * The get task information API will continue to list these cancelled tasks until they complete. @@ -32,6 +36,7 @@ import { TaskId } from '@_types/common' * @rest_spec_name tasks.cancel * @availability stack since=2.3.0 stability=experimental * @availability serverless stability=experimental visibility=private + * @cluster_privileges manage * @doc_id tasks */ export interface Request extends RequestBase { @@ -47,23 +52,27 @@ export interface Request extends RequestBase { ] path_parts: { /** - * ID of the task. + * The task identifier. */ task_id?: TaskId } query_parameters: { /** - * Comma-separated list or wildcard expression of actions used to limit the request. + * A comma-separated list or wildcard expression of actions that is used to limit the request. */ actions?: string | string[] /** - * Comma-separated list of node IDs or names used to limit the request. + * A comma-separated list of node IDs or names that is used to limit the request. */ nodes?: string[] /** - * Parent task ID used to limit the tasks. + * A parent task ID that is used to limit the tasks. */ parent_task_id?: string + /** + * If true, the request blocks until all found tasks are complete. + * @server_default false + */ wait_for_completion?: boolean } } diff --git a/specification/tasks/get/GetTaskRequest.ts b/specification/tasks/get/GetTaskRequest.ts index 4f9ad935b0..9f626071ad 100644 --- a/specification/tasks/get/GetTaskRequest.ts +++ b/specification/tasks/get/GetTaskRequest.ts @@ -24,9 +24,15 @@ import { Duration } from '@_types/Time' /** * Get task information. * Get information about a task currently running in the cluster. + * + * WARNING: The task management API is new and should still be considered a beta feature. + * The API may change in ways that are not backwards compatible. + * + * If the task identifier is not found, a 404 response code indicates that there are no resources that match the request. * @rest_spec_name tasks.get * @availability stack since=5.0.0 stability=experimental * @availability serverless stability=experimental visibility=public + * @cluster_privileges monitor * @doc_id tasks */ export interface Request extends RequestBase { @@ -38,13 +44,13 @@ export interface Request extends RequestBase { ] path_parts: { /** - * ID of the task. + * The task identifier. */ task_id: Id } query_parameters: { /** - * Period to wait for a response. + * The period to wait for a response. * If no response is received before the timeout expires, the request fails and returns an error. * @server_default 30s */ diff --git a/specification/tasks/get/examples/response/GetTaskResponseExample1.yaml b/specification/tasks/get/examples/200_response/GetTaskResponseExample1.yaml similarity index 100% rename from specification/tasks/get/examples/response/GetTaskResponseExample1.yaml rename to specification/tasks/get/examples/200_response/GetTaskResponseExample1.yaml diff --git a/specification/tasks/list/ListTasksRequest.ts b/specification/tasks/list/ListTasksRequest.ts index 18c1d66040..a5847ef89e 100644 --- a/specification/tasks/list/ListTasksRequest.ts +++ b/specification/tasks/list/ListTasksRequest.ts @@ -25,6 +25,63 @@ import { Duration } from '@_types/Time' /** * Get all tasks. * Get information about the tasks currently running on one or more nodes in the cluster. + * + * WARNING: The task management API is new and should still be considered a beta feature. + * The API may change in ways that are not backwards compatible. + * + * **Identifying running tasks** + * + * The `X-Opaque-Id header`, when provided on the HTTP request header, is going to be returned as a header in the response as well as in the headers field for in the task information. + * This enables you to track certain calls or associate certain tasks with the client that started them. + * For example: + * + * ``` + * curl -i -H "X-Opaque-Id: 123456" "http://localhost:9200/_tasks?group_by=parents" + * ``` + * + * The API returns the following result: + * + * ``` + * HTTP/1.1 200 OK + * X-Opaque-Id: 123456 + * content-type: application/json; charset=UTF-8 + * content-length: 831 + * + * { + * "tasks" : { + * "u5lcZHqcQhu-rUoFaqDphA:45" : { + * "node" : "u5lcZHqcQhu-rUoFaqDphA", + * "id" : 45, + * "type" : "transport", + * "action" : "cluster:monitor/tasks/lists", + * "start_time_in_millis" : 1513823752749, + * "running_time_in_nanos" : 293139, + * "cancellable" : false, + * "headers" : { + * "X-Opaque-Id" : "123456" + * }, + * "children" : [ + * { + * "node" : "u5lcZHqcQhu-rUoFaqDphA", + * "id" : 46, + * "type" : "direct", + * "action" : "cluster:monitor/tasks/lists[n]", + * "start_time_in_millis" : 1513823752750, + * "running_time_in_nanos" : 92133, + * "cancellable" : false, + * "parent_task_id" : "u5lcZHqcQhu-rUoFaqDphA:45", + * "headers" : { + * "X-Opaque-Id" : "123456" + * } + * } + * ] + * } + * } + * } + * ``` + * In this example, `X-Opaque-Id: 123456` is the ID as a part of the response header. + * The `X-Opaque-Id` in the task `headers` is the ID for the task that was initiated by the REST request. + * The `X-Opaque-Id` in the children `headers` is the child task of the task that was initiated by the REST request. * @rest_spec_name tasks.list * @availability stack since=2.3.0 stability=experimental * @availability serverless stability=experimental visibility=private @@ -40,29 +97,35 @@ export interface Request extends RequestBase { ] query_parameters: { /** - * Comma-separated list or wildcard expression of actions used to limit the request. + * A comma-separated list or wildcard expression of actions used to limit the request. + * For example, you can use `cluser:*` to retrieve all cluster-related tasks. */ actions?: string | string[] /** - * If `true`, the response includes detailed information about shard recoveries. + * If `true`, the response includes detailed information about the running tasks. * This information is useful to distinguish tasks from each other but is more costly to run. * @server_default false */ detailed?: boolean /** - * Key used to group tasks in the response. + * A key that is used to group tasks in the response. + * The task lists can be grouped either by nodes or by parent tasks. */ group_by?: GroupBy /** - * Comma-separated list of node IDs or names used to limit returned information. + * A comma-separated list of node IDs or names that is used to limit the returned information. */ nodes?: NodeIds /** - * Parent task ID used to limit returned information. To return all tasks, omit this parameter or use a value of `-1`. + * A parent task identifier that is used to limit returned information. + * To return all tasks, omit this parameter or use a value of `-1`. + * If the parent task is not found, the API does not return a 404 response code. */ parent_task_id?: Id /** - * Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. + * The period to wait for each node to respond. + * If a node does not respond before its timeout expires, the response does not include its information. + * However, timed out nodes are included in the `node_failures` property. * @server_default 30s */ timeout?: Duration diff --git a/specification/tasks/list/examples/200_response/ListTasksResponseExample1.yaml b/specification/tasks/list/examples/200_response/ListTasksResponseExample1.yaml new file mode 100644 index 0000000000..be315fc233 --- /dev/null +++ b/specification/tasks/list/examples/200_response/ListTasksResponseExample1.yaml @@ -0,0 +1,31 @@ +# summary: +description: > + A successful response from `GET _tasks?actions=*search&detailed` + The `detailed` parameter affects the `description` field, which contains human readable text that identifies the particular request that the task is performing. + For example, it helps identify the search request being performed by a search task. +# type: response +# response_code: '' +value: |- + { + "nodes" : { + "oTUltX4IQMOUUVeiohTt8A" : { + "name" : "H5dfFeA", + "transport_address" : "127.0.0.1:9300", + "host" : "127.0.0.1", + "ip" : "127.0.0.1:9300", + "tasks" : { + "oTUltX4IQMOUUVeiohTt8A:464" : { + "node" : "oTUltX4IQMOUUVeiohTt8A", + "id" : 464, + "type" : "transport", + "action" : "indices:data/read/search", + "description" : "indices[test], types[test], search_type[QUERY_THEN_FETCH], source[{\"query\":...}]", + "start_time_in_millis" : 1483478610008, + "running_time_in_nanos" : 13991383, + "cancellable" : true, + "cancelled" : false + } + } + } + } + }