diff --git a/docs/overlays/elasticsearch-openapi-overlays.yaml b/docs/overlays/elasticsearch-openapi-overlays.yaml index 7ac7a58289..b5de33ae4b 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 8d6ec89771..ff9ba077ac 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -35406,7 +35406,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": [ { @@ -35436,7 +35436,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": [ { @@ -35469,13 +35469,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": { @@ -35486,7 +35486,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" @@ -35543,13 +35543,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": [ @@ -35569,7 +35569,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" @@ -35579,7 +35579,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" @@ -35589,7 +35589,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" @@ -35599,7 +35599,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" @@ -35609,7 +35609,7 @@ { "in": "query", "name": "master_timeout", - "description": "Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.", + "description": "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.", "deprecated": false, "schema": { "$ref": "#/components/schemas/_types:Duration" @@ -35619,7 +35619,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" @@ -105537,7 +105537,7 @@ "tasks.cancel#task_id": { "in": "path", "name": "task_id", - "description": "ID of the task.", + "description": "The task identifier.", "required": true, "deprecated": false, "schema": { @@ -105548,7 +105548,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": [ @@ -105568,7 +105568,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", @@ -105581,7 +105581,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" @@ -105591,7 +105591,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 dddf85b72d..0c618c1c83 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -18436,13 +18436,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": { @@ -18453,7 +18453,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 f0573a6bfc..ff9ebd274e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -20234,10 +20234,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" @@ -20276,10 +20281,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" @@ -20312,7 +20322,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", @@ -212785,11 +212795,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" }, { @@ -213251,7 +213261,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", @@ -213264,7 +213274,7 @@ }, "path": [ { - "description": "ID of the task.", + "description": "The task identifier.", "name": "task_id", "required": false, "type": { @@ -213278,7 +213288,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": { @@ -213305,7 +213315,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": { @@ -213320,7 +213330,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": { @@ -213332,9 +213342,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": { @@ -213344,7 +213355,7 @@ } } ], - "specLocation": "tasks/cancel/CancelTasksRequest.ts#L23-L59" + "specLocation": "tasks/cancel/CancelTasksRequest.ts#L23-L68" }, { "kind": "response", @@ -213372,7 +213383,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", @@ -213385,7 +213396,7 @@ }, "path": [ { - "description": "ID of the task.", + "description": "The task identifier.", "name": "task_id", "required": true, "type": { @@ -213399,7 +213410,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", @@ -213425,7 +213436,7 @@ } } ], - "specLocation": "tasks/get/GetTaskRequest.ts#L24-L52" + "specLocation": "tasks/get/GetTaskRequest.ts#L24-L58" }, { "kind": "response", @@ -213488,7 +213499,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", @@ -213502,7 +213513,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": { @@ -213529,7 +213540,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, @@ -213542,7 +213553,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": { @@ -213554,7 +213565,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": { @@ -213566,7 +213577,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": { @@ -213578,7 +213589,7 @@ } }, { - "description": "Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.", + "description": "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.", "name": "master_timeout", "required": false, "serverDefault": "30s", @@ -213591,7 +213602,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", @@ -213617,7 +213628,7 @@ } } ], - "specLocation": "tasks/list/ListTasksRequest.ts#L25-L74" + "specLocation": "tasks/list/ListTasksRequest.ts#L25-L138" }, { "kind": "response", diff --git a/specification/security/activate_user_profile/examples/request/RequestExample1.yaml b/specification/security/activate_user_profile/examples/request/RequestExample1.yaml index 39dcf9af50..c7a0baf0af 100644 --- a/specification/security/activate_user_profile/examples/request/RequestExample1.yaml +++ b/specification/security/activate_user_profile/examples/request/RequestExample1.yaml @@ -1,5 +1,4 @@ # summary: -<<<<<<< HEAD # method_request: POST /_security/profile/_activate description: > Run `POST /_security/profile/_activate` to activate a user profile. @@ -9,19 +8,4 @@ value: |- "grant_type": "password", "username" : "jacknich", "password" : "l0ng-r4nd0m-p@ssw0rd" -======= -# method_request: POST /_security/user/jacknich -description: > - Run `POST /_security/user/jacknich` to create a user. -# type: request -value: |- - { - "password" : "l0ng-r4nd0m-p@ssw0rd", - "roles" : [ "admin", "other_role1" ], - "full_name" : "Jack Nicholson", - "email" : "jacknich@example.com", - "metadata" : { - "intelligence" : 7 - } ->>>>>>> fb93809aa (Add security API examples (#3490)) } 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 79fce38634..70ed607158 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,28 +36,33 @@ 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 { 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 f6b1f9f6da..8e5d87480e 100644 --- a/specification/tasks/get/GetTaskRequest.ts +++ b/specification/tasks/get/GetTaskRequest.ts @@ -24,21 +24,27 @@ 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 { 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 63fb774595..80ad052a9f 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 @@ -34,34 +91,41 @@ import { Duration } from '@_types/Time' 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 connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. + * The period to wait for a connection to the master node. + * If no response is received before the timeout expires, the request fails and returns an error. * @server_default 30s */ master_timeout?: Duration /** - * 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 + } + } + } + } + }