From d315ae3713085f170c66de5ca7d45219a281a441 Mon Sep 17 00:00:00 2001 From: lcawl Date: Fri, 3 Oct 2025 12:21:56 -0700 Subject: [PATCH 1/2] Override Duration data type --- docs/examples/languageExamples.json | 174 +++++++++++++++++- .../elasticsearch-shared-overlays.yaml | 8 + output/schema/schema.json | 174 +++++++++++++++++- 3 files changed, 336 insertions(+), 20 deletions(-) diff --git a/docs/examples/languageExamples.json b/docs/examples/languageExamples.json index a90130e4cf..3a683cb799 100644 --- a/docs/examples/languageExamples.json +++ b/docs/examples/languageExamples.json @@ -3016,23 +3016,23 @@ "specification/indices/put_alias/examples/request/indicesPutAliasRequestExample1.yaml": [ { "language": "Python", - "code": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" + "code": "resp = client.indices.put_alias(\n index=\"my-index-2099.05.06-000001\",\n name=\"my-alias\",\n filter={\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n },\n)" }, { "language": "JavaScript", - "code": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" + "code": "const response = await client.indices.putAlias({\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n filter: {\n bool: {\n filter: [\n {\n range: {\n \"@timestamp\": {\n gte: \"now-1d/d\",\n lt: \"now/d\",\n },\n },\n },\n {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n ],\n },\n },\n});" }, { "language": "Ruby", - "code": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" + "code": "response = client.indices.put_alias(\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n body: {\n \"filter\": {\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n }\n }\n)" }, { "language": "PHP", - "code": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" + "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"my-index-2099.05.06-000001\",\n \"name\" => \"my-alias\",\n \"body\" => [\n \"filter\" => [\n \"bool\" => [\n \"filter\" => array(\n [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"now-1d/d\",\n \"lt\" => \"now/d\",\n ],\n ],\n ],\n [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ),\n ],\n ],\n ],\n]);" }, { "language": "curl", - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"filter\":{\"bool\":{\"filter\":[{\"range\":{\"@timestamp\":{\"gte\":\"now-1d/d\",\"lt\":\"now/d\"}}},{\"term\":{\"user.id\":\"kimchy\"}}]}}}' \"$ELASTICSEARCH_URL/my-index-2099.05.06-000001/_alias/my-alias\"" } ], "specification/indices/put_data_stream_settings/examples/request/IndicesPutDataStreamSettingsRequestExample1.yaml": [ @@ -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,159 @@ "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/indices/put_alias/examples/request/indicesPutAliasRequestExample3.yaml": [ + { + "language": "Python", + "code": "resp = client.indices.put_alias(\n index=\"my-index-2099.05.06-000001\",\n name=\"my-alias\",\n routing=\"1\",\n)" + }, + { + "language": "JavaScript", + "code": "const response = await client.indices.putAlias({\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n routing: 1,\n});" + }, + { + "language": "Ruby", + "code": "response = client.indices.put_alias(\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n body: {\n \"routing\": \"1\"\n }\n)" + }, + { + "language": "PHP", + "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"my-index-2099.05.06-000001\",\n \"name\" => \"my-alias\",\n \"body\" => [\n \"routing\" => \"1\",\n ],\n]);" + }, + { + "language": "curl", + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"routing\":\"1\"}' \"$ELASTICSEARCH_URL/my-index-2099.05.06-000001/_alias/my-alias\"" + } + ], + "specification/indices/put_alias/examples/request/indicesPutAliasRequestExample2.yaml": [ + { + "language": "Python", + "code": "resp = client.indices.put_alias(\n index=\"logs-my_app-default\",\n name=\"logs\",\n is_write_index=True,\n)" + }, + { + "language": "JavaScript", + "code": "const response = await client.indices.putAlias({\n index: \"logs-my_app-default\",\n name: \"logs\",\n is_write_index: true,\n});" + }, + { + "language": "Ruby", + "code": "response = client.indices.put_alias(\n index: \"logs-my_app-default\",\n name: \"logs\",\n body: {\n \"is_write_index\": true\n }\n)" + }, + { + "language": "PHP", + "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"logs-my_app-default\",\n \"name\" => \"logs\",\n \"body\" => [\n \"is_write_index\" => true,\n ],\n]);" + }, + { + "language": "curl", + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"is_write_index\":true}' \"$ELASTICSEARCH_URL/logs-my_app-default/_alias/logs\"" + } + ], + "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\"" + } + ], + "specification/project/tags/examples/request/ProjectTagsRequestExample1.yaml": [ + { + "language": "Python", + "code": "resp = client.project.tags()" + }, + { + "language": "JavaScript", + "code": "const response = await client.project.tags();" + }, + { + "language": "Ruby", + "code": "response = client.project.tags" + }, + { + "language": "PHP", + "code": "$resp = $client->project()->tags();" + }, + { + "language": "curl", + "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_project/tags\"" + } + ], + "specification/inference/put_contextualai/examples/request/PutContextualAiRequestExample1.yaml": [ + { + "language": "Python", + "code": "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"contextualai-rerank\",\n inference_config={\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n },\n)" + }, + { + "language": "JavaScript", + "code": "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n inference_config: {\n service: \"contextualai\",\n service_settings: {\n api_key: \"ContextualAI-Api-key\",\n model_id: \"ctxl-rerank-v2-instruct-multilingual-mini\",\n },\n task_settings: {\n instruction:\n \"Rerank the following documents based on their relevance to the query.\",\n top_k: 3,\n },\n },\n});" + }, + { + "language": "Ruby", + "code": "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n body: {\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n }\n)" + }, + { + "language": "PHP", + "code": "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"contextualai-rerank\",\n \"body\" => [\n \"service\" => \"contextualai\",\n \"service_settings\" => [\n \"api_key\" => \"ContextualAI-Api-key\",\n \"model_id\" => \"ctxl-rerank-v2-instruct-multilingual-mini\",\n ],\n \"task_settings\" => [\n \"instruction\" => \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\" => 3,\n ],\n ],\n]);" + }, + { + "language": "curl", + "code": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"contextualai\",\"service_settings\":{\"api_key\":\"ContextualAI-Api-key\",\"model_id\":\"ctxl-rerank-v2-instruct-multilingual-mini\"},\"task_settings\":{\"instruction\":\"Rerank the following documents based on their relevance to the query.\",\"top_k\":3}}' \"$ELASTICSEARCH_URL/_inference/rerank/contextualai-rerank\"" + } ] } \ No newline at end of file diff --git a/docs/overlays/elasticsearch-shared-overlays.yaml b/docs/overlays/elasticsearch-shared-overlays.yaml index e000f5faae..ecddf06684 100644 --- a/docs/overlays/elasticsearch-shared-overlays.yaml +++ b/docs/overlays/elasticsearch-shared-overlays.yaml @@ -1152,3 +1152,11 @@ actions: - target: "$.components['schemas']['cat._types.CatTransformColumn'].enum" description: Remove enum array from cat transforms remove: true +# Simplify duration type + - target: "$.components['schemas']['_types.Duration'].oneOf" + description: Remove existing oneOf definition for Duration + remove: true + - target: "$.components['schemas']['_types.Duration']" + description: Re-add a simple string type for Duration + update: + type: string \ No newline at end of file diff --git a/output/schema/schema.json b/output/schema/schema.json index 418d1cfccd..3e112e8f6f 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -160380,23 +160380,23 @@ "indicesPutAliasRequestExample1": { "alternatives": [ { - "code": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)", + "code": "resp = client.indices.put_alias(\n index=\"my-index-2099.05.06-000001\",\n name=\"my-alias\",\n filter={\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n },\n)", "language": "Python" }, { - "code": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});", + "code": "const response = await client.indices.putAlias({\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n filter: {\n bool: {\n filter: [\n {\n range: {\n \"@timestamp\": {\n gte: \"now-1d/d\",\n lt: \"now/d\",\n },\n },\n },\n {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n ],\n },\n },\n});", "language": "JavaScript" }, { - "code": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)", + "code": "response = client.indices.put_alias(\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n body: {\n \"filter\": {\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n }\n }\n)", "language": "Ruby" }, { - "code": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);", + "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"my-index-2099.05.06-000001\",\n \"name\" => \"my-alias\",\n \"body\" => [\n \"filter\" => [\n \"bool\" => [\n \"filter\" => array(\n [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"now-1d/d\",\n \"lt\" => \"now/d\",\n ],\n ],\n ],\n [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ),\n ],\n ],\n ],\n]);", "language": "PHP" }, { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"", + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"filter\":{\"bool\":{\"filter\":[{\"range\":{\"@timestamp\":{\"gte\":\"now-1d/d\",\"lt\":\"now/d\"}}},{\"term\":{\"user.id\":\"kimchy\"}}]}}}' \"$ELASTICSEARCH_URL/my-index-2099.05.06-000001/_alias/my-alias\"", "language": "curl" } ], @@ -160406,12 +160406,56 @@ "value": "{\n \"filter\": {\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n }\n}" }, "indicesPutAliasRequestExample2": { + "alternatives": [ + { + "code": "resp = client.indices.put_alias(\n index=\"logs-my_app-default\",\n name=\"logs\",\n is_write_index=True,\n)", + "language": "Python" + }, + { + "code": "const response = await client.indices.putAlias({\n index: \"logs-my_app-default\",\n name: \"logs\",\n is_write_index: true,\n});", + "language": "JavaScript" + }, + { + "code": "response = client.indices.put_alias(\n index: \"logs-my_app-default\",\n name: \"logs\",\n body: {\n \"is_write_index\": true\n }\n)", + "language": "Ruby" + }, + { + "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"logs-my_app-default\",\n \"name\" => \"logs\",\n \"body\" => [\n \"is_write_index\" => true,\n ],\n]);", + "language": "PHP" + }, + { + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"is_write_index\":true}' \"$ELASTICSEARCH_URL/logs-my_app-default/_alias/logs\"", + "language": "curl" + } + ], "description": "You can use is_write_index to specify a write index or data stream for an alias. Elasticsearch routes any write requests for the alias to this index or data stream.", "method_request": "POST /logs-my_app-default/_alias/logs", "summary": "Write index", "value": "{\n \"is_write_index\": true\n}" }, "indicesPutAliasRequestExample3": { + "alternatives": [ + { + "code": "resp = client.indices.put_alias(\n index=\"my-index-2099.05.06-000001\",\n name=\"my-alias\",\n routing=\"1\",\n)", + "language": "Python" + }, + { + "code": "const response = await client.indices.putAlias({\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n routing: 1,\n});", + "language": "JavaScript" + }, + { + "code": "response = client.indices.put_alias(\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n body: {\n \"routing\": \"1\"\n }\n)", + "language": "Ruby" + }, + { + "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"my-index-2099.05.06-000001\",\n \"name\" => \"my-alias\",\n \"body\" => [\n \"routing\" => \"1\",\n ],\n]);", + "language": "PHP" + }, + { + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"routing\":\"1\"}' \"$ELASTICSEARCH_URL/my-index-2099.05.06-000001/_alias/my-alias\"", + "language": "curl" + } + ], "description": "Use the routing option to route requests for an alias to a specific shard.", "method_request": "POST /my-index-2099.05.06-000001/_alias/my-alias", "summary": "Routing", @@ -177796,6 +177840,28 @@ "description": "Create an Contextual AI inference endpoint.\n\nCreate an inference endpoint to perform an inference task with the `contexualai` service.\n\nTo review the available `rerank` models, refer to .", "examples": { "PutContextualAiRequestExample1": { + "alternatives": [ + { + "code": "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"contextualai-rerank\",\n inference_config={\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n },\n)", + "language": "Python" + }, + { + "code": "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n inference_config: {\n service: \"contextualai\",\n service_settings: {\n api_key: \"ContextualAI-Api-key\",\n model_id: \"ctxl-rerank-v2-instruct-multilingual-mini\",\n },\n task_settings: {\n instruction:\n \"Rerank the following documents based on their relevance to the query.\",\n top_k: 3,\n },\n },\n});", + "language": "JavaScript" + }, + { + "code": "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n body: {\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n }\n)", + "language": "Ruby" + }, + { + "code": "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"contextualai-rerank\",\n \"body\" => [\n \"service\" => \"contextualai\",\n \"service_settings\" => [\n \"api_key\" => \"ContextualAI-Api-key\",\n \"model_id\" => \"ctxl-rerank-v2-instruct-multilingual-mini\",\n ],\n \"task_settings\" => [\n \"instruction\" => \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\" => 3,\n ],\n ],\n]);", + "language": "PHP" + }, + { + "code": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"contextualai\",\"service_settings\":{\"api_key\":\"ContextualAI-Api-key\",\"model_id\":\"ctxl-rerank-v2-instruct-multilingual-mini\"},\"task_settings\":{\"instruction\":\"Rerank the following documents based on their relevance to the query.\",\"top_k\":3}}' \"$ELASTICSEARCH_URL/_inference/rerank/contextualai-rerank\"", + "language": "curl" + } + ], "description": "Run `PUT _inference/rerank/contextualai-rerank` to create an inference endpoint for rerank tasks using the Contextual AI service.", "method_request": "PUT _inference/rerank/contextualai-rerank", "summary": "A rerank task", @@ -180928,23 +180994,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" } ], @@ -227649,6 +227715,28 @@ "description": "Return tags defined for the project", "examples": { "ProjectTagsRequestExample1": { + "alternatives": [ + { + "code": "resp = client.project.tags()", + "language": "Python" + }, + { + "code": "const response = await client.project.tags();", + "language": "JavaScript" + }, + { + "code": "response = client.project.tags", + "language": "Ruby" + }, + { + "code": "$resp = $client->project()->tags();", + "language": "PHP" + }, + { + "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_project/tags\"", + "language": "curl" + } + ], "method_request": "GET /_project/tags" } }, @@ -259375,6 +259463,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" } @@ -259457,6 +259567,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" } @@ -259561,6 +259693,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" } From bdc29138e73d465b70ead6bb86dc76cb57d37ed9 Mon Sep 17 00:00:00 2001 From: lcawl Date: Fri, 3 Oct 2025 12:31:23 -0700 Subject: [PATCH 2/2] Revert changes to generated files --- docs/examples/languageExamples.json | 174 ++-------------------------- output/schema/schema.json | 174 ++-------------------------- 2 files changed, 20 insertions(+), 328 deletions(-) diff --git a/docs/examples/languageExamples.json b/docs/examples/languageExamples.json index 3a683cb799..a90130e4cf 100644 --- a/docs/examples/languageExamples.json +++ b/docs/examples/languageExamples.json @@ -3016,23 +3016,23 @@ "specification/indices/put_alias/examples/request/indicesPutAliasRequestExample1.yaml": [ { "language": "Python", - "code": "resp = client.indices.put_alias(\n index=\"my-index-2099.05.06-000001\",\n name=\"my-alias\",\n filter={\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n },\n)" + "code": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)" }, { "language": "JavaScript", - "code": "const response = await client.indices.putAlias({\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n filter: {\n bool: {\n filter: [\n {\n range: {\n \"@timestamp\": {\n gte: \"now-1d/d\",\n lt: \"now/d\",\n },\n },\n },\n {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n ],\n },\n },\n});" + "code": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});" }, { "language": "Ruby", - "code": "response = client.indices.put_alias(\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n body: {\n \"filter\": {\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n }\n }\n)" + "code": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)" }, { "language": "PHP", - "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"my-index-2099.05.06-000001\",\n \"name\" => \"my-alias\",\n \"body\" => [\n \"filter\" => [\n \"bool\" => [\n \"filter\" => array(\n [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"now-1d/d\",\n \"lt\" => \"now/d\",\n ],\n ],\n ],\n [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ),\n ],\n ],\n ],\n]);" + "code": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);" }, { "language": "curl", - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"filter\":{\"bool\":{\"filter\":[{\"range\":{\"@timestamp\":{\"gte\":\"now-1d/d\",\"lt\":\"now/d\"}}},{\"term\":{\"user.id\":\"kimchy\"}}]}}}' \"$ELASTICSEARCH_URL/my-index-2099.05.06-000001/_alias/my-alias\"" + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"" } ], "specification/indices/put_data_stream_settings/examples/request/IndicesPutDataStreamSettingsRequestExample1.yaml": [ @@ -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 input_type=\"ingest\",\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 task_settings={\n \"input_type\": \"ingest\"\n },\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 input_type: \"ingest\",\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 task_settings: {\n input_type: \"ingest\",\n },\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 \"input_type\": \"ingest\"\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 \"task_settings\": {\n \"input_type\": \"ingest\"\n }\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 \"input_type\" => \"ingest\",\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 \"task_settings\" => [\n \"input_type\" => \"ingest\",\n ],\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.\",\"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.\",\"task_settings\":{\"input_type\":\"ingest\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint\"" } ], "specification/inference/put_jinaai/examples/request/PutJinaAiRequestExample1.yaml": [ @@ -14848,159 +14848,5 @@ "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/indices/put_alias/examples/request/indicesPutAliasRequestExample3.yaml": [ - { - "language": "Python", - "code": "resp = client.indices.put_alias(\n index=\"my-index-2099.05.06-000001\",\n name=\"my-alias\",\n routing=\"1\",\n)" - }, - { - "language": "JavaScript", - "code": "const response = await client.indices.putAlias({\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n routing: 1,\n});" - }, - { - "language": "Ruby", - "code": "response = client.indices.put_alias(\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n body: {\n \"routing\": \"1\"\n }\n)" - }, - { - "language": "PHP", - "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"my-index-2099.05.06-000001\",\n \"name\" => \"my-alias\",\n \"body\" => [\n \"routing\" => \"1\",\n ],\n]);" - }, - { - "language": "curl", - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"routing\":\"1\"}' \"$ELASTICSEARCH_URL/my-index-2099.05.06-000001/_alias/my-alias\"" - } - ], - "specification/indices/put_alias/examples/request/indicesPutAliasRequestExample2.yaml": [ - { - "language": "Python", - "code": "resp = client.indices.put_alias(\n index=\"logs-my_app-default\",\n name=\"logs\",\n is_write_index=True,\n)" - }, - { - "language": "JavaScript", - "code": "const response = await client.indices.putAlias({\n index: \"logs-my_app-default\",\n name: \"logs\",\n is_write_index: true,\n});" - }, - { - "language": "Ruby", - "code": "response = client.indices.put_alias(\n index: \"logs-my_app-default\",\n name: \"logs\",\n body: {\n \"is_write_index\": true\n }\n)" - }, - { - "language": "PHP", - "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"logs-my_app-default\",\n \"name\" => \"logs\",\n \"body\" => [\n \"is_write_index\" => true,\n ],\n]);" - }, - { - "language": "curl", - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"is_write_index\":true}' \"$ELASTICSEARCH_URL/logs-my_app-default/_alias/logs\"" - } - ], - "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\"" - } - ], - "specification/project/tags/examples/request/ProjectTagsRequestExample1.yaml": [ - { - "language": "Python", - "code": "resp = client.project.tags()" - }, - { - "language": "JavaScript", - "code": "const response = await client.project.tags();" - }, - { - "language": "Ruby", - "code": "response = client.project.tags" - }, - { - "language": "PHP", - "code": "$resp = $client->project()->tags();" - }, - { - "language": "curl", - "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_project/tags\"" - } - ], - "specification/inference/put_contextualai/examples/request/PutContextualAiRequestExample1.yaml": [ - { - "language": "Python", - "code": "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"contextualai-rerank\",\n inference_config={\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n },\n)" - }, - { - "language": "JavaScript", - "code": "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n inference_config: {\n service: \"contextualai\",\n service_settings: {\n api_key: \"ContextualAI-Api-key\",\n model_id: \"ctxl-rerank-v2-instruct-multilingual-mini\",\n },\n task_settings: {\n instruction:\n \"Rerank the following documents based on their relevance to the query.\",\n top_k: 3,\n },\n },\n});" - }, - { - "language": "Ruby", - "code": "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n body: {\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n }\n)" - }, - { - "language": "PHP", - "code": "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"contextualai-rerank\",\n \"body\" => [\n \"service\" => \"contextualai\",\n \"service_settings\" => [\n \"api_key\" => \"ContextualAI-Api-key\",\n \"model_id\" => \"ctxl-rerank-v2-instruct-multilingual-mini\",\n ],\n \"task_settings\" => [\n \"instruction\" => \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\" => 3,\n ],\n ],\n]);" - }, - { - "language": "curl", - "code": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"contextualai\",\"service_settings\":{\"api_key\":\"ContextualAI-Api-key\",\"model_id\":\"ctxl-rerank-v2-instruct-multilingual-mini\"},\"task_settings\":{\"instruction\":\"Rerank the following documents based on their relevance to the query.\",\"top_k\":3}}' \"$ELASTICSEARCH_URL/_inference/rerank/contextualai-rerank\"" - } ] } \ No newline at end of file diff --git a/output/schema/schema.json b/output/schema/schema.json index 3e112e8f6f..418d1cfccd 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -160380,23 +160380,23 @@ "indicesPutAliasRequestExample1": { "alternatives": [ { - "code": "resp = client.indices.put_alias(\n index=\"my-index-2099.05.06-000001\",\n name=\"my-alias\",\n filter={\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n },\n)", + "code": "resp = client.indices.update_aliases(\n actions=[\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ],\n)", "language": "Python" }, { - "code": "const response = await client.indices.putAlias({\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n filter: {\n bool: {\n filter: [\n {\n range: {\n \"@timestamp\": {\n gte: \"now-1d/d\",\n lt: \"now/d\",\n },\n },\n },\n {\n term: {\n \"user.id\": \"kimchy\",\n },\n },\n ],\n },\n },\n});", + "code": "const response = await client.indices.updateAliases({\n actions: [\n {\n add: {\n index: \"my-data-stream\",\n alias: \"my-alias\",\n },\n },\n ],\n});", "language": "JavaScript" }, { - "code": "response = client.indices.put_alias(\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n body: {\n \"filter\": {\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n }\n }\n)", + "code": "response = client.indices.update_aliases(\n body: {\n \"actions\": [\n {\n \"add\": {\n \"index\": \"my-data-stream\",\n \"alias\": \"my-alias\"\n }\n }\n ]\n }\n)", "language": "Ruby" }, { - "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"my-index-2099.05.06-000001\",\n \"name\" => \"my-alias\",\n \"body\" => [\n \"filter\" => [\n \"bool\" => [\n \"filter\" => array(\n [\n \"range\" => [\n \"@timestamp\" => [\n \"gte\" => \"now-1d/d\",\n \"lt\" => \"now/d\",\n ],\n ],\n ],\n [\n \"term\" => [\n \"user.id\" => \"kimchy\",\n ],\n ],\n ),\n ],\n ],\n ],\n]);", + "code": "$resp = $client->indices()->updateAliases([\n \"body\" => [\n \"actions\" => array(\n [\n \"add\" => [\n \"index\" => \"my-data-stream\",\n \"alias\" => \"my-alias\",\n ],\n ],\n ),\n ],\n]);", "language": "PHP" }, { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"filter\":{\"bool\":{\"filter\":[{\"range\":{\"@timestamp\":{\"gte\":\"now-1d/d\",\"lt\":\"now/d\"}}},{\"term\":{\"user.id\":\"kimchy\"}}]}}}' \"$ELASTICSEARCH_URL/my-index-2099.05.06-000001/_alias/my-alias\"", + "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"actions\":[{\"add\":{\"index\":\"my-data-stream\",\"alias\":\"my-alias\"}}]}' \"$ELASTICSEARCH_URL/_aliases\"", "language": "curl" } ], @@ -160406,56 +160406,12 @@ "value": "{\n \"filter\": {\n \"bool\": {\n \"filter\": [\n {\n \"range\": {\n \"@timestamp\": {\n \"gte\": \"now-1d/d\",\n \"lt\": \"now/d\"\n }\n }\n },\n {\n \"term\": {\n \"user.id\": \"kimchy\"\n }\n }\n ]\n }\n }\n}" }, "indicesPutAliasRequestExample2": { - "alternatives": [ - { - "code": "resp = client.indices.put_alias(\n index=\"logs-my_app-default\",\n name=\"logs\",\n is_write_index=True,\n)", - "language": "Python" - }, - { - "code": "const response = await client.indices.putAlias({\n index: \"logs-my_app-default\",\n name: \"logs\",\n is_write_index: true,\n});", - "language": "JavaScript" - }, - { - "code": "response = client.indices.put_alias(\n index: \"logs-my_app-default\",\n name: \"logs\",\n body: {\n \"is_write_index\": true\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"logs-my_app-default\",\n \"name\" => \"logs\",\n \"body\" => [\n \"is_write_index\" => true,\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"is_write_index\":true}' \"$ELASTICSEARCH_URL/logs-my_app-default/_alias/logs\"", - "language": "curl" - } - ], "description": "You can use is_write_index to specify a write index or data stream for an alias. Elasticsearch routes any write requests for the alias to this index or data stream.", "method_request": "POST /logs-my_app-default/_alias/logs", "summary": "Write index", "value": "{\n \"is_write_index\": true\n}" }, "indicesPutAliasRequestExample3": { - "alternatives": [ - { - "code": "resp = client.indices.put_alias(\n index=\"my-index-2099.05.06-000001\",\n name=\"my-alias\",\n routing=\"1\",\n)", - "language": "Python" - }, - { - "code": "const response = await client.indices.putAlias({\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n routing: 1,\n});", - "language": "JavaScript" - }, - { - "code": "response = client.indices.put_alias(\n index: \"my-index-2099.05.06-000001\",\n name: \"my-alias\",\n body: {\n \"routing\": \"1\"\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->indices()->putAlias([\n \"index\" => \"my-index-2099.05.06-000001\",\n \"name\" => \"my-alias\",\n \"body\" => [\n \"routing\" => \"1\",\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X POST -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"routing\":\"1\"}' \"$ELASTICSEARCH_URL/my-index-2099.05.06-000001/_alias/my-alias\"", - "language": "curl" - } - ], "description": "Use the routing option to route requests for an alias to a specific shard.", "method_request": "POST /my-index-2099.05.06-000001/_alias/my-alias", "summary": "Routing", @@ -177840,28 +177796,6 @@ "description": "Create an Contextual AI inference endpoint.\n\nCreate an inference endpoint to perform an inference task with the `contexualai` service.\n\nTo review the available `rerank` models, refer to .", "examples": { "PutContextualAiRequestExample1": { - "alternatives": [ - { - "code": "resp = client.inference.put(\n task_type=\"rerank\",\n inference_id=\"contextualai-rerank\",\n inference_config={\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n },\n)", - "language": "Python" - }, - { - "code": "const response = await client.inference.put({\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n inference_config: {\n service: \"contextualai\",\n service_settings: {\n api_key: \"ContextualAI-Api-key\",\n model_id: \"ctxl-rerank-v2-instruct-multilingual-mini\",\n },\n task_settings: {\n instruction:\n \"Rerank the following documents based on their relevance to the query.\",\n top_k: 3,\n },\n },\n});", - "language": "JavaScript" - }, - { - "code": "response = client.inference.put(\n task_type: \"rerank\",\n inference_id: \"contextualai-rerank\",\n body: {\n \"service\": \"contextualai\",\n \"service_settings\": {\n \"api_key\": \"ContextualAI-Api-key\",\n \"model_id\": \"ctxl-rerank-v2-instruct-multilingual-mini\"\n },\n \"task_settings\": {\n \"instruction\": \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\": 3\n }\n }\n)", - "language": "Ruby" - }, - { - "code": "$resp = $client->inference()->put([\n \"task_type\" => \"rerank\",\n \"inference_id\" => \"contextualai-rerank\",\n \"body\" => [\n \"service\" => \"contextualai\",\n \"service_settings\" => [\n \"api_key\" => \"ContextualAI-Api-key\",\n \"model_id\" => \"ctxl-rerank-v2-instruct-multilingual-mini\",\n ],\n \"task_settings\" => [\n \"instruction\" => \"Rerank the following documents based on their relevance to the query.\",\n \"top_k\" => 3,\n ],\n ],\n]);", - "language": "PHP" - }, - { - "code": "curl -X PUT -H \"Authorization: ApiKey $ELASTIC_API_KEY\" -H \"Content-Type: application/json\" -d '{\"service\":\"contextualai\",\"service_settings\":{\"api_key\":\"ContextualAI-Api-key\",\"model_id\":\"ctxl-rerank-v2-instruct-multilingual-mini\"},\"task_settings\":{\"instruction\":\"Rerank the following documents based on their relevance to the query.\",\"top_k\":3}}' \"$ELASTICSEARCH_URL/_inference/rerank/contextualai-rerank\"", - "language": "curl" - } - ], "description": "Run `PUT _inference/rerank/contextualai-rerank` to create an inference endpoint for rerank tasks using the Contextual AI service.", "method_request": "PUT _inference/rerank/contextualai-rerank", "summary": "A rerank task", @@ -180994,23 +180928,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 input_type=\"ingest\",\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 task_settings={\n \"input_type\": \"ingest\"\n },\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 input_type: \"ingest\",\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 task_settings: {\n input_type: \"ingest\",\n },\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 \"input_type\": \"ingest\"\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 \"task_settings\": {\n \"input_type\": \"ingest\"\n }\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 \"input_type\" => \"ingest\",\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 \"task_settings\" => [\n \"input_type\" => \"ingest\",\n ],\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.\",\"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.\",\"task_settings\":{\"input_type\":\"ingest\"}}' \"$ELASTICSEARCH_URL/_inference/text_embedding/my-cohere-endpoint\"", "language": "curl" } ], @@ -227715,28 +227649,6 @@ "description": "Return tags defined for the project", "examples": { "ProjectTagsRequestExample1": { - "alternatives": [ - { - "code": "resp = client.project.tags()", - "language": "Python" - }, - { - "code": "const response = await client.project.tags();", - "language": "JavaScript" - }, - { - "code": "response = client.project.tags", - "language": "Ruby" - }, - { - "code": "$resp = $client->project()->tags();", - "language": "PHP" - }, - { - "code": "curl -X GET -H \"Authorization: ApiKey $ELASTIC_API_KEY\" \"$ELASTICSEARCH_URL/_project/tags\"", - "language": "curl" - } - ], "method_request": "GET /_project/tags" } }, @@ -259463,28 +259375,6 @@ "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" } @@ -259567,28 +259457,6 @@ "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" } @@ -259693,28 +259561,6 @@ "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" }