From 593ba18114e56d9dd4822081b541a242a6eb415a Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Tue, 19 Aug 2025 16:53:57 +0100 Subject: [PATCH 1/2] [API] Generates latest code from c87b1a22e846cc829f8d06c4958b0d2418b51375 --- elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb | 1 + .../lib/elasticsearch/api/actions/cat/aliases.rb | 2 +- .../lib/elasticsearch/api/actions/cat/allocation.rb | 2 +- .../elasticsearch/api/actions/cat/component_templates.rb | 2 +- .../lib/elasticsearch/api/actions/cat/count.rb | 2 +- .../lib/elasticsearch/api/actions/cat/fielddata.rb | 2 +- .../elasticsearch/api/actions/cluster/get_settings.rb | 7 ++++++- .../lib/elasticsearch/api/actions/indices/put_mapping.rb | 2 +- .../lib/elasticsearch/api/actions/inference/put.rb | 9 +++++---- .../lib/elasticsearch/api/actions/reindex.rb | 5 +++++ elasticsearch-api/lib/elasticsearch/api/version.rb | 2 +- 11 files changed, 24 insertions(+), 12 deletions(-) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb b/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb index 820ab1844d..1ec0d57a68 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb @@ -78,6 +78,7 @@ module Actions # * JavaScript: Check out `client.helpers.*` # * .NET: Check out `BulkAllObservable` # * PHP: Check out bulk indexing. + # * Ruby: Check out `Elasticsearch::Helpers::BulkHelper` # **Submitting bulk requests with cURL** # If you're providing text file input to `curl`, you must use the `--data-binary` flag instead of plain `-d`. # The latter doesn't preserve newlines. For example: diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb index 37549558fa..952f8190d7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb @@ -28,7 +28,7 @@ module Actions # IMPORTANT: CAT APIs are only intended for human consumption using the command line or the Kibana console. They are not intended for use by applications. For application consumption, use the aliases API. # # @option arguments [String, Array] :name A comma-separated list of aliases to retrieve. Supports wildcards (`*`). To retrieve all aliases, omit this parameter or use `*` or `_all`. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb index 8daa241f68..3094858f1e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb @@ -28,7 +28,7 @@ module Actions # # @option arguments [String, Array] :node_id A comma-separated list of node identifiers or names used to limit the returned information. # @option arguments [String] :bytes The unit used to display byte values. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb index 81460d34e8..e9386e2dc1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb @@ -31,7 +31,7 @@ module Actions # @option arguments [String] :name The name of the component template. # It accepts wildcard expressions. # If it is omitted, all component templates are returned. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb index 785d772ea6..bd5ab98e08 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb @@ -31,7 +31,7 @@ module Actions # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases used to limit the request. # It supports wildcards (`*`). # To target all data streams and indices, omit this parameter or use `*` or `_all`. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb index 973b0cf643..85d743dd7d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb @@ -30,7 +30,7 @@ module Actions # @option arguments [String, Array] :fields Comma-separated list of fields used to limit returned information. # To retrieve all fields, omit this parameter. # @option arguments [String] :bytes The unit used to display byte values. - # @option arguments [String, Array] :h List of columns to appear in the response. Supports simple wildcards. + # @option arguments [String, Array] :h A comma-separated list of columns names to display. It supports simple wildcards. # @option arguments [String, Array] :s List of columns that determine how the table should be sorted. # Sorting defaults to ascending and can be changed by setting `:asc` # or `:desc` as a suffix to the column name. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb index 079aac89e9..cceded3515 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb @@ -26,7 +26,12 @@ module Actions # By default, it returns only settings that have been explicitly defined. # # @option arguments [Boolean] :flat_settings If `true`, returns settings in flat format. - # @option arguments [Boolean] :include_defaults If `true`, returns default cluster settings from the local node. + # @option arguments [Boolean] :include_defaults If `true`, also returns default values for all other cluster settings, reflecting the values + # in the `elasticsearch.yml` file of one of the nodes in the cluster. If the nodes in your + # cluster do not all have the same values in their `elasticsearch.yml` config files then the + # values returned by this API may vary from invocation to invocation and may not reflect the + # values that Elasticsearch uses in all situations. Use the `GET _nodes/settings` API to + # fetch the settings for each individual node in your cluster. # @option arguments [Time] :master_timeout 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. # @option arguments [Time] :timeout Period to wait for a response. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb index 7642a06665..5bf1317179 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb @@ -32,7 +32,7 @@ module Actions # - Update supported mapping parameters # - Change a field's mapping using reindexing # - Rename a field using a field alias - # Learn how to use the update mapping API with practical examples in the {https://www.elastic.co/docs//manage-data/data-store/mapping/update-mappings-examples Update mapping API examples} guide. + # Learn how to use the update mapping API with practical examples in the {https://www.elastic.co/docs/manage-data/data-store/mapping/update-mappings-examples Update mapping API examples} guide. # # @option arguments [String, Array] :index A comma-separated list of index names the mapping should be added to (supports wildcards); use `_all` or omit to add the mapping on all indices. (*Required*) # @option arguments [Boolean] :allow_no_indices If `false`, the request returns an error if any wildcard expression, index alias, or `_all` value targets only missing or closed indices. diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb index 4753927c69..f7b4982148 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb @@ -34,17 +34,18 @@ module Actions # * Azure AI Studio (`completion`, `text_embedding`) # * Azure OpenAI (`completion`, `text_embedding`) # * Cohere (`completion`, `rerank`, `text_embedding`) - # * DeepSeek (`completion`, `chat_completion`) + # * DeepSeek (`chat_completion`, `completion`) # * Elasticsearch (`rerank`, `sparse_embedding`, `text_embedding` - this service is for built-in models and models uploaded through Eland) # * ELSER (`sparse_embedding`) # * Google AI Studio (`completion`, `text_embedding`) - # * Google Vertex AI (`rerank`, `text_embedding`) + # * Google Vertex AI (`chat_completion`, `completion`, `rerank`, `text_embedding`) # * Hugging Face (`chat_completion`, `completion`, `rerank`, `text_embedding`) + # * JinaAI (`rerank`, `text_embedding`) + # * Llama (`chat_completion`, `completion`, `text_embedding`) # * Mistral (`chat_completion`, `completion`, `text_embedding`) # * OpenAI (`chat_completion`, `completion`, `text_embedding`) - # * VoyageAI (`text_embedding`, `rerank`) + # * VoyageAI (`rerank`, `text_embedding`) # * Watsonx inference integration (`text_embedding`) - # * JinaAI (`text_embedding`, `rerank`) # # @option arguments [String] :task_type The task type. Refer to the integration list in the API description for the available task types. # @option arguments [String] :inference_id The inference Id (*Required*) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/reindex.rb b/elasticsearch-api/lib/elasticsearch/api/actions/reindex.rb index 1f1007cdca..38b1963809 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/reindex.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/reindex.rb @@ -51,6 +51,11 @@ module Actions # In this case, the response includes a count of the version conflicts that were encountered. # Note that the handling of other error types is unaffected by the `conflicts` property. # Additionally, if you opt to count version conflicts, the operation could attempt to reindex more documents from the source than `max_docs` until it has successfully indexed `max_docs` documents into the target or it has gone through every document in the source query. + # It's recommended to reindex on indices with a green status. Reindexing can fail when a node shuts down or crashes. + # * When requested with `wait_for_completion=true` (default), the request fails if the node shuts down. + # * When requested with `wait_for_completion=false`, a task id is returned, which can be used via the task management API to monitor, debug, or cancel the task. The task may disappear or fail if the node shuts down. + # When retrying a failed reindex operation, it might be necessary to set `conflicts=proceed` or to first delete the partial destination index. + # Additionally, dry runs, checking disk space, and fetching index recovery information can help address the root cause. # Refer to the linked documentation for examples of how to reindex documents. # # @option arguments [Boolean] :refresh If `true`, the request refreshes affected shards to make this operation visible to search. diff --git a/elasticsearch-api/lib/elasticsearch/api/version.rb b/elasticsearch-api/lib/elasticsearch/api/version.rb index 3f8792516a..26c91ad7a2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/version.rb +++ b/elasticsearch-api/lib/elasticsearch/api/version.rb @@ -18,6 +18,6 @@ module Elasticsearch module API VERSION = '9.1.1'.freeze - ES_SPECIFICATION_COMMIT = '569f8b3768762075a47e5fa16a694b41cbc90a34'.freeze + ES_SPECIFICATION_COMMIT = 'c87b1a22e846cc829f8d06c4958b0d2418b51375'.freeze end end From 670237c767af240c604378a789fc66fa4f1dfbec Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Tue, 19 Aug 2025 16:55:33 +0100 Subject: [PATCH 2/2] [API] Adds transform.set_upgrade_mode --- .../api/actions/transform/set_upgrade_mode.rb | 50 +++++++++++++++++++ .../transform/set_upgrade_mode_spec.rb | 35 +++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/transform/set_upgrade_mode.rb create mode 100644 elasticsearch-api/spec/unit/actions/transform/set_upgrade_mode_spec.rb diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/set_upgrade_mode.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/set_upgrade_mode.rb new file mode 100644 index 0000000000..75c12bc322 --- /dev/null +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/set_upgrade_mode.rb @@ -0,0 +1,50 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# +# This code was automatically generated from the Elasticsearch Specification +# See https://github.com/elastic/elasticsearch-specification +# See Elasticsearch::ES_SPECIFICATION_COMMIT for commit hash. +module Elasticsearch + module API + module Transform + module Actions + # Sets a cluster wide upgrade_mode setting that prepares transform indices for an upgrade. + # + # @option arguments [Hash] :headers Custom HTTP headers + # + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/transform-set-upgrade-mode.html + # + def set_upgrade_mode(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || 'transform.set_upgrade_mode' } + + arguments = arguments.clone + headers = arguments.delete(:headers) || {} + + body = nil + + method = Elasticsearch::API::HTTP_POST + path = '_transform/set_upgrade_mode' + params = {} + + Elasticsearch::API::Response.new( + perform_request(method, path, params, body, headers, request_opts) + ) + end + end + end + end +end diff --git a/elasticsearch-api/spec/unit/actions/transform/set_upgrade_mode_spec.rb b/elasticsearch-api/spec/unit/actions/transform/set_upgrade_mode_spec.rb new file mode 100644 index 0000000000..9dd1b158c1 --- /dev/null +++ b/elasticsearch-api/spec/unit/actions/transform/set_upgrade_mode_spec.rb @@ -0,0 +1,35 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +require 'spec_helper' + +describe 'client.transform#set_upgrade_mode' do + let(:expected_args) do + [ + 'POST', + '_transform/set_upgrade_mode', + {}, + nil, + {}, + { endpoint: 'transform.set_upgrade_mode' } + ] + end + + it 'performs the request' do + expect(client_double.transform.set_upgrade_mode).to be_a Elasticsearch::API::Response + end +end