From 534dc00e09dcdb2d8ffe312a13217d39c3f1aa2a Mon Sep 17 00:00:00 2001 From: Charlotte Hoblik Date: Mon, 22 Sep 2025 15:55:19 +0200 Subject: [PATCH] change task api availability --- docs/examples/languageExamples.json | 76 +++++++++++++++-- output/openapi/elasticsearch-openapi.json | 8 +- output/schema/schema.json | 82 +++++++++++++++++-- .../tasks/cancel/CancelTasksRequest.ts | 2 +- specification/tasks/get/GetTaskRequest.ts | 2 +- specification/tasks/list/ListTasksRequest.ts | 2 +- 6 files changed, 152 insertions(+), 20 deletions(-) diff --git a/docs/examples/languageExamples.json b/docs/examples/languageExamples.json index a90130e4cf..cdacc84d47 100644 --- a/docs/examples/languageExamples.json +++ b/docs/examples/languageExamples.json @@ -11552,23 +11552,23 @@ "specification/inference/text_embedding/examples/request/TextEmbeddingRequestExample1.yaml": [ { "language": "Python", - "code": "resp = client.inference.text_embedding(\n inference_id=\"my-cohere-endpoint\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n task_settings={\n \"input_type\": \"ingest\"\n },\n)" + "code": "resp = client.inference.text_embedding(\n inference_id=\"my-cohere-endpoint\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n input_type=\"ingest\",\n)" }, { "language": "JavaScript", - "code": "const response = await client.inference.textEmbedding({\n inference_id: \"my-cohere-endpoint\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n task_settings: {\n input_type: \"ingest\",\n },\n});" + "code": "const response = await client.inference.textEmbedding({\n inference_id: \"my-cohere-endpoint\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n input_type: \"ingest\",\n});" }, { "language": "Ruby", - "code": "response = client.inference.text_embedding(\n inference_id: \"my-cohere-endpoint\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n }\n)" + "code": "response = client.inference.text_embedding(\n inference_id: \"my-cohere-endpoint\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n }\n)" }, { "language": "PHP", - "code": "$resp = $client->inference()->textEmbedding([\n \"inference_id\" => \"my-cohere-endpoint\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\" => [\n \"input_type\" => \"ingest\",\n ],\n ],\n]);" + "code": "$resp = $client->inference()->textEmbedding([\n \"inference_id\" => \"my-cohere-endpoint\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\" => \"ingest\",\n ],\n]);" }, { "language": "curl", - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"The sky above the port was the color of television tuned to a dead channel.\",\"task_settings\":{\"input_type\":\"ingest\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint\"" + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"The sky above the port was the color of television tuned to a dead channel.\",\"input_type\":\"ingest\"}' \"$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint\"" } ], "specification/inference/put_jinaai/examples/request/PutJinaAiRequestExample1.yaml": [ @@ -14848,5 +14848,71 @@ "language": "curl", "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"query\":\"SELECT * FROM library ORDER BY page_count DESC LIMIT 5\"}' \"$ELASTICSEARCH_URL/_sql?format=txt\"" } + ], + "specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml": [ + { + "language": "Python", + "code": "resp = client.streams.logs_disable()" + }, + { + "language": "JavaScript", + "code": "const response = await client.streams.logsDisable();" + }, + { + "language": "Ruby", + "code": "response = client.streams.logs_disable" + }, + { + "language": "PHP", + "code": "$resp = $client->streams()->logsDisable();" + }, + { + "language": "curl", + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_streams/logs/_disable\"" + } + ], + "specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml": [ + { + "language": "Python", + "code": "resp = client.streams.status()" + }, + { + "language": "JavaScript", + "code": "const response = await client.streams.status();" + }, + { + "language": "Ruby", + "code": "response = client.streams.status" + }, + { + "language": "PHP", + "code": "$resp = $client->streams()->status();" + }, + { + "language": "curl", + "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_streams/status\"" + } + ], + "specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml": [ + { + "language": "Python", + "code": "resp = client.streams.logs_enable()" + }, + { + "language": "JavaScript", + "code": "const response = await client.streams.logsEnable();" + }, + { + "language": "Ruby", + "code": "response = client.streams.logs_enable" + }, + { + "language": "PHP", + "code": "$resp = $client->streams()->logsEnable();" + }, + { + "language": "curl", + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_streams/logs/_enable\"" + } ] } \ No newline at end of file diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index e55cff53d4..830bd968c7 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -48320,7 +48320,7 @@ "$ref": "#/components/responses/tasks.cancel-200" } }, - "x-state": "Technical preview; Added in 2.3.0", + "x-state": "Generally available; Added in 2.3.0", "x-metaTags": [ { "content": "Elasticsearch", @@ -48359,7 +48359,7 @@ "$ref": "#/components/responses/tasks.cancel-200" } }, - "x-state": "Technical preview; Added in 2.3.0", + "x-state": "Generally available; Added in 2.3.0", "x-metaTags": [ { "content": "Elasticsearch", @@ -48459,7 +48459,7 @@ } } }, - "x-state": "Technical preview; Added in 5.0.0", + "x-state": "Generally available; Added in 5.0.0", "x-metaTags": [ { "content": "Elasticsearch", @@ -48576,7 +48576,7 @@ } } }, - "x-state": "Technical preview; Added in 2.3.0", + "x-state": "Generally available; Added in 2.3.0", "x-metaTags": [ { "content": "Elasticsearch", diff --git a/output/schema/schema.json b/output/schema/schema.json index 59afa0a176..9ca1a443a2 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -23042,7 +23042,7 @@ }, "stack": { "since": "2.3.0", - "stability": "experimental" + "stability": "stable" } }, "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.", @@ -23090,7 +23090,7 @@ }, "stack": { "since": "5.0.0", - "stability": "experimental" + "stability": "stable" } }, "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.", @@ -23132,7 +23132,7 @@ }, "stack": { "since": "2.3.0", - "stability": "experimental" + "stability": "stable" } }, "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.", @@ -180123,23 +180123,23 @@ "TextEmbeddingRequestExample1": { "alternatives": [ { - "code": "resp = client.inference.text_embedding(\n inference_id=\"my-cohere-endpoint\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n task_settings={\n \"input_type\": \"ingest\"\n },\n)", + "code": "resp = client.inference.text_embedding(\n inference_id=\"my-cohere-endpoint\",\n input=\"The sky above the port was the color of television tuned to a dead channel.\",\n input_type=\"ingest\",\n)", "language": "Python" }, { - "code": "const response = await client.inference.textEmbedding({\n inference_id: \"my-cohere-endpoint\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n task_settings: {\n input_type: \"ingest\",\n },\n});", + "code": "const response = await client.inference.textEmbedding({\n inference_id: \"my-cohere-endpoint\",\n input:\n \"The sky above the port was the color of television tuned to a dead channel.\",\n input_type: \"ingest\",\n});", "language": "JavaScript" }, { - "code": "response = client.inference.text_embedding(\n inference_id: \"my-cohere-endpoint\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\": {\n \"input_type\": \"ingest\"\n }\n }\n)", + "code": "response = client.inference.text_embedding(\n inference_id: \"my-cohere-endpoint\",\n body: {\n \"input\": \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\": \"ingest\"\n }\n)", "language": "Ruby" }, { - "code": "$resp = $client->inference()->textEmbedding([\n \"inference_id\" => \"my-cohere-endpoint\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n \"task_settings\" => [\n \"input_type\" => \"ingest\",\n ],\n ],\n]);", + "code": "$resp = $client->inference()->textEmbedding([\n \"inference_id\" => \"my-cohere-endpoint\",\n \"body\" => [\n \"input\" => \"The sky above the port was the color of television tuned to a dead channel.\",\n \"input_type\" => \"ingest\",\n ],\n]);", "language": "PHP" }, { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"The sky above the port was the color of television tuned to a dead channel.\",\"task_settings\":{\"input_type\":\"ingest\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint\"", + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"input\":\"The sky above the port was the color of television tuned to a dead channel.\",\"input_type\":\"ingest\"}' \"$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint\"", "language": "curl" } ], @@ -258257,6 +258257,28 @@ "description": "Disable logs stream.\n\nTurn off the logs stream feature for this cluster.", "examples": { "PostStreamsDisableRequestExample1": { + "alternatives": [ + { + "code": "resp = client.streams.logs_disable()", + "language": "Python" + }, + { + "code": "const response = await client.streams.logsDisable();", + "language": "JavaScript" + }, + { + "code": "response = client.streams.logs_disable", + "language": "Ruby" + }, + { + "code": "$resp = $client->streams()->logsDisable();", + "language": "PHP" + }, + { + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_streams/logs/_disable\"", + "language": "curl" + } + ], "method_request": "POST _streams/logs/_disable", "summary": "Disable the logs streams on this cluster" } @@ -258339,6 +258361,28 @@ "description": "Enable logs stream.\n\nTurn on the logs stream feature for this cluster.\n\nNOTE: To protect existing data, this feature can be turned on only if the\ncluster does not have existing indices or data streams that match the pattern `logs|logs.*`.\nIf those indices or data streams exist, a `409 - Conflict` response and error is returned.", "examples": { "PostStreamsEnableRequestExample1": { + "alternatives": [ + { + "code": "resp = client.streams.logs_enable()", + "language": "Python" + }, + { + "code": "const response = await client.streams.logsEnable();", + "language": "JavaScript" + }, + { + "code": "response = client.streams.logs_enable", + "language": "Ruby" + }, + { + "code": "$resp = $client->streams()->logsEnable();", + "language": "PHP" + }, + { + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_streams/logs/_enable\"", + "language": "curl" + } + ], "method_request": "POST _streams/logs/_enable", "summary": "Enable the logs streams on this cluster" } @@ -258443,6 +258487,28 @@ "description": "Get the status of streams.\n\nGet the current status for all types of streams.", "examples": { "GetStreamsStatusRequestExample1": { + "alternatives": [ + { + "code": "resp = client.streams.status()", + "language": "Python" + }, + { + "code": "const response = await client.streams.status();", + "language": "JavaScript" + }, + { + "code": "response = client.streams.status", + "language": "Ruby" + }, + { + "code": "$resp = $client->streams()->status();", + "language": "PHP" + }, + { + "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_streams/status\"", + "language": "curl" + } + ], "method_request": "GET _streams/status", "summary": "Get the current status of streams" } diff --git a/specification/tasks/cancel/CancelTasksRequest.ts b/specification/tasks/cancel/CancelTasksRequest.ts index a400c36f95..8ab7c40d85 100644 --- a/specification/tasks/cancel/CancelTasksRequest.ts +++ b/specification/tasks/cancel/CancelTasksRequest.ts @@ -34,7 +34,7 @@ import { TaskId } from '@_types/common' * To 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. * You 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. * @rest_spec_name tasks.cancel - * @availability stack since=2.3.0 stability=experimental + * @availability stack since=2.3.0 stability=stable * @availability serverless stability=experimental visibility=private * @cluster_privileges manage * @doc_id tasks diff --git a/specification/tasks/get/GetTaskRequest.ts b/specification/tasks/get/GetTaskRequest.ts index 9f626071ad..776e5521ea 100644 --- a/specification/tasks/get/GetTaskRequest.ts +++ b/specification/tasks/get/GetTaskRequest.ts @@ -30,7 +30,7 @@ import { Duration } from '@_types/Time' * * 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 stack since=5.0.0 stability=stable * @availability serverless stability=experimental visibility=public * @cluster_privileges monitor * @doc_id tasks diff --git a/specification/tasks/list/ListTasksRequest.ts b/specification/tasks/list/ListTasksRequest.ts index 939dda5ff5..09094609c8 100644 --- a/specification/tasks/list/ListTasksRequest.ts +++ b/specification/tasks/list/ListTasksRequest.ts @@ -83,7 +83,7 @@ import { GroupBy } from '@tasks/_types/GroupBy' * 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 stack since=2.3.0 stability=stable * @availability serverless stability=experimental visibility=private * @cluster_privileges monitor * @doc_id tasks