From 6f6a3c1c5f038500a9072d10b8be690a3ddc9e96 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Tue, 25 Feb 2025 16:49:45 +0000 Subject: [PATCH 01/11] [Generator] Updates automation rake task for code generation --- .github/make.sh | 1 + rake_tasks/automation.rake | 17 ++++++++++++----- rake_tasks/elasticsearch_tasks.rake | 3 ++- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/make.sh b/.github/make.sh index a3ce02170..b36c4cea5 100755 --- a/.github/make.sh +++ b/.github/make.sh @@ -128,6 +128,7 @@ docker run \ -u "$(id -u)" \ --env "RUBY_VERSION=${RUBY_VERSION}" \ --env "WORKFLOW=${WORKFLOW}" \ + --env "CLIENTS_GITHUB_TOKEN=${CLIENTS_GITHUB_TOKEN}" \ --name test-runner \ --volume "${repo}:/usr/src/app" \ --rm \ diff --git a/rake_tasks/automation.rake b/rake_tasks/automation.rake index 7ccca18e4..8076005a6 100644 --- a/rake_tasks/automation.rake +++ b/rake_tasks/automation.rake @@ -38,12 +38,19 @@ namespace :automation do desc 'Generate API code' task :codegen do - version = YAML.load_file(File.expand_path("#{__dir__}/../.buildkite/pipeline.yml"))['steps'].first['env']['STACK_VERSION'] + path = File.expand_path('../elasticsearch-api/', __dir__) + branch = YAML.load_file(File.expand_path("#{__dir__}/../.buildkite/pipeline.yml"))['steps'].first['env']['ES_YAML_TESTS_BRANCH'] + unless File.exist?(File.expand_path('elastic-client-generator-ruby', __dir__)) + sh "git clone https://#{ENV['CLIENTS_GITHUB_TOKEN']}@github.com/elastic/elastic-client-generator-ruby.git " + end - Rake::Task['es:download_artifacts'].invoke(version) - sh "cd #{CURRENT_PATH.join('elasticsearch-api/utils')} \ - && BUNDLE_GEMFILE=`pwd`/Gemfile \ - && bundle exec thor code:generate" + sh "export ES_RUBY_CLIENT_PATH=#{path} " \ + ' && cd elastic-client-generator-ruby/elasticsearch ' \ + ' && sudo bundle install ' \ + " && bundle exec rake update[#{branch}]" \ + ' && bundle exec rake gen_es' \ + ' && cd ../../ ' \ + ' && rm -rf elastic-client-generator-ruby ' end desc <<-DESC diff --git a/rake_tasks/elasticsearch_tasks.rake b/rake_tasks/elasticsearch_tasks.rake index 9d7deb50a..316cbb71a 100644 --- a/rake_tasks/elasticsearch_tasks.rake +++ b/rake_tasks/elasticsearch_tasks.rake @@ -73,7 +73,8 @@ namespace :es do abort e.message end - desc 'Download artifacts (tests and REST spec) for currently running cluster' + # Deprecated + desc 'Download Elasticsearch artifacts (tests and REST spec) for currently running cluster' task :download_artifacts, :version do |_, args| json_filename = CURRENT_PATH.join('tmp/artifacts.json') From 1fd4c1b08f44e867e6c369ade0ae6493ad5f53bd Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Tue, 25 Feb 2025 17:02:37 +0000 Subject: [PATCH 02/11] Adds .env to gitignore --- elasticsearch-api/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/elasticsearch-api/.gitignore b/elasticsearch-api/.gitignore index d87d4be66..fc492d778 100644 --- a/elasticsearch-api/.gitignore +++ b/elasticsearch-api/.gitignore @@ -2,6 +2,7 @@ *.rbc .bundle .config +.env .yardoc Gemfile.lock InstalledFiles From 58e65e9b4b788acb1b10dfb0c031b9271825c660 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 6 Mar 2025 09:11:55 +0000 Subject: [PATCH 03/11] [API] Removes rollup APIs The rollup feature was never GA-ed and is still tech preview. It has been deprecated since 8.11.0 in favor of downsampling. --- elasticsearch-api/lib/elasticsearch/api.rb | 1 - .../api/actions/rollup/delete_job.rb | 64 ----------------- .../api/actions/rollup/get_jobs.rb | 66 ------------------ .../api/actions/rollup/get_rollup_caps.rb | 66 ------------------ .../actions/rollup/get_rollup_index_caps.rb | 64 ----------------- .../api/actions/rollup/put_job.rb | 66 ------------------ .../api/actions/rollup/rollup_search.rb | 68 ------------------- .../api/actions/rollup/start_job.rb | 64 ----------------- .../api/actions/rollup/stop_job.rb | 66 ------------------ .../lib/elasticsearch/api/namespace/rollup.rb | 36 ---------- .../rollup/get_rollup_index_caps_spec.rb | 35 ---------- 11 files changed, 596 deletions(-) delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/rollup/delete_job.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_jobs.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_rollup_caps.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_rollup_index_caps.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/rollup/put_job.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/rollup/rollup_search.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/rollup/start_job.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/rollup/stop_job.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/rollup.rb delete mode 100644 elasticsearch-api/spec/unit/actions/rollup/get_rollup_index_caps_spec.rb diff --git a/elasticsearch-api/lib/elasticsearch/api.rb b/elasticsearch-api/lib/elasticsearch/api.rb index 1a8471002..ae016a87c 100644 --- a/elasticsearch-api/lib/elasticsearch/api.rb +++ b/elasticsearch-api/lib/elasticsearch/api.rb @@ -70,7 +70,6 @@ def self.included(base) Elasticsearch::API::Logstash, Elasticsearch::API::Migration, Elasticsearch::API::MachineLearning, - Elasticsearch::API::Rollup, Elasticsearch::API::SearchableSnapshots, Elasticsearch::API::Security, Elasticsearch::API::SnapshotLifecycleManagement, diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/delete_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/rollup/delete_job.rb deleted file mode 100644 index fe87cfa55..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/delete_job.rb +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Rollup - module Actions - # Deletes an existing rollup job. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the job to delete - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-delete-job.html - # - def delete_job(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'rollup.delete_job' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_DELETE - path = "_rollup/job/#{Utils.__listify(_id)}" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_jobs.rb b/elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_jobs.rb deleted file mode 100644 index 434438652..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_jobs.rb +++ /dev/null @@ -1,66 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Rollup - module Actions - # Retrieves the configuration, stats, and status of rollup jobs. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the job(s) to fetch. Accepts glob patterns, or left blank for all jobs - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-get-job.html - # - def get_jobs(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'rollup.get_jobs' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_GET - path = if _id - "_rollup/job/#{Utils.__listify(_id)}" - else - '_rollup/job' - end - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_rollup_caps.rb b/elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_rollup_caps.rb deleted file mode 100644 index 93ac86cec..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_rollup_caps.rb +++ /dev/null @@ -1,66 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Rollup - module Actions - # Returns the capabilities of any rollup jobs that have been configured for a specific index or index pattern. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the index to check rollup capabilities on, or left blank for all jobs - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-get-rollup-caps.html - # - def get_rollup_caps(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'rollup.get_rollup_caps' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_GET - path = if _id - "_rollup/data/#{Utils.__listify(_id)}" - else - '_rollup/data' - end - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_rollup_index_caps.rb b/elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_rollup_index_caps.rb deleted file mode 100644 index d530edc59..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/get_rollup_index_caps.rb +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Rollup - module Actions - # Returns the rollup capabilities of all jobs inside of a rollup index (e.g. the index where rollup data is stored). - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :index The rollup index or index pattern to obtain rollup capabilities from. - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-get-rollup-index-caps.html - # - def get_rollup_index_caps(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'rollup.get_rollup_index_caps' } - - defined_params = [:index].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _index = arguments.delete(:index) - - method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_rollup/data" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/put_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/rollup/put_job.rb deleted file mode 100644 index 1286e65c2..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/put_job.rb +++ /dev/null @@ -1,66 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Rollup - module Actions - # Creates a rollup job. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the job to create - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The job configuration (*Required*) - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-put-job.html - # - def put_job(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'rollup.put_job' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_PUT - path = "_rollup/job/#{Utils.__listify(_id)}" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/rollup_search.rb b/elasticsearch-api/lib/elasticsearch/api/actions/rollup/rollup_search.rb deleted file mode 100644 index 597524c34..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/rollup_search.rb +++ /dev/null @@ -1,68 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Rollup - module Actions - # Enables searching rolled-up data using the standard query DSL. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [List] :index The indices or index-pattern(s) (containing rollup or regular data) that should be searched - # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response - # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether hits.total should be rendered as an integer or an object in the rest search response - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search request body (*Required*) - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-search.html - # - def rollup_search(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'rollup.rollup_search' } - - defined_params = [:index].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - _index = arguments.delete(:index) - - method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_rollup_search" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/start_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/rollup/start_job.rb deleted file mode 100644 index d1108d1ba..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/start_job.rb +++ /dev/null @@ -1,64 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Rollup - module Actions - # Starts an existing, stopped rollup job. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the job to start - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-start-job.html - # - def start_job(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'rollup.start_job' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_POST - path = "_rollup/job/#{Utils.__listify(_id)}/_start" - params = {} - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/stop_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/rollup/stop_job.rb deleted file mode 100644 index f33070a4d..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/rollup/stop_job.rb +++ /dev/null @@ -1,66 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Rollup - module Actions - # Stops an existing, started rollup job. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :id The ID of the job to stop - # @option arguments [Boolean] :wait_for_completion True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false. - # @option arguments [Time] :timeout Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s. - # @option arguments [Hash] :headers Custom HTTP headers - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/rollup-stop-job.html - # - def stop_job(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'rollup.stop_job' } - - defined_params = [:id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = nil - - _id = arguments.delete(:id) - - method = Elasticsearch::API::HTTP_POST - path = "_rollup/job/#{Utils.__listify(_id)}/_stop" - params = Utils.process_params(arguments) - - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/rollup.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/rollup.rb deleted file mode 100644 index 1e0e4b1c8..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/rollup.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Rollup - module Actions; end - - # Client for the "rollup" namespace (includes the {Rollup::Actions} methods) - # - class RollupClient - include Common::Client, Common::Client::Base, Rollup::Actions - end - - # Proxy method for {RollupClient}, available in the receiving object - # - def rollup - @rollup ||= RollupClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/spec/unit/actions/rollup/get_rollup_index_caps_spec.rb b/elasticsearch-api/spec/unit/actions/rollup/get_rollup_index_caps_spec.rb deleted file mode 100644 index 240a98be4..000000000 --- a/elasticsearch-api/spec/unit/actions/rollup/get_rollup_index_caps_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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#rollup.get_rollup_index_caps' do - let(:expected_args) do - [ - 'GET', - 'foo/_rollup/data', - {}, - nil, - {}, - { endpoint: 'rollup.get_rollup_index_caps', defined_params: { index: 'foo' } } - ] - end - - it 'performs the request' do - expect(client_double.rollup.get_rollup_index_caps(index: 'foo')).to be_a Elasticsearch::API::Response - end -end From 8c00cd2e37a50aa23a49723363968ba3f97cb1e8 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 6 Mar 2025 09:39:20 +0000 Subject: [PATCH 04/11] [API] Refactors namespace and requiring API code Based on the code written in the Elasticsearch Serverless client, this change makes the creation of the namespace clients dynamic, removing all the files that were under `namespace` before. Some outdated and deprecated code was removed too, like unnecessary namespaces. --- elasticsearch-api/lib/elasticsearch/api.rb | 133 ++++++++++-------- .../api/namespace/async_search.rb | 36 ----- .../api/namespace/autoscaling.rb | 36 ----- .../lib/elasticsearch/api/namespace/cat.rb | 36 ----- .../elasticsearch/api/namespace/cluster.rb | 37 ----- .../lib/elasticsearch/api/namespace/common.rb | 42 ------ .../elasticsearch/api/namespace/connector.rb | 36 ----- .../namespace/cross_cluster_replication.rb | 38 ----- .../api/namespace/dangling_indices.rb | 35 ----- .../data_frame_transform_deprecated.rb | 36 ----- .../lib/elasticsearch/api/namespace/enrich.rb | 36 ----- .../lib/elasticsearch/api/namespace/eql.rb | 36 ----- .../lib/elasticsearch/api/namespace/esql.rb | 36 ----- .../elasticsearch/api/namespace/features.rb | 36 ----- .../lib/elasticsearch/api/namespace/fleet.rb | 36 ----- .../lib/elasticsearch/api/namespace/graph.rb | 36 ----- .../namespace/index_lifecycle_management.rb | 38 ----- .../elasticsearch/api/namespace/indices.rb | 37 ----- .../elasticsearch/api/namespace/inference.rb | 36 ----- .../lib/elasticsearch/api/namespace/ingest.rb | 36 ----- .../elasticsearch/api/namespace/license.rb | 36 ----- .../elasticsearch/api/namespace/logstash.rb | 36 ----- .../api/namespace/machine_learning.rb | 38 ----- .../elasticsearch/api/namespace/migration.rb | 36 ----- .../lib/elasticsearch/api/namespace/nodes.rb | 37 ----- .../api/namespace/query_rules.rb | 36 ----- .../api/namespace/query_ruleset.rb | 36 ----- .../lib/elasticsearch/api/namespace/remote.rb | 37 ----- .../api/namespace/search_application.rb | 36 ----- .../api/namespace/searchable_snapshots.rb | 36 ----- .../elasticsearch/api/namespace/security.rb | 36 ----- .../elasticsearch/api/namespace/simulate.rb | 36 ----- .../elasticsearch/api/namespace/snapshot.rb | 37 ----- .../snapshot_lifecycle_management.rb | 38 ----- .../lib/elasticsearch/api/namespace/sql.rb | 36 ----- .../lib/elasticsearch/api/namespace/ssl.rb | 36 ----- .../elasticsearch/api/namespace/synonyms.rb | 36 ----- .../lib/elasticsearch/api/namespace/tasks.rb | 37 ----- .../api/namespace/text_structure.rb | 36 ----- .../elasticsearch/api/namespace/transform.rb | 36 ----- .../elasticsearch/api/namespace/watcher.rb | 36 ----- .../lib/elasticsearch/api/namespace/xpack.rb | 36 ----- 42 files changed, 78 insertions(+), 1550 deletions(-) delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/async_search.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/autoscaling.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/cat.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/cluster.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/common.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/connector.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/cross_cluster_replication.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/dangling_indices.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/data_frame_transform_deprecated.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/enrich.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/eql.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/esql.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/features.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/fleet.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/graph.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/index_lifecycle_management.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/indices.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/inference.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/ingest.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/license.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/logstash.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/machine_learning.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/migration.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/nodes.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/query_rules.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/query_ruleset.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/remote.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/search_application.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/searchable_snapshots.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/security.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/simulate.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/snapshot.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/snapshot_lifecycle_management.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/sql.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/ssl.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/synonyms.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/tasks.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/text_structure.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/transform.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/watcher.rb delete mode 100644 elasticsearch-api/lib/elasticsearch/api/namespace/xpack.rb diff --git a/elasticsearch-api/lib/elasticsearch/api.rb b/elasticsearch-api/lib/elasticsearch/api.rb index ae016a87c..f187a0502 100644 --- a/elasticsearch-api/lib/elasticsearch/api.rb +++ b/elasticsearch-api/lib/elasticsearch/api.rb @@ -15,21 +15,19 @@ # specific language governing permissions and limitations # under the License. -require "cgi" -require "multi_json" - -require "elasticsearch/api/version" -require "elasticsearch/api/namespace/common" -require "elasticsearch/api/utils" +require 'cgi' +require 'multi_json' +require 'elasticsearch/api/version' +require 'elasticsearch/api/utils' require 'elasticsearch/api/response' -Dir[ File.expand_path('../api/actions/**/*.rb', __FILE__) ].each { |f| require f } -Dir[ File.expand_path('../api/namespace/**/*.rb', __FILE__) ].each { |f| require f } +Dir[File.expand_path('api/actions/**/*.rb', __dir__)].each { |f| require f } module Elasticsearch # This is the main module for including all API endpoint functions # It includes the namespace modules from ./api/actions module API + include Elasticsearch::API::Actions DEFAULT_SERIALIZER = MultiJson HTTP_GET = 'GET'.freeze @@ -37,57 +35,82 @@ module API HTTP_POST = 'POST'.freeze HTTP_PUT = 'PUT'.freeze HTTP_DELETE = 'DELETE'.freeze - UNDERSCORE_SEARCH = '_search'.freeze - UNDERSCORE_ALL = '_all'.freeze - DEFAULT_DOC = '_doc'.freeze - # Auto-include all namespaces in the receiver + module CommonClient + attr_reader :client + + def initialize(client) + @client = client + end + + def perform_request(method, path, params = {}, body = nil, headers = nil, request_opts = {}) + client.perform_request(method, path, params, body, headers, request_opts) + end + end + + # Add new namespaces to this constant # - def self.included(base) - base.send :include, - Elasticsearch::API::Common, - Elasticsearch::API::Actions, - Elasticsearch::API::Cluster, - Elasticsearch::API::Nodes, - Elasticsearch::API::Indices, - Elasticsearch::API::Ingest, - Elasticsearch::API::Snapshot, - Elasticsearch::API::Tasks, - Elasticsearch::API::Cat, - Elasticsearch::API::Remote, - Elasticsearch::API::DanglingIndices, - Elasticsearch::API::Features, - Elasticsearch::API::AsyncSearch, - Elasticsearch::API::Autoscaling, - Elasticsearch::API::CrossClusterReplication, - Elasticsearch::API::DataFrameTransformDeprecated, - Elasticsearch::API::Enrich, - Elasticsearch::API::Eql, - Elasticsearch::API::Fleet, - Elasticsearch::API::Graph, - Elasticsearch::API::IndexLifecycleManagement, - Elasticsearch::API::License, - Elasticsearch::API::Logstash, - Elasticsearch::API::Migration, - Elasticsearch::API::MachineLearning, - Elasticsearch::API::SearchableSnapshots, - Elasticsearch::API::Security, - Elasticsearch::API::SnapshotLifecycleManagement, - Elasticsearch::API::SQL, - Elasticsearch::API::SSL, - Elasticsearch::API::TextStructure, - Elasticsearch::API::Transform, - Elasticsearch::API::Watcher, - Elasticsearch::API::XPack, - Elasticsearch::API::SearchApplication, - Elasticsearch::API::Synonyms, - Elasticsearch::API::Esql, - Elasticsearch::API::Inference, - Elasticsearch::API::Simulate, - Elasticsearch::API::Connector, - Elasticsearch::API::QueryRules + API_NAMESPACES = [:async_search, + :cat, + :cross_cluster_replication, + :cluster, + :connector, + :dangling_indices, + :enrich, + :eql, + :esql, + :features, + :fleet, + :graph, + :index_lifecycle_management, + :indices, + :inference, + :ingest, + :license, + :logstash, + :migration, + :machine_learning, + :nodes, + :query_rules, + :search_application, + :searchable_snapshots, + :security, + :simulate, + :snapshot_lifecycle_management, + :snapshot, + :sql, + :ssl, + :synonyms, + :tasks, + :text_structure, + :transform, + :watcher, + :xpack].freeze + + UPPERCASE_APIS = ['sql', 'ssl'].freeze + API_NAMESPACES.each do |namespace| + name = namespace.to_s + module_name = if UPPERCASE_APIS.include?(name) + name.upcase + elsif name == 'xpack' + 'XPack' + else + name.split('_').map(&:capitalize).join + end + class_name = "#{module_name}Client" + + klass = Class.new(Object) do + include CommonClient, Object.const_get("Elasticsearch::API::#{module_name}::Actions") + end + Object.const_set(class_name, klass) + define_method(name) do + instance_variable_set("@#{name}", klass.new(self)) + end end + alias ml machine_learning + alias ilm index_lifecycle_management + # The serializer class # def self.serializer diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/async_search.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/async_search.rb deleted file mode 100644 index af5f5eafc..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/async_search.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module AsyncSearch - module Actions; end - - # Client for the "async_search" namespace (includes the {AsyncSearch::Actions} methods) - # - class AsyncSearchClient - include Common::Client, Common::Client::Base, AsyncSearch::Actions - end - - # Proxy method for {AsyncSearchClient}, available in the receiving object - # - def async_search - @async_search ||= AsyncSearchClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/autoscaling.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/autoscaling.rb deleted file mode 100644 index 0ded4d5e4..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/autoscaling.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Autoscaling - module Actions; end - - # Client for the "autoscaling" namespace (includes the {Autoscaling::Actions} methods) - # - class AutoscalingClient - include Common::Client, Common::Client::Base, Autoscaling::Actions - end - - # Proxy method for {AutoscalingClient}, available in the receiving object - # - def autoscaling - @autoscaling ||= AutoscalingClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/cat.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/cat.rb deleted file mode 100644 index ba3952e3b..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/cat.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Cat - module Actions; end - - # Client for the "cat" namespace (includes the {Cat::Actions} methods) - # - class CatClient - include Common::Client, Common::Client::Base, Cat::Actions - end - - # Proxy method for {CatClient}, available in the receiving object - # - def cat - @cat ||= CatClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/cluster.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/cluster.rb deleted file mode 100644 index e2eb15f70..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/cluster.rb +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Cluster - module Actions; end - - # Client for the "cluster" namespace (includes the {Cluster::Actions} methods) - # - class ClusterClient - include Common::Client, Common::Client::Base, Cluster::Actions - end - - # Proxy method for {ClusterClient}, available in the receiving object - # - def cluster - @cluster ||= ClusterClient.new(self) - end - - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/common.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/common.rb deleted file mode 100644 index 789aca251..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/common.rb +++ /dev/null @@ -1,42 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Common - module Actions; end - - module Client - # Base client wrapper - # - module Base - attr_reader :client - - def initialize(client) - @client = client - end - end - - # Delegates the `perform_request` method to the wrapped client - # - def perform_request(method, path, params={}, body=nil, headers=nil, request_opts={}) - client.perform_request method, path, params, body, headers, request_opts - end - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/connector.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/connector.rb deleted file mode 100644 index b9bed4408..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/connector.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Connector - module Actions; end - - # Client for the "connector" namespace (includes the {Connector::Actions} methods) - # - class ConnectorClient - include Common::Client, Common::Client::Base, Connector::Actions - end - - # Proxy method for {ConnectorClient}, available in the receiving object - # - def connector - @connector ||= ConnectorClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/cross_cluster_replication.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/cross_cluster_replication.rb deleted file mode 100644 index d9cb23065..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/cross_cluster_replication.rb +++ /dev/null @@ -1,38 +0,0 @@ -# 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. - -module Elasticsearch - module API - module CrossClusterReplication - module Actions; end - - # Client for the "cross_cluster_replication" namespace (includes the {CrossClusterReplication::Actions} methods) - # - class CrossClusterReplicationClient - include Common::Client, Common::Client::Base, CrossClusterReplication::Actions - end - - # Proxy method for {CrossClusterReplicationClient}, available in the receiving object - # - def cross_cluster_replication - @cross_cluster_replication ||= CrossClusterReplicationClient.new(self) - end - - alias ccr cross_cluster_replication - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/dangling_indices.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/dangling_indices.rb deleted file mode 100644 index 76291aaed..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/dangling_indices.rb +++ /dev/null @@ -1,35 +0,0 @@ -# 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. - -module Elasticsearch - module API - module DanglingIndices - module Actions; end - # Client for the "dangling_indices" namespace (includes the {DanglingIndices::Actions} methods) - # - class DanglingIndicesClient - include Common::Client, Common::Client::Base, DanglingIndices::Actions - end - - # Proxy method for {DanglingIndicesClient}, available in the receiving object - # - def dangling_indices - @dangling_indices ||= DanglingIndicesClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/data_frame_transform_deprecated.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/data_frame_transform_deprecated.rb deleted file mode 100644 index 8487199af..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/data_frame_transform_deprecated.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module DataFrameTransformDeprecated - module Actions; end - - # Client for the "data_frame_transform_deprecated" namespace (includes the {DataFrameTransformDeprecated::Actions} methods) - # - class DataFrameTransformDeprecatedClient - include Common::Client, Common::Client::Base, DataFrameTransformDeprecated::Actions - end - - # Proxy method for {DataFrameTransformDeprecatedClient}, available in the receiving object - # - def data_frame_transform_deprecated - @data_frame_transform_deprecated ||= DataFrameTransformDeprecatedClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/enrich.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/enrich.rb deleted file mode 100644 index d591cc99a..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/enrich.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Enrich - module Actions; end - - # Client for the "enrich" namespace (includes the {Enrich::Actions} methods) - # - class EnrichClient - include Common::Client, Common::Client::Base, Enrich::Actions - end - - # Proxy method for {EnrichClient}, available in the receiving object - # - def enrich - @enrich ||= EnrichClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/eql.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/eql.rb deleted file mode 100644 index 38c9f891e..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/eql.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Eql - module Actions; end - - # Client for the "eql" namespace (includes the {Eql::Actions} methods) - # - class EqlClient - include Common::Client, Common::Client::Base, Eql::Actions - end - - # Proxy method for {EqlClient}, available in the receiving object - # - def eql - @eql ||= EqlClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/esql.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/esql.rb deleted file mode 100644 index e41c6c712..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/esql.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Esql - module Actions; end - - # Client for the "esql" namespace (includes the {Esql::Actions} methods) - # - class EsqlClient - include Common::Client, Common::Client::Base, Esql::Actions - end - - # Proxy method for {EsqlClient}, available in the receiving object - # - def esql - @esql ||= EsqlClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/features.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/features.rb deleted file mode 100644 index 8b968f167..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/features.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Features - module Actions; end - - # Client for the "features" namespace (includes the {Features::Actions} methods) - # - class FeaturesClient - include Common::Client, Common::Client::Base, Features::Actions - end - - # Proxy method for {FeaturesClient}, available in the receiving object - # - def features - @features ||= FeaturesClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/fleet.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/fleet.rb deleted file mode 100644 index 81f8cc369..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/fleet.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Fleet - module Actions; end - - # Client for the "fleet" namespace (includes the {Fleet::Actions} methods) - # - class FleetClient - include Common::Client, Common::Client::Base, Fleet::Actions - end - - # Proxy method for {FleetClient}, available in the receiving object - # - def fleet - @fleet ||= FleetClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/graph.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/graph.rb deleted file mode 100644 index 04fd1d08a..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/graph.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Graph - module Actions; end - - # Client for the "graph" namespace (includes the {Graph::Actions} methods) - # - class GraphClient - include Common::Client, Common::Client::Base, Graph::Actions - end - - # Proxy method for {GraphClient}, available in the receiving object - # - def graph - @graph ||= GraphClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/index_lifecycle_management.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/index_lifecycle_management.rb deleted file mode 100644 index 23077edeb..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/index_lifecycle_management.rb +++ /dev/null @@ -1,38 +0,0 @@ -# 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. - -module Elasticsearch - module API - module IndexLifecycleManagement - module Actions; end - - # Client for the "index_lifecycle_management" namespace (includes the {IndexLifecycleManagement::Actions} methods) - # - class IndexLifecycleManagementClient - include Common::Client, Common::Client::Base, IndexLifecycleManagement::Actions - end - - # Proxy method for {IndexLifecycleManagementClient}, available in the receiving object - # - def ilm - @ilm ||= IndexLifecycleManagementClient.new(self) - end - - alias index_lifecycle_management ilm - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/indices.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/indices.rb deleted file mode 100644 index 75a3c0f29..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/indices.rb +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Indices - module Actions; end - - # Client for the "indices" namespace (includes the {Indices::Actions} methods) - # - class IndicesClient - include Common::Client, Common::Client::Base, Indices::Actions - end - - # Proxy method for {IndicesClient}, available in the receiving object - # - def indices - @indices ||= IndicesClient.new(self) - end - - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/inference.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/inference.rb deleted file mode 100644 index 84b398364..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/inference.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Inference - module Actions; end - - # Client for the "inference" namespace (includes the {Inference::Actions} methods) - # - class InferenceClient - include Common::Client, Common::Client::Base, Inference::Actions - end - - # Proxy method for {InferenceClient}, available in the receiving object - # - def inference - @inference ||= InferenceClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/ingest.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/ingest.rb deleted file mode 100644 index 6e5e57af1..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/ingest.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Ingest - module Actions; end - - # Client for the "ingest" namespace (includes the {Ingest::Actions} methods) - # - class IngestClient - include Common::Client, Common::Client::Base, Ingest::Actions - end - - # Proxy method for {IngestClient}, available in the receiving object - # - def ingest - @ingest ||= IngestClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/license.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/license.rb deleted file mode 100644 index e6fbd8367..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/license.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module License - module Actions; end - - # Client for the "license" namespace (includes the {License::Actions} methods) - # - class LicenseClient - include Common::Client, Common::Client::Base, License::Actions - end - - # Proxy method for {LicenseClient}, available in the receiving object - # - def license - @license ||= LicenseClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/logstash.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/logstash.rb deleted file mode 100644 index 2a0dd3487..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/logstash.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Logstash - module Actions; end - - # Client for the "logstash" namespace (includes the {Logstash::Actions} methods) - # - class LogstashClient - include Common::Client, Common::Client::Base, Logstash::Actions - end - - # Proxy method for {LogstashClient}, available in the receiving object - # - def logstash - @logstash ||= LogstashClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/machine_learning.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/machine_learning.rb deleted file mode 100644 index 63ada11f0..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/machine_learning.rb +++ /dev/null @@ -1,38 +0,0 @@ -# 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. - -module Elasticsearch - module API - module MachineLearning - module Actions; end - - # Client for the "machine_learning" namespace (includes the {MachineLearning::Actions} methods) - # - class MachineLearningClient - include Common::Client, Common::Client::Base, MachineLearning::Actions - end - - # Proxy method for {MachineLearningClient}, available in the receiving object - # - def machine_learning - @machine_learning ||= MachineLearningClient.new(self) - end - - alias ml machine_learning - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/migration.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/migration.rb deleted file mode 100644 index 05685adf4..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/migration.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Migration - module Actions; end - - # Client for the "migration" namespace (includes the {Migration::Actions} methods) - # - class MigrationClient - include Common::Client, Common::Client::Base, Migration::Actions - end - - # Proxy method for {MigrationClient}, available in the receiving object - # - def migration - @migration ||= MigrationClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/nodes.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/nodes.rb deleted file mode 100644 index e717db05b..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/nodes.rb +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Nodes - module Actions; end - - # Client for the "nodes" namespace (includes the {Nodes::Actions} methods) - # - class NodesClient - include Common::Client, Common::Client::Base, Nodes::Actions - end - - # Proxy method for {NodesClient}, available in the receiving object - # - def nodes - @nodes ||= NodesClient.new(self) - end - - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/query_rules.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/query_rules.rb deleted file mode 100644 index efff86c63..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/query_rules.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module QueryRules - module Actions; end - - # Client for the "query_rules" namespace (includes the {QueryRules::Actions} methods) - # - class QueryRulesClient - include Common::Client, Common::Client::Base, QueryRules::Actions - end - - # Proxy method for {QueryRulesClient}, available in the receiving object - # - def query_rules - @query_rules ||= QueryRulesClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/query_ruleset.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/query_ruleset.rb deleted file mode 100644 index c77d50dbc..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/query_ruleset.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module QueryRuleset - module Actions; end - - # Client for the "query_ruleset" namespace (includes the {QueryRuleset::Actions} methods) - # - class QueryRulesetClient - include Common::Client, Common::Client::Base, QueryRuleset::Actions - end - - # Proxy method for {QueryRulesetClient}, available in the receiving object - # - def query_ruleset - @query_ruleset ||= QueryRulesetClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/remote.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/remote.rb deleted file mode 100644 index bcf5e4265..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/remote.rb +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Remote - module Actions; end - - # Client for the "remote" namespace (includes the {Remote::Actions} methods) - # - class RemoteClient - include Common::Client, Common::Client::Base, Remote::Actions - end - - # Proxy method for {RemoteClient}, available in the receiving object - # - def remote - @remote ||= RemoteClient.new(self) - end - - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/search_application.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/search_application.rb deleted file mode 100644 index 962bf15b5..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/search_application.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module SearchApplication - module Actions; end - - # Client for the "searchable_snapshots" namespace (includes the {SearchableSnapshots::Actions} methods) - # - class SearchApplicationClient - include Common::Client, Common::Client::Base, SearchApplication::Actions - end - - # Proxy method for {SearchApplicationClient}, available in the receiving object - # - def search_application - @search_application ||= SearchApplicationClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/searchable_snapshots.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/searchable_snapshots.rb deleted file mode 100644 index 0a2add26b..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/searchable_snapshots.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module SearchableSnapshots - module Actions; end - - # Client for the "searchable_snapshots" namespace (includes the {SearchableSnapshots::Actions} methods) - # - class SearchableSnapshotsClient - include Common::Client, Common::Client::Base, SearchableSnapshots::Actions - end - - # Proxy method for {SearchableSnapshotsClient}, available in the receiving object - # - def searchable_snapshots - @searchable_snapshots ||= SearchableSnapshotsClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/security.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/security.rb deleted file mode 100644 index 61f9efba1..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/security.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Security - module Actions; end - - # Client for the "security" namespace (includes the {Security::Actions} methods) - # - class SecurityClient - include Common::Client, Common::Client::Base, Security::Actions - end - - # Proxy method for {SecurityClient}, available in the receiving object - # - def security - @security ||= SecurityClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/simulate.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/simulate.rb deleted file mode 100644 index b5e6eb88e..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/simulate.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Simulate - module Actions; end - - # Client for the "simulate" namespace (includes the {Simulate::Actions} methods) - # - class SimulateClient - include Common::Client, Common::Client::Base, Simulate::Actions - end - - # Proxy method for {SimulateClient}, available in the receiving object - # - def simulate - @simulate ||= SimulateClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/snapshot.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/snapshot.rb deleted file mode 100644 index 35853de86..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/snapshot.rb +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Snapshot - module Actions; end - - # Client for the "snapshot" namespace (includes the {Snapshot::Actions} methods) - # - class SnapshotClient - include Common::Client, Common::Client::Base, Snapshot::Actions - end - - # Proxy method for {SnapshotClient}, available in the receiving object - # - def snapshot - @snapshot ||= SnapshotClient.new(self) - end - - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/snapshot_lifecycle_management.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/snapshot_lifecycle_management.rb deleted file mode 100644 index 29b74ac93..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/snapshot_lifecycle_management.rb +++ /dev/null @@ -1,38 +0,0 @@ -# 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. - -module Elasticsearch - module API - module SnapshotLifecycleManagement - module Actions; end - - # Client for the "snapshot_lifecycle_management" namespace (includes the {SnapshotLifecycleManagement::Actions} methods) - # - class SnapshotLifecycleManagementClient - include Common::Client, Common::Client::Base, SnapshotLifecycleManagement::Actions - end - - # Proxy method for {SnapshotLifecycleManagementClient}, available in the receiving object - # - def snapshot_lifecycle_management - @snapshot_lifecycle_management ||= SnapshotLifecycleManagementClient.new(self) - end - - alias slm snapshot_lifecycle_management - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/sql.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/sql.rb deleted file mode 100644 index f0a5c7939..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/sql.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module SQL - module Actions; end - - # Client for the "sql" namespace (includes the {SQL::Actions} methods) - # - class SQLClient - include Common::Client, Common::Client::Base, SQL::Actions - end - - # Proxy method for {SQLClient}, available in the receiving object - # - def sql - @sql ||= SQLClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/ssl.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/ssl.rb deleted file mode 100644 index d298fce67..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/ssl.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module SSL - module Actions; end - - # Client for the "ssl" namespace (includes the {SSL::Actions} methods) - # - class SSLClient - include Common::Client, Common::Client::Base, SSL::Actions - end - - # Proxy method for {SSLClient}, available in the receiving object - # - def ssl - @ssl ||= SSLClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/synonyms.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/synonyms.rb deleted file mode 100644 index 083a21520..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/synonyms.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Synonyms - module Actions; end - - # Client for the "synonyms" namespace (includes the {Synonyms::Actions} methods) - # - class SynonymsClient - include Common::Client, Common::Client::Base, Synonyms::Actions - end - - # Proxy method for {SynonymsClient}, available in the receiving object - # - def synonyms - @synonyms ||= SynonymsClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/tasks.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/tasks.rb deleted file mode 100644 index 9c4809dce..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/tasks.rb +++ /dev/null @@ -1,37 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Tasks - module Actions; end - - # Client for the "tasks" namespace (includes the {Tasks::Actions} methods) - # - class TasksClient - include Common::Client, Common::Client::Base, Tasks::Actions - end - - # Proxy method for {TasksClient}, available in the receiving object - # - def tasks - @tasks ||= TasksClient.new(self) - end - - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/text_structure.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/text_structure.rb deleted file mode 100644 index 0d1f5b763..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/text_structure.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module TextStructure - module Actions; end - - # Client for the "text_structure" namespace (includes the {TextStructure::Actions} methods) - # - class TextStructureClient - include Common::Client, Common::Client::Base, TextStructure::Actions - end - - # Proxy method for {TextStructureClient}, available in the receiving object - # - def text_structure - @text_structure ||= TextStructureClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/transform.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/transform.rb deleted file mode 100644 index 0c9040adf..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/transform.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Transform - module Actions; end - - # Client for the "transform" namespace (includes the {Transform::Actions} methods) - # - class TransformClient - include Common::Client, Common::Client::Base, Transform::Actions - end - - # Proxy method for {TransformClient}, available in the receiving object - # - def transform - @transform ||= TransformClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/watcher.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/watcher.rb deleted file mode 100644 index 554e40136..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/watcher.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module Watcher - module Actions; end - - # Client for the "watcher" namespace (includes the {Watcher::Actions} methods) - # - class WatcherClient - include Common::Client, Common::Client::Base, Watcher::Actions - end - - # Proxy method for {WatcherClient}, available in the receiving object - # - def watcher - @watcher ||= WatcherClient.new(self) - end - end - end -end diff --git a/elasticsearch-api/lib/elasticsearch/api/namespace/xpack.rb b/elasticsearch-api/lib/elasticsearch/api/namespace/xpack.rb deleted file mode 100644 index 74d8f9bb1..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/namespace/xpack.rb +++ /dev/null @@ -1,36 +0,0 @@ -# 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. - -module Elasticsearch - module API - module XPack - module Actions; end - - # Client for the "xpack" namespace (includes the {XPack::Actions} methods) - # - class XPackClient - include Common::Client, Common::Client::Base, XPack::Actions - end - - # Proxy method for {XPackClient}, available in the receiving object - # - def xpack - @xpack ||= XPackClient.new(self) - end - end - end -end From 743348089bacfd82a2fda615396931f64e8216a3 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Tue, 11 Mar 2025 13:32:18 +0000 Subject: [PATCH 05/11] [API] Removes connector.last_sync endpoint --- .../api/actions/connector/last_sync.rb | 66 ------------------- .../unit/actions/connector/last_sync_spec.rb | 38 ----------- 2 files changed, 104 deletions(-) delete mode 100644 elasticsearch-api/lib/elasticsearch/api/actions/connector/last_sync.rb delete mode 100644 elasticsearch-api/spec/unit/actions/connector/last_sync_spec.rb diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/last_sync.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/last_sync.rb deleted file mode 100644 index 1a342f408..000000000 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/last_sync.rb +++ /dev/null @@ -1,66 +0,0 @@ -# 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. -# -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec -# -module Elasticsearch - module API - module Connector - module Actions - # Updates the stats of last sync in the connector document. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. - # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. - # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Object with stats related to the last connector sync run. (*Required*) - # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-last-sync-api.html - # - def last_sync(arguments = {}) - request_opts = { endpoint: arguments[:endpoint] || 'connector.last_sync' } - - defined_params = [:connector_id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - - raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] - raise ArgumentError, "Required argument 'connector_id' missing" unless arguments[:connector_id] - - arguments = arguments.clone - headers = arguments.delete(:headers) || {} - - body = arguments.delete(:body) - - _connector_id = arguments.delete(:connector_id) - - method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_last_sync" - 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/connector/last_sync_spec.rb b/elasticsearch-api/spec/unit/actions/connector/last_sync_spec.rb deleted file mode 100644 index 68cb2b635..000000000 --- a/elasticsearch-api/spec/unit/actions/connector/last_sync_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -# 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.connector#last_sync' do - let(:expected_args) do - [ - 'PUT', - '_connector/foo/_last_sync', - {}, - {}, - {}, - { - :defined_params=>{ connector_id: 'foo' }, - endpoint: 'connector.last_sync' - } - ] - end - - it 'performs the request' do - expect(client_double.connector.last_sync(connector_id: 'foo', body: {})).to be_a Elasticsearch::API::Response - end -end From c39a66da80b968e6291d52a3238ef5458d57ea88 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 12 Mar 2025 14:30:03 +0000 Subject: [PATCH 06/11] Adds generator to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index eda31fc81..b6ec5bd32 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ profile/**/data/*.json parsed_alternative_report.json .byebug_history build/ -*.gem \ No newline at end of file +*.gem +elastic-client-generator-ruby \ No newline at end of file From 50587119c30dd9c7cf2ca54604583c1571333101 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Wed, 12 Mar 2025 15:45:47 +0000 Subject: [PATCH 07/11] [API] Renames functions in utils.rb from __ names * Renames __bulkify to bulkify * Renames __escape to escape * Renames __listify to listify * Renames __pathify to pathify * Renames __extract_parts to extract_parts * Renames __rescue_from_not_found to rescue_from_not_found --- .../lib/elasticsearch/api/utils.rb | 62 +++---- elasticsearch-api/spec/unit/utils_spec.rb | 169 ++++-------------- .../utils/thor/endpoint_specifics.rb | 4 +- .../utils/thor/templates/_body.erb | 2 +- 4 files changed, 67 insertions(+), 170 deletions(-) diff --git a/elasticsearch-api/lib/elasticsearch/api/utils.rb b/elasticsearch-api/lib/elasticsearch/api/utils.rb index fc53cb1d4..8959b3aa8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/utils.rb +++ b/elasticsearch-api/lib/elasticsearch/api/utils.rb @@ -24,60 +24,62 @@ module Utils # URL-escape a string # # @example - # __escape('foo/bar') # => 'foo%2Fbar' - # __escape('bar^bam') # => 'bar%5Ebam' + # escape('foo/bar') # => 'foo%2Fbar' + # escape('bar^bam') # => 'bar%5Ebam' # # @api private - def __escape(string) + def escape(string) return string if string == '*' + ERB::Util.url_encode(string.to_s) end # Create a "list" of values from arguments, ignoring nil values and encoding special characters. # # @example Create a list from array - # __listify(['A','B']) # => 'A,B' + # listify(['A','B']) # => 'A,B' # # @example Create a list from arguments - # __listify('A','B') # => 'A,B' + # listify('A','B') # => 'A,B' # # @example Escape values - # __listify('foo','bar^bam') # => 'foo,bar%5Ebam' + # listify('foo','bar^bam') # => 'foo,bar%5Ebam' # # @example Do not escape the values - # __listify('foo','bar^bam', escape: false) # => 'foo,bar^bam' + # listify('foo','bar^bam', escape: false) # => 'foo,bar^bam' # # @api private - def __listify(*list) + def listify(*list) options = list.last.is_a?(Hash) ? list.pop : {} escape = options[:escape] - Array(list). - flat_map { |e| e.respond_to?(:split) ? e.split(',') : e }. - flatten. - compact. - map { |e| escape == false ? e : __escape(e) }. - join(',') + Array(list) + .flat_map { |e| e.respond_to?(:split) ? e.split(',') : e } + .flatten + .compact + .map { |e| escape == false ? e : escape(e) } + .join(',') end # Create a path (URL part) from arguments, ignoring nil values and empty strings. # # @example Create a path from array - # __pathify(['foo', '', nil, 'bar']) # => 'foo/bar' + # pathify(['foo', '', nil, 'bar']) # => 'foo/bar' # # @example Create a path from arguments - # __pathify('foo', '', nil, 'bar') # => 'foo/bar' + # pathify('foo', '', nil, 'bar') # => 'foo/bar' # # # @example Encode special characters - # __pathify(['foo', 'bar^bam']) # => 'foo/bar%5Ebam' + # pathify(['foo', 'bar^bam']) # => 'foo/bar%5Ebam' # # @api private - def __pathify(*segments) - Array(segments).flatten. - compact. - reject { |s| s.to_s.strip.empty? }. - join('/'). - squeeze('/') + def pathify(*segments) + Array(segments) + .flatten + .compact + .reject { |s| s.to_s.strip.empty? } + .join('/') + .squeeze('/') end # Convert an array of payloads into Elasticsearch `header\ndata` format @@ -86,7 +88,7 @@ def __pathify(*segments) # or the conveniency "combined" format where data is passed along with the header # in a single item. # - # Elasticsearch::API::Utils.__bulkify [ + # Elasticsearch::API::Utils.bulkify [ # { :index => { :_index => 'myindexA', :_type => 'mytype', :_id => '1', :data => { :title => 'Test' } } }, # { :update => { :_index => 'myindexB', :_type => 'mytype', :_id => '2', :data => { :doc => { :title => 'Update' } } } } # ] @@ -96,7 +98,7 @@ def __pathify(*segments) # # => {"update":{"_index":"myindexB","_type":"mytype","_id":"2"}} # # => {"doc":{"title":"Update"}} # - def __bulkify(payload) + def bulkify(payload) operations = %w[index create delete update] case @@ -131,7 +133,7 @@ def __bulkify(payload) def process_params(arguments) arguments = Hash[arguments] unless arguments.is_a?(Hash) - Hash[arguments.map { |k, v| v.is_a?(Array) ? [k, __listify(v, { escape: false })] : [k, v] }] # Listify Arrays + Hash[arguments.map { |k, v| v.is_a?(Array) ? [k, listify(v, { escape: false })] : [k, v] }] # Listify Arrays end # Extracts the valid parts of the URL from the arguments @@ -144,14 +146,14 @@ def process_params(arguments) # @return [Array] Valid parts of the URL as an array of strings # # @example Extract parts - # __extract_parts { :foo => true }, [:foo, :bar] + # extract_parts { :foo => true }, [:foo, :bar] # # => [:foo] # # # @api private # - def __extract_parts(arguments, valid_parts=[]) - Hash[arguments].reduce([]) { |sum, item| k, v = item; v.is_a?(TrueClass) ? sum << k.to_s : sum << v } + def extract_parts(arguments, _valid_parts = []) + Hash[arguments].reduce([]) { |sum, item| k, v = item; v.is_a?(TrueClass) ? sum << k.to_s : sum << v } end # Calls the given block, rescuing from `StandardError`. @@ -165,7 +167,7 @@ def __extract_parts(arguments, valid_parts=[]) # # @api private # - def __rescue_from_not_found(&block) + def rescue_from_not_found(&block) yield rescue StandardError => e if e.class.to_s =~ /NotFound/ || e.message =~ /Not\s*Found/i diff --git a/elasticsearch-api/spec/unit/utils_spec.rb b/elasticsearch-api/spec/unit/utils_spec.rb index 63eba22f1..93680796c 100644 --- a/elasticsearch-api/spec/unit/utils_spec.rb +++ b/elasticsearch-api/spec/unit/utils_spec.rb @@ -22,72 +22,72 @@ Class.new { include Elasticsearch::API::Utils }.new end - describe '#__escape' do + describe '#escape' do it 'encodes Unicode characters' do - expect(utils.__escape('中文')).to eq('%E4%B8%AD%E6%96%87') + expect(utils.escape('中文')).to eq('%E4%B8%AD%E6%96%87') end it 'encodes special characters' do - expect(utils.__escape('foo bar')).to eq('foo%20bar') - expect(utils.__escape('foo/bar')).to eq('foo%2Fbar') - expect(utils.__escape('foo^bar')).to eq('foo%5Ebar') + expect(utils.escape('foo bar')).to eq('foo%20bar') + expect(utils.escape('foo/bar')).to eq('foo%2Fbar') + expect(utils.escape('foo^bar')).to eq('foo%5Ebar') end it 'does not encode asterisks' do - expect(utils.__escape('*')).to eq('*') + expect(utils.escape('*')).to eq('*') end end - describe '#__listify' do + describe '#listify' do it 'creates a list from a single value' do - expect(utils.__listify('foo')).to eq('foo') + expect(utils.listify('foo')).to eq('foo') end it 'creates a list from an array' do - expect(utils.__listify(['foo', 'bar'])).to eq('foo,bar') + expect(utils.listify(['foo', 'bar'])).to eq('foo,bar') end it 'creates a list from multiple arguments' do - expect(utils.__listify('foo', 'bar')).to eq('foo,bar') + expect(utils.listify('foo', 'bar')).to eq('foo,bar') end it 'ignores nil values' do - expect(utils.__listify(['foo', nil, 'bar'])).to eq('foo,bar') + expect(utils.listify(['foo', nil, 'bar'])).to eq('foo,bar') end it 'ignores special characters' do - expect(utils.__listify(['foo', 'bar^bam'])).to eq('foo,bar%5Ebam') + expect(utils.listify(['foo', 'bar^bam'])).to eq('foo,bar%5Ebam') end context 'when the escape option is set to false' do it 'does not escape the characters' do - expect(utils.__listify(['foo', 'bar^bam'], escape: false)).to eq('foo,bar^bam') + expect(utils.listify(['foo', 'bar^bam'], escape: false)).to eq('foo,bar^bam') end end end - describe '#__pathify' do + describe '#pathify' do it 'creates a path from a single value' do - expect(utils.__pathify('foo')).to eq('foo') + expect(utils.pathify('foo')).to eq('foo') end it 'creates a path from an array' do - expect(utils.__pathify(['foo', 'bar'])).to eq('foo/bar') + expect(utils.pathify(['foo', 'bar'])).to eq('foo/bar') end it 'ignores nil values' do - expect(utils.__pathify(['foo', nil, 'bar'])).to eq('foo/bar') + expect(utils.pathify(['foo', nil, 'bar'])).to eq('foo/bar') end it 'ignores empty string values' do - expect(utils.__pathify(['foo', '', 'bar'])).to eq('foo/bar') + expect(utils.pathify(['foo', '', 'bar'])).to eq('foo/bar') end end - describe '#__bulkify' do + describe '#bulkify' do context 'when the input is an array of hashes' do let(:result) do - utils.__bulkify [ + utils.bulkify [ { index: { _index: 'myindexA', _id: '1', data: { title: 'Test' } } }, { update: { _index: 'myindexB', _id: '2', data: { doc: { title: 'Update' } } } }, { delete: { _index: 'myindexC', _id: '3' } } @@ -112,7 +112,7 @@ context 'when the input is an array of strings' do let(:result) do - utils.__bulkify(['{"foo":"bar"}','{"moo":"bam"}']) + utils.bulkify(['{"foo":"bar"}','{"moo":"bam"}']) end let(:expected_string) do @@ -130,7 +130,7 @@ context 'when the input is an array of header/data pairs' do let(:result) do - utils.__bulkify([{ foo: 'bar' }, { moo: 'bam' },{ foo: 'baz' }]) + utils.bulkify([{ foo: 'bar' }, { moo: 'bam' },{ foo: 'baz' }]) end let(:expected_string) do @@ -153,7 +153,7 @@ end let(:result) do - utils.__bulkify([input]) + utils.bulkify([input]) end let(:expected_string) do @@ -178,7 +178,7 @@ end let(:result) do - utils.__bulkify([{ index: { foo: 'bar'} } , data]) + utils.bulkify([{ index: { foo: 'bar'} } , data]) end let(:lines) do @@ -221,135 +221,30 @@ end end - describe '#__extract_parts' do + describe '#extract_parts' do it 'extracts parts with true value from a Hash' do - expect(utils.__extract_parts({ foo: true, moo: 'blah' })).to eq(['foo', 'blah']) + expect(utils.extract_parts({ foo: true, moo: 'blah' })).to eq(['foo', 'blah']) end it 'extracts parts with string value from a Hash' do - expect(utils.__extract_parts({ foo: 'qux', moo: 'blah' })).to eq(['qux', 'blah']) + expect(utils.extract_parts({ foo: 'qux', moo: 'blah' })).to eq(['qux', 'blah']) end end - context '#__rescue_from_not_found' do - + context '#rescue_from_not_found' do it 'returns false if exception class name contains \'NotFound\'' do - expect(utils.__rescue_from_not_found { raise NotFound }).to be(false) + expect(utils.rescue_from_not_found { raise NotFound }).to be(false) end it 'returns false if exception message contains \'Not Found\'' do - expect(utils.__rescue_from_not_found { raise StandardError.new "Not Found" }).to be(false) - expect(utils.__rescue_from_not_found { raise StandardError.new "NotFound" }).to be(false) + expect(utils.rescue_from_not_found { raise StandardError.new "Not Found" }).to be(false) + expect(utils.rescue_from_not_found { raise StandardError.new "NotFound" }).to be(false) end it 'raises the exception if the class name and message do not include \'NotFound\'' do expect { - utils.__rescue_from_not_found { raise StandardError.new "Any other exception" } + utils.rescue_from_not_found { raise StandardError.new "Any other exception" } }.to raise_exception(StandardError) end end - - context '#__report_unsupported_parameters' do - - context 'when the parameters are passed as Symbols' do - - let(:arguments) do - { foo: 'bar', moo: 'bam', baz: 'qux' } - end - - let(:unsupported_params) do - [ :foo, :moo] - end - - let(:message) do - message = '' - expect(Kernel).to receive(:warn) { |msg| message = msg } - utils.__report_unsupported_parameters(arguments, unsupported_params) - message - end - - it 'prints the unsupported parameters' do - expect(message).to match(/You are using unsupported parameter \[\:foo\]/) - expect(message).to match(/You are using unsupported parameter \[\:moo\]/) - end - end - - context 'when the parameters are passed as Hashes' do - - let(:arguments) do - { foo: 'bar', moo: 'bam', baz: 'qux' } - end - - let(:unsupported_params) do - [ :foo, :moo] - end - - let(:message) do - message = '' - expect(Kernel).to receive(:warn) { |msg| message = msg } - utils.__report_unsupported_parameters(arguments, unsupported_params) - message - end - - it 'prints the unsupported parameters' do - expect(message).to match(/You are using unsupported parameter \[\:foo\]/) - expect(message).to match(/You are using unsupported parameter \[\:moo\]/) - end - end - - context 'when the parameters are passed as a mix of Hashes and Symbols' do - - let(:arguments) do - { foo: 'bar', moo: 'bam', baz: 'qux' } - end - - let(:unsupported_params) do - [ { foo: { explanation: 'NOT_SUPPORTED'} }, :moo ] - end - - - let(:message) do - message = '' - expect(Kernel).to receive(:warn) { |msg| message = msg } - utils.__report_unsupported_parameters(arguments, unsupported_params) - message - end - - it 'prints the unsupported parameters' do - expect(message).to match(/You are using unsupported parameter \[\:foo\]/) - expect(message).to match(/You are using unsupported parameter \[\:moo\]/) - expect(message).to match(/NOT_SUPPORTED/) - end - end - - context 'when unsupported parameters are unused' do - - let(:arguments) do - { moo: 'bam', baz: 'qux' } - end - - let(:unsupported_params) do - [ :foo ] - end - - it 'prints the unsupported parameters' do - expect(Kernel).not_to receive(:warn) - utils.__report_unsupported_parameters(arguments, unsupported_params) - end - end - end - - describe '#__report_unsupported_method' do - - let(:message) do - message = '' - expect(Kernel).to receive(:warn) { |msg| message = msg } - utils.__report_unsupported_method(:foo) - message - end - - it 'prints a warning' do - expect(message).to match(/foo/) - end - end end diff --git a/elasticsearch-api/utils/thor/endpoint_specifics.rb b/elasticsearch-api/utils/thor/endpoint_specifics.rb index eea5f46cd..d521b5160 100644 --- a/elasticsearch-api/utils/thor/endpoint_specifics.rb +++ b/elasticsearch-api/utils/thor/endpoint_specifics.rb @@ -136,7 +136,7 @@ def msearch_template_body_helper def bulk_body_helper <<~SRC payload = if body.is_a? Array - Elasticsearch::API::Utils.__bulkify(body) + Elasticsearch::API::Utils.bulkify(body) else body end @@ -150,7 +150,7 @@ def find_structure_body_helper def bulk_doc_helper(info) <<~SRC # @option arguments [String|Array] :body #{info}. Array of Strings, Header/Data pairs, - # or the conveniency "combined" format can be passed, refer to Elasticsearch::API::Utils.__bulkify documentation. + # or the conveniency "combined" format can be passed, refer to Elasticsearch::API::Utils.bulkify documentation. SRC end end diff --git a/elasticsearch-api/utils/thor/templates/_body.erb b/elasticsearch-api/utils/thor/templates/_body.erb index 6e8072b6b..458bebeae 100644 --- a/elasticsearch-api/utils/thor/templates/_body.erb +++ b/elasticsearch-api/utils/thor/templates/_body.erb @@ -28,7 +28,7 @@ when 'mtermvectors' <%- when 'cluster.reroute', 'cluster.put_settings' %> body = arguments.delete(:body) || {} <%- when 'ml.find_file_structure' %> - body = Utils.__bulkify(arguments.delete(:body)) + body = Utils.bulkify(arguments.delete(:body)) <%- else -%> body = <%= @spec.body.nil? ? 'nil' : 'arguments.delete(:body)' %> <%- end -%> From 43c40378d7a4d5690dc4a9e3b0a5da8b54ce1557 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 13 Mar 2025 10:54:16 +0000 Subject: [PATCH 08/11] [API] Removes old unused code from utils.rb --- .../lib/elasticsearch/api/utils.rb | 57 ------------------- 1 file changed, 57 deletions(-) diff --git a/elasticsearch-api/lib/elasticsearch/api/utils.rb b/elasticsearch-api/lib/elasticsearch/api/utils.rb index 8959b3aa8..128281a61 100644 --- a/elasticsearch-api/lib/elasticsearch/api/utils.rb +++ b/elasticsearch-api/lib/elasticsearch/api/utils.rb @@ -177,63 +177,6 @@ def rescue_from_not_found(&block) end end - def __report_unsupported_parameters(arguments, params=[]) - messages = [] - unsupported_params = params.select {|d| d.is_a?(Hash) ? arguments.include?(d.keys.first) : arguments.include?(d) } - - unsupported_params.each do |param| - name = case param - when Symbol - param - when Hash - param.keys.first - else - raise ArgumentError, "The param must be a Symbol or a Hash" - end - - explanation = if param.is_a?(Hash) - ". #{param.values.first[:explanation]}." - else - ". This parameter is not supported in the version you're using: #{Elasticsearch::API::VERSION}, and will be removed in the next release." - end - - message = "[!] You are using unsupported parameter [:#{name}]" - - if source = caller && caller.last - message += " in `#{source}`" - end - - message += explanation - - messages << message - end - - unless messages.empty? - messages << "Suppress this warning by the `-WO` command line flag." - - if STDERR.tty? - Kernel.warn messages.map { |m| "\e[31;1m#{m}\e[0m" }.join("\n") - else - Kernel.warn messages.join("\n") - end - end - end - - def __report_unsupported_method(name) - message = "[!] You are using unsupported method [#{name}]" - if source = caller && caller.last - message += " in `#{source}`" - end - - message += ". This method is not supported in the version you're using: #{Elasticsearch::API::VERSION}, and will be removed in the next release. Suppress this warning by the `-WO` command line flag." - - if STDERR.tty? - Kernel.warn "\e[31;1m#{message}\e[0m" - else - Kernel.warn message - end - end - extend self end end From ffd4782ff117866e88e0c1e94bc950ff15823e3a Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 13 Mar 2025 11:25:33 +0000 Subject: [PATCH 09/11] [API] Updates generated API code to 9.x --- .../api/actions/async_search/delete.rb | 15 +- .../api/actions/async_search/get.rb | 24 ++- .../api/actions/async_search/status.rb | 19 +- .../api/actions/async_search/submit.rb | 85 ++++---- .../lib/elasticsearch/api/actions/bulk.rb | 134 +++++++++++-- .../elasticsearch/api/actions/cat/aliases.rb | 39 ++-- .../api/actions/cat/allocation.rb | 39 ++-- .../api/actions/cat/component_templates.rb | 39 ++-- .../elasticsearch/api/actions/cat/count.rb | 36 ++-- .../api/actions/cat/fielddata.rb | 32 +-- .../elasticsearch/api/actions/cat/health.rb | 39 ++-- .../lib/elasticsearch/api/actions/cat/help.rb | 2 +- .../elasticsearch/api/actions/cat/indices.rb | 56 ++++-- .../elasticsearch/api/actions/cat/master.rb | 33 +-- .../actions/cat/ml_data_frame_analytics.rb | 33 +-- .../api/actions/cat/ml_datafeeds.rb | 41 ++-- .../elasticsearch/api/actions/cat/ml_jobs.rb | 43 ++-- .../api/actions/cat/ml_trained_models.rb | 40 ++-- .../api/actions/cat/nodeattrs.rb | 33 +-- .../elasticsearch/api/actions/cat/nodes.rb | 38 ++-- .../api/actions/cat/pending_tasks.rb | 37 ++-- .../elasticsearch/api/actions/cat/plugins.rb | 33 +-- .../elasticsearch/api/actions/cat/recovery.rb | 43 ++-- .../api/actions/cat/repositories.rb | 33 +-- .../elasticsearch/api/actions/cat/segments.rb | 42 ++-- .../elasticsearch/api/actions/cat/shards.rb | 41 ++-- .../api/actions/cat/snapshots.rb | 38 ++-- .../elasticsearch/api/actions/cat/tasks.rb | 41 ++-- .../api/actions/cat/templates.rb | 37 ++-- .../api/actions/cat/thread_pool.rb | 42 ++-- .../api/actions/cat/transforms.rb | 39 ++-- .../elasticsearch/api/actions/clear_scroll.rb | 28 +-- .../api/actions/close_point_in_time.rb | 16 +- .../api/actions/cluster/allocation_explain.rb | 24 ++- .../cluster/delete_component_template.rb | 19 +- .../delete_voting_config_exclusions.rb | 20 +- .../cluster/exists_component_template.rb | 21 +- .../actions/cluster/get_component_template.rb | 21 +- .../api/actions/cluster/get_settings.rb | 21 +- .../api/actions/cluster/health.rb | 43 ++-- .../elasticsearch/api/actions/cluster/info.rb | 13 +- .../api/actions/cluster/pending_tasks.rb | 21 +- .../cluster/post_voting_config_exclusions.rb | 37 +++- .../actions/cluster/put_component_template.rb | 37 +++- .../api/actions/cluster/put_settings.rb | 29 ++- .../api/actions/cluster/remote_info.rb | 12 +- .../api/actions/cluster/reroute.rb | 34 ++-- .../api/actions/cluster/state.rb | 43 ++-- .../api/actions/cluster/stats.rb | 19 +- .../api/actions/connector/check_in.rb | 13 +- .../api/actions/connector/delete.rb | 28 +-- .../api/actions/connector/get.rb | 23 ++- .../api/actions/connector/list.rb | 31 +-- .../api/actions/connector/post.rb | 23 ++- .../api/actions/connector/put.rb | 22 +- .../api/actions/connector/sync_job_cancel.rb | 22 +- .../actions/connector/sync_job_check_in.rb | 15 +- .../api/actions/connector/sync_job_claim.rb | 20 +- .../api/actions/connector/sync_job_delete.rb | 22 +- .../api/actions/connector/sync_job_error.rb | 17 +- .../api/actions/connector/sync_job_get.rb | 20 +- .../api/actions/connector/sync_job_list.rb | 27 +-- .../api/actions/connector/sync_job_post.rb | 21 +- .../connector/sync_job_update_stats.rb | 19 +- .../connector/update_active_filtering.rb | 13 +- .../actions/connector/update_api_key_id.rb | 26 ++- .../actions/connector/update_configuration.rb | 23 ++- .../api/actions/connector/update_error.rb | 17 +- .../api/actions/connector/update_features.rb | 24 ++- .../api/actions/connector/update_filtering.rb | 25 ++- .../connector/update_filtering_validation.rb | 15 +- .../actions/connector/update_index_name.rb | 23 ++- .../api/actions/connector/update_name.rb | 22 +- .../api/actions/connector/update_native.rb | 22 +- .../api/actions/connector/update_pipeline.rb | 23 ++- .../actions/connector/update_scheduling.rb | 22 +- .../actions/connector/update_service_type.rb | 22 +- .../api/actions/connector/update_status.rb | 14 +- .../lib/elasticsearch/api/actions/count.rb | 74 ++++--- .../lib/elasticsearch/api/actions/create.rb | 98 +++++++-- .../delete_auto_follow_pattern.rb | 17 +- .../cross_cluster_replication/follow.rb | 25 ++- .../cross_cluster_replication/follow_info.rb | 20 +- .../cross_cluster_replication/follow_stats.rb | 19 +- .../forget_follower.rb | 27 ++- .../get_auto_follow_pattern.rb | 18 +- .../pause_auto_follow_pattern.rb | 22 +- .../cross_cluster_replication/pause_follow.rb | 22 +- .../put_auto_follow_pattern.rb | 21 +- .../resume_auto_follow_pattern.rb | 19 +- .../resume_follow.rb | 22 +- .../cross_cluster_replication/stats.rb | 17 +- .../cross_cluster_replication/unfollow.rb | 21 +- .../dangling_indices/delete_dangling_index.rb | 18 +- .../dangling_indices/import_dangling_index.rb | 19 +- .../dangling_indices/list_dangling_indices.rb | 13 +- .../lib/elasticsearch/api/actions/delete.rb | 65 ++++-- .../api/actions/delete_by_query.rb | 156 +++++++++++---- .../api/actions/delete_by_query_rethrottle.rb | 17 +- .../api/actions/delete_script.rb | 21 +- .../api/actions/enrich/delete_policy.rb | 13 +- .../api/actions/enrich/execute_policy.rb | 17 +- .../api/actions/enrich/get_policy.rb | 16 +- .../api/actions/enrich/put_policy.rb | 17 +- .../elasticsearch/api/actions/enrich/stats.rb | 13 +- .../elasticsearch/api/actions/eql/delete.rb | 16 +- .../lib/elasticsearch/api/actions/eql/get.rb | 19 +- .../api/actions/eql/get_status.rb | 13 +- .../elasticsearch/api/actions/eql/search.rb | 32 +-- .../api/actions/esql/async_query.rb | 32 ++- .../api/actions/esql/async_query_delete.rb | 19 +- .../api/actions/esql/async_query_get.rb | 27 ++- .../api/actions/esql/async_query_stop.rb | 5 +- .../elasticsearch/api/actions/esql/query.rb | 23 ++- .../lib/elasticsearch/api/actions/exists.rb | 64 ++++-- .../api/actions/exists_source.rb | 44 ++-- .../lib/elasticsearch/api/actions/explain.rb | 56 ++++-- .../api/actions/features/get_features.rb | 19 +- .../api/actions/features/reset_features.rb | 22 +- .../elasticsearch/api/actions/field_caps.rb | 46 +++-- .../api/actions/fleet/global_checkpoints.rb | 28 ++- .../api/actions/fleet/msearch.rb | 40 +++- .../elasticsearch/api/actions/fleet/search.rb | 66 +++++- .../lib/elasticsearch/api/actions/get.rb | 96 +++++++-- .../elasticsearch/api/actions/get_script.rb | 17 +- .../api/actions/get_script_context.rb | 11 +- .../api/actions/get_script_languages.rb | 11 +- .../elasticsearch/api/actions/get_source.rb | 47 +++-- .../api/actions/graph/explore.rb | 25 ++- .../api/actions/health_report.rb | 30 ++- .../lib/elasticsearch/api/actions/index.rb | 146 +++++++++++--- .../delete_lifecycle.rb | 17 +- .../explain_lifecycle.rb | 24 ++- .../get_lifecycle.rb | 16 +- .../index_lifecycle_management/get_status.rb | 11 +- .../migrate_to_data_tiers.rb | 29 ++- .../move_to_step.rb | 26 ++- .../put_lifecycle.rb | 20 +- .../remove_policy.rb | 16 +- .../index_lifecycle_management/retry.rb | 17 +- .../index_lifecycle_management/start.rb | 17 +- .../index_lifecycle_management/stop.rb | 18 +- .../api/actions/indices/add_block.rb | 41 ++-- .../api/actions/indices/analyze.rb | 31 +-- .../actions/indices/cancel_migrate_reindex.rb | 7 +- .../api/actions/indices/clear_cache.rb | 40 ++-- .../api/actions/indices/clone.rb | 59 ++++-- .../api/actions/indices/close.rb | 46 +++-- .../api/actions/indices/create.rb | 40 +++- .../api/actions/indices/create_data_stream.rb | 22 +- .../api/actions/indices/create_from.rb | 7 +- .../api/actions/indices/data_streams_stats.rb | 19 +- .../api/actions/indices/delete.rb | 40 ++-- .../api/actions/indices/delete_alias.rb | 27 ++- .../actions/indices/delete_data_lifecycle.rb | 17 +- .../api/actions/indices/delete_data_stream.rb | 17 +- .../actions/indices/delete_index_template.rb | 19 +- .../api/actions/indices/delete_template.rb | 21 +- .../api/actions/indices/disk_usage.rb | 37 ++-- .../api/actions/indices/downsample.rb | 26 ++- .../api/actions/indices/exists.rb | 33 +-- .../api/actions/indices/exists_alias.rb | 35 ++-- .../actions/indices/exists_index_template.rb | 17 +- .../api/actions/indices/exists_template.rb | 26 ++- .../actions/indices/explain_data_lifecycle.rb | 15 +- .../api/actions/indices/field_usage_stats.rb | 33 ++- .../api/actions/indices/flush.rb | 39 ++-- .../api/actions/indices/forcemerge.rb | 58 +++++- .../elasticsearch/api/actions/indices/get.rb | 37 ++-- .../api/actions/indices/get_alias.rb | 38 ++-- .../api/actions/indices/get_data_lifecycle.rb | 23 ++- .../indices/get_data_lifecycle_stats.rb | 11 +- .../api/actions/indices/get_data_stream.rb | 23 ++- .../api/actions/indices/get_field_mapping.rb | 45 +++-- .../api/actions/indices/get_index_template.rb | 21 +- .../api/actions/indices/get_mapping.rb | 32 +-- .../indices/get_migrate_reindex_status.rb | 7 +- .../api/actions/indices/get_settings.rb | 49 +++-- .../api/actions/indices/get_template.rb | 23 ++- .../api/actions/indices/migrate_reindex.rb | 4 +- .../actions/indices/migrate_to_data_stream.rb | 26 ++- .../api/actions/indices/modify_data_stream.rb | 13 +- .../elasticsearch/api/actions/indices/open.rb | 53 +++-- .../actions/indices/promote_data_stream.rb | 22 +- .../api/actions/indices/put_alias.rb | 31 +-- .../api/actions/indices/put_data_lifecycle.rb | 28 ++- .../api/actions/indices/put_index_template.rb | 39 +++- .../api/actions/indices/put_mapping.rb | 53 +++-- .../api/actions/indices/put_settings.rb | 56 ++++-- .../api/actions/indices/put_template.rb | 38 +++- .../api/actions/indices/recovery.rb | 36 +++- .../api/actions/indices/refresh.rb | 35 +++- .../indices/reload_search_analyzers.rb | 29 ++- .../api/actions/indices/resolve_cluster.rb | 70 ++++++- .../api/actions/indices/resolve_index.rb | 26 ++- .../api/actions/indices/rollover.rb | 62 ++++-- .../api/actions/indices/segments.rb | 28 ++- .../api/actions/indices/shard_stores.rb | 33 ++- .../api/actions/indices/shrink.rb | 51 +++-- .../indices/simulate_index_template.rb | 5 +- .../api/actions/indices/simulate_template.rb | 23 ++- .../api/actions/indices/split.rb | 52 +++-- .../api/actions/indices/stats.rb | 47 +++-- .../api/actions/indices/update_aliases.rb | 19 +- .../api/actions/indices/validate_query.rb | 55 ++--- .../inference/chat_completion_unified.rb | 5 +- .../api/actions/inference/completion.rb | 5 +- .../api/actions/inference/delete.rb | 7 +- .../api/actions/inference/get.rb | 9 +- .../api/actions/inference/put.rb | 7 +- .../api/actions/inference/put_watsonx.rb | 15 +- .../api/actions/inference/rerank.rb | 5 +- .../api/actions/inference/sparse_embedding.rb | 5 +- .../actions/inference/stream_completion.rb | 5 +- .../api/actions/inference/text_embedding.rb | 5 +- .../api/actions/inference/update.rb | 7 +- .../lib/elasticsearch/api/actions/info.rb | 11 +- .../actions/ingest/delete_geoip_database.rb | 18 +- .../ingest/delete_ip_location_database.rb | 20 +- .../api/actions/ingest/delete_pipeline.rb | 20 +- .../api/actions/ingest/geo_ip_stats.rb | 11 +- .../api/actions/ingest/get_geoip_database.rb | 15 +- .../ingest/get_ip_location_database.rb | 19 +- .../api/actions/ingest/get_pipeline.rb | 19 +- .../api/actions/ingest/processor_grok.rb | 13 +- .../api/actions/ingest/put_geoip_database.rb | 20 +- .../ingest/put_ip_location_database.rb | 22 +- .../api/actions/ingest/put_pipeline.rb | 19 +- .../api/actions/ingest/simulate.rb | 19 +- .../elasticsearch/api/actions/knn_search.rb | 29 ++- .../api/actions/license/delete.rb | 16 +- .../elasticsearch/api/actions/license/get.rb | 16 +- .../api/actions/license/get_basic_status.rb | 10 +- .../api/actions/license/get_trial_status.rb | 10 +- .../elasticsearch/api/actions/license/post.rb | 24 ++- .../api/actions/license/post_start_basic.rb | 19 +- .../api/actions/license/post_start_trial.rb | 18 +- .../api/actions/logstash/delete_pipeline.rb | 14 +- .../api/actions/logstash/get_pipeline.rb | 13 +- .../api/actions/logstash/put_pipeline.rb | 16 +- .../clear_trained_model_deployment_cache.rb | 14 +- .../api/actions/machine_learning/close_job.rb | 26 ++- .../machine_learning/delete_calendar.rb | 13 +- .../machine_learning/delete_calendar_event.rb | 17 +- .../machine_learning/delete_calendar_job.rb | 17 +- .../delete_data_frame_analytics.rb | 16 +- .../machine_learning/delete_datafeed.rb | 18 +- .../machine_learning/delete_expired_data.rb | 28 ++- .../actions/machine_learning/delete_filter.rb | 14 +- .../machine_learning/delete_forecast.rb | 33 ++- .../actions/machine_learning/delete_job.rb | 28 ++- .../machine_learning/delete_model_snapshot.rb | 19 +- .../machine_learning/delete_trained_model.rb | 17 +- .../delete_trained_model_alias.rb | 19 +- .../machine_learning/estimate_model_memory.rb | 15 +- .../machine_learning/evaluate_data_frame.rb | 16 +- .../explain_data_frame_analytics.rb | 30 ++- .../api/actions/machine_learning/flush_job.rb | 37 ++-- .../api/actions/machine_learning/forecast.rb | 33 ++- .../actions/machine_learning/get_buckets.rb | 48 +++-- .../machine_learning/get_calendar_events.rb | 22 +- .../actions/machine_learning/get_calendars.rb | 26 +-- .../machine_learning/get_categories.rb | 36 ++-- .../get_data_frame_analytics.rb | 35 +++- .../get_data_frame_analytics_stats.rb | 30 ++- .../machine_learning/get_datafeed_stats.rb | 29 ++- .../actions/machine_learning/get_datafeeds.rb | 32 ++- .../actions/machine_learning/get_filters.rb | 17 +- .../machine_learning/get_influencers.rb | 39 ++-- .../actions/machine_learning/get_job_stats.rb | 24 ++- .../api/actions/machine_learning/get_jobs.rb | 31 ++- .../machine_learning/get_memory_stats.rb | 21 +- .../get_model_snapshot_upgrade_stats.rb | 26 ++- .../machine_learning/get_model_snapshots.rb | 41 ++-- .../machine_learning/get_overall_buckets.rb | 60 ++++-- .../actions/machine_learning/get_records.rb | 42 ++-- .../machine_learning/get_trained_models.rb | 40 ++-- .../get_trained_models_stats.rb | 26 ++- .../machine_learning/infer_trained_model.rb | 10 +- .../api/actions/machine_learning/info.rb | 17 +- .../api/actions/machine_learning/open_job.rb | 23 ++- .../machine_learning/post_calendar_events.rb | 14 +- .../api/actions/machine_learning/post_data.rb | 20 +- .../preview_data_frame_analytics.rb | 23 ++- .../machine_learning/preview_datafeed.rb | 37 ++-- .../actions/machine_learning/put_calendar.rb | 14 +- .../machine_learning/put_calendar_job.rb | 16 +- .../put_data_frame_analytics.rb | 21 +- .../actions/machine_learning/put_datafeed.rb | 36 +++- .../actions/machine_learning/put_filter.rb | 16 +- .../api/actions/machine_learning/put_job.rb | 31 ++- .../machine_learning/put_trained_model.rb | 22 +- .../put_trained_model_alias.rb | 36 +++- .../put_trained_model_definition_part.rb | 19 +- .../put_trained_model_vocabulary.rb | 16 +- .../api/actions/machine_learning/reset_job.rb | 23 ++- .../machine_learning/revert_model_snapshot.rb | 34 +++- .../machine_learning/set_upgrade_mode.rb | 28 ++- .../start_data_frame_analytics.rb | 31 ++- .../machine_learning/start_datafeed.rb | 43 +++- .../start_trained_model_deployment.rb | 5 +- .../stop_data_frame_analytics.rb | 34 +++- .../actions/machine_learning/stop_datafeed.rb | 31 ++- .../stop_trained_model_deployment.rb | 19 +- .../update_data_frame_analytics.rb | 16 +- .../machine_learning/update_datafeed.rb | 35 +++- .../actions/machine_learning/update_filter.rb | 15 +- .../actions/machine_learning/update_job.rb | 13 +- .../machine_learning/update_model_snapshot.rb | 17 +- .../update_trained_model_deployment.rb | 21 +- .../machine_learning/upgrade_job_snapshot.rb | 30 ++- .../lib/elasticsearch/api/actions/mget.rb | 50 +++-- .../api/actions/migration/deprecations.rb | 17 +- .../migration/get_feature_upgrade_status.rb | 14 +- .../actions/migration/post_feature_upgrade.rb | 14 +- .../lib/elasticsearch/api/actions/msearch.rb | 55 +++-- .../api/actions/msearch_template.rb | 40 ++-- .../elasticsearch/api/actions/mtermvectors.rb | 62 +++--- .../clear_repositories_metering_archive.rb | 23 ++- .../nodes/get_repositories_metering_info.rb | 16 +- .../api/actions/nodes/hot_threads.rb | 30 +-- .../elasticsearch/api/actions/nodes/info.rb | 25 +-- .../actions/nodes/reload_secure_settings.rb | 23 ++- .../elasticsearch/api/actions/nodes/stats.rb | 46 +++-- .../elasticsearch/api/actions/nodes/usage.rb | 24 ++- .../api/actions/open_point_in_time.rb | 58 ++++-- .../lib/elasticsearch/api/actions/ping.rb | 11 +- .../elasticsearch/api/actions/put_script.rb | 31 +-- .../api/actions/query_rules/delete_rule.rb | 18 +- .../api/actions/query_rules/delete_ruleset.rb | 30 ++- .../api/actions/query_rules/get_rule.rb | 17 +- .../api/actions/query_rules/get_ruleset.rb | 13 +- .../api/actions/query_rules/list_rulesets.rb | 15 +- .../api/actions/query_rules/put_rule.rb | 23 ++- .../api/actions/query_rules/put_ruleset.rb | 20 +- .../api/actions/query_rules/test.rb | 19 +- .../elasticsearch/api/actions/rank_eval.rb | 27 +-- .../lib/elasticsearch/api/actions/reindex.rb | 171 ++++++++++++++-- .../api/actions/reindex_rethrottle.rb | 23 ++- .../api/actions/render_search_template.rb | 24 ++- .../api/actions/scripts_painless_execute.rb | 17 +- .../lib/elasticsearch/api/actions/scroll.rb | 36 ++-- .../lib/elasticsearch/api/actions/search.rb | 189 +++++++++++++----- .../api/actions/search_application/delete.rb | 21 +- .../delete_behavioral_analytics.rb | 11 +- .../api/actions/search_application/get.rb | 20 +- .../get_behavioral_analytics.rb | 12 +- .../api/actions/search_application/list.rb | 25 +-- .../post_behavioral_analytics_event.rb | 20 +- .../api/actions/search_application/put.rb | 24 +-- .../put_behavioral_analytics.rb | 12 +- .../search_application/render_query.rb | 18 +- .../api/actions/search_application/search.rb | 26 +-- .../elasticsearch/api/actions/search_mvt.rb | 177 +++++++++++++--- .../api/actions/search_shards.rb | 42 ++-- .../api/actions/search_template.rb | 51 +++-- .../searchable_snapshots/cache_stats.rb | 16 +- .../searchable_snapshots/clear_cache.rb | 20 +- .../api/actions/searchable_snapshots/mount.rb | 29 +-- .../api/actions/searchable_snapshots/stats.rb | 16 +- .../actions/security/activate_user_profile.rb | 2 +- .../api/actions/security/authenticate.rb | 14 +- .../api/actions/security/bulk_delete_role.rb | 16 +- .../api/actions/security/bulk_put_role.rb | 16 +- .../actions/security/bulk_update_api_keys.rb | 21 +- .../api/actions/security/change_password.rb | 18 +- .../actions/security/clear_api_key_cache.rb | 18 +- .../security/clear_cached_privileges.rb | 16 +- .../actions/security/clear_cached_realms.rb | 22 +- .../actions/security/clear_cached_roles.rb | 15 +- .../security/clear_cached_service_tokens.rb | 25 ++- .../api/actions/security/create_api_key.rb | 22 +- .../security/create_cross_cluster_api_key.rb | 21 +- .../actions/security/create_service_token.rb | 28 ++- .../api/actions/security/delegate_pki.rb | 17 +- .../api/actions/security/delete_privileges.rb | 22 +- .../api/actions/security/delete_role.rb | 17 +- .../actions/security/delete_role_mapping.rb | 18 +- .../actions/security/delete_service_token.rb | 21 +- .../api/actions/security/delete_user.rb | 15 +- .../api/actions/security/disable_user.rb | 17 +- .../actions/security/disable_user_profile.rb | 5 +- .../api/actions/security/enable_user.rb | 16 +- .../actions/security/enable_user_profile.rb | 5 +- .../api/actions/security/enroll_kibana.rb | 13 +- .../api/actions/security/enroll_node.rb | 13 +- .../api/actions/security/get_api_key.rb | 36 ++-- .../security/get_builtin_privileges.rb | 11 +- .../api/actions/security/get_privileges.rb | 24 ++- .../api/actions/security/get_role.rb | 19 +- .../api/actions/security/get_role_mapping.rb | 15 +- .../actions/security/get_service_accounts.rb | 23 ++- .../security/get_service_credentials.rb | 20 +- .../api/actions/security/get_settings.rb | 18 +- .../api/actions/security/get_token.rb | 21 +- .../api/actions/security/get_user.rb | 17 +- .../actions/security/get_user_privileges.rb | 19 +- .../api/actions/security/get_user_profile.rb | 5 +- .../api/actions/security/grant_api_key.rb | 30 ++- .../api/actions/security/has_privileges.rb | 15 +- .../security/has_privileges_user_profile.rb | 2 +- .../actions/security/invalidate_api_key.rb | 22 +- .../api/actions/security/invalidate_token.rb | 21 +- .../api/actions/security/oidc_authenticate.rb | 15 +- .../api/actions/security/oidc_logout.rb | 16 +- .../security/oidc_prepare_authentication.rb | 16 +- .../api/actions/security/put_privileges.rb | 26 ++- .../api/actions/security/put_role.rb | 19 +- .../api/actions/security/put_role_mapping.rb | 34 +++- .../api/actions/security/put_user.rb | 22 +- .../api/actions/security/query_api_keys.rb | 28 ++- .../api/actions/security/query_role.rb | 19 +- .../api/actions/security/query_user.rb | 20 +- .../api/actions/security/saml_authenticate.rb | 21 +- .../actions/security/saml_complete_logout.rb | 20 +- .../api/actions/security/saml_invalidate.rb | 19 +- .../api/actions/security/saml_logout.rb | 17 +- .../security/saml_prepare_authentication.rb | 22 +- .../saml_service_provider_metadata.rb | 15 +- .../actions/security/suggest_user_profiles.rb | 2 +- .../api/actions/security/update_api_key.rb | 27 ++- .../security/update_cross_cluster_api_key.rb | 24 ++- .../api/actions/security/update_settings.rb | 22 +- .../security/update_user_profile_data.rb | 5 +- .../api/actions/simulate/ingest.rb | 33 ++- .../actions/snapshot/cleanup_repository.rb | 21 +- .../api/actions/snapshot/clone.rb | 27 ++- .../api/actions/snapshot/create.rb | 27 ++- .../api/actions/snapshot/create_repository.rb | 31 ++- .../api/actions/snapshot/delete.rb | 24 ++- .../api/actions/snapshot/delete_repository.rb | 25 ++- .../elasticsearch/api/actions/snapshot/get.rb | 62 ++++-- .../api/actions/snapshot/get_repository.rb | 22 +- .../actions/snapshot/repository_analyze.rb | 115 +++++++++-- .../api/actions/snapshot/restore.rb | 37 +++- .../api/actions/snapshot/status.rb | 41 ++-- .../api/actions/snapshot/verify_repository.rb | 21 +- .../delete_lifecycle.rb | 20 +- .../execute_lifecycle.rb | 20 +- .../execute_retention.rb | 18 +- .../get_lifecycle.rb | 19 +- .../get_stats.rb | 15 +- .../get_status.rb | 18 +- .../put_lifecycle.rb | 25 ++- .../snapshot_lifecycle_management/start.rb | 20 +- .../snapshot_lifecycle_management/stop.rb | 24 ++- .../api/actions/sql/clear_cursor.rb | 12 +- .../api/actions/sql/delete_async.rb | 17 +- .../api/actions/sql/get_async.rb | 27 ++- .../api/actions/sql/get_async_status.rb | 13 +- .../elasticsearch/api/actions/sql/query.rb | 17 +- .../api/actions/sql/translate.rb | 14 +- .../api/actions/ssl/certificates.rb | 20 +- .../api/actions/synonyms/delete_synonym.rb | 24 ++- .../actions/synonyms/delete_synonym_rule.rb | 17 +- .../api/actions/synonyms/get_synonym.rb | 16 +- .../api/actions/synonyms/get_synonym_rule.rb | 17 +- .../api/actions/synonyms/get_synonyms_sets.rb | 15 +- .../api/actions/synonyms/put_synonym.rb | 18 +- .../api/actions/synonyms/put_synonym_rule.rb | 21 +- .../elasticsearch/api/actions/tasks/cancel.rb | 28 ++- .../elasticsearch/api/actions/tasks/get.rb | 23 ++- .../elasticsearch/api/actions/tasks/list.rb | 82 ++++++-- .../elasticsearch/api/actions/terms_enum.rb | 18 +- .../elasticsearch/api/actions/termvectors.rb | 69 +++++-- .../text_structure/find_field_structure.rb | 101 ++++++++-- .../text_structure/find_message_structure.rb | 96 +++++++-- .../actions/text_structure/find_structure.rb | 116 +++++++++-- .../text_structure/test_grok_pattern.rb | 18 +- .../api/actions/transform/delete_transform.rb | 20 +- .../api/actions/transform/get_node_stats.rb | 13 +- .../api/actions/transform/get_transform.rb | 31 ++- .../actions/transform/get_transform_stats.rb | 27 ++- .../actions/transform/preview_transform.rb | 30 +-- .../api/actions/transform/put_transform.rb | 40 +++- .../api/actions/transform/reset_transform.rb | 20 +- .../transform/schedule_now_transform.rb | 19 +- .../api/actions/transform/start_transform.rb | 29 ++- .../api/actions/transform/stop_transform.rb | 29 ++- .../api/actions/transform/update_transform.rb | 25 ++- .../actions/transform/upgrade_transforms.rb | 26 ++- .../lib/elasticsearch/api/actions/update.rb | 66 +++--- .../api/actions/update_by_query.rb | 169 ++++++++++++---- .../api/actions/update_by_query_rethrottle.rb | 17 +- .../api/actions/watcher/ack_watch.rb | 25 ++- .../api/actions/watcher/activate_watch.rb | 13 +- .../api/actions/watcher/deactivate_watch.rb | 13 +- .../api/actions/watcher/delete_watch.rb | 19 +- .../api/actions/watcher/execute_watch.rb | 25 ++- .../api/actions/watcher/get_settings.rb | 15 +- .../api/actions/watcher/get_watch.rb | 12 +- .../api/actions/watcher/put_watch.rb | 31 ++- .../api/actions/watcher/query_watches.rb | 16 +- .../api/actions/watcher/start.rb | 13 +- .../api/actions/watcher/stats.rb | 16 +- .../elasticsearch/api/actions/watcher/stop.rb | 15 +- .../api/actions/watcher/update_settings.rb | 21 +- .../elasticsearch/api/actions/xpack/info.rb | 22 +- .../elasticsearch/api/actions/xpack/usage.rb | 16 +- 499 files changed, 9003 insertions(+), 4787 deletions(-) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/async_search/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/async_search/delete.rb index 21fefe452..abdd7009d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/async_search/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/async_search/delete.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module AsyncSearch module Actions - # Deletes an async search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + # Delete an async search. + # If the asynchronous search is still running, it is cancelled. + # Otherwise, the saved search results are deleted. + # If the Elasticsearch security features are enabled, the deletion of a specific async search is restricted to: the authenticated user that submitted the original search request; users that have the +cancel_task+ cluster privilege. # - # @option arguments [String] :id The async search ID + # @option arguments [String] :id A unique identifier for the async search. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit # def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'async_search.delete' } @@ -47,7 +50,7 @@ def delete(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_async_search/#{Utils.__listify(_id)}" + path = "_async_search/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/async_search/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/async_search/get.rb index 92c26c588..3fd8699a8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/async_search/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/async_search/get.rb @@ -15,22 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module AsyncSearch module Actions - # Retrieves the results of a previously submitted async search request given its ID. + # Get async search results. + # Retrieve the results of a previously submitted asynchronous search request. + # If the Elasticsearch security features are enabled, access to the results of a specific async search is restricted to the user or API key that submitted it. # - # @option arguments [String] :id The async search ID - # @option arguments [Time] :wait_for_completion_timeout Specify the time that the request should block waiting for the final response - # @option arguments [Time] :keep_alive Specify the time interval in which the results (partial or final) for this search will be available + # @option arguments [String] :id A unique identifier for the async search. (*Required*) + # @option arguments [Time] :keep_alive The length of time that the async search should be available in the cluster. + # When not specified, the +keep_alive+ set with the corresponding submit async request will be used. + # Otherwise, it is possible to override the value and extend the validity of the request. + # When this period expires, the search, if still running, is cancelled. + # If the search is completed, its saved results are deleted. # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response + # @option arguments [Time] :wait_for_completion_timeout Specifies to wait for the search to be completed up until the provided timeout. + # Final results will be returned if available before the timeout expires, otherwise the currently available results will be returned once the timeout expires. + # By default no timeout is set meaning that the currently available results will be returned without any additional wait. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit # def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'async_search.get' } @@ -50,7 +58,7 @@ def get(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_async_search/#{Utils.__listify(_id)}" + path = "_async_search/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/async_search/status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/async_search/status.rb index 4b2008d03..d59f34e8a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/async_search/status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/async_search/status.rb @@ -15,20 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module AsyncSearch module Actions - # Retrieves the status of a previously submitted async search request given its ID. + # Get the async search status. + # Get the status of a previously submitted async search request given its identifier, without retrieving search results. + # If the Elasticsearch security features are enabled, the access to the status of a specific async search is restricted to: + # * The user or API key that submitted the original async search request. + # * Users that have the +monitor+ cluster privilege or greater privileges. # - # @option arguments [String] :id The async search ID - # @option arguments [Time] :keep_alive Specify the time interval in which the results (partial or final) for this search will be available + # @option arguments [String] :id A unique identifier for the async search. (*Required*) + # @option arguments [Time] :keep_alive The length of time that the async search needs to be available. + # Ongoing async searches and any saved search results are deleted after this period. Server default: 5d. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit # def status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'async_search.status' } @@ -48,7 +53,7 @@ def status(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_async_search/status/#{Utils.__listify(_id)}" + path = "_async_search/status/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/async_search/submit.rb b/elasticsearch-api/lib/elasticsearch/api/actions/async_search/submit.rb index 34c9b80ae..255122ffb 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/async_search/submit.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/async_search/submit.rb @@ -15,63 +15,70 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module AsyncSearch module Actions - # Executes a search request asynchronously. + # Run an async search. + # When the primary sort of the results is an indexed field, shards get sorted based on minimum and maximum value that they hold for that field. Partial results become available following the sort criteria that was requested. + # Warning: Asynchronous search does not support scroll or search requests that include only the suggest section. + # By default, Elasticsearch does not allow you to store an async search response larger than 10Mb and an attempt to do this results in an error. + # The maximum allowed size for a stored async search response can be set by changing the +search.max_async_search_response_size+ cluster level setting. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - # @option arguments [Time] :wait_for_completion_timeout Specify the time that the request should block waiting for the final response - # @option arguments [Boolean] :keep_on_completion Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false) - # @option arguments [Time] :keep_alive Update the time interval in which the results (partial or final) for this search will be available - # @option arguments [Number] :batched_reduce_size The number of shard results that should be reduced at once on the coordinating node. This value should be used as the granularity at which progress results will be made available. - # @option arguments [Boolean] :request_cache Specify if request cache should be used for this request or not, defaults to true + # @option arguments [String, Array] :index A comma-separated list of index names to search; use +_all+ or empty string to perform the operation on all indices + # @option arguments [Time] :wait_for_completion_timeout Blocks and waits until the search is completed up to a certain timeout. + # When the async search completes within the timeout, the response won’t include the ID as the results are not stored in the cluster. Server default: 1s. + # @option arguments [Time] :keep_alive Specifies how long the async search needs to be available. + # Ongoing async searches and any saved search results are deleted after this period. Server default: 5d. + # @option arguments [Boolean] :keep_on_completion If +true+, results are stored for later retrieval when the search completes within the +wait_for_completion_timeout+. + # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes +_all+ string or when no indices have been specified) + # @option arguments [Boolean] :allow_partial_search_results Indicate if an error should be returned if there is a partial search failure or timeout # @option arguments [String] :analyzer The analyzer to use for the query string # @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false) - # @option arguments [Boolean] :ccs_minimize_roundtrips When doing a cross-cluster search, setting it to true may improve overall search latency, particularly when searching clusters with a large number of shards. However, when set to true, the progress of searches on the remote clusters will not be received until the search finishes on all clusters. - # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR) + # @option arguments [Integer] :batched_reduce_size Affects how often partial results become available, which happens whenever shard results are reduced. + # A partial reduction is performed every time the coordinating node has received a certain number of new shard responses (5 by default). Server default: 5. + # @option arguments [Boolean] :ccs_minimize_roundtrips The default value is the only supported value. + # @option arguments [String] :default_operator The default operator for query string query (AND or OR) # @option arguments [String] :df The field to use as default where no field prefix is given in the query string + # @option arguments [String, Array] :docvalue_fields A comma-separated list of fields to return as the docvalue representation of a field for each hit + # @option arguments [String, Array] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. # @option arguments [Boolean] :explain Specify whether to return detailed information about score computation as part of a hit - # @option arguments [List] :stored_fields A comma-separated list of stored fields to return as part of a hit - # @option arguments [List] :docvalue_fields A comma-separated list of fields to return as the docvalue representation of a field for each hit - # @option arguments [Number] :from Starting offset (default: 0) - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) # @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored + # @option arguments [Integer] :max_concurrent_shard_requests The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether hits.total should be rendered as an integer or an object in the rest search response - # @option arguments [String] :q Query in the Lucene query string syntax - # @option arguments [List] :routing A comma-separated list of specific routing values - # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch) - # @option arguments [Number] :size Number of hits to return (default: 10) - # @option arguments [List] :sort A comma-separated list of : pairs - # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return - # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field - # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field - # @option arguments [Number] :terminate_after The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - # @option arguments [List] :stats Specific 'tag' of the request for logging and statistical purposes - # @option arguments [String] :suggest_field Specify which field to use for suggestions - # @option arguments [String] :suggest_mode Specify suggest mode (options: missing, popular, always) - # @option arguments [Number] :suggest_size How many suggestions to return in response - # @option arguments [String] :suggest_text The source text for which the suggestions should be returned + # @option arguments [Boolean] :request_cache Specify if request cache should be used for this request or not, defaults to true Server default: true. + # @option arguments [String] :routing A comma-separated list of specific routing values + # @option arguments [String] :search_type Search operation type + # @option arguments [Array] :stats Specific 'tag' of the request for logging and statistical purposes + # @option arguments [String, Array] :stored_fields A comma-separated list of stored fields to return as part of a hit + # @option arguments [String] :suggest_field Specifies which field to use for suggestions. + # @option arguments [String] :suggest_mode Specify suggest mode + # @option arguments [Integer] :suggest_size How many suggestions to return in response + # @option arguments [String] :suggest_text The source text for which the suggestions should be returned. + # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [Boolean, Integer] :track_total_hits Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. # @option arguments [Boolean] :track_scores Whether to calculate and return scores even if they are not used for sorting - # @option arguments [Boolean|long] :track_total_hits Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. - # @option arguments [Boolean] :allow_partial_search_results Indicate if an error should be returned if there is a partial search failure or timeout # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response + # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether hits.total should be rendered as an integer or an object in the rest search response # @option arguments [Boolean] :version Specify whether to return document version as part of a hit + # @option arguments [Boolean, String, Array] :_source True or false to return the _source field or not, or a list of fields to return + # @option arguments [String, Array] :_source_excludes A list of fields to exclude from the returned _source field + # @option arguments [String, Array] :_source_includes A list of fields to extract and return from the _source field # @option arguments [Boolean] :seq_no_primary_term Specify whether to return sequence number and primary term of the last modification of each hit - # @option arguments [Number] :max_concurrent_shard_requests The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests + # @option arguments [String] :q Query in the Lucene query string syntax + # @option arguments [Integer] :size Number of hits to return (default: 10) + # @option arguments [Integer] :from Starting offset (default: 0) + # @option arguments [String] :sort A comma-separated list of : pairs # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search definition using the Query DSL + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/async-search.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-async-search-submit # def submit(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'async_search.submit' } @@ -84,13 +91,13 @@ def submit(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_async_search" + "#{Utils.listify(_index)}/_async_search" else '_async_search' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb b/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb index c1a049141..7a66d6767 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb @@ -15,32 +15,122 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows to perform multiple index/update/delete operations in a single request. + # Bulk index or delete documents. + # Perform multiple +index+, +create+, +delete+, and +update+ actions in a single request. + # This reduces overhead and can greatly increase indexing speed. + # If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias: + # * To use the +create+ action, you must have the +create_doc+, +create+, +index+, or +write+ index privilege. Data streams support only the +create+ action. + # * To use the +index+ action, you must have the +create+, +index+, or +write+ index privilege. + # * To use the +delete+ action, you must have the +delete+ or +write+ index privilege. + # * To use the +update+ action, you must have the +index+ or +write+ index privilege. + # * To automatically create a data stream or index with a bulk API request, you must have the +auto_configure+, +create_index+, or +manage+ index privilege. + # * To make the result of a bulk operation visible to search using the +refresh+ parameter, you must have the +maintenance+ or +manage+ index privilege. + # Automatic data stream creation requires a matching index template with data stream enabled. + # The actions are specified in the request body using a newline delimited JSON (NDJSON) structure: + # + + # action_and_meta_data\n + # optional_source\n + # action_and_meta_data\n + # optional_source\n + # .... + # action_and_meta_data\n + # optional_source\n + # + + # The +index+ and +create+ actions expect a source on the next line and have the same semantics as the +op_type+ parameter in the standard index API. + # A +create+ action fails if a document with the same ID already exists in the target + # An +index+ action adds or replaces a document as necessary. + # NOTE: Data streams support only the +create+ action. + # To update or delete a document in a data stream, you must target the backing index containing the document. + # An +update+ action expects that the partial doc, upsert, and script and its options are specified on the next line. + # A +delete+ action does not expect a source on the next line and has the same semantics as the standard delete API. + # NOTE: The final line of data must end with a newline character (+\n+). + # Each newline character may be preceded by a carriage return (+\r+). + # When sending NDJSON data to the +_bulk+ endpoint, use a +Content-Type+ header of +application/json+ or +application/x-ndjson+. + # Because this format uses literal newline characters (+\n+) as delimiters, make sure that the JSON actions and sources are not pretty printed. + # If you provide a target in the request path, it is used for any actions that don't explicitly specify an +_index+ argument. + # A note on the format: the idea here is to make processing as fast as possible. + # As some of the actions are redirected to other shards on other nodes, only +action_meta_data+ is parsed on the receiving node side. + # Client libraries using this protocol should try and strive to do something similar on the client side, and reduce buffering as much as possible. + # There is no "correct" number of actions to perform in a single bulk request. + # Experiment with different settings to find the optimal size for your particular workload. + # Note that Elasticsearch limits the maximum size of a HTTP request to 100mb by default so clients must ensure that no request exceeds this size. + # It is not possible to index a single document that exceeds the size limit, so you must pre-process any such documents into smaller pieces before sending them to Elasticsearch. + # For instance, split documents into pages or chapters before indexing them, or store raw binary data in a system outside Elasticsearch and replace the raw data with a link to the external system in the documents that you send to Elasticsearch. + # **Client suppport for bulk requests** + # Some of the officially supported clients provide helpers to assist with bulk requests and reindexing: + # * Go: Check out +esutil.BulkIndexer+ + # * Perl: Check out +Search::Elasticsearch::Client::5_0::Bulk+ and +Search::Elasticsearch::Client::5_0::Scroll+ + # * Python: Check out +elasticsearch.helpers.*+ + # * JavaScript: Check out +client.helpers.*+ + # * .NET: Check out +BulkAllObservable+ + # * PHP: Check out bulk indexing. + # **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: + # + + # $ cat requests + # { "index" : { "_index" : "test", "_id" : "1" } } + # { "field1" : "value1" } + # $ curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk --data-binary "@requests"; echo + # {"took":7, "errors": false, "items":[{"index":{"_index":"test","_id":"1","_version":1,"result":"created","forced_refresh":false}}]} + # + + # **Optimistic concurrency control** + # Each +index+ and +delete+ action within a bulk API call may include the +if_seq_no+ and +if_primary_term+ parameters in their respective action and meta data lines. + # The +if_seq_no+ and +if_primary_term+ parameters control how operations are run, based on the last modification to existing documents. See Optimistic concurrency control for more details. + # **Versioning** + # Each bulk item can include the version value using the +version+ field. + # It automatically follows the behavior of the index or delete operation based on the +_version+ mapping. + # It also support the +version_type+. + # **Routing** + # Each bulk item can include the routing value using the +routing+ field. + # It automatically follows the behavior of the index or delete operation based on the +_routing+ mapping. + # NOTE: Data streams do not support custom routing unless they were created with the +allow_custom_routing+ setting enabled in the template. + # **Wait for active shards** + # When making bulk calls, you can set the +wait_for_active_shards+ parameter to require a minimum number of shard copies to be active before starting to process the bulk request. + # **Refresh** + # Control when the changes made by this request are visible to search. + # NOTE: Only the shards that receive the bulk request will be affected by refresh. + # Imagine a +_bulk?refresh=wait_for+ request with three documents in it that happen to be routed to different shards in an index with five shards. + # The request will only wait for those three shards to refresh. + # The other two shards that make up the index do not participate in the +_bulk+ request at all. # - # @option arguments [String] :index Default index for items which don't provide one - # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the bulk operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for) - # @option arguments [String] :routing Specific routing value - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [List] :_source True or false to return the _source field or not, or default list of fields to return, can be overridden on each sub-request - # @option arguments [List] :_source_excludes Default list of fields to exclude from the returned _source field, can be overridden on each sub-request - # @option arguments [List] :_source_includes Default list of fields to extract and return from the _source field, can be overridden on each sub-request - # @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with - # @option arguments [Boolean] :require_alias If true, the request’s actions must target an index alias. Defaults to false. - # @option arguments [Boolean] :require_data_stream If true, the request's actions must target a data stream (existing or to-be-created). Default to false - # @option arguments [Boolean] :list_executed_pipelines Sets list_executed_pipelines for all incoming documents. Defaults to unset (false) - # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Defaults to true. + # @option arguments [String] :index The name of the data stream, index, or index alias to perform bulk actions on. + # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Server default: true. + # @option arguments [Boolean] :list_executed_pipelines If +true+, the response will include the ingest pipelines that were run for each index or create. + # @option arguments [String] :pipeline The pipeline identifier to use to preprocess incoming documents. + # If the index has a default ingest pipeline specified, setting the value to +_none+ turns off the default ingest pipeline for this request. + # If a final pipeline is configured, it will always run regardless of the value of this parameter. + # @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search. + # If +wait_for+, wait for a refresh to make this operation visible to search. + # If +false+, do nothing with refreshes. + # Valid values: +true+, +false+, +wait_for+. Server default: false. + # @option arguments [String] :routing A custom value that is used to route operations to a specific shard. + # @option arguments [Boolean, String, Array] :_source Indicates whether to return the +_source+ field (+true+ or +false+) or contains a list of fields to return. + # @option arguments [String, Array] :_source_excludes A comma-separated list of source fields to exclude from the response. + # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [String, Array] :_source_includes A comma-separated list of source fields to include in the response. + # If this parameter is specified, only these source fields are returned. + # You can exclude fields from this subset using the +_source_excludes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [Time] :timeout The period each action waits for the following operations: automatic index creation, dynamic mapping updates, and waiting for active shards. + # The default is +1m+ (one minute), which guarantees Elasticsearch waits for at least the timeout before failing. + # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). + # The default is +1+, which waits for each primary shard to be active. Server default: 1. + # @option arguments [Boolean] :require_alias If +true+, the request's actions must target an index alias. + # @option arguments [Boolean] :require_data_stream If +true+, the request's actions must target a data stream (existing or to be created). # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [String|Array] :body The operation definition and data (action-data pairs), separated by newlines. Array of Strings, Header/Data pairs, - # or the conveniency "combined" format can be passed, refer to Elasticsearch::API::Utils.__bulkify documentation. + # @option arguments [String|Array] :body operations. Array of Strings, Header/Data pairs, or the conveniency "combined" format can be passed, refer to Elasticsearch::API::Utils.bulkify documentation. # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-bulk # def bulk(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'bulk' } @@ -55,20 +145,20 @@ def bulk(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_bulk" + "#{Utils.listify(_index)}/_bulk" else '_bulk' end params = Utils.process_params(arguments) payload = if body.is_a? Array - Elasticsearch::API::Utils.__bulkify(body) + Elasticsearch::API::Utils.bulkify(body) else body end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb index 8c1362361..0c48914fd 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/aliases.rb @@ -15,26 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Shows information about currently configured aliases to indices including filter and routing infos. + # Get aliases. + # Get the cluster's index aliases, including filter and routing information. + # This API does not return data stream aliases. + # 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 [List] :name A comma-separated list of alias names to return - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked + # @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] :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. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # It supports comma-separated values, such as +open,hidden+. + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicated that the request should never timeout, you can set it to +-1+. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-aliases # def aliases(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.aliases' } @@ -53,12 +64,12 @@ def aliases(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_cat/aliases/#{Utils.__listify(_name)}" + "_cat/aliases/#{Utils.listify(_name)}" else '_cat/aliases' end params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h]) if params[:h] + params[:h] = Utils.listify(params[:h]) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb index f37b53e12..85c32ca56 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/allocation.rb @@ -15,27 +15,36 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Provides a snapshot of how many shards are allocated to each data node and how much disk space they are using. + # Get shard allocation information. + # Get a snapshot of the number of shards allocated to each data node and their disk space. + # IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. # - # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @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] :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. + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-allocation.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-allocation # def allocation(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.allocation' } @@ -54,12 +63,12 @@ def allocation(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _node_id - "_cat/allocation/#{Utils.__listify(_node_id)}" + "_cat/allocation/#{Utils.listify(_node_id)}" else '_cat/allocation' end params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h]) if params[:h] + params[:h] = Utils.listify(params[:h]) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) 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 0765a09a5..1e940e1c6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/component_templates.rb @@ -15,26 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns information about existing component_templates templates. + # Get component templates. + # Get information about component templates in a cluster. + # Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. + # IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. + # They are not intended for use by applications. For application consumption, use the get component template API. # - # @option arguments [String] :name A pattern that returned component template names must match - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @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] :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. + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-component-templates.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-component-templates # def component_templates(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.component_templates' } @@ -53,7 +66,7 @@ def component_templates(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_cat/component_templates/#{Utils.__listify(_name)}" + "_cat/component_templates/#{Utils.listify(_name)}" else '_cat/component_templates' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb index 8afd4cade..7f30de702 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/count.rb @@ -15,24 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Provides quick access to the document count of the entire cluster, or individual indices. + # Get a document count. + # Get quick access to a document count for a data stream, an index, or an entire cluster. + # The document count only includes live documents, not deleted documents which have not yet been removed by the merge process. + # IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. + # They are not intended for use by applications. For application consumption, use the count API. # - # @option arguments [List] :index A comma-separated list of index names to limit the returned information - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @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] :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. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-count.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-count # def count(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.count' } @@ -45,18 +55,18 @@ def count(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "_cat/count/#{Utils.__listify(_index)}" + "_cat/count/#{Utils.listify(_index)}" else '_cat/count' end params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h]) if params[:h] + params[:h] = Utils.listify(params[:h]) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb index 592958c96..114ec4086 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/fielddata.rb @@ -15,25 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Shows how much heap memory is currently being used by fielddata on every data node in the cluster. + # Get field data cache information. + # Get the amount of heap memory currently used by the field data cache on every data node in the cluster. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. + # They are not intended for use by applications. For application consumption, use the nodes stats API. # - # @option arguments [List] :fields A comma-separated list of fields to return the fielddata size - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @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] :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. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-fielddata.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-fielddata # def fielddata(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.fielddata' } @@ -52,7 +60,7 @@ def fielddata(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _fields - "_cat/fielddata/#{Utils.__listify(_fields)}" + "_cat/fielddata/#{Utils.listify(_fields)}" else '_cat/fielddata' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/health.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/health.rb index 59309d508..461cb1748 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/health.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/health.rb @@ -15,25 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns a concise representation of the cluster health. + # Get the cluster health status. + # IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. + # They are not intended for use by applications. For application consumption, use the cluster health API. + # This API is often used to check malfunctioning clusters. + # To help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats: + # +HH:MM:SS+, which is human-readable but includes no date information; + # +Unix epoch time+, which is machine-sortable and includes date information. + # The latter format is useful for cluster recoveries that take multiple days. + # You can use the cat health API to verify cluster health across multiple nodes. + # You also can use the API to track the recovery of a large cluster over a longer period of time. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :ts Set to false to disable timestamping - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String] :time The unit used to display time values. + # @option arguments [Boolean] :ts If true, returns +HH:MM:SS+ and Unix epoch timestamps. Server default: true. + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-health.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-health # def health(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.health' } @@ -41,12 +54,12 @@ def health(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cat/health' params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h]) if params[:h] + params[:h] = Utils.listify(params[:h]) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/help.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/help.rb index 8e0f1e26d..1746fba92 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/help.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/help.rb @@ -38,7 +38,7 @@ def help(arguments = {}) body = nil method = Elasticsearch::API::HTTP_GET - path = "_cat" + path = '_cat' params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/indices.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/indices.rb index accc79e8c..a11c14395 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/indices.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/indices.rb @@ -15,31 +15,47 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns information about indices: number of primaries and replicas, document counts, disk size, ... + # Get index information. + # Get high-level information about indices in a cluster, including backing indices for data streams. + # Use this request to get the following information for each index in a cluster: + # - shard count + # - document count + # - deleted document count + # - primary store size + # - total store size of all shards, including shard replicas + # These metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents. + # To get an accurate count of Elasticsearch documents, use the cat count or count APIs. + # CAT APIs are only intended for human consumption using the command line or Kibana console. + # They are not intended for use by applications. For application consumption, use an index endpoint. # - # @option arguments [List] :index A comma-separated list of index names to limit the returned information - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [String] :health A health status ("green", "yellow", or "red" to filter only indices matching the specified health status (options: green, yellow, red) - # @option arguments [Boolean] :help Return help information - # @option arguments [Boolean] :pri Set to true to return stats only for primary shards - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers - # @option arguments [Boolean] :include_unloaded_segments If set to true segment stats will include stats for segments that are not currently loaded into memory - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @option arguments [String] :bytes The unit used to display byte values. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. + # @option arguments [String] :health The health status used to limit returned indices. By default, the response includes indices of any health status. + # @option arguments [Boolean] :include_unloaded_segments If true, the response includes information from segments that are not loaded into memory. + # @option arguments [Boolean] :pri If true, the response only includes information from primary shards. + # @option arguments [String] :time The unit used to display time values. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-indices.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-indices # def indices(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.indices' } @@ -52,18 +68,18 @@ def indices(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "_cat/indices/#{Utils.__listify(_index)}" + "_cat/indices/#{Utils.listify(_index)}" else '_cat/indices' end params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h]) if params[:h] + params[:h] = Utils.listify(params[:h]) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/master.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/master.rb index f8512afd3..2d18055c8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/master.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/master.rb @@ -15,25 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns information about the master node. + # Get master node information. + # Get information about the master node, including the ID, bound IP address, and name. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-master.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-master # def master(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.master' } @@ -41,7 +50,7 @@ def master(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cat/master' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_data_frame_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_data_frame_analytics.rb index 72e1f6977..4b6d79328 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_data_frame_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_data_frame_analytics.rb @@ -15,27 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Gets configuration and usage information about data frame analytics jobs. + # Get data frame analytics jobs. + # Get configuration and usage information about data frame analytics jobs. + # IMPORTANT: CAT APIs are only intended for human consumption using the Kibana + # console or command line. They are not intended for use by applications. For + # application consumption, use the get data frame analytics jobs statistics API. # # @option arguments [String] :id The ID of the data frame analytics to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no configs. (This includes `_all` string or when no configs have been specified) - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no configs. (This includes +_all+ string or when no configs have been specified) + # @option arguments [String] :bytes The unit in which to display byte values + # @option arguments [String, Array] :h Comma-separated list of column names to display. Server default: create_time,id,state,type. + # @option arguments [String, Array] :s Comma-separated list of column names or column aliases used to sort the + # response. + # @option arguments [String] :time Unit used to display time values. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-data-frame-analytics # def ml_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.ml_data_frame_analytics' } @@ -54,7 +61,7 @@ def ml_data_frame_analytics(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _id - "_cat/ml/data_frame/analytics/#{Utils.__listify(_id)}" + "_cat/ml/data_frame/analytics/#{Utils.listify(_id)}" else '_cat/ml/data_frame/analytics' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_datafeeds.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_datafeeds.rb index c00d25ba2..1191978d3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_datafeeds.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_datafeeds.rb @@ -15,26 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Gets configuration and usage information about datafeeds. + # Get datafeeds. + # Get configuration and usage information about datafeeds. + # This API returns a maximum of 10,000 datafeeds. + # If the Elasticsearch security features are enabled, you must have +monitor_ml+, +monitor+, +manage_ml+, or +manage+ + # cluster privileges to use this API. + # IMPORTANT: CAT APIs are only intended for human consumption using the Kibana + # console or command line. They are not intended for use by applications. For + # application consumption, use the get datafeed statistics API. # - # @option arguments [String] :datafeed_id The ID of the datafeeds stats to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no datafeeds that match. + # - Contains the +_all+ string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # If +true+, the API returns an empty datafeeds array when there are no matches and the subset of results when + # there are partial matches. If +false+, the API returns a 404 status code when there are no matches or only + # partial matches. Server default: true. + # @option arguments [String, Array] :h Comma-separated list of column names to display. Server default: ['bc', 'id', 'sc', 's']. + # @option arguments [String, Array] :s Comma-separated list of column names or column aliases used to sort the response. + # @option arguments [String] :time The unit used to display time values. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-datafeeds.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-datafeeds # def ml_datafeeds(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.ml_datafeeds' } @@ -53,7 +68,7 @@ def ml_datafeeds(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _datafeed_id - "_cat/ml/datafeeds/#{Utils.__listify(_datafeed_id)}" + "_cat/ml/datafeeds/#{Utils.listify(_datafeed_id)}" else '_cat/ml/datafeeds' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_jobs.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_jobs.rb index 0a9f41ff9..2dc94c4ae 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_jobs.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_jobs.rb @@ -15,27 +15,42 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Gets configuration and usage information about anomaly detection jobs. + # Get anomaly detection jobs. + # Get configuration and usage information for anomaly detection jobs. + # This API returns a maximum of 10,000 jobs. + # If the Elasticsearch security features are enabled, you must have +monitor_ml+, + # +monitor+, +manage_ml+, or +manage+ cluster privileges to use this API. + # IMPORTANT: CAT APIs are only intended for human consumption using the Kibana + # console or command line. They are not intended for use by applications. For + # application consumption, use the get anomaly detection job statistics API. # - # @option arguments [String] :job_id The ID of the jobs stats to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String] :job_id Identifier for the anomaly detection job. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no jobs that match. + # - Contains the +_all+ string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # If +true+, the API returns an empty jobs array when there are no matches and the subset of results when there + # are partial matches. If +false+, the API returns a 404 status code when there are no matches or only partial + # matches. Server default: true. + # @option arguments [String] :bytes The unit used to display byte values. + # @option arguments [String, Array] :h Comma-separated list of column names to display. Server default: buckets.count,data.processed_records,forecasts.total,id,model.bytes,model.memory_status,state. + # @option arguments [String, Array] :s Comma-separated list of column names or column aliases used to sort the response. + # @option arguments [String] :time The unit used to display time values. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-anomaly-detectors.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-jobs # def ml_jobs(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.ml_jobs' } @@ -54,7 +69,7 @@ def ml_jobs(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _job_id - "_cat/ml/anomaly_detectors/#{Utils.__listify(_job_id)}" + "_cat/ml/anomaly_detectors/#{Utils.listify(_job_id)}" else '_cat/ml/anomaly_detectors' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_trained_models.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_trained_models.rb index 3af9c15a3..db2290625 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_trained_models.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/ml_trained_models.rb @@ -15,29 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Gets configuration and usage information about inference trained models. + # Get trained models. + # Get configuration and usage information about inference trained models. + # IMPORTANT: CAT APIs are only intended for human consumption using the Kibana + # console or command line. They are not intended for use by applications. For + # application consumption, use the get trained models statistics API. # - # @option arguments [String] :model_id The ID of the trained models stats to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) - # @option arguments [Integer] :from skips a number of trained models - # @option arguments [Integer] :size specifies a max number of trained models to get - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String] :model_id A unique identifier for the trained model. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: contains wildcard expressions and there are no models that match; contains the +_all+ string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. + # If +true+, the API returns an empty array when there are no matches and the subset of results when there are partial matches. + # If +false+, the API returns a 404 status code when there are no matches or only partial matches. Server default: true. + # @option arguments [String] :bytes The unit used to display byte values. + # @option arguments [String, Array] :h A comma-separated list of column names to display. + # @option arguments [String, Array] :s A comma-separated list of column names or aliases used to sort the response. + # @option arguments [Integer] :from Skips the specified number of transforms. + # @option arguments [Integer] :size The maximum number of transforms to display. + # @option arguments [String] :time Unit used to display time values. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-trained-model.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-ml-trained-models # def ml_trained_models(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.ml_trained_models' } @@ -56,7 +64,7 @@ def ml_trained_models(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _model_id - "_cat/ml/trained_models/#{Utils.__listify(_model_id)}" + "_cat/ml/trained_models/#{Utils.listify(_model_id)}" else '_cat/ml/trained_models' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/nodeattrs.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/nodeattrs.rb index 54102162e..5227a8a28 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/nodeattrs.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/nodeattrs.rb @@ -15,25 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns information about custom node attributes. + # Get node attribute information. + # Get information about custom node attributes. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodeattrs.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodeattrs # def nodeattrs(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.nodeattrs' } @@ -41,7 +50,7 @@ def nodeattrs(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cat/nodeattrs' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/nodes.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/nodes.rb index 1411277c4..cf2f9c30f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/nodes.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/nodes.rb @@ -15,28 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns basic statistics about performance of cluster nodes. + # Get node information. + # Get information about the nodes in a cluster. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. # - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :full_id Return the full node ID instead of the shortened version (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers - # @option arguments [Boolean] :include_unloaded_segments If set to true segment stats will include stats for segments that are not currently loaded into memory + # @option arguments [String] :bytes The unit used to display byte values. + # @option arguments [Boolean, String] :full_id If +true+, return the full node ID. If +false+, return the shortened node ID. Server default: false. + # @option arguments [Boolean] :include_unloaded_segments If true, the response includes information from segments that are not loaded into memory. + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :time Unit used to display time values. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-nodes.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-nodes # def nodes(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.nodes' } @@ -44,12 +50,12 @@ def nodes(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cat/nodes' params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h], escape: false) if params[:h] + params[:h] = Utils.listify(params[:h], escape: false) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/pending_tasks.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/pending_tasks.rb index 67acfd781..f2963038d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/pending_tasks.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/pending_tasks.rb @@ -15,26 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns a concise representation of the cluster pending tasks. + # Get pending task information. + # Get information about cluster-level changes that have not yet taken effect. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the pending cluster tasks API. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :time Unit used to display time values. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-pending-tasks.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-pending-tasks # def pending_tasks(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.pending_tasks' } @@ -42,12 +51,12 @@ def pending_tasks(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cat/pending_tasks' params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h]) if params[:h] + params[:h] = Utils.listify(params[:h]) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/plugins.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/plugins.rb index fbde5d60e..dd8738f65 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/plugins.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/plugins.rb @@ -15,26 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns information about installed plugins across nodes node. + # Get plugin information. + # Get a list of plugins running on each node of a cluster. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information + # @option arguments [String, Array] :h List of columns to appear in the response. 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. # @option arguments [Boolean] :include_bootstrap Include bootstrap plugins in the response - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-plugins.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-plugins # def plugins(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.plugins' } @@ -42,7 +51,7 @@ def plugins(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cat/plugins' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/recovery.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/recovery.rb index 5e6865e47..ff1cf2710 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/recovery.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/recovery.rb @@ -15,28 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns information about index shard recoveries, both on-going completed. + # Get shard recovery information. + # Get information about ongoing and completed shard recoveries. + # Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or syncing a replica shard from a primary shard. When a shard recovery completes, the recovered shard is available for search and indexing. + # For data streams, the API returns information about the stream’s backing indices. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index recovery API. # - # @option arguments [List] :index Comma-separated list or wildcard expression of index names to limit the returned information - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :active_only If `true`, the response only includes ongoing shard recoveries - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [Boolean] :detailed If `true`, the response includes detailed information about shard recoveries - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @option arguments [Boolean] :active_only If +true+, the response only includes ongoing shard recoveries. + # @option arguments [String] :bytes The unit used to display byte values. + # @option arguments [Boolean] :detailed If +true+, the response includes detailed information about shard recoveries. + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [String] :time Unit used to display time values. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-recovery.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-recovery # def recovery(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.recovery' } @@ -49,18 +58,18 @@ def recovery(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "_cat/recovery/#{Utils.__listify(_index)}" + "_cat/recovery/#{Utils.listify(_index)}" else '_cat/recovery' end params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h]) if params[:h] + params[:h] = Utils.listify(params[:h]) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/repositories.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/repositories.rb index 482ceff4b..55e24c7b0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/repositories.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/repositories.rb @@ -15,25 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns information about snapshot repositories registered in the cluster. + # Get snapshot repository information. + # Get a list of snapshot repositories for a cluster. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot repository API. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-repositories.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-repositories # def repositories(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.repositories' } @@ -41,7 +50,7 @@ def repositories(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cat/repositories' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/segments.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/segments.rb index e9146b30c..f8a9e8e54 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/segments.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/segments.rb @@ -15,27 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Provides low-level information about the segments in the shards of an index. + # Get segment information. + # Get low-level information about the Lucene segments in index shards. + # For data streams, the API returns information about the backing indices. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API. # - # @option arguments [List] :index A comma-separated list of index names to limit the returned information - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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] :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. + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-segments.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-segments # def segments(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.segments' } @@ -48,13 +60,13 @@ def segments(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "_cat/segments/#{Utils.__listify(_index)}" + "_cat/segments/#{Utils.listify(_index)}" else '_cat/segments' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/shards.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/shards.rb index 4e4cae17d..b8656b523 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/shards.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/shards.rb @@ -15,27 +15,36 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Provides a detailed view of shard allocation on nodes. + # Get shard information. + # Get information about the shards in a cluster. + # For data streams, the API returns information about the backing indices. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. # - # @option arguments [List] :index A comma-separated list of index names to limit the returned information - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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] :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. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :time Unit used to display time values. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-shards.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-shards # def shards(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.shards' } @@ -48,18 +57,18 @@ def shards(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "_cat/shards/#{Utils.__listify(_index)}" + "_cat/shards/#{Utils.listify(_index)}" else '_cat/shards' end params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h]) if params[:h] + params[:h] = Utils.listify(params[:h]) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/snapshots.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/snapshots.rb index 3ae1c0088..dd44f2727 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/snapshots.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/snapshots.rb @@ -15,27 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns all snapshots in a specific repository. + # Get snapshot information. + # Get information about the snapshots stored in one or more repositories. + # A snapshot is a backup of an index or running Elasticsearch cluster. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get snapshot API. # - # @option arguments [List] :repository Name of repository from which to fetch the snapshot information - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :ignore_unavailable Set to true to ignore unavailable snapshots - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String, Array] :repository A comma-separated list of snapshot repositories used to limit the request. + # Accepts wildcard expressions. + # +_all+ returns all repositories. + # If any repository fails during the request, Elasticsearch returns an error. + # @option arguments [Boolean] :ignore_unavailable If +true+, the response does not include information from unavailable snapshots. + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :time Unit used to display time values. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-snapshots # def snapshots(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.snapshots' } @@ -54,7 +64,7 @@ def snapshots(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _repository - "_cat/snapshots/#{Utils.__listify(_repository)}" + "_cat/snapshots/#{Utils.listify(_repository)}" else '_cat/snapshots' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/tasks.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/tasks.rb index bbbb3bb6c..601e73d2f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/tasks.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/tasks.rb @@ -15,34 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns information about the tasks currently executing on one or more nodes in the cluster. + # Get task information. + # Get information about tasks currently running in the cluster. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the task management API. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [List] :nodes A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - # @option arguments [List] :actions A comma-separated list of actions that should be returned. Leave empty to return all. - # @option arguments [Boolean] :detailed Return detailed task information (default: false) - # @option arguments [String] :parent_task_id Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers - # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. - # @option arguments [Boolean] :wait_for_completion If `true`, the request blocks until the task has completed. + # @option arguments [Array] :actions The task action names, which are used to limit the response. + # @option arguments [Boolean] :detailed If +true+, the response includes detailed information about shard recoveries. + # @option arguments [Array] :nodes Unique node identifiers, which are used to limit the response. + # @option arguments [String] :parent_task_id The parent task identifier, which is used to limit the response. + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [String] :time Unit used to display time values. + # @option arguments [Time] :timeout Period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the task has completed. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-tasks # def tasks(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.tasks' } @@ -50,7 +57,7 @@ def tasks(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cat/tasks' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/templates.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/templates.rb index 42423d5f2..46c778473 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/templates.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/templates.rb @@ -15,26 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns information about existing templates. + # Get index template information. + # Get information about the index templates in a cluster. + # You can use index templates to apply index settings and field mappings to new indices at creation. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the get index template API. # - # @option arguments [String] :name A pattern that returned template names must match - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String] :name The name of the template to return. + # Accepts wildcard expressions. If omitted, all templates are returned. + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-templates.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-templates # def templates(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.templates' } @@ -53,7 +64,7 @@ def templates(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_cat/templates/#{Utils.__listify(_name)}" + "_cat/templates/#{Utils.listify(_name)}" else '_cat/templates' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/thread_pool.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/thread_pool.rb index f3ffd705f..65125ce46 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/thread_pool.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/thread_pool.rb @@ -15,28 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Returns cluster-wide thread pool statistics per node. - # By default the active, queue and rejected statistics are returned for all thread pools. + # Get thread pool statistics. + # Get thread pool statistics for each node in a cluster. + # Returned information includes all built-in thread pools and custom thread pools. + # IMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API. # - # @option arguments [List] :thread_pool_patterns A comma-separated list of regular-expressions to filter the thread pools in the output - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String, Array] :thread_pool_patterns A comma-separated list of thread pool names used to limit the request. + # Accepts wildcard expressions. + # @option arguments [String, Array] :h List of columns to appear in the response. 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. + # @option arguments [String] :time The unit used to display time values. + # @option arguments [Boolean] :local If +true+, the request computes the list of selected nodes from the + # local cluster state. If +false+ the list of selected nodes are computed + # from the cluster state of the master node. In both cases the coordinating + # node will send requests for further information to each selected node. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-thread-pool.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-thread-pool # def thread_pool(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.thread_pool' } @@ -55,12 +65,12 @@ def thread_pool(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _thread_pool_patterns - "_cat/thread_pool/#{Utils.__listify(_thread_pool_patterns)}" + "_cat/thread_pool/#{Utils.listify(_thread_pool_patterns)}" else '_cat/thread_pool' end params = Utils.process_params(arguments) - params[:h] = Utils.__listify(params[:h]) if params[:h] + params[:h] = Utils.listify(params[:h]) if params[:h] Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cat/transforms.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cat/transforms.rb index 172e7445a..e94c7c231 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cat/transforms.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cat/transforms.rb @@ -15,28 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cat module Actions - # Gets configuration and usage information about transforms. + # Get transform information. + # Get configuration and usage information about transforms. + # CAT APIs are only intended for human consumption using the Kibana + # console or command line. They are not intended for use by applications. For + # application consumption, use the get transform statistics API. # - # @option arguments [String] :transform_id The id of the transform for which to get stats. '_all' or '*' implies all transforms - # @option arguments [Integer] :from skips a number of transform configs, defaults to 0 - # @option arguments [Integer] :size specifies a max number of transforms to get, defaults to 100 - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [List] :h Comma-separated list of column names to display - # @option arguments [Boolean] :help Return help information - # @option arguments [List] :s Comma-separated list of column names or column aliases to sort by - # @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos) - # @option arguments [Boolean] :v Verbose mode. Display column headers + # @option arguments [String] :transform_id A transform identifier or a wildcard expression. + # If you do not specify one of these options, the API returns information for all transforms. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; contains the +_all+ string or no identifiers and there are no matches; contains wildcard expressions and there are only partial matches. + # If +true+, it returns an empty transforms array when there are no matches and the subset of results when there are partial matches. + # If +false+, the request returns a 404 status code when there are no matches or only partial matches. Server default: true. + # @option arguments [Integer] :from Skips the specified number of transforms. Server default: 0. + # @option arguments [String, Array] :h Comma-separated list of column names to display. Server default: changes_last_detection_time,checkpoint,checkpoint_progress,documents_processed,id,last_search_time,state. + # @option arguments [String, Array] :s Comma-separated list of column names or column aliases used to sort the response. + # @option arguments [String] :time The unit used to display time values. + # @option arguments [Integer] :size The maximum number of transforms to obtain. Server default: 100. + # @option arguments [String] :format Specifies the format to return the columnar data in, can be set to + # +text+, +json+, +cbor+, +yaml+, or +smile+. Server default: text. + # @option arguments [Boolean] :help When set to +true+ will output available columns. This option + # can't be combined with any other query string option. + # @option arguments [Boolean] :v When set to +true+ will enable verbose output. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cat-transforms.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-transforms # def transforms(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cat.transforms' } @@ -55,7 +64,7 @@ def transforms(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _transform_id - "_cat/transforms/#{Utils.__listify(_transform_id)}" + "_cat/transforms/#{Utils.listify(_transform_id)}" else '_cat/transforms' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/clear_scroll.rb b/elasticsearch-api/lib/elasticsearch/api/actions/clear_scroll.rb index 793bff1ea..2ada3e053 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/clear_scroll.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/clear_scroll.rb @@ -15,33 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Explicitly clears the search context for a scroll. + # Clear a scrolling search. + # Clear the search context and results for a scrolling search. # - # @option arguments [List] :scroll_id A comma-separated list of scroll IDs to clear *Deprecated* + # @option arguments [String, Array] :scroll_id A comma-separated list of scroll IDs to clear. + # To clear all scroll IDs, use +_all+. + # IMPORTANT: Scroll IDs can be long. It is recommended to specify scroll IDs in the request body parameter. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body A comma-separated list of scroll IDs to clear if none was specified via the scroll_id parameter + # @option arguments [Hash] :body request body # # *Deprecation notice*: # A scroll id can be quite large and should be specified as part of the body # Deprecated since version 7.0.0 # # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-scroll-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-clear-scroll # def clear_scroll(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'clear_scroll' } - defined_params = [:scroll_id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -50,15 +48,11 @@ def clear_scroll(arguments = {}) _scroll_id = arguments.delete(:scroll_id) method = Elasticsearch::API::HTTP_DELETE - path = if _scroll_id - "_search/scroll/#{Utils.__listify(_scroll_id)}" - else - '_search/scroll' - end + path = '_search/scroll' params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/close_point_in_time.rb b/elasticsearch-api/lib/elasticsearch/api/actions/close_point_in_time.rb index 05b7b5935..48387cd78 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/close_point_in_time.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/close_point_in_time.rb @@ -15,18 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Close a point in time + # Close a point in time. + # A point in time must be opened explicitly before being used in search requests. + # The +keep_alive+ parameter tells Elasticsearch how long it should persist. + # A point in time is automatically closed when the +keep_alive+ period has elapsed. + # However, keeping points in time has a cost; close them as soon as they are no longer required for search requests. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body a point-in-time id to close + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time # def close_point_in_time(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'close_point_in_time' } @@ -34,7 +38,7 @@ def close_point_in_time(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_DELETE path = '_pit' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/allocation_explain.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/allocation_explain.rb index 08abe8949..6913912d8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/allocation_explain.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/allocation_explain.rb @@ -15,22 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Provides explanations for shard allocations in the cluster. + # Explain the shard allocations. + # Get explanations for shard allocations in the cluster. + # For unassigned shards, it provides an explanation for why the shard is unassigned. + # For assigned shards, it provides an explanation for why the shard is remaining on its current node and has not moved or rebalanced to another node. + # This API can be very useful when attempting to diagnose why a shard is unassigned or why a shard continues to remain on its current node when you might expect otherwise. # - # @option arguments [Time] :master_timeout Timeout for connection to master node - # @option arguments [Boolean] :include_yes_decisions Return 'YES' decisions in explanation (default: false) - # @option arguments [Boolean] :include_disk_info Return information about disk usage and shard sizes (default: false) + # @option arguments [Boolean] :include_disk_info If true, returns information about disk usage and shard sizes. + # @option arguments [Boolean] :include_yes_decisions If true, returns YES decisions in explanation. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The index, shard, and primary flag to explain. Empty means 'explain a randomly-chosen unassigned shard' + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-allocation-explain.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-allocation-explain # def allocation_explain(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.allocation_explain' } @@ -38,7 +42,7 @@ def allocation_explain(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = if body Elasticsearch::API::HTTP_POST @@ -46,7 +50,7 @@ def allocation_explain(arguments = {}) Elasticsearch::API::HTTP_GET end - path = '_cluster/allocation/explain' + path = '_cluster/allocation/explain' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/delete_component_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/delete_component_template.rb index a0a62dd66..7491f54b7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/delete_component_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/delete_component_template.rb @@ -15,21 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Deletes a component template + # Delete component templates. + # Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. # - # @option arguments [String] :name The name of the template - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String, Array] :name Comma-separated list or wildcard expression of component template names used to limit the request. (*Required*) + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-component-template.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template # def delete_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.delete_component_template' } @@ -49,7 +52,7 @@ def delete_component_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_component_template/#{Utils.__listify(_name)}" + path = "_component_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb index 4609b743d..a3084653c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/delete_voting_config_exclusions.rb @@ -15,20 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Clears cluster voting config exclusions. + # Clear cluster voting config exclusions. + # Remove master-eligible nodes from the voting configuration exclusion list. # - # @option arguments [Boolean] :wait_for_removal Specifies whether to wait for all excluded nodes to be removed from the cluster before clearing the voting configuration exclusions list. - # @option arguments [Time] :master_timeout Timeout for submitting request to master + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [Boolean] :wait_for_removal Specifies whether to wait for all excluded nodes to be removed from the + # cluster before clearing the voting configuration exclusions list. + # Defaults to true, meaning that all excluded nodes must be removed from + # the cluster before this API takes any action. If set to false then the + # voting configuration exclusions list is cleared even if some excluded + # nodes are still in the cluster. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/voting-config-exclusions.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-post-voting-config-exclusions # def delete_voting_config_exclusions(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.delete_voting_config_exclusions' } @@ -36,7 +42,7 @@ def delete_voting_config_exclusions(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_DELETE path = '_cluster/voting_config_exclusions' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/exists_component_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/exists_component_template.rb index 505979897..30006edb1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/exists_component_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/exists_component_template.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Returns information about whether a particular component template exist + # Check component templates. + # Returns information about whether a particular component template exists. # - # @option arguments [String] :name The name of the template - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated* + # @option arguments [String, Array] :name Comma-separated list of component template names used to limit the request. + # Wildcard (*) expressions are supported. (*Required*) + # @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 [Boolean] :local If true, the request retrieves information from the local node only. + # Defaults to false, which means information is retrieved from the master node. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-component-template.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template # def exists_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.exists_component_template' } @@ -49,7 +54,7 @@ def exists_component_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_HEAD - path = "_component_template/#{Utils.__listify(_name)}" + path = "_component_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_component_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_component_template.rb index d4570f23a..a75610fca 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_component_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_component_template.rb @@ -15,22 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Returns one or more component templates + # Get component templates. + # Get information about component templates. # - # @option arguments [List] :name The comma separated names of the component templates - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated* + # @option arguments [String] :name Comma-separated list of component template names used to limit the request. + # Wildcard (+*+) expressions are supported. + # @option arguments [Boolean] :flat_settings If +true+, returns settings in flat format. # @option arguments [Boolean] :include_defaults Return all default configurations for the component template (default: false) + # @option arguments [Boolean] :local If +true+, the request retrieves information from the local node only. + # If +false+, information is retrieved from the master node. + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-component-template.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template # def get_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.get_component_template' } @@ -49,7 +54,7 @@ def get_component_template(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_component_template/#{Utils.__listify(_name)}" + "_component_template/#{Utils.listify(_name)}" else '_component_template' end 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 12beaf9ac..703061922 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/get_settings.rb @@ -15,22 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Returns cluster settings. + # Get cluster-wide settings. + # By default, it returns only settings that have been explicitly defined. # - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Boolean] :include_defaults Whether to return all default clusters setting. + # @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 [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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-get-settings.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-get-settings # def get_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.get_settings' } @@ -38,7 +41,7 @@ def get_settings(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cluster/settings' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/health.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/health.rb index 3a585036b..3774f7f96 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/health.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/health.rb @@ -15,30 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Returns basic information about the health of the cluster. + # Get the cluster health status. + # You can also use the API to get the health status of only specified data streams and indices. + # For data streams, the API retrieves the health status of the stream’s backing indices. + # The cluster health status is: green, yellow or red. + # On the shard level, a red status indicates that the specific shard is not allocated in the cluster. Yellow means that the primary shard is allocated but replicas are not. Green means that all shards are allocated. + # The index level status is controlled by the worst shard status. + # One of the main benefits of the API is the ability to wait until the cluster reaches a certain high watermark health level. + # The cluster status is controlled by the worst index status. # - # @option arguments [List] :index Limit the information returned to a specific index - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [String] :level Specify the level of detail for returned information (options: cluster, indices, shards) - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [String] :wait_for_active_shards Wait until the specified number of shards is active - # @option arguments [String] :wait_for_nodes Wait until the specified number of nodes is available - # @option arguments [String] :wait_for_events Wait until all currently queued events with the given priority are processed (options: immediate, urgent, high, normal, low, languid) - # @option arguments [Boolean] :wait_for_no_relocating_shards Whether to wait until there are no relocating shards in the cluster - # @option arguments [Boolean] :wait_for_no_initializing_shards Whether to wait until there are no initializing shards in the cluster - # @option arguments [String] :wait_for_status Wait until cluster is in a specific state (options: green, yellow, red) + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and index aliases used to limit the request. Wildcard expressions (+*+) are supported. To target all data streams and indices in a cluster, omit this parameter or use _all or +*+. + # @option arguments [String, Array] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. + # @option arguments [String] :level Can be one of cluster, indices or shards. Controls the details level of the health information returned. Server default: cluster. + # @option arguments [Boolean] :local If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Integer, String] :wait_for_active_shards A number controlling to how many active shards to wait for, all to wait for all shards in the cluster to be active, or 0 to not wait. Server default: 0. + # @option arguments [String] :wait_for_events Can be one of immediate, urgent, high, normal, low, languid. Wait until all currently queued events with the given priority are processed. + # @option arguments [String, Integer] :wait_for_nodes The request waits until the specified number N of nodes is available. It also accepts >=N, <=N, >N and yellow > red. By default, will not wait for any status. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-health.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-health # def health(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.health' } @@ -51,13 +58,13 @@ def health(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "_cluster/health/#{Utils.__listify(_index)}" + "_cluster/health/#{Utils.listify(_index)}" else '_cluster/health' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/info.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/info.rb index 83b2e81d8..a417c361a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/info.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/info.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Returns different information about the cluster. + # Get cluster info. + # Returns basic information about the cluster. # - # @option arguments [List] :target Limit the information returned to the specified target. (options: _all, http, ingest, thread_pool, script) + # @option arguments [String, Array] :target Limits the information returned to the specific target. Supports a comma-separated list, such as http,ingest. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-info.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-info # def info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.info' } @@ -47,7 +48,7 @@ def info(arguments = {}) _target = arguments.delete(:target) method = Elasticsearch::API::HTTP_GET - path = "_info/#{Utils.__listify(_target)}" + path = "_info/#{Utils.listify(_target)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/pending_tasks.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/pending_tasks.rb index 783626ef7..294a609f3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/pending_tasks.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/pending_tasks.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Returns a list of any cluster-level changes (e.g. create index, update mapping, - # allocate or fail shard) which have not yet been executed. + # Get the pending cluster tasks. + # Get information about cluster-level changes (such as create index, update mapping, allocate or fail shard) that have not yet taken effect. + # NOTE: This API returns a list of any pending updates to the cluster state. + # These are distinct from the tasks reported by the task management API which include periodic tasks and tasks initiated by the user, such as node stats, search queries, or create index requests. + # However, if a user-initiated task such as a create index command causes a cluster state update, the activity of this task might be reported by both task api and pending cluster tasks API. # - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [Boolean] :local If +true+, the request retrieves information from the local node only. + # If +false+, information is retrieved from the master node. + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-pending.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-pending-tasks # def pending_tasks(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.pending_tasks' } @@ -37,7 +42,7 @@ def pending_tasks(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_cluster/pending_tasks' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb index dd9edf0cb..686131220 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/post_voting_config_exclusions.rb @@ -15,22 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Updates the cluster voting config exclusions by node ids or node names. + # Update voting configuration exclusions. + # Update the cluster voting config exclusions by node IDs or node names. + # By default, if there are more than three master-eligible nodes in the cluster and you remove fewer than half of the master-eligible nodes in the cluster at once, the voting configuration automatically shrinks. + # If you want to shrink the voting configuration to contain fewer than three nodes or to remove half or more of the master-eligible nodes in the cluster at once, use this API to remove departing nodes from the voting configuration manually. + # The API adds an entry for each specified node to the cluster’s voting configuration exclusions list. + # It then waits until the cluster has reconfigured its voting configuration to exclude the specified nodes. + # Clusters should have no voting configuration exclusions in normal operation. + # Once the excluded nodes have stopped, clear the voting configuration exclusions with +DELETE /_cluster/voting_config_exclusions+. + # This API waits for the nodes to be fully removed from the cluster before it returns. + # If your cluster has voting configuration exclusions for nodes that you no longer intend to remove, use +DELETE /_cluster/voting_config_exclusions?wait_for_removal=false+ to clear the voting configuration exclusions without waiting for the nodes to leave the cluster. + # A response to +POST /_cluster/voting_config_exclusions+ with an HTTP status code of 200 OK guarantees that the node has been removed from the voting configuration and will not be reinstated until the voting configuration exclusions are cleared by calling +DELETE /_cluster/voting_config_exclusions+. + # If the call to +POST /_cluster/voting_config_exclusions+ fails or returns a response with an HTTP status code other than 200 OK then the node may not have been removed from the voting configuration. + # In that case, you may safely retry the call. + # NOTE: Voting exclusions are required only when you remove at least half of the master-eligible nodes from a cluster in a short time period. + # They are not required when removing master-ineligible nodes or when removing fewer than half of the master-eligible nodes. # - # @option arguments [String] :node_ids A comma-separated list of the persistent ids of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_names. - # @option arguments [String] :node_names A comma-separated list of the names of the nodes to exclude from the voting configuration. If specified, you may not also specify ?node_ids. - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Timeout for submitting request to master + # @option arguments [String, Array] :node_names A comma-separated list of the names of the nodes to exclude from the + # voting configuration. If specified, you may not also specify node_ids. + # @option arguments [String, Array] :node_ids A comma-separated list of the persistent ids of the nodes to exclude + # from the voting configuration. If specified, you may not also specify node_names. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [Time] :timeout When adding a voting configuration exclusion, the API waits for the + # specified nodes to be excluded from the voting configuration before + # returning. If the timeout expires before the appropriate condition + # is satisfied, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/voting-config-exclusions.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-post-voting-config-exclusions # def post_voting_config_exclusions(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.post_voting_config_exclusions' } @@ -38,7 +57,7 @@ def post_voting_config_exclusions(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_cluster/voting_config_exclusions' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/put_component_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/put_component_template.rb index e6cf35203..f309773b1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/put_component_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/put_component_template.rb @@ -15,23 +15,40 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Creates or updates a component template + # Create or update a component template. + # Component templates are building blocks for constructing index templates that specify index mappings, settings, and aliases. + # An index template can be composed of multiple component templates. + # To use a component template, specify it in an index template’s +composed_of+ list. + # Component templates are only applied to new data streams and indices as part of a matching index template. + # Settings and mappings specified directly in the index template or the create index request override any settings or mappings specified in a component template. + # Component templates are only used during index creation. + # For data streams, this includes data stream creation and the creation of a stream’s backing indices. + # Changes to component templates do not affect existing indices, including a stream’s backing indices. + # You can use C-style +/* *\/+ block comments in component templates. + # You can include comments anywhere in the request body except before the opening curly bracket. + # **Applying component templates** + # You cannot directly apply a component template to a data stream or index. + # To be applied, a component template must be included in an index template's +composed_of+ list. # - # @option arguments [String] :name The name of the template - # @option arguments [Boolean] :create Whether the index template should only be added if new or can also replace an existing one - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :name Name of the component template to create. + # Elasticsearch includes the following built-in component templates: +logs-mappings+; +logs-settings+; +metrics-mappings+; +metrics-settings+;+synthetics-mapping+; +synthetics-settings+. + # Elastic Agent uses these templates to configure backing indices for its data streams. + # If you use Elastic Agent and want to overwrite one of these templates, set the +version+ for your replacement template higher than the current version. + # If you don’t use Elastic Agent and want to disable all built-in component and index templates, set +stack.templates.enabled+ to +false+ using the cluster update settings API. (*Required*) + # @option arguments [Boolean] :create If +true+, this request cannot replace or update existing component templates. + # @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 [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The template definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-component-template.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template # def put_component_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.put_component_template' } @@ -52,7 +69,7 @@ def put_component_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_component_template/#{Utils.__listify(_name)}" + path = "_component_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/put_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/put_settings.rb index 22854aaf9..2c3a74552 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/put_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/put_settings.rb @@ -15,22 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Updates the cluster settings. + # Update the cluster settings. + # Configure and update dynamic settings on a running cluster. + # You can also configure dynamic settings locally on an unstarted or shut down node in +elasticsearch.yml+. + # Updates made with this API can be persistent, which apply across cluster restarts, or transient, which reset after a cluster restart. + # You can also reset transient or persistent settings by assigning them a null value. + # If you configure the same setting using multiple methods, Elasticsearch applies the settings in following order of precedence: 1) Transient setting; 2) Persistent setting; 3) +elasticsearch.yml+ setting; 4) Default setting value. + # For example, you can apply a transient setting to override a persistent setting or +elasticsearch.yml+ setting. + # However, a change to an +elasticsearch.yml+ setting will not override a defined transient or persistent setting. + # TIP: In Elastic Cloud, use the user settings feature to configure all cluster settings. This method automatically rejects unsafe settings that could break your cluster. + # If you run Elasticsearch on your own hardware, use this API to configure dynamic cluster settings. + # Only use +elasticsearch.yml+ for static cluster settings and node settings. + # The API doesn’t require a restart and ensures a setting’s value is the same on all nodes. + # WARNING: Transient cluster settings are no longer recommended. Use persistent cluster settings instead. + # If a cluster becomes unstable, transient settings can clear unexpectedly, resulting in a potentially undesired cluster configuration. # # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node Server default: 30s. + # @option arguments [Time] :timeout Explicit operation timeout Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The settings to be updated. Can be either `transient` or `persistent` (survives cluster restart). (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-settings # def put_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.put_settings' } @@ -40,7 +53,7 @@ def put_settings(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) || {} + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_PUT path = '_cluster/settings' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/remote_info.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/remote_info.rb index 63d1f824f..209c445fb 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/remote_info.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/remote_info.rb @@ -15,18 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Returns the information about configured remote clusters. + # Get remote cluster information. + # Get information about configured remote clusters. + # The API returns connection and endpoint information keyed by the configured remote cluster alias. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-remote-info.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-remote-info # def remote_info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.remote_info' } @@ -34,7 +36,7 @@ def remote_info(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_remote/info' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/reroute.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/reroute.rb index 450384932..51bdfba32 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/reroute.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/reroute.rb @@ -15,25 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Allows to manually change the allocation of individual shards in the cluster. + # Reroute the cluster. + # Manually change the allocation of individual shards in the cluster. + # For example, a shard can be moved from one node to another explicitly, an allocation can be canceled, and an unassigned shard can be explicitly allocated to a specific node. + # It is important to note that after processing any reroute commands Elasticsearch will perform rebalancing as normal (respecting the values of settings such as +cluster.routing.rebalance.enable+) in order to remain in a balanced state. + # For example, if the requested allocation includes moving a shard from node1 to node2 then this may cause a shard to be moved from node2 back to node1 to even things out. + # The cluster can be set to disable allocations using the +cluster.routing.allocation.enable+ setting. + # If allocations are disabled then the only allocations that will be performed are explicit ones given using the reroute command, and consequent allocations due to rebalancing. + # The cluster will attempt to allocate a shard a maximum of +index.allocation.max_retries+ times in a row (defaults to +5+), before giving up and leaving the shard unallocated. + # This scenario can be caused by structural problems such as having an analyzer which refers to a stopwords file which doesn’t exist on all nodes. + # Once the problem has been corrected, allocation can be manually retried by calling the reroute API with the +?retry_failed+ URI query parameter, which will attempt a single retry round for these shards. # - # @option arguments [Boolean] :dry_run Simulate the operation only and return the resulting state - # @option arguments [Boolean] :explain Return an explanation of why the commands can or cannot be executed - # @option arguments [Boolean] :retry_failed Retries allocation of shards that are blocked due to too many subsequent allocation failures - # @option arguments [List] :metric Limit the information returned to the specified metrics. Defaults to all but metadata (options: _all, blocks, metadata, nodes, none, routing_table, master_node, version) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [Boolean] :dry_run If true, then the request simulates the operation. + # It will calculate the result of applying the commands to the current cluster state and return the resulting cluster state after the commands (and rebalancing) have been applied; it will not actually perform the requested changes. + # @option arguments [Boolean] :explain If true, then the response contains an explanation of why the commands can or cannot run. + # @option arguments [String, Array] :metric Limits the information returned to the specified metrics. Server default: all. + # @option arguments [Boolean] :retry_failed If true, then retries allocation of shards that are blocked due to too many subsequent allocation failures. + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The definition of `commands` to perform (`move`, `cancel`, `allocate`) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-reroute.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-reroute # def reroute(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.reroute' } @@ -41,7 +51,7 @@ def reroute(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) || {} + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_cluster/reroute' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/state.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/state.rb index 24d7eb487..3a08d92ea 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/state.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/state.rb @@ -15,33 +15,46 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Returns a comprehensive information about the state of the cluster. + # Get the cluster state. + # Get comprehensive information about the state of the cluster. + # The cluster state is an internal data structure which keeps track of a variety of information needed by every node, including the identity and attributes of the other nodes in the cluster; cluster-wide settings; index metadata, including the mapping and settings for each index; the location and status of every shard copy in the cluster. + # The elected master node ensures that every node in the cluster has a copy of the same cluster state. + # This API lets you retrieve a representation of this internal state for debugging or diagnostic purposes. + # You may need to consult the Elasticsearch source code to determine the precise meaning of the response. + # By default the API will route requests to the elected master node since this node is the authoritative source of cluster states. + # You can also retrieve the cluster state held on the node handling the API request by adding the +?local=true+ query parameter. + # Elasticsearch may need to expend significant effort to compute a response to this API in larger clusters, and the response may comprise a very large quantity of data. + # If you use this API repeatedly, your cluster may become unstable. + # WARNING: The response is a representation of an internal data structure. + # Its format is not subject to the same compatibility guarantees as other more stable APIs and may change from version to version. + # Do not query this API using external monitoring tools. + # Instead, obtain the information you require using other more stable cluster APIs. # - # @option arguments [List] :metric Limit the information returned to the specified metrics (options: _all, blocks, metadata, nodes, routing_table, routing_nodes, master_node, version) - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String, Array] :metric Limit the information returned to the specified metrics + # @option arguments [String, Array] :index A comma-separated list of index names; use +_all+ or empty string to perform the operation on all indices + # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes +_all+ string or when no indices have been specified) Server default: true. + # @option arguments [String, Array] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Number] :wait_for_metadata_version Wait for the metadata version to be equal or greater than the specified metadata version - # @option arguments [Time] :wait_for_timeout The maximum time to wait for wait_for_metadata_version before timing out # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) + # @option arguments [Time] :master_timeout Specify timeout for connection to master Server default: 30s. + # @option arguments [Integer] :wait_for_metadata_version Wait for the metadata version to be equal or greater than the specified metadata version + # @option arguments [Time] :wait_for_timeout The maximum time to wait for wait_for_metadata_version before timing out # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-state.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-state # def state(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.state' } - defined_params = %i[metric index].each_with_object({}) do |variable, set_variables| + defined_params = [:metric, :index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -57,9 +70,9 @@ def state(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _metric && _index - "_cluster/state/#{Utils.__listify(_metric)}/#{Utils.__listify(_index)}" + "_cluster/state/#{Utils.listify(_metric)}/#{Utils.listify(_index)}" elsif _metric - "_cluster/state/#{Utils.__listify(_metric)}" + "_cluster/state/#{Utils.listify(_metric)}" else '_cluster/state' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/stats.rb index a960c912f..894835ee4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cluster/stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cluster/stats.rb @@ -15,21 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Cluster module Actions - # Returns high-level overview of cluster statistics. + # Get cluster statistics. + # Get basic index metrics (shard numbers, store size, memory usage) and information about the current nodes that form the cluster (number, roles, os, jvm versions, memory usage, cpu and installed plugins). # - # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - # @option arguments [Boolean] :include_remotes Include remote cluster data into the response (default: false) - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :node_id Comma-separated list of node filters used to limit returned information. Defaults to all nodes in the cluster. + # @option arguments [Boolean] :include_remotes Include remote cluster data into the response + # @option arguments [Time] :timeout Period to wait for each node to respond. + # If a node does not respond before its timeout expires, the response does not include its stats. + # However, timed out nodes are included in the response’s +_nodes.failed+ property. Defaults to no timeout. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-stats # def stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'cluster.stats' } @@ -48,7 +51,7 @@ def stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _node_id - "_cluster/stats/nodes/#{Utils.__listify(_node_id)}" + "_cluster/stats/nodes/#{Utils.listify(_node_id)}" else '_cluster/stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/check_in.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/check_in.rb index e2c46f6ff..11ad54411 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/check_in.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/check_in.rb @@ -15,23 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the last_seen timestamp in the connector document. + # Check in a connector. + # Update the +last_seen+ field in the connector and set it to the current timestamp. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be checked in (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/check-in-connector-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-check-in # def check_in(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.check_in' } @@ -51,7 +52,7 @@ def check_in(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_check_in" + path = "_connector/#{Utils.listify(_connector_id)}/_check_in" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/delete.rb index a10c9e305..dd0ea85c7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/delete.rb @@ -15,25 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Deletes a connector. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Delete a connector. + # Removes a connector and associated sync jobs. + # This is a destructive action that is not recoverable. + # NOTE: This action doesn’t delete any API keys, ingest pipelines, or data indices associated with the connector. + # These need to be removed manually. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be deleted. - # @option arguments [Boolean] :hard If true, the connector doc is deleted. If false, connector doc is marked as deleted (soft-deleted). - # @option arguments [Boolean] :delete_sync_jobs Determines whether associated sync jobs are also deleted. + # @option arguments [String] :connector_id The unique identifier of the connector to be deleted (*Required*) + # @option arguments [Boolean] :delete_sync_jobs A flag indicating if associated sync jobs should be also removed. Defaults to false. + # @option arguments [Boolean] :hard A flag indicating if the connector should be hard deleted. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-connector-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-delete # def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.delete' } @@ -53,7 +57,7 @@ def delete(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_DELETE - path = "_connector/#{Utils.__listify(_connector_id)}" + path = "_connector/#{Utils.listify(_connector_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/get.rb index 23b710938..ec737228e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/get.rb @@ -15,24 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Returns the details about a connector. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Get a connector. + # Get the details about a connector. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be returned. - # @option arguments [Boolean] :include_deleted A flag indicating whether to return connectors that have been soft-deleted. + # @option arguments [String] :connector_id The unique identifier of the connector (*Required*) + # @option arguments [Boolean] :include_deleted A flag to indicate if the desired connector should be fetched, even if it was soft-deleted. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-connector-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-get # def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.get' } @@ -52,7 +53,7 @@ def get(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_GET - path = "_connector/#{Utils.__listify(_connector_id)}" + path = "_connector/#{Utils.listify(_connector_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/list.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/list.rb index e79a2ca64..88ba43c7a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/list.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/list.rb @@ -15,29 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Lists all connectors. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Get all connectors. + # Get information about all connectors. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # # @option arguments [Integer] :from Starting offset (default: 0) - # @option arguments [Integer] :size Specifies a max number of results to get (default: 100) - # @option arguments [List] :index_name A comma-separated list of connector index names to fetch connector documents for - # @option arguments [List] :connector_name A comma-separated list of connector names to fetch connector documents for - # @option arguments [List] :service_type A comma-separated list of connector service types to fetch connector documents for - # @option arguments [String] :query A search string for querying connectors, filtering results by matching against connector names, descriptions, and index names - # @option arguments [Boolean] :include_deleted A flag indicating whether to return connectors that have been soft-deleted. + # @option arguments [Integer] :size Specifies a max number of results to get + # @option arguments [String, Array] :index_name A comma-separated list of connector index names to fetch connector documents for + # @option arguments [String, Array] :connector_name A comma-separated list of connector names to fetch connector documents for + # @option arguments [String, Array] :service_type A comma-separated list of connector service types to fetch connector documents for + # @option arguments [Boolean] :include_deleted A flag to indicate if the desired connector should be fetched, even if it was soft-deleted. + # @option arguments [String] :query A wildcard query string that filters connectors with matching name, description or index name # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/list-connector-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-list # def list(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.list' } @@ -45,7 +46,7 @@ def list(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_connector' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/post.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/post.rb index 6e2c05554..391855f16 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/post.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/post.rb @@ -15,23 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Creates a connector. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Create a connector. + # Connectors are Elasticsearch integrations that bring content from third-party data sources, which can be deployed on Elastic Cloud or hosted on your own infrastructure. + # Elastic managed connectors (Native connectors) are a managed service on Elastic Cloud. + # Self-managed connectors (Connector clients) are self-managed on your infrastructure. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The connector configuration. + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-put # def post(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.post' } @@ -39,7 +42,7 @@ def post(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_connector' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/put.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/put.rb index 038f37ab3..56d5d20de 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/put.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/put.rb @@ -15,24 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Creates or updates a connector. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Create or update a connector. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be created or updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be created or updated. ID is auto-generated if not provided. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The connector configuration. + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-put # def put(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.put' } @@ -51,7 +51,7 @@ def put(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = if _connector_id - "_connector/#{Utils.__listify(_connector_id)}" + "_connector/#{Utils.listify(_connector_id)}" else '_connector' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_cancel.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_cancel.rb index 3a6bcebf4..2fd2d7899 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_cancel.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_cancel.rb @@ -15,23 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Cancels a connector sync job. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Cancel a connector sync job. + # Cancel a connector sync job, which sets the status to cancelling and updates +cancellation_requested_at+ to the current time. + # The connector service is then responsible for setting the status of connector sync jobs to cancelled. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to be canceled + # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cancel-connector-sync-job-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-cancel # def sync_job_cancel(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_cancel' } @@ -54,7 +56,7 @@ def sync_job_cancel(arguments = {}) _connector_sync_job_id = arguments.delete(:connector_sync_job_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/_sync_job/#{Utils.__listify(_connector_sync_job_id)}/_cancel" + path = "_connector/_sync_job/#{Utils.listify(_connector_sync_job_id)}/_cancel" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_check_in.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_check_in.rb index 90e935c52..c72c406f3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_check_in.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_check_in.rb @@ -15,23 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Checks in a connector sync job (refreshes 'last_seen'). + # Check in a connector sync job. + # Check in a connector sync job and set the +last_seen+ field to the current time before updating it in the internal index. + # To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. + # This service runs automatically on Elastic Cloud for Elastic managed connectors. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to be checked in + # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to be checked in. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/check-in-connector-sync-job-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-check-in # def sync_job_check_in(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_check_in' } @@ -54,7 +57,7 @@ def sync_job_check_in(arguments = {}) _connector_sync_job_id = arguments.delete(:connector_sync_job_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/_sync_job/#{Utils.__listify(_connector_sync_job_id)}/_check_in" + path = "_connector/_sync_job/#{Utils.listify(_connector_sync_job_id)}/_check_in" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_claim.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_claim.rb index f524141fc..7faa95495 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_claim.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_claim.rb @@ -15,24 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Claims a connector sync job. + # Claim a connector sync job. + # This action updates the job status to +in_progress+ and sets the +last_seen+ and +started_at+ timestamps to the current time. + # Additionally, it can set the +sync_cursor+ property for the sync job. + # This API is not intended for direct connector management by users. + # It supports the implementation of services that utilize the connector protocol to communicate with Elasticsearch. + # To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. + # This service runs automatically on Elastic Cloud for Elastic managed connectors. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to be claimed. + # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Data to claim a sync job. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/claim-connector-sync-job-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-claim # def sync_job_claim(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_claim' } @@ -57,7 +63,7 @@ def sync_job_claim(arguments = {}) _connector_sync_job_id = arguments.delete(:connector_sync_job_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/_sync_job/#{Utils.__listify(_connector_sync_job_id)}/_claim" + path = "_connector/_sync_job/#{Utils.listify(_connector_sync_job_id)}/_claim" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_delete.rb index 3a7ed141c..84f9aa281 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_delete.rb @@ -15,23 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Deletes a connector sync job. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Delete a connector sync job. + # Remove a connector sync job and its associated data. + # This is a destructive action that is not recoverable. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to be deleted. + # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to be deleted (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-connector-sync-job-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-delete # def sync_job_delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_delete' } @@ -54,7 +56,7 @@ def sync_job_delete(arguments = {}) _connector_sync_job_id = arguments.delete(:connector_sync_job_id) method = Elasticsearch::API::HTTP_DELETE - path = "_connector/_sync_job/#{Utils.__listify(_connector_sync_job_id)}" + path = "_connector/_sync_job/#{Utils.listify(_connector_sync_job_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_error.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_error.rb index 73ed91cbd..ecf751139 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_error.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_error.rb @@ -15,24 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Sets an error for a connector sync job. + # Set a connector sync job error. + # Set the +error+ field for a connector sync job and set its +status+ to +error+. + # To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. + # This service runs automatically on Elastic Cloud for Elastic managed connectors. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to set an error for. + # @option arguments [String] :connector_sync_job_id The unique identifier for the connector sync job. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The error to set in the connector sync job. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/set-connector-sync-job-error-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-error # def sync_job_error(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_error' } @@ -57,7 +60,7 @@ def sync_job_error(arguments = {}) _connector_sync_job_id = arguments.delete(:connector_sync_job_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/_sync_job/#{Utils.__listify(_connector_sync_job_id)}/_error" + path = "_connector/_sync_job/#{Utils.listify(_connector_sync_job_id)}/_error" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_get.rb index 22e755477..43028fd07 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_get.rb @@ -15,23 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Returns the details about a connector sync job. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Get a connector sync job. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to be returned. + # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-connector-sync-job-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-get # def sync_job_get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_get' } @@ -54,7 +54,7 @@ def sync_job_get(arguments = {}) _connector_sync_job_id = arguments.delete(:connector_sync_job_id) method = Elasticsearch::API::HTTP_GET - path = "_connector/_sync_job/#{Utils.__listify(_connector_sync_job_id)}" + path = "_connector/_sync_job/#{Utils.listify(_connector_sync_job_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_list.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_list.rb index 222314a51..507d509fc 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_list.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_list.rb @@ -15,27 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Lists all connector sync jobs. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Get all connector sync jobs. + # Get information about all stored connector sync jobs listed by their creation date in ascending order. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # # @option arguments [Integer] :from Starting offset (default: 0) - # @option arguments [Integer] :size specifies a max number of results to get (default: 100) - # @option arguments [String] :status Sync job status, which sync jobs are fetched for - # @option arguments [String] :connector_id Id of the connector to fetch the sync jobs for - # @option arguments [List] :job_type A comma-separated list of job types + # @option arguments [Integer] :size Specifies a max number of results to get + # @option arguments [String] :status A sync job status to fetch connector sync jobs for + # @option arguments [String] :connector_id A connector id to fetch connector sync jobs for + # @option arguments [Syncjobtype] :job_type A comma-separated list of job types to fetch the sync jobs for # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/list-connector-sync-jobs-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-list # def sync_job_list(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_list' } @@ -43,7 +44,7 @@ def sync_job_list(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_connector/_sync_job' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_post.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_post.rb index a455a8028..117c50cc1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_post.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_post.rb @@ -15,23 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Creates a connector sync job. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Create a connector sync job. + # Create a connector sync job document in the internal index and initialize its counters and timestamps with default values. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The connector sync job data. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/create-connector-sync-job-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-post # def sync_job_post(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_post' } @@ -41,7 +42,7 @@ def sync_job_post(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_connector/_sync_job' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_update_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_update_stats.rb index 772a28cf3..ff1f9f8fe 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_update_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/sync_job_update_stats.rb @@ -15,24 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the stats fields in the connector sync job document. + # Set the connector sync job stats. + # Stats include: +deleted_document_count+, +indexed_document_count+, +indexed_document_volume+, and +total_document_count+. + # You can also update +last_seen+. + # This API is mainly used by the connector service for updating sync job information. + # To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. + # This service runs automatically on Elastic Cloud for Elastic managed connectors. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job to be updated. + # @option arguments [String] :connector_sync_job_id The unique identifier of the connector sync job. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The stats to update for the connector sync job. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/set-connector-sync-job-stats-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-sync-job-update-stats # def sync_job_update_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.sync_job_update_stats' } @@ -57,7 +62,7 @@ def sync_job_update_stats(arguments = {}) _connector_sync_job_id = arguments.delete(:connector_sync_job_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/_sync_job/#{Utils.__listify(_connector_sync_job_id)}/_stats" + path = "_connector/_sync_job/#{Utils.listify(_connector_sync_job_id)}/_stats" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_active_filtering.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_active_filtering.rb index 975c7aa3d..f81d0dbf0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_active_filtering.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_active_filtering.rb @@ -15,23 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Activates the draft filtering rules if they are in a validated state. + # Activate the connector draft filter. + # Activates the valid draft filtering for a connector. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-filtering-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering # def update_active_filtering(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_active_filtering' } @@ -51,7 +52,7 @@ def update_active_filtering(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_filtering/_activate" + path = "_connector/#{Utils.listify(_connector_id)}/_filtering/_activate" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_api_key_id.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_api_key_id.rb index a44130824..f1ba538fa 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_api_key_id.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_api_key_id.rb @@ -15,24 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the API key id and/or API key secret id fields in the connector document. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Update the connector API key ID. + # Update the +api_key_id+ and +api_key_secret_id+ fields of a connector. + # You can specify the ID of the API key used for authorization and the ID of the connector secret where the API key is stored. + # The connector secret ID is required only for Elastic managed (native) connectors. + # Self-managed connectors (connector clients) do not use this field. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the connector's API key id and/or Connector Secret document id for that API key. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-api-key-id-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-api-key-id # def update_api_key_id(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_api_key_id' } @@ -53,7 +57,7 @@ def update_api_key_id(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_api_key_id" + path = "_connector/#{Utils.listify(_connector_id)}/_api_key_id" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_configuration.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_configuration.rb index fc51bd431..8143806c0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_configuration.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_configuration.rb @@ -15,24 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the connector configuration. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Update the connector configuration. + # Update the configuration field in the connector document. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Mapping between field names to configuration. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-configuration-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-configuration # def update_configuration(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_configuration' } @@ -53,7 +54,7 @@ def update_configuration(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_configuration" + path = "_connector/#{Utils.listify(_connector_id)}/_configuration" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_error.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_error.rb index eec511fc2..7a415e165 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_error.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_error.rb @@ -15,24 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the error field in the connector document. + # Update the connector error field. + # Set the error field for the connector. + # If the error provided in the request body is non-null, the connector’s status is updated to error. + # Otherwise, if the error is reset to null, the connector status is updated to connected. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the connector's error. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-error-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-error # def update_error(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_error' } @@ -53,7 +56,7 @@ def update_error(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_error" + path = "_connector/#{Utils.listify(_connector_id)}/_error" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_features.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_features.rb index 531a7c2ad..6187ba7c1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_features.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_features.rb @@ -15,24 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the connector features in the connector document. + # Update the connector features. + # Update the connector features in the connector document. + # This API can be used to control the following aspects of a connector: + # * document-level security + # * incremental syncs + # * advanced sync rules + # * basic sync rules + # Normally, the running connector service automatically manages these features. + # However, you can use this API to override the default behavior. + # To sync data using self-managed connectors, you need to deploy the Elastic connector service on your own infrastructure. + # This service runs automatically on Elastic Cloud for Elastic managed connectors. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the connector's features definition. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-features-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-features # def update_features(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_features' } @@ -53,7 +63,7 @@ def update_features(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_features" + path = "_connector/#{Utils.listify(_connector_id)}/_features" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_filtering.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_filtering.rb index 314a30e6d..af27874e0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_filtering.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_filtering.rb @@ -15,24 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the filtering field in the connector document. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Update the connector filtering. + # Update the draft filtering configuration of a connector and marks the draft validation state as edited. + # The filtering draft is activated once validated by the running Elastic connector service. + # The filtering property is used to configure sync rules (both basic and advanced) for a connector. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body A list of connector filtering configurations. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-filtering-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-filtering # def update_filtering(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_filtering' } @@ -53,7 +56,7 @@ def update_filtering(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_filtering" + path = "_connector/#{Utils.listify(_connector_id)}/_filtering" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_filtering_validation.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_filtering_validation.rb index b42a75b4d..33dc67608 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_filtering_validation.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_filtering_validation.rb @@ -15,24 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the validation info of the draft filtering rules. + # Update the connector draft filtering validation. + # Update the draft filtering validation info for a connector. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Validation info for the draft filtering rules (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-filtering-api.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-filtering-validation-api.html # def update_filtering_validation(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_filtering_validation' } @@ -53,7 +54,7 @@ def update_filtering_validation(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_filtering/_validation" + path = "_connector/#{Utils.listify(_connector_id)}/_filtering/_validation" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_index_name.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_index_name.rb index ce76d0150..e97b28fa1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_index_name.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_index_name.rb @@ -15,24 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the index name of the connector. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Update the connector index name. + # Update the +index_name+ field of a connector, specifying the index where the data ingested by the connector is stored. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the connector's index name. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-index-name-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-index-name # def update_index_name(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_index_name' } @@ -53,7 +54,7 @@ def update_index_name(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_index_name" + path = "_connector/#{Utils.listify(_connector_id)}/_index_name" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_name.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_name.rb index ecdac5b2a..059e6b4c0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_name.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_name.rb @@ -15,24 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the name and/or description fields in the connector document. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Update the connector name and description. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the connector's name and/or description. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-name-description-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-name # def update_name(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_name' } @@ -53,7 +53,7 @@ def update_name(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_name" + path = "_connector/#{Utils.listify(_connector_id)}/_name" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_native.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_native.rb index 81779e6e3..7ec801f72 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_native.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_native.rb @@ -15,24 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the is_native flag of the connector. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Update the connector is_native flag. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the connector's is_native flag (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/connector-apis.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-native-api.html # def update_native(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_native' } @@ -53,7 +53,7 @@ def update_native(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_native" + path = "_connector/#{Utils.listify(_connector_id)}/_native" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_pipeline.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_pipeline.rb index e5f7f6ee2..87c4b25c2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_pipeline.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_pipeline.rb @@ -15,24 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the pipeline field in the connector document. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Update the connector pipeline. + # When you create a new connector, the configuration of an ingest pipeline is populated with default settings. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object with connector ingest pipeline configuration. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-pipeline-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-pipeline # def update_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_pipeline' } @@ -53,7 +54,7 @@ def update_pipeline(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_pipeline" + path = "_connector/#{Utils.listify(_connector_id)}/_pipeline" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_scheduling.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_scheduling.rb index 2c87061c2..b76fc7754 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_scheduling.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_scheduling.rb @@ -15,24 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the scheduling field in the connector document. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Update the connector scheduling. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the connector's scheduling configuration. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-scheduling-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-scheduling # def update_scheduling(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_scheduling' } @@ -53,7 +53,7 @@ def update_scheduling(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_scheduling" + path = "_connector/#{Utils.listify(_connector_id)}/_scheduling" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_service_type.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_service_type.rb index 757b43c8e..2fc43dfca 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_service_type.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_service_type.rb @@ -15,24 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the service type of the connector. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Update the connector service type. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the connector's service type. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-service-type-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-service-type # def update_service_type(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_service_type' } @@ -53,7 +53,7 @@ def update_service_type(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_service_type" + path = "_connector/#{Utils.listify(_connector_id)}/_service_type" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_status.rb index 8b1ef81f3..d2ac66676 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/connector/update_status.rb @@ -15,24 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Connector module Actions - # Updates the status of the connector. + # Update the connector status. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :connector_id The unique identifier of the connector to be updated. + # @option arguments [String] :connector_id The unique identifier of the connector to be updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the connector's status. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-connector-status-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-connector-update-status # def update_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'connector.update_status' } @@ -53,7 +53,7 @@ def update_status(arguments = {}) _connector_id = arguments.delete(:connector_id) method = Elasticsearch::API::HTTP_PUT - path = "_connector/#{Utils.__listify(_connector_id)}/_status" + path = "_connector/#{Utils.listify(_connector_id)}/_status" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/count.rb b/elasticsearch-api/lib/elasticsearch/api/actions/count.rb index 393bbb7fd..f6f975b11 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/count.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/count.rb @@ -15,33 +15,57 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns number of documents matching a query. + # Count search results. + # Get the number of documents matching a query. + # The query can be provided either by using a simple query string as a parameter, or by defining Query DSL within the request body. + # The query is optional. When no query is provided, the API uses +match_all+ to count all the documents. + # The count API supports multi-target syntax. You can run a single count API search across multiple data streams and indices. + # The operation is broadcast across all shards. + # For each shard ID group, a replica is chosen and the search is run against it. + # This means that replicas increase the scalability of the count. # - # @option arguments [List] :index A comma-separated list of indices to restrict the results - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Number] :min_score Include only documents with a specific `_score` value in the result - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [List] :routing A comma-separated list of specific routing values - # @option arguments [String] :q Query in the Lucene query string syntax - # @option arguments [String] :analyzer The analyzer to use for the query string - # @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false) - # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR) - # @option arguments [String] :df The field to use as default where no field prefix is given in the query string - # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - # @option arguments [Number] :terminate_after The maximum count for each shard, upon reaching which the query execution will terminate early + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search. + # It supports wildcards (+*+). + # To search all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true. + # @option arguments [String] :analyzer The analyzer to use for the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. + # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR. + # @option arguments [String] :df The field to use as a default when no field prefix is given in the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # It supports comma-separated values, such as +open,hidden+. Server default: open. + # @option arguments [Boolean] :ignore_throttled If +true+, concrete, expanded, or aliased indices are ignored when frozen. Server default: true. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Float] :min_score The minimum +_score+ value that documents must have to be included in the result. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # By default, it is random. + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard. + # If a query reaches this limit, Elasticsearch terminates the query early. + # Elasticsearch collects documents before sorting.IMPORTANT: Use with caution. + # Elasticsearch applies this parameter to each shard handling the request. + # When possible, let Elasticsearch perform early termination automatically. + # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + # @option arguments [String] :q The query in Lucene query string syntax. This parameter cannot be used with a request body. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body A query to restrict the results specified with the Query DSL (optional) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-count.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-count # def count(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'count' } @@ -64,11 +88,11 @@ def count(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _index - "#{Utils.__listify(_index)}/_count" - else - '_count' - end + path = if _index + "#{Utils.listify(_index)}/_count" + else + '_count' + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/create.rb b/elasticsearch-api/lib/elasticsearch/api/actions/create.rb index cc1cc723a..98c580576 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/create.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/create.rb @@ -15,35 +15,97 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Creates a new document in the index. + # Create a new document in the index. + # You can index a new JSON document with the +//_doc/+ or +//_create/<_id>+ APIs + # Using +_create+ guarantees that the document is indexed only if it does not already exist. + # It returns a 409 response when a document with a same ID already exists in the index. + # To update an existing document, you must use the +//_doc/+ API. + # If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias: + # * To add a document using the +PUT //_create/<_id>+ or +POST //_create/<_id>+ request formats, you must have the +create_doc+, +create+, +index+, or +write+ index privilege. + # * To automatically create a data stream or index with this API request, you must have the +auto_configure+, +create_index+, or +manage+ index privilege. + # Automatic data stream creation requires a matching index template with data stream enabled. + # **Automatically create data streams and indices** + # If the request's target doesn't exist and matches an index template with a +data_stream+ definition, the index operation automatically creates the data stream. + # If the target doesn't exist and doesn't match a data stream template, the operation automatically creates the index and applies any matching index templates. + # NOTE: Elasticsearch includes several built-in index templates. To avoid naming collisions with these templates, refer to index pattern documentation. + # If no mapping exists, the index operation creates a dynamic mapping. + # By default, new fields and objects are automatically added to the mapping if needed. + # Automatic index creation is controlled by the +action.auto_create_index+ setting. + # If it is +true+, any index can be created automatically. + # You can modify this setting to explicitly allow or block automatic creation of indices that match specified patterns or set it to +false+ to turn off automatic index creation entirely. + # Specify a comma-separated list of patterns you want to allow or prefix each pattern with +++ or +-+ to indicate whether it should be allowed or blocked. + # When a list is specified, the default behaviour is to disallow. + # NOTE: The +action.auto_create_index+ setting affects the automatic creation of indices only. + # It does not affect the creation of data streams. + # **Routing** + # By default, shard placement — or routing — is controlled by using a hash of the document's ID value. + # For more explicit control, the value fed into the hash function used by the router can be directly specified on a per-operation basis using the +routing+ parameter. + # When setting up explicit mapping, you can also use the +_routing+ field to direct the index operation to extract the routing value from the document itself. + # This does come at the (very minimal) cost of an additional document parsing pass. + # If the +_routing+ mapping is defined and set to be required, the index operation will fail if no routing value is provided or extracted. + # NOTE: Data streams do not support custom routing unless they were created with the +allow_custom_routing+ setting enabled in the template. + # **Distributed** + # The index operation is directed to the primary shard based on its route and performed on the actual node containing this shard. + # After the primary shard completes the operation, if needed, the update is distributed to applicable replicas. + # **Active shards** + # To improve the resiliency of writes to the system, indexing operations can be configured to wait for a certain number of active shard copies before proceeding with the operation. + # If the requisite number of active shard copies are not available, then the write operation must wait and retry, until either the requisite shard copies have started or a timeout occurs. + # By default, write operations only wait for the primary shards to be active before proceeding (that is to say +wait_for_active_shards+ is +1+). + # This default can be overridden in the index settings dynamically by setting +index.write.wait_for_active_shards+. + # To alter this behavior per operation, use the +wait_for_active_shards request+ parameter. + # Valid values are all or any positive integer up to the total number of configured copies per shard in the index (which is +number_of_replicas++1). + # Specifying a negative value or a number greater than the number of shard copies will throw an error. + # For example, suppose you have a cluster of three nodes, A, B, and C and you create an index index with the number of replicas set to 3 (resulting in 4 shard copies, one more copy than there are nodes). + # If you attempt an indexing operation, by default the operation will only ensure the primary copy of each shard is available before proceeding. + # This means that even if B and C went down and A hosted the primary shard copies, the indexing operation would still proceed with only one copy of the data. + # If +wait_for_active_shards+ is set on the request to +3+ (and all three nodes are up), the indexing operation will require 3 active shard copies before proceeding. + # This requirement should be met because there are 3 active nodes in the cluster, each one holding a copy of the shard. + # However, if you set +wait_for_active_shards+ to +all+ (or to +4+, which is the same in this situation), the indexing operation will not proceed as you do not have all 4 copies of each shard active in the index. + # The operation will timeout unless a new node is brought up in the cluster to host the fourth copy of the shard. + # It is important to note that this setting greatly reduces the chances of the write operation not writing to the requisite number of shard copies, but it does not completely eliminate the possibility, because this check occurs before the write operation starts. + # After the write operation is underway, it is still possible for replication to fail on any number of shard copies but still succeed on the primary. + # The +_shards+ section of the API response reveals the number of shard copies on which replication succeeded and failed. # - # Returns a 409 response when a document with a same ID already exists in the index. - # - # @option arguments [String] :id Document ID - # @option arguments [String] :index The name of the index - # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for) - # @option arguments [String] :routing Specific routing value - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte) - # @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with - # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Defaults to true. + # @option arguments [String] :id A unique identifier for the document. + # To automatically generate a document ID, use the +POST //_doc/+ request format. (*Required*) + # @option arguments [String] :index The name of the data stream or index to target. + # If the target doesn't exist and matches the name or wildcard (+*+) pattern of an index template with a +data_stream+ definition, this request creates the data stream. + # If the target doesn't exist and doesn’t match a data stream template, this request creates the index. (*Required*) + # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Server default: true. + # @option arguments [String] :pipeline The ID of the pipeline to use to preprocess incoming documents. + # If the index has a default ingest pipeline specified, setting the value to +_none+ turns off the default ingest pipeline for this request. + # If a final pipeline is configured, it will always run regardless of the value of this parameter. + # @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search. + # If +wait_for+, it waits for a refresh to make this operation visible to search. + # If +false+, it does nothing with refreshes. Server default: false. + # @option arguments [String] :routing A custom value that is used to route operations to a specific shard. + # @option arguments [Time] :timeout The period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards. + # Elasticsearch waits for at least the specified timeout period before failing. + # The actual wait time could be longer, particularly when multiple waits occur.This parameter is useful for situations where the primary shard assigned to perform the operation might not be available when the operation runs. + # Some reasons for this might be that the primary shard is currently recovering from a gateway or undergoing relocation. + # By default, the operation will wait on the primary shard to become available for at least 1 minute before failing and responding with an error. + # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m. + # @option arguments [Integer] :version The explicit version number for concurrency control. + # It must be a non-negative long number. + # @option arguments [String] :version_type The version type. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # You can set it to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). + # The default value of +1+ means it waits for each primary shard to be active. Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The document (*Required*) + # @option arguments [Hash] :body document # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create # def create(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'create' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/delete_auto_follow_pattern.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/delete_auto_follow_pattern.rb index b3537c7ad..8f3b605a1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/delete_auto_follow_pattern.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/delete_auto_follow_pattern.rb @@ -15,20 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Deletes auto-follow patterns. + # Delete auto-follow patterns. + # Delete a collection of cross-cluster replication auto-follow patterns. # - # @option arguments [String] :name The name of the auto follow pattern. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :name The auto-follow pattern collection to delete. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-delete-auto-follow-pattern # def delete_auto_follow_pattern(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.delete_auto_follow_pattern' } @@ -48,7 +51,7 @@ def delete_auto_follow_pattern(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_ccr/auto_follow/#{Utils.__listify(_name)}" + path = "_ccr/auto_follow/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow.rb index c1fffadc1..2dd331d74 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow.rb @@ -15,22 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Creates a new follower index configured to follow the referenced leader index. + # Create a follower. + # Create a cross-cluster replication follower index that follows a specific leader index. + # When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index. # - # @option arguments [String] :index The name of the follower index - # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :index The name of the follower index. (*Required*) + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [Integer, String] :wait_for_active_shards Specifies the number of shards to wait on being active before responding. This defaults to waiting on none of the shards to be + # active. + # A shard must be restored from the leader index before being active. Restoring a follower shard requires transferring all the + # remote Lucene segment files to the follower index. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The name of the leader index and other optional ccr related parameters (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow # def follow(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.follow' } @@ -46,12 +51,12 @@ def follow(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_PUT - path = "#{Utils.__listify(_index)}/_ccr/follow" + path = "#{Utils.listify(_index)}/_ccr/follow" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow_info.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow_info.rb index 7ba6a422b..9aebeda6d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow_info.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow_info.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Retrieves information about all follower indices, including parameters and status for each follower index + # Get follower information. + # Get information about all cross-cluster replication follower indices. + # For example, the results include follower index names, leader index names, replication options, and whether the follower indices are active or paused. # - # @option arguments [List] :index A comma-separated list of index patterns; use `_all` to perform the operation on all indices - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String, Array] :index A comma-delimited list of follower index patterns. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-info.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-info # def follow_info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.follow_info' } @@ -43,12 +47,12 @@ def follow_info(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_ccr/info" + path = "#{Utils.listify(_index)}/_ccr/info" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow_stats.rb index 85e45f125..b927c737a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/follow_stats.rb @@ -15,20 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Retrieves follower stats. return shard-level stats about the following tasks associated with each shard for the specified indices. + # Get follower stats. + # Get cross-cluster replication follower stats. + # The API returns shard-level stats about the "following tasks" associated with each shard for the specified indices. # - # @option arguments [List] :index A comma-separated list of index patterns; use `_all` to perform the operation on all indices - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :index A comma-delimited list of index patterns. (*Required*) + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-follow-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow-stats # def follow_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.follow_stats' } @@ -43,12 +46,12 @@ def follow_stats(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_ccr/stats" + path = "#{Utils.listify(_index)}/_ccr/stats" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/forget_follower.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/forget_follower.rb index aa3726b0b..d9089e274 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/forget_follower.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/forget_follower.rb @@ -15,21 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Removes the follower retention leases from the leader. + # Forget a follower. + # Remove the cross-cluster replication follower retention leases from the leader. + # A following index takes out retention leases on its leader index. + # These leases are used to increase the likelihood that the shards of the leader index retain the history of operations that the shards of the following index need to run replication. + # When a follower index is converted to a regular index by the unfollow API (either by directly calling the API or by index lifecycle management tasks), these leases are removed. + # However, removal of the leases can fail, for example when the remote cluster containing the leader index is unavailable. + # While the leases will eventually expire on their own, their extended existence can cause the leader index to hold more history than necessary and prevent index lifecycle management from performing some operations on the leader index. + # This API exists to enable manually removing the leases when the unfollow API is unable to do so. + # NOTE: This API does not stop replication by a following index. If you use this API with a follower index that is still actively following, the following index will add back retention leases on the leader. + # The only purpose of this API is to handle the case of failure to remove the following retention leases after the unfollow API is invoked. # - # @option arguments [String] :index the name of the leader index for which specified follower retention leases should be removed - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :index the name of the leader index for which specified follower retention leases should be removed (*Required*) + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body the name and UUID of the follower index, the name of the cluster containing the follower index, and the alias from the perspective of that cluster for the remote cluster containing the leader index (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-forget-follower.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-forget-follower # def forget_follower(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.forget_follower' } @@ -45,12 +54,12 @@ def forget_follower(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_ccr/forget_follower" + path = "#{Utils.listify(_index)}/_ccr/forget_follower" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/get_auto_follow_pattern.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/get_auto_follow_pattern.rb index ea4f844ef..55bbeabe8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/get_auto_follow_pattern.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/get_auto_follow_pattern.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Gets configured auto-follow patterns. Returns the specified auto-follow pattern collection. + # Get auto-follow patterns. + # Get cross-cluster replication auto-follow patterns. # - # @option arguments [String] :name The name of the auto follow pattern. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :name The auto-follow pattern collection that you want to retrieve. + # If you do not specify a name, the API returns information for all collections. + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-auto-follow-pattern.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-get-auto-follow-pattern-1 # def get_auto_follow_pattern(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.get_auto_follow_pattern' } @@ -47,7 +51,7 @@ def get_auto_follow_pattern(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_ccr/auto_follow/#{Utils.__listify(_name)}" + "_ccr/auto_follow/#{Utils.listify(_name)}" else '_ccr/auto_follow' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/pause_auto_follow_pattern.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/pause_auto_follow_pattern.rb index 573bd73ad..8a216016f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/pause_auto_follow_pattern.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/pause_auto_follow_pattern.rb @@ -15,20 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Pauses an auto-follow pattern + # Pause an auto-follow pattern. + # Pause a cross-cluster replication auto-follow pattern. + # When the API returns, the auto-follow pattern is inactive. + # New indices that are created on the remote cluster and match the auto-follow patterns are ignored. + # You can resume auto-following with the resume auto-follow pattern API. + # When it resumes, the auto-follow pattern is active again and automatically configures follower indices for newly created indices on the remote cluster that match its patterns. + # Remote indices that were created while the pattern was paused will also be followed, unless they have been deleted or closed in the interim. # - # @option arguments [String] :name The name of the auto follow pattern that should pause discovering new indices to follow. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :name The name of the auto-follow pattern to pause. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-pause-auto-follow-pattern.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-auto-follow-pattern # def pause_auto_follow_pattern(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.pause_auto_follow_pattern' } @@ -48,7 +56,7 @@ def pause_auto_follow_pattern(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_POST - path = "_ccr/auto_follow/#{Utils.__listify(_name)}/pause" + path = "_ccr/auto_follow/#{Utils.listify(_name)}/pause" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/pause_follow.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/pause_follow.rb index 275bd1675..ded431f8c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/pause_follow.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/pause_follow.rb @@ -15,20 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Pauses a follower index. The follower index will not fetch any additional operations from the leader index. + # Pause a follower. + # Pause a cross-cluster replication follower index. + # The follower index will not fetch any additional operations from the leader index. + # You can resume following with the resume follower API. + # You can pause and resume a follower index to change the configuration of the following task. # - # @option arguments [String] :index The name of the follower index that should pause following its leader index. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :index The name of the follower index. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-pause-follow.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-pause-follow # def pause_follow(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.pause_follow' } @@ -43,12 +49,12 @@ def pause_follow(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_ccr/pause_follow" + path = "#{Utils.listify(_index)}/_ccr/pause_follow" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/put_auto_follow_pattern.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/put_auto_follow_pattern.rb index 4ea1a7a75..a539d5d5b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/put_auto_follow_pattern.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/put_auto_follow_pattern.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Creates a new named collection of auto-follow patterns against a specified remote cluster. Newly created indices on the remote cluster matching any of the specified patterns will be automatically configured as follower indices. + # Create or update auto-follow patterns. + # Create a collection of cross-cluster replication auto-follow patterns for a remote cluster. + # Newly created indices on the remote cluster that match any of the patterns are automatically configured as follower indices. + # Indices on the remote cluster that were created before the auto-follow pattern was created will not be auto-followed even if they match the pattern. + # This API can also be used to update auto-follow patterns. + # NOTE: Follower indices that were configured automatically before updating an auto-follow pattern will remain unchanged even if they do not match against the new patterns. # - # @option arguments [String] :name The name of the auto follow pattern. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :name The name of the collection of auto-follow patterns. (*Required*) + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The specification of the auto follow pattern (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-auto-follow-pattern.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-put-auto-follow-pattern # def put_auto_follow_pattern(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.put_auto_follow_pattern' } @@ -50,7 +55,7 @@ def put_auto_follow_pattern(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_ccr/auto_follow/#{Utils.__listify(_name)}" + path = "_ccr/auto_follow/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/resume_auto_follow_pattern.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/resume_auto_follow_pattern.rb index 2a979f9ad..03aece6b9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/resume_auto_follow_pattern.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/resume_auto_follow_pattern.rb @@ -15,20 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Resumes an auto-follow pattern that has been paused + # Resume an auto-follow pattern. + # Resume a cross-cluster replication auto-follow pattern that was paused. + # The auto-follow pattern will resume configuring following indices for newly created indices that match its patterns on the remote cluster. + # Remote indices created while the pattern was paused will also be followed unless they have been deleted or closed in the interim. # - # @option arguments [String] :name The name of the auto follow pattern to resume discovering new indices to follow. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :name The name of the auto-follow pattern to resume. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-resume-auto-follow-pattern.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-auto-follow-pattern # def resume_auto_follow_pattern(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.resume_auto_follow_pattern' } @@ -48,7 +53,7 @@ def resume_auto_follow_pattern(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_POST - path = "_ccr/auto_follow/#{Utils.__listify(_name)}/resume" + path = "_ccr/auto_follow/#{Utils.listify(_name)}/resume" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/resume_follow.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/resume_follow.rb index f172d59a8..228c8b476 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/resume_follow.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/resume_follow.rb @@ -15,21 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Resumes a follower index that has been paused + # Resume a follower. + # Resume a cross-cluster replication follower index that was paused. + # The follower index could have been paused with the pause follower API. + # Alternatively it could be paused due to replication that cannot be retried due to failures during following tasks. + # When this API returns, the follower index will resume fetching operations from the leader index. # - # @option arguments [String] :index The name of the follow index to resume following. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :index The name of the follow index to resume following. (*Required*) + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The name of the leader index and other optional ccr related parameters + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-resume-follow.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-resume-follow # def resume_follow(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.resume_follow' } @@ -44,12 +48,12 @@ def resume_follow(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_ccr/resume_follow" + path = "#{Utils.listify(_index)}/_ccr/resume_follow" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/stats.rb index 276ce44b3..b02efbb90 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/stats.rb @@ -15,20 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Gets all stats related to cross-cluster replication. + # Get cross-cluster replication stats. + # This API returns stats about auto-following and the same shard-level stats as the get follower stats API. # - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-get-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-stats # def stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.stats' } @@ -36,7 +39,7 @@ def stats(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_ccr/stats' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/unfollow.rb b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/unfollow.rb index 9719fd23a..3329aa555 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/unfollow.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/cross_cluster_replication/unfollow.rb @@ -15,20 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module CrossClusterReplication module Actions - # Stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + # Unfollow an index. + # Convert a cross-cluster replication follower index to a regular index. + # The API stops the following task associated with a follower index and removes index metadata and settings associated with cross-cluster replication. + # The follower index must be paused and closed before you call the unfollow API. # - # @option arguments [String] :index The name of the follower index that should be turned into a regular index. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :index The name of the follower index. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-post-unfollow.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-unfollow # def unfollow(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ccr.unfollow' } @@ -43,12 +48,12 @@ def unfollow(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_ccr/unfollow" + path = "#{Utils.listify(_index)}/_ccr/unfollow" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb b/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb index 82810e3a0..e65a167c2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/delete_dangling_index.rb @@ -15,22 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module DanglingIndices module Actions - # Deletes the specified dangling index + # Delete a dangling index. + # If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. + # For example, this can happen if you delete more than +cluster.indices.tombstones.size+ indices while an Elasticsearch node is offline. # - # @option arguments [String] :index_uuid The UUID of the dangling index - # @option arguments [Boolean] :accept_data_loss Must be set to true in order to delete the dangling index - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :index_uuid The UUID of the index to delete. Use the get dangling indices API to find the UUID. (*Required*) + # @option arguments [Boolean] :accept_data_loss This parameter must be set to true to acknowledge that it will no longer be possible to recove data from the dangling index. (*Required*) # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway-dangling-indices.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-dangling-indices-delete-dangling-index # def delete_dangling_index(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'dangling_indices.delete_dangling_index' } @@ -50,7 +52,7 @@ def delete_dangling_index(arguments = {}) _index_uuid = arguments.delete(:index_uuid) method = Elasticsearch::API::HTTP_DELETE - path = "_dangling/#{Utils.__listify(_index_uuid)}" + path = "_dangling/#{Utils.listify(_index_uuid)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb b/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb index 3806639cb..80a63c15c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/import_dangling_index.rb @@ -15,22 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module DanglingIndices module Actions - # Imports the specified dangling index + # Import a dangling index. + # If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. + # For example, this can happen if you delete more than +cluster.indices.tombstones.size+ indices while an Elasticsearch node is offline. # - # @option arguments [String] :index_uuid The UUID of the dangling index - # @option arguments [Boolean] :accept_data_loss Must be set to true in order to import the dangling index - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :index_uuid The UUID of the index to import. Use the get dangling indices API to locate the UUID. (*Required*) + # @option arguments [Boolean] :accept_data_loss This parameter must be set to true to import a dangling index. + # Because Elasticsearch cannot know where the dangling index data came from or determine which shard copies are fresh and which are stale, it cannot guarantee that the imported data represents the latest state of the index when it was last in the cluster. (*Required*) # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway-dangling-indices.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-dangling-indices-import-dangling-index # def import_dangling_index(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'dangling_indices.import_dangling_index' } @@ -50,7 +53,7 @@ def import_dangling_index(arguments = {}) _index_uuid = arguments.delete(:index_uuid) method = Elasticsearch::API::HTTP_POST - path = "_dangling/#{Utils.__listify(_index_uuid)}" + path = "_dangling/#{Utils.listify(_index_uuid)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb b/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb index a46ca9851..15b29475b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/dangling_indices/list_dangling_indices.rb @@ -15,18 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module DanglingIndices module Actions - # Returns all dangling indices. + # Get the dangling indices. + # If Elasticsearch encounters index data that is absent from the current cluster state, those indices are considered to be dangling. + # For example, this can happen if you delete more than +cluster.indices.tombstones.size+ indices while an Elasticsearch node is offline. + # Use this API to list dangling indices, which you can then import or delete. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-gateway-dangling-indices.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-dangling-indices-list-dangling-indices # def list_dangling_indices(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'dangling_indices.list_dangling_indices' } @@ -34,7 +37,7 @@ def list_dangling_indices(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_dangling' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/delete.rb index 3d0505817..bcea1d26e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/delete.rb @@ -15,32 +15,63 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Removes a document from the index. + # Delete a document. + # Remove a JSON document from the specified index. + # NOTE: You cannot send deletion requests directly to a data stream. + # To delete a document in a data stream, you must target the backing index containing the document. + # **Optimistic concurrency control** + # Delete operations can be made conditional and only be performed if the last modification to the document was assigned the sequence number and primary term specified by the +if_seq_no+ and +if_primary_term+ parameters. + # If a mismatch is detected, the operation will result in a +VersionConflictException+ and a status code of +409+. + # **Versioning** + # Each document indexed is versioned. + # When deleting a document, the version can be specified to make sure the relevant document you are trying to delete is actually being deleted and it has not changed in the meantime. + # Every write operation run on a document, deletes included, causes its version to be incremented. + # The version number of a deleted document remains available for a short time after deletion to allow for control of concurrent operations. + # The length of time for which a deleted document's version remains available is determined by the +index.gc_deletes+ index setting. + # **Routing** + # If routing is used during indexing, the routing value also needs to be specified to delete a document. + # If the +_routing+ mapping is set to +required+ and no routing value is specified, the delete API throws a +RoutingMissingException+ and rejects the request. + # For example: + # + + # DELETE /my-index-000001/_doc/1?routing=shard-1 + # + + # This request deletes the document with ID 1, but it is routed based on the user. + # The document is not deleted if the correct routing is not specified. + # **Distributed** + # The delete operation gets hashed into a specific shard ID. + # It then gets redirected into the primary shard within that ID group and replicated (if needed) to shard replicas within that ID group. # - # @option arguments [String] :id The document ID - # @option arguments [String] :index The name of the index - # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the delete operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for) - # @option arguments [String] :routing Specific routing value - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Number] :if_seq_no only perform the delete operation if the last operation that has changed the document has the specified sequence number - # @option arguments [Number] :if_primary_term only perform the delete operation if the last operation that has changed the document has the specified primary term - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte) + # @option arguments [String] :id A unique identifier for the document. (*Required*) + # @option arguments [String] :index The name of the target index. (*Required*) + # @option arguments [Integer] :if_primary_term Only perform the operation if the document has this primary term. + # @option arguments [Integer] :if_seq_no Only perform the operation if the document has this sequence number. + # @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search. + # If +wait_for+, it waits for a refresh to make this operation visible to search. + # If +false+, it does nothing with refreshes. Server default: false. + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Time] :timeout The period to wait for active shards.This parameter is useful for situations where the primary shard assigned to perform the delete operation might not be available when the delete operation runs. + # Some reasons for this might be that the primary shard is currently recovering from a store or undergoing relocation. + # By default, the delete operation will wait on the primary shard to become available for up to 1 minute before failing and responding with an error. Server default: 1m. + # @option arguments [Integer] :version An explicit version number for concurrency control. + # It must match the current version of the document for the request to succeed. + # @option arguments [String] :version_type The version type. + # @option arguments [Integer, String] :wait_for_active_shards The minimum number of shard copies that must be active before proceeding with the operation. + # You can set it to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). + # The default value of +1+ means it waits for each primary shard to be active. Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete # def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'delete' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -58,11 +89,11 @@ def delete(arguments = {}) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_DELETE - path = "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}" + path = "#{Utils.listify(_index)}/_doc/#{Utils.listify(_id)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/delete_by_query.rb b/elasticsearch-api/lib/elasticsearch/api/actions/delete_by_query.rb index 395cd5061..edc6d85cf 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/delete_by_query.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/delete_by_query.rb @@ -15,48 +15,130 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Deletes documents matching the provided query. + # Delete documents. + # Deletes documents that match the specified query. + # If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias: + # * +read+ + # * +delete+ or +write+ + # You can specify the query criteria in the request URI or the request body using the same syntax as the search API. + # When you submit a delete by query request, Elasticsearch gets a snapshot of the data stream or index when it begins processing the request and deletes matching documents using internal versioning. + # If a document changes between the time that the snapshot is taken and the delete operation is processed, it results in a version conflict and the delete operation fails. + # NOTE: Documents with a version equal to 0 cannot be deleted using delete by query because internal versioning does not support 0 as a valid version number. + # While processing a delete by query request, Elasticsearch performs multiple search requests sequentially to find all of the matching documents to delete. + # A bulk delete request is performed for each batch of matching documents. + # If a search or bulk request is rejected, the requests are retried up to 10 times, with exponential back off. + # If the maximum retry limit is reached, processing halts and all failed requests are returned in the response. + # Any delete requests that completed successfully still stick, they are not rolled back. + # You can opt to count version conflicts instead of halting and returning by setting +conflicts+ to +proceed+. + # Note that if you opt to count version conflicts the operation could attempt to delete more documents from the source than +max_docs+ until it has successfully deleted +max_docs documents+, or it has gone through every document in the source query. + # **Throttling delete requests** + # To control the rate at which delete by query issues batches of delete operations, you can set +requests_per_second+ to any positive decimal number. + # This pads each batch with a wait time to throttle the rate. + # Set +requests_per_second+ to +-1+ to disable throttling. + # Throttling uses a wait time between batches so that the internal scroll requests can be given a timeout that takes the request padding into account. + # The padding time is the difference between the batch size divided by the +requests_per_second+ and the time spent writing. + # By default the batch size is +1000+, so if +requests_per_second+ is set to +500+: + # + + # target_time = 1000 / 500 per second = 2 seconds + # wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds + # + + # Since the batch is issued as a single +_bulk+ request, large batch sizes cause Elasticsearch to create many requests and wait before starting the next set. + # This is "bursty" instead of "smooth". + # **Slicing** + # Delete by query supports sliced scroll to parallelize the delete process. + # This can improve efficiency and provide a convenient way to break the request down into smaller parts. + # Setting +slices+ to +auto+ lets Elasticsearch choose the number of slices to use. + # This setting will use one slice per shard, up to a certain limit. + # If there are multiple source data streams or indices, it will choose the number of slices based on the index or backing index with the smallest number of shards. + # Adding slices to the delete by query operation creates sub-requests which means it has some quirks: + # * You can see these requests in the tasks APIs. These sub-requests are "child" tasks of the task for the request with slices. + # * Fetching the status of the task for the request with slices only contains the status of completed slices. + # * These sub-requests are individually addressable for things like cancellation and rethrottling. + # * Rethrottling the request with +slices+ will rethrottle the unfinished sub-request proportionally. + # * Canceling the request with +slices+ will cancel each sub-request. + # * Due to the nature of +slices+ each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution. + # * Parameters like +requests_per_second+ and +max_docs+ on a request with +slices+ are distributed proportionally to each sub-request. Combine that with the earlier point about distribution being uneven and you should conclude that using +max_docs+ with +slices+ might not result in exactly +max_docs+ documents being deleted. + # * Each sub-request gets a slightly different snapshot of the source data stream or index though these are all taken at approximately the same time. + # If you're slicing manually or otherwise tuning automatic slicing, keep in mind that: + # * Query performance is most efficient when the number of slices is equal to the number of shards in the index or backing index. If that number is large (for example, 500), choose a lower number as too many +slices+ hurts performance. Setting +slices+ higher than the number of shards generally does not improve efficiency and adds overhead. + # * Delete performance scales linearly across available resources with the number of slices. + # Whether query or delete performance dominates the runtime depends on the documents being reindexed and cluster resources. + # **Cancel a delete by query operation** + # Any delete by query can be canceled using the task cancel API. For example: + # + + # POST _tasks/r1A2WoRbTwKZ516z6NEs5A:36619/_cancel + # + + # The task ID can be found by using the get tasks API. + # Cancellation should happen quickly but might take a few seconds. + # The get task status API will continue to list the delete by query task until this task checks that it has been cancelled and terminates itself. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - # @option arguments [String] :analyzer The analyzer to use for the query string - # @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false) - # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR) - # @option arguments [String] :df The field to use as default where no field prefix is given in the query string - # @option arguments [Number] :from Starting offset (default: 0) - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :conflicts What to do when the delete by query hits version conflicts? (options: abort, proceed) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [String] :q Query in the Lucene query string syntax - # @option arguments [List] :routing A comma-separated list of specific routing values - # @option arguments [Time] :scroll Specify how long a consistent view of the index should be maintained for scrolled search - # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch) - # @option arguments [Time] :search_timeout Explicit timeout for each search request. Defaults to no timeout. - # @option arguments [Number] :max_docs Maximum number of documents to process (default: all documents) - # @option arguments [List] :sort A comma-separated list of : pairs - # @option arguments [Number] :terminate_after The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - # @option arguments [List] :stats Specific 'tag' of the request for logging and statistical purposes - # @option arguments [Boolean] :version Specify whether to return document version as part of a hit - # @option arguments [Boolean] :request_cache Specify if request cache should be used for this request or not, defaults to index level setting - # @option arguments [Boolean] :refresh Should the affected indexes be refreshed? - # @option arguments [Time] :timeout Time each individual bulk request should wait for shards that are unavailable. - # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - # @option arguments [Number] :scroll_size Size on the scroll request powering the delete by query - # @option arguments [Boolean] :wait_for_completion Should the request should block until the delete by query is complete. - # @option arguments [Number] :requests_per_second The throttle for this request in sub-requests per second. -1 means no throttle. - # @option arguments [Number|string] :slices The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search. + # It supports wildcards (+*+). + # To search all data streams or indices, omit this parameter or use +*+ or +_all+. (*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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true. + # @option arguments [String] :analyzer Analyzer to use for the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [String] :conflicts What to do if delete by query hits version conflicts: +abort+ or +proceed+. Server default: abort. + # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. + # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR. + # @option arguments [String] :df The field to use as default where no field prefix is given in the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # It supports comma-separated values, such as +open,hidden+. Server default: open. + # @option arguments [Integer] :from Starting offset (default: 0) + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Integer] :max_docs The maximum number of documents to process. + # Defaults to all documents. + # When set to a value less then or equal to +scroll_size+, a scroll will not be used to retrieve the results for the operation. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # It is random by default. + # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes all shards involved in the delete by query after the request completes. + # This is different than the delete API's +refresh+ parameter, which causes just the shard that received the delete request to be refreshed. + # Unlike the delete API, it does not support +wait_for+. + # @option arguments [Boolean] :request_cache If +true+, the request cache is used for this request. + # Defaults to the index-level setting. + # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. Server default: -1. + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [String] :q A query in the Lucene query string syntax. + # @option arguments [Time] :scroll The period to retain the search context for scrolling. + # @option arguments [Integer] :scroll_size The size of the scroll request that powers the operation. Server default: 1000. + # @option arguments [Time] :search_timeout The explicit timeout for each search request. + # It defaults to no timeout. + # @option arguments [String] :search_type The type of the search operation. + # Available options include +query_then_fetch+ and +dfs_query_then_fetch+. + # @option arguments [Integer, String] :slices The number of slices this task should be divided into. Server default: 1. + # @option arguments [Array] :sort A comma-separated list of +:+ pairs. + # @option arguments [Array] :stats The specific +tag+ of the request for logging and statistical purposes. + # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard. + # If a query reaches this limit, Elasticsearch terminates the query early. + # Elasticsearch collects documents before sorting.Use with caution. + # Elasticsearch applies this parameter to each shard handling the request. + # When possible, let Elasticsearch perform early termination automatically. + # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + # @option arguments [Time] :timeout The period each deletion request waits for active shards. Server default: 1m. + # @option arguments [Boolean] :version If +true+, returns the document version as part of a hit. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). + # The +timeout+ value controls how long each write request waits for unavailable shards to become available. Server default: 1. + # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete. + # If +false+, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task. Elasticsearch creates a record of this task as a document at +.tasks/task/${taskId}+. When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search definition using the Query DSL (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query # def delete_by_query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'delete_by_query' } @@ -72,12 +154,12 @@ def delete_by_query(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_delete_by_query" + path = "#{Utils.listify(_index)}/_delete_by_query" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb index 081b6efc8..5c3629dd1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/delete_by_query_rethrottle.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Changes the number of requests per second for a particular Delete By Query operation. + # Throttle a delete by query operation. + # Change the number of requests per second for a particular delete by query operation. + # Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts. # - # @option arguments [String] :task_id The task id to rethrottle - # @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (*Required*) + # @option arguments [String, Integer] :task_id The ID for the task. (*Required*) + # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. + # To disable throttling, set it to +-1+. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-by-query-rethrottle # def delete_by_query_rethrottle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'delete_by_query_rethrottle' } @@ -47,7 +50,7 @@ def delete_by_query_rethrottle(arguments = {}) _task_id = arguments.delete(:task_id) method = Elasticsearch::API::HTTP_POST - path = "_delete_by_query/#{Utils.__listify(_task_id)}/_rethrottle" + path = "_delete_by_query/#{Utils.listify(_task_id)}/_rethrottle" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/delete_script.rb b/elasticsearch-api/lib/elasticsearch/api/actions/delete_script.rb index 9f1d8be91..7d088f1de 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/delete_script.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/delete_script.rb @@ -15,20 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Deletes a script. + # Delete a script or search template. + # Deletes a stored script or search template. # - # @option arguments [String] :id Script ID - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :id The identifier for the stored script or search template. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-delete-script # def delete_script(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'delete_script' } @@ -48,7 +53,7 @@ def delete_script(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_scripts/#{Utils.__listify(_id)}" + path = "_scripts/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/delete_policy.rb b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/delete_policy.rb index de116ae99..89f909e2b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/delete_policy.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/delete_policy.rb @@ -15,20 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Enrich module Actions + # Delete an enrich policy. # Deletes an existing enrich policy and its enrich index. # - # @option arguments [String] :name The name of the enrich policy - # @option arguments [Time] :master_timeout Timeout for processing on master node + # @option arguments [String] :name Enrich policy to delete. (*Required*) + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-enrich-policy-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-delete-policy # def delete_policy(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'enrich.delete_policy' } @@ -48,7 +49,7 @@ def delete_policy(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_enrich/policy/#{Utils.__listify(_name)}" + path = "_enrich/policy/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/execute_policy.rb b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/execute_policy.rb index f30444fef..4565fbc3c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/execute_policy.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/execute_policy.rb @@ -15,21 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Enrich module Actions - # Creates the enrich index for an existing enrich policy. + # Run an enrich policy. + # Create the enrich index for an existing enrich policy. # - # @option arguments [String] :name The name of the enrich policy - # @option arguments [Boolean] :wait_for_completion Should the request should block until the execution is complete. - # @option arguments [Time] :master_timeout Timeout for processing on master node + # @option arguments [String] :name Enrich policy to execute. (*Required*) + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks other enrich policy execution requests until complete. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/execute-enrich-policy-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-execute-policy # def execute_policy(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'enrich.execute_policy' } @@ -49,7 +50,7 @@ def execute_policy(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_enrich/policy/#{Utils.__listify(_name)}/_execute" + path = "_enrich/policy/#{Utils.listify(_name)}/_execute" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/get_policy.rb b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/get_policy.rb index 76ef6e736..334ead139 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/get_policy.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/get_policy.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Enrich module Actions - # Gets information about an enrich policy. + # Get an enrich policy. + # Returns information about an enrich policy. # - # @option arguments [List] :name A comma-separated list of enrich policy names - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked + # @option arguments [String, Array] :name Comma-separated list of enrich policy names used to limit the request. + # To return information for all enrich policies, omit this parameter. + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-enrich-policy-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-get-policy # def get_policy(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'enrich.get_policy' } @@ -47,7 +49,7 @@ def get_policy(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_enrich/policy/#{Utils.__listify(_name)}" + "_enrich/policy/#{Utils.listify(_name)}" else '_enrich/policy' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/put_policy.rb b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/put_policy.rb index b93de33b2..571fe3827 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/put_policy.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/put_policy.rb @@ -15,21 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Enrich module Actions - # Creates a new enrich policy. + # Create an enrich policy. + # Creates an enrich policy. # - # @option arguments [String] :name The name of the enrich policy - # @option arguments [Time] :master_timeout Timeout for processing on master node + # @option arguments [String] :name Name of the enrich policy to create or update. (*Required*) + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The enrich policy to register (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-enrich-policy-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-put-policy # def put_policy(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'enrich.put_policy' } @@ -50,7 +51,7 @@ def put_policy(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_enrich/policy/#{Utils.__listify(_name)}" + path = "_enrich/policy/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/stats.rb index d511f5f32..80bc7e23e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/enrich/stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/enrich/stats.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Enrich module Actions - # Gets enrich coordinator statistics and information about enrich policies that are currently executing. + # Get enrich stats. + # Returns enrich coordinator statistics and information about enrich policies that are currently executing. # - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-enrich-stats # def stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'enrich.stats' } @@ -35,7 +36,7 @@ def stats(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_enrich/_stats' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/eql/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/eql/delete.rb index d0a794a59..e265c7743 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/eql/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/eql/delete.rb @@ -15,19 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Eql module Actions - # Deletes an async EQL search by ID. If the search is still running, the search request will be cancelled. Otherwise, the saved search results are deleted. + # Delete an async EQL search. + # Delete an async EQL search or a stored synchronous EQL search. + # The API also deletes results for the search. # - # @option arguments [String] :id The async search ID + # @option arguments [String] :id Identifier for the search to delete. + # A search ID is provided in the EQL search API's response for an async search. + # A search ID is also provided if the request’s +keep_on_completion+ parameter is +true+. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-delete # def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'eql.delete' } @@ -47,7 +51,7 @@ def delete(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_eql/search/#{Utils.__listify(_id)}" + path = "_eql/search/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/eql/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/eql/get.rb index 87341090a..94f647fb2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/eql/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/eql/get.rb @@ -15,21 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Eql module Actions - # Returns async results from previously executed Event Query Language (EQL) search + # Get async EQL search results. + # Get the current status and available results for an async EQL search or a stored synchronous EQL search. # - # @option arguments [String] :id The async search ID - # @option arguments [Time] :wait_for_completion_timeout Specify the time that the request should block waiting for the final response - # @option arguments [Time] :keep_alive Update the time interval in which the results (partial or final) for this search will be available + # @option arguments [String] :id Identifier for the search. (*Required*) + # @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster. + # Defaults to the keep_alive value set by the search’s EQL search API request. + # @option arguments [Time] :wait_for_completion_timeout Timeout duration to wait for the request to finish. + # Defaults to no timeout, meaning the request waits for complete search results. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get # def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'eql.get' } @@ -49,7 +52,7 @@ def get(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_eql/search/#{Utils.__listify(_id)}" + path = "_eql/search/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/eql/get_status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/eql/get_status.rb index 06e4d9846..2acf65464 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/eql/get_status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/eql/get_status.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Eql module Actions - # Returns the status of a previously submitted async or stored Event Query Language (EQL) search + # Get the async EQL status. + # Get the current status for an async EQL search or a stored synchronous EQL search without returning results. # - # @option arguments [String] :id The async search ID + # @option arguments [String] :id Identifier for the search. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-get-status # def get_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'eql.get_status' } @@ -47,7 +48,7 @@ def get_status(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_eql/search/status/#{Utils.__listify(_id)}" + path = "_eql/search/status/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/eql/search.rb b/elasticsearch-api/lib/elasticsearch/api/actions/eql/search.rb index 870291cd1..4f9242ed0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/eql/search.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/eql/search.rb @@ -15,25 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Eql module Actions - # Returns results matching a query expressed in Event Query Language (EQL) + # Get EQL search results. + # Returns search results for an Event Query Language (EQL) query. + # EQL assumes each document in a data stream or index corresponds to an event. # - # @option arguments [String] :index The name of the index to scope the operation - # @option arguments [Time] :wait_for_completion_timeout Specify the time that the request should block waiting for the final response - # @option arguments [Boolean] :keep_on_completion Control whether the response should be stored in the cluster if it completed within the provided [wait_for_completion] time (default: false) - # @option arguments [Time] :keep_alive Update the time interval in which the results (partial or final) for this search will be available - # @option arguments [Boolean] :allow_partial_search_results Control whether the query should keep running in case of shard failures, and return partial results - # @option arguments [Boolean] :allow_partial_sequence_results Control whether a sequence query should return partial results or no results at all in case of shard failures. This option has effect only if [allow_partial_search_results] is true. + # @option arguments [String, Array] :index The name of the index to scope the operation (*Required*) + # @option arguments [Boolean] :allow_no_indices [TODO] Server default: true. + # @option arguments [Boolean] :allow_partial_search_results If true, returns partial results if there are shard failures. If false, returns an error with no partial results. Server default: true. + # @option arguments [Boolean] :allow_partial_sequence_results If true, sequence queries will return partial results in case of shard failures. If false, they will return no results at all. + # This flag has effect only if allow_partial_search_results is true. + # @option arguments [String, Array] :expand_wildcards [TODO] Server default: open. + # @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response. Server default: true. + # @option arguments [Time] :keep_alive Period for which the search and its results are stored on the cluster. Server default: 5d. + # @option arguments [Boolean] :keep_on_completion If true, the search and its results are stored on the cluster. + # @option arguments [Time] :wait_for_completion_timeout Timeout duration to wait for the request to finish. Defaults to no timeout, meaning the request waits for complete search results. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Eql request body. Use the `query` to limit the query scope. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-search-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-eql-search # def search(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'eql.search' } @@ -49,12 +55,12 @@ def search(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_eql/search" + path = "#{Utils.listify(_index)}/_eql/search" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query.rb b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query.rb index fadffc40e..290a1632f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query.rb @@ -15,22 +15,36 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Esql module Actions - # Executes an ESQL request asynchronously + # Run an async ES|QL query. + # Asynchronously run an ES|QL (Elasticsearch query language) query, monitor its progress, and retrieve results when they become available. + # The API accepts the same parameters and request body as the synchronous query API, along with additional async related properties. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [String] :delimiter The character to use between values within a CSV row. Only valid for the csv format. - # @option arguments [Boolean] :drop_null_columns Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. + # @option arguments [String] :delimiter The character to use between values within a CSV row. + # It is valid only for the CSV format. + # @option arguments [Boolean] :drop_null_columns Indicates whether columns that are entirely +null+ will be removed from the +columns+ and +values+ portion of the results. + # If +true+, the response will include an extra section under the name +all_columns+ which has the name of all the columns. + # @option arguments [String] :format A short version of the Accept header, for example +json+ or +yaml+. + # @option arguments [Time] :keep_alive The period for which the query and its results are stored in the cluster. + # The default period is five days. + # When this period expires, the query and its results are deleted, even if the query is still ongoing. + # If the +keep_on_completion+ parameter is false, Elasticsearch only stores async queries that do not complete within the period set by the +wait_for_completion_timeout+ parameter, regardless of this value. Server default: 5d. + # @option arguments [Boolean] :keep_on_completion Indicates whether the query and its results are stored in the cluster. + # If false, the query and its results are stored in the cluster only if the request does not complete during the period set by the +wait_for_completion_timeout+ parameter. + # @option arguments [Time] :wait_for_completion_timeout The period to wait for the request to finish. + # By default, the request waits for 1 second for the query results. + # If the query completes during this period, results are returned + # Otherwise, a query ID is returned that can later be used to retrieve the results. Server default: 1s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Use the `query` element to start a query. Use `columnar` to format the answer. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-async-query-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query # def async_query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.async_query' } @@ -40,7 +54,7 @@ def async_query(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_query/async' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_delete.rb index 647470b44..3ea289b71 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_delete.rb @@ -15,19 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Esql module Actions - # Delete an async query request given its ID. + # Delete an async ES|QL query. + # If the query is still running, it is cancelled. + # Otherwise, the stored results are deleted. + # If the Elasticsearch security features are enabled, only the following users can use this API to delete a query: + # * The authenticated user that submitted the original query request + # * Users with the +cancel_task+ cluster privilege # - # @option arguments [String] :id The async query ID + # @option arguments [String] :id The unique identifier of the query. + # A query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time. + # A query ID is also provided when the request was submitted with the +keep_on_completion+ parameter set to +true+. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-async-query-delete-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-delete # def async_query_delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.async_query_delete' } @@ -47,7 +54,7 @@ def async_query_delete(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_query/async/#{Utils.__listify(_id)}" + path = "_query/async/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_get.rb index 4d5950401..1f8f5f3d8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_get.rb @@ -15,22 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Esql module Actions - # Retrieves the results of a previously submitted async query request given its ID. + # Get async ES|QL query results. + # Get the current status and available results or stored results for an ES|QL asynchronous query. + # If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can retrieve the results using this API. # - # @option arguments [String] :id The async query ID - # @option arguments [Time] :wait_for_completion_timeout Specify the time that the request should block waiting for the final response - # @option arguments [Time] :keep_alive Specify the time interval in which the results (partial or final) for this search will be available - # @option arguments [Boolean] :drop_null_columns Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. + # @option arguments [String] :id The unique identifier of the query. + # A query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time. + # A query ID is also provided when the request was submitted with the +keep_on_completion+ parameter set to +true+. (*Required*) + # @option arguments [Boolean] :drop_null_columns Indicates whether columns that are entirely +null+ will be removed from the +columns+ and +values+ portion of the results. + # If +true+, the response will include an extra section under the name +all_columns+ which has the name of all the columns. + # @option arguments [Time] :keep_alive The period for which the query and its results are stored in the cluster. + # When this period expires, the query and its results are deleted, even if the query is still ongoing. + # @option arguments [Time] :wait_for_completion_timeout The period to wait for the request to finish. + # By default, the request waits for complete query results. + # If the request completes during the period specified in this parameter, complete query results are returned. + # Otherwise, the response returns an +is_running+ value of +true+ and no results. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-async-query-get-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-esql-async-query-get # def async_query_get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.async_query_get' } @@ -50,7 +59,7 @@ def async_query_get(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_query/async/#{Utils.__listify(_id)}" + path = "_query/async/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_stop.rb b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_stop.rb index b4520b20c..143e27df3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_stop.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/esql/async_query_stop.rb @@ -38,9 +38,8 @@ module Actions def async_query_stop(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.async_query_stop' } - defined_params = [:id].inject({}) do |set_variables, variable| + defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -54,7 +53,7 @@ def async_query_stop(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_POST - path = "_query/async/#{Utils.__listify(_id)}/stop" + path = "_query/async/#{Utils.listify(_id)}/stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/esql/query.rb b/elasticsearch-api/lib/elasticsearch/api/actions/esql/query.rb index 0d722a7f7..cfda90c2a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/esql/query.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/esql/query.rb @@ -15,22 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Esql module Actions - # Executes an ESQL request + # Run an ES|QL query. + # Get search results for an ES|QL (Elasticsearch query language) query. + # This functionality is subject to potential breaking changes within a + # minor version, meaning that your referencing code may break when this + # library is upgraded. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml - # @option arguments [String] :delimiter The character to use between values within a CSV row. Only valid for the csv format. - # @option arguments [Boolean] :drop_null_columns Should entirely null columns be removed from the results? Their name and type will be returning in a new `all_columns` section. + # @option arguments [String] :format A short version of the Accept header, e.g. json, yaml. + # @option arguments [String] :delimiter The character to use between values within a CSV row. Only valid for the CSV format. + # @option arguments [Boolean] :drop_null_columns Should columns that are entirely +null+ be removed from the +columns+ and +values+ portion of the results? + # Defaults to +false+. If +true+ then the response will include an extra section under the name +all_columns+ which has the name of all columns. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Use the `query` element to start a query. Use `columnar` to format the answer. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-query-api.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-rest.html # def query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'esql.query' } @@ -40,7 +45,7 @@ def query(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_query' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/exists.rb b/elasticsearch-api/lib/elasticsearch/api/actions/exists.rb index aaf756abe..31bfdb1d4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/exists.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/exists.rb @@ -15,34 +15,60 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns information about whether a document exists in an index. + # Check a document. + # Verify that a document exists. + # For example, check to see if a document with the +_id+ 0 exists: + # + + # HEAD my-index-000001/_doc/0 + # + + # If the document exists, the API returns a status code of +200 - OK+. + # If the document doesn’t exist, the API returns +404 - Not Found+. + # **Versioning support** + # You can use the +version+ parameter to check the document only if its current version is equal to the specified one. + # Internally, Elasticsearch has marked the old document as deleted and added an entirely new document. + # The old version of the document doesn't disappear immediately, although you won't be able to access it. + # Elasticsearch cleans up deleted documents in the background as you continue to index more data. # - # @option arguments [String] :id The document ID - # @option arguments [String] :index The name of the index - # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode - # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation - # @option arguments [String] :routing Specific routing value - # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return - # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field - # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte) + # @option arguments [String] :id A unique document identifier. (*Required*) + # @option arguments [String] :index A comma-separated list of data streams, indices, and aliases. + # It supports wildcards (+*+). (*Required*) + # @option arguments [String] :preference The node or shard the operation should be performed on. + # By default, the operation is randomized between the shard replicas.If it is set to +_local+, the operation will prefer to be run on a local allocated shard when possible. + # If it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value. + # This can help with "jumping values" when hitting different shards in different refresh states. + # A sample value can be something like the web session ID or the user name. + # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true. + # @option arguments [Boolean] :refresh If +true+, the request refreshes the relevant shards before retrieving the document. + # Setting it to +true+ should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing). + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Boolean, String, Array] :_source Indicates whether to return the +_source+ field (+true+ or +false+) or lists the fields to return. + # @option arguments [String, Array] :_source_excludes A comma-separated list of source fields to exclude from the response. + # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [String, Array] :_source_includes A comma-separated list of source fields to include in the response. + # If this parameter is specified, only these source fields are returned. + # You can exclude fields from this subset using the +_source_excludes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [String, Array] :stored_fields A comma-separated list of stored fields to return as part of a hit. + # If no fields are specified, no stored fields are included in the response. + # If this field is specified, the +_source+ parameter defaults to +false+. + # @option arguments [Integer] :version Explicit version number for concurrency control. + # The specified version must match the current version of the document for the request to succeed. + # @option arguments [String] :version_type The version type. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get # def exists(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'exists' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -60,10 +86,10 @@ def exists(arguments = {}) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_HEAD - path = "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}" + path = "#{Utils.listify(_index)}/_doc/#{Utils.listify(_id)}" params = Utils.process_params(arguments) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do perform_request(method, path, params, body, headers, request_opts).status == 200 end end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/exists_source.rb b/elasticsearch-api/lib/elasticsearch/api/actions/exists_source.rb index ce01cb5e2..962649aed 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/exists_source.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/exists_source.rb @@ -15,33 +15,43 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns information about whether a document source exists in an index. + # Check for a document source. + # Check whether a document source exists in an index. + # For example: + # + + # HEAD my-index-000001/_source/1 + # + + # A document's source is not available if it is disabled in the mapping. # - # @option arguments [String] :id The document ID - # @option arguments [String] :index The name of the index - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode - # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation - # @option arguments [String] :routing Specific routing value - # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return - # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field - # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte) + # @option arguments [String] :id A unique identifier for the document. (*Required*) + # @option arguments [String] :index A comma-separated list of data streams, indices, and aliases. + # It supports wildcards (+*+). (*Required*) + # @option arguments [String] :preference The node or shard the operation should be performed on. + # By default, the operation is randomized between the shard replicas. + # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true. + # @option arguments [Boolean] :refresh If +true+, the request refreshes the relevant shards before retrieving the document. + # Setting it to +true+ should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing). + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Boolean, String, Array] :_source Indicates whether to return the +_source+ field (+true+ or +false+) or lists the fields to return. + # @option arguments [String, Array] :_source_excludes A comma-separated list of source fields to exclude in the response. + # @option arguments [String, Array] :_source_includes A comma-separated list of source fields to include in the response. + # @option arguments [Integer] :version The version number for concurrency control. + # It must match the current version of the document for the request to succeed. + # @option arguments [String] :version_type The version type. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get # def exists_source(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'exists_source' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -59,7 +69,7 @@ def exists_source(arguments = {}) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_HEAD - path = "#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}" + path = "#{Utils.listify(_index)}/_source/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/explain.rb b/elasticsearch-api/lib/elasticsearch/api/actions/explain.rb index b78f9160a..43248f175 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/explain.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/explain.rb @@ -15,37 +15,51 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns information about why a specific matches (or doesn't match) a query. + # Explain a document match result. + # Get information about why a specific document matches, or doesn't match, a query. + # It computes a score explanation for a query and a specific document. # - # @option arguments [String] :id The document ID - # @option arguments [String] :index The name of the index - # @option arguments [Boolean] :analyze_wildcard Specify whether wildcards and prefix queries in the query string query should be analyzed (default: false) - # @option arguments [String] :analyzer The analyzer for the query string query - # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR) - # @option arguments [String] :df The default field for query string query (default: _all) - # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response - # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [String] :q Query in the Lucene query string syntax - # @option arguments [String] :routing Specific routing value - # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return - # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field - # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field + # @option arguments [String] :id The document identifier. (*Required*) + # @option arguments [String] :index Index names that are used to limit the request. + # Only a single index name can be provided to this parameter. (*Required*) + # @option arguments [String] :analyzer The analyzer to use for the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. + # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR. + # @option arguments [String] :df The field to use as default where no field prefix is given in the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # It is random by default. + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Boolean, String, Array] :_source +True+ or +false+ to return the +_source+ field or not or a list of fields to return. + # @option arguments [String, Array] :_source_excludes A comma-separated list of source fields to exclude from the response. + # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [String, Array] :_source_includes A comma-separated list of source fields to include in the response. + # If this parameter is specified, only these source fields are returned. + # You can exclude fields from this subset using the +_source_excludes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [String, Array] :stored_fields A comma-separated list of stored fields to return in the response. + # @option arguments [String] :q The query in the Lucene query string syntax. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The query definition using the Query DSL + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-explain.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-explain # def explain(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'explain' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -68,7 +82,7 @@ def explain(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "#{Utils.__listify(_index)}/_explain/#{Utils.__listify(_id)}" + path = "#{Utils.listify(_index)}/_explain/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/features/get_features.rb b/elasticsearch-api/lib/elasticsearch/api/actions/features/get_features.rb index 65c71bc79..1586b6aa7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/features/get_features.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/features/get_features.rb @@ -15,19 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Features module Actions - # Gets a list of features which can be included in snapshots using the feature_states field when creating a snapshot + # Get the features. + # Get a list of features that can be included in snapshots using the +feature_states+ field when creating a snapshot. + # You can use this API to determine which feature states to include when taking a snapshot. + # By default, all feature states are included in a snapshot if that snapshot includes the global state, or none if it does not. + # A feature state includes one or more system indices necessary for a given feature to function. + # In order to ensure data integrity, all system indices that comprise a feature state are snapshotted and restored together. + # The features listed by this API are a combination of built-in features and features defined by plugins. + # In order for a feature state to be listed in this API and recognized as a valid feature state by the create snapshot API, the plugin that defines that feature must be installed on the master node. # - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-features-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-features-get-features # def get_features(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'features.get_features' } @@ -35,7 +42,7 @@ def get_features(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_features' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/features/reset_features.rb b/elasticsearch-api/lib/elasticsearch/api/actions/features/reset_features.rb index 63ea0c5e8..752c44f89 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/features/reset_features.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/features/reset_features.rb @@ -15,23 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Features module Actions - # Resets the internal state of features, usually by deleting system indices + # Reset the features. + # Clear all of the state information stored in system indices by Elasticsearch features, including the security and machine learning indices. + # WARNING: Intended for development and testing use only. Do not reset features on a production cluster. + # Return a cluster to the same state as a new installation by resetting the feature state for all Elasticsearch features. + # This deletes all state information stored in system indices. + # The response code is HTTP 200 if the state is successfully reset for all features. + # It is HTTP 500 if the reset operation failed for any feature. + # Note that select features might provide a way to reset particular system indices. + # Using this API resets all features, both those that are built-in and implemented as plugins. + # To list the features that will be affected, use the get features API. + # IMPORTANT: The features installed on the node you submit this request to are the features that will be reset. Run on the master node if you have any doubts about which plugins are installed on individual nodes. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-features-reset-features # def reset_features(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'features.reset_features' } @@ -39,7 +49,7 @@ def reset_features(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_features/_reset' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/field_caps.rb b/elasticsearch-api/lib/elasticsearch/api/actions/field_caps.rb index 0ad6237bb..31c5bf637 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/field_caps.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/field_caps.rb @@ -15,27 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns the information about the capabilities of fields among multiple indices. + # Get the field capabilities. + # Get information about the capabilities of fields among multiple indices. + # For data streams, the API returns field capabilities among the stream’s backing indices. + # It returns runtime fields like any other field. + # For example, a runtime field with a type of keyword is returned the same as any other field that belongs to the +keyword+ family. # - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [List] :fields A comma-separated list of field names - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :include_unmapped Indicates whether unmapped fields should be included in the response. - # @option arguments [List] :filters An optional set of filters: can include +metadata,-metadata,-nested,-multifield,-parent - # @option arguments [List] :types Only return results for fields that have one of the types in the list - # @option arguments [Boolean] :include_empty_fields Include empty fields in result + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases used to limit the request. Supports wildcards (*). To target all data streams and indices, omit this parameter or use * or _all. + # @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. This behavior applies even if the request targets other open indices. For example, a request + # targeting +foo*,bar*+ returns an error if an index starts with foo but no index starts with bar. Server default: true. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such as +open,hidden+. Server default: open. + # @option arguments [String, Array] :fields A comma-separated list of fields to retrieve capabilities for. Wildcard (+*+) expressions are supported. + # @option arguments [Boolean] :ignore_unavailable If +true+, missing or closed indices are not included in the response. + # @option arguments [Boolean] :include_unmapped If true, unmapped fields are included in the response. + # @option arguments [String] :filters A comma-separated list of filters to apply to the response. + # @option arguments [Array] :types A comma-separated list of field types to include. + # Any fields that do not match one of these types will be excluded from the results. + # It defaults to empty, meaning that all field types are returned. + # @option arguments [Boolean] :include_empty_fields If false, empty fields are not included in the response. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An index filter specified with the Query DSL + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-field-caps.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-field-caps # def field_caps(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'field_caps' } @@ -58,11 +66,11 @@ def field_caps(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _index - "#{Utils.__listify(_index)}/_field_caps" - else - '_field_caps' - end + path = if _index + "#{Utils.listify(_index)}/_field_caps" + else + '_field_caps' + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/global_checkpoints.rb b/elasticsearch-api/lib/elasticsearch/api/actions/fleet/global_checkpoints.rb index 7768f2c53..c0faf1dfe 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/global_checkpoints.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/fleet/global_checkpoints.rb @@ -15,23 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Fleet module Actions - # Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project. + # Get global checkpoints. + # Get the current global checkpoints for an index. + # This API is designed for internal use by the Fleet server project. # - # @option arguments [String] :index The name of the index. - # @option arguments [Boolean] :wait_for_advance Whether to wait for the global checkpoint to advance past the specified current checkpoints - # @option arguments [Boolean] :wait_for_index Whether to wait for the target index to exist and all primary shards be active - # @option arguments [List] :checkpoints Comma separated list of checkpoints - # @option arguments [Time] :timeout Timeout to wait for global checkpoint to advance + # @option arguments [Indexname, Indexalias] :index A single index or index alias that resolves to a single index. (*Required*) + # @option arguments [Boolean] :wait_for_advance A boolean value which controls whether to wait (until the timeout) for the global checkpoints + # to advance past the provided +checkpoints+. + # @option arguments [Boolean] :wait_for_index A boolean value which controls whether to wait (until the timeout) for the target index to exist + # and all primary shards be active. Can only be true when +wait_for_advance+ is true. + # @option arguments [Array] :checkpoints A comma separated list of previous global checkpoints. When used in combination with +wait_for_advance+, + # the API will only return once the global checkpoints advances past the checkpoints. Providing an empty list + # will cause Elasticsearch to immediately return the current global checkpoints. Server default: []. + # @option arguments [Time] :timeout Period to wait for a global checkpoints to advance past +checkpoints+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-global-checkpoints.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-fleet # def global_checkpoints(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'fleet.global_checkpoints' } @@ -46,12 +52,12 @@ def global_checkpoints(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_fleet/global_checkpoints" + path = "#{Utils.listify(_index)}/_fleet/global_checkpoints" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/msearch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/fleet/msearch.rb index d80bbed75..abdeb239d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/msearch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/fleet/msearch.rb @@ -15,24 +15,44 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Fleet module Actions - # Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. + # Run multiple Fleet searches. + # Run several Fleet searches with a single API request. + # The API follows the same structure as the multi search API. + # However, similar to the Fleet search API, it supports the +wait_for_checkpoints+ parameter. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :index The index name to use as the default + # @option arguments [Indexname, Indexalias] :index A single target to search. If the target is an index alias, it must resolve to a single index. + # @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. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. + # @option arguments [Boolean] :ccs_minimize_roundtrips If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # @option arguments [Boolean] :ignore_throttled If true, concrete, expanded or aliased indices are ignored when frozen. + # @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response. + # @option arguments [Integer] :max_concurrent_searches Maximum number of concurrent searches the multi search API can execute. + # @option arguments [Integer] :max_concurrent_shard_requests Maximum number of concurrent shard requests that each sub-search request executes per node. Server default: 5. + # @option arguments [Integer] :pre_filter_shard_size Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. + # @option arguments [String] :search_type Indicates whether global term and document frequencies should be used when scoring returned documents. + # @option arguments [Boolean] :rest_total_hits_as_int If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. + # @option arguments [Boolean] :typed_keys Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. + # @option arguments [Array] :wait_for_checkpoints A comma separated list of checkpoints. When configured, the search API will only be executed on a shard + # after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause + # Elasticsearch to immediately execute the search. Server default: []. + # @option arguments [Boolean] :allow_partial_search_results If true, returns partial results if there are shard request timeouts or {https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-replication.html#shard-failures shard failures}. If false, returns + # an error with no partial results. Defaults to the configured cluster setting +search.default_allow_partial_results+ + # which is true by default. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The request definitions (metadata-fleet search request definition pairs), separated by newlines (*Required*) + # @option arguments [Hash] :body searches # - # @see [TODO] + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-fleet-msearch # def msearch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'fleet.msearch' } @@ -47,19 +67,19 @@ def msearch(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_fleet/_fleet_msearch" + "#{Utils.listify(_index)}/_fleet/_fleet_msearch" else '_fleet/_fleet_msearch' end - params = {} + params = Utils.process_params(arguments) - if body.is_a?(Array) && body.any? { |d| d.has_key? :search } + if body.is_a?(Array) && body.any? { |d| d.key? :search } payload = body.each_with_object([]) do |item, sum| meta = item data = meta.delete(:search) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/search.rb b/elasticsearch-api/lib/elasticsearch/api/actions/fleet/search.rb index d3f67b21d..531678706 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/fleet/search.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/fleet/search.rb @@ -15,27 +15,73 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Fleet module Actions - # Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. + # Run a Fleet search. + # The purpose of the Fleet search API is to provide an API where the search will be run only + # after the provided checkpoint has been processed and is visible for searches inside of Elasticsearch. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :index The index name to search. - # @option arguments [List] :wait_for_checkpoints Comma separated list of checkpoints, one per shard - # @option arguments [Time] :wait_for_checkpoints_timeout Explicit wait_for_checkpoints timeout - # @option arguments [Boolean] :allow_partial_search_results Indicate if an error should be returned if there is a partial search failure or timeout + # @option arguments [Indexname, Indexalias] :index A single target to search. If the target is an index alias, it must resolve to a single index. (*Required*) + # @option arguments [Boolean] :allow_no_indices [TODO] + # @option arguments [String] :analyzer [TODO] + # @option arguments [Boolean] :analyze_wildcard [TODO] + # @option arguments [Integer] :batched_reduce_size [TODO] + # @option arguments [Boolean] :ccs_minimize_roundtrips [TODO] + # @option arguments [String] :default_operator [TODO] + # @option arguments [String] :df [TODO] + # @option arguments [String, Array] :docvalue_fields [TODO] + # @option arguments [String, Array] :expand_wildcards [TODO] + # @option arguments [Boolean] :explain [TODO] + # @option arguments [Boolean] :ignore_throttled [TODO] + # @option arguments [Boolean] :ignore_unavailable [TODO] + # @option arguments [Boolean] :lenient [TODO] + # @option arguments [Integer] :max_concurrent_shard_requests [TODO] + # @option arguments [String] :preference [TODO] + # @option arguments [Integer] :pre_filter_shard_size [TODO] + # @option arguments [Boolean] :request_cache [TODO] + # @option arguments [String] :routing [TODO] + # @option arguments [Time] :scroll [TODO] + # @option arguments [String] :search_type [TODO] + # @option arguments [Array] :stats [TODO] + # @option arguments [String, Array] :stored_fields [TODO] + # @option arguments [String] :suggest_field Specifies which field to use for suggestions. + # @option arguments [String] :suggest_mode [TODO] + # @option arguments [Integer] :suggest_size [TODO] + # @option arguments [String] :suggest_text The source text for which the suggestions should be returned. + # @option arguments [Integer] :terminate_after [TODO] + # @option arguments [Time] :timeout [TODO] + # @option arguments [Boolean, Integer] :track_total_hits [TODO] + # @option arguments [Boolean] :track_scores [TODO] + # @option arguments [Boolean] :typed_keys [TODO] + # @option arguments [Boolean] :rest_total_hits_as_int [TODO] + # @option arguments [Boolean] :version [TODO] + # @option arguments [Boolean, String, Array] :_source [TODO] + # @option arguments [String, Array] :_source_excludes [TODO] + # @option arguments [String, Array] :_source_includes [TODO] + # @option arguments [Boolean] :seq_no_primary_term [TODO] + # @option arguments [String] :q [TODO] + # @option arguments [Integer] :size [TODO] + # @option arguments [Integer] :from [TODO] + # @option arguments [String] :sort [TODO] + # @option arguments [Array] :wait_for_checkpoints A comma separated list of checkpoints. When configured, the search API will only be executed on a shard + # after the relevant checkpoint has become visible for search. Defaults to an empty list which will cause + # Elasticsearch to immediately execute the search. Server default: []. + # @option arguments [Boolean] :allow_partial_search_results If true, returns partial results if there are shard request timeouts or {https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-replication.html#shard-failures shard failures}. If false, returns + # an error with no partial results. Defaults to the configured cluster setting +search.default_allow_partial_results+ + # which is true by default. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search definition using the Query DSL + # @option arguments [Hash] :body request body # - # @see [TODO] + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-fleet-search # def search(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'fleet.search' } @@ -60,7 +106,7 @@ def search(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "#{Utils.__listify(_index)}/_fleet/_fleet_search" + path = "#{Utils.listify(_index)}/_fleet/_fleet_search" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/get.rb index 3b956abf0..736d367f9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/get.rb @@ -15,35 +15,91 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns a document. + # Get a document by its ID. + # Get a document and its source or stored fields from an index. + # By default, this API is realtime and is not affected by the refresh rate of the index (when data will become visible for search). + # In the case where stored fields are requested with the +stored_fields+ parameter and the document has been updated but is not yet refreshed, the API will have to parse and analyze the source to extract the stored fields. + # To turn off realtime behavior, set the +realtime+ parameter to false. + # **Source filtering** + # By default, the API returns the contents of the +_source+ field unless you have used the +stored_fields+ parameter or the +_source+ field is turned off. + # You can turn off +_source+ retrieval by using the +_source+ parameter: + # + + # GET my-index-000001/_doc/0?_source=false + # + + # If you only need one or two fields from the +_source+, use the +_source_includes+ or +_source_excludes+ parameters to include or filter out particular fields. + # This can be helpful with large documents where partial retrieval can save on network overhead + # Both parameters take a comma separated list of fields or wildcard expressions. + # For example: + # + + # GET my-index-000001/_doc/0?_source_includes=*.id&_source_excludes=entities + # + + # If you only want to specify includes, you can use a shorter notation: + # + + # GET my-index-000001/_doc/0?_source=*.id + # + + # **Routing** + # If routing is used during indexing, the routing value also needs to be specified to retrieve a document. + # For example: + # + + # GET my-index-000001/_doc/2?routing=user1 + # + + # This request gets the document with ID 2, but it is routed based on the user. + # The document is not fetched if the correct routing is not specified. + # **Distributed** + # The GET operation is hashed into a specific shard ID. + # It is then redirected to one of the replicas within that shard ID and returns the result. + # The replicas are the primary shard and its replicas within that shard ID group. + # This means that the more replicas you have, the better your GET scaling will be. + # **Versioning support** + # You can use the +version+ parameter to retrieve the document only if its current version is equal to the specified one. + # Internally, Elasticsearch has marked the old document as deleted and added an entirely new document. + # The old version of the document doesn't disappear immediately, although you won't be able to access it. + # Elasticsearch cleans up deleted documents in the background as you continue to index more data. # - # @option arguments [String] :id The document ID - # @option arguments [String] :index The name of the index - # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index. - # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode - # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation - # @option arguments [String] :routing Specific routing value - # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return - # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field - # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte) + # @option arguments [String] :id A unique document identifier. (*Required*) + # @option arguments [String] :index The name of the index that contains the document. (*Required*) + # @option arguments [Boolean] :force_synthetic_source Indicates whether the request forces synthetic +_source+. + # Use this paramater to test if the mapping supports synthetic +_source+ and to get a sense of the worst case performance. + # Fetches with this parameter enabled will be slower than enabling synthetic source natively in the index. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # By default, the operation is randomized between the shard replicas.If it is set to +_local+, the operation will prefer to be run on a local allocated shard when possible. + # If it is set to a custom value, the value is used to guarantee that the same shards will be used for the same custom value. + # This can help with "jumping values" when hitting different shards in different refresh states. + # A sample value can be something like the web session ID or the user name. + # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true. + # @option arguments [Boolean] :refresh If +true+, the request refreshes the relevant shards before retrieving the document. + # Setting it to +true+ should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing). + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Boolean, String, Array] :_source Indicates whether to return the +_source+ field (+true+ or +false+) or lists the fields to return. + # @option arguments [String, Array] :_source_excludes A comma-separated list of source fields to exclude from the response. + # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [String, Array] :_source_includes A comma-separated list of source fields to include in the response. + # If this parameter is specified, only these source fields are returned. + # You can exclude fields from this subset using the +_source_excludes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [String, Array] :stored_fields A comma-separated list of stored fields to return as part of a hit. + # If no fields are specified, no stored fields are included in the response. + # If this field is specified, the +_source+ parameter defaults to +false+. + # Only leaf fields can be retrieved with the +stored_field+ option. + # Object fields can't be returned;​if specified, the request fails. + # @option arguments [Integer] :version The version number for concurrency control. + # It must match the current version of the document for the request to succeed. + # @option arguments [String] :version_type The version type. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get # def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'get' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -61,11 +117,11 @@ def get(arguments = {}) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}" + path = "#{Utils.listify(_index)}/_doc/#{Utils.listify(_id)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/get_script.rb b/elasticsearch-api/lib/elasticsearch/api/actions/get_script.rb index d1a4baf47..0f0a4ec19 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/get_script.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/get_script.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns a script. + # Get a script or search template. + # Retrieves a stored script or search template. # - # @option arguments [String] :id Script ID - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :id The identifier for the stored script or search template. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: . # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script # def get_script(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'get_script' } @@ -47,7 +50,7 @@ def get_script(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_scripts/#{Utils.__listify(_id)}" + path = "_scripts/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/get_script_context.rb b/elasticsearch-api/lib/elasticsearch/api/actions/get_script_context.rb index 845762ab8..110b7d727 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/get_script_context.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/get_script_context.rb @@ -15,17 +15,18 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns all script contexts. + # Get script contexts. + # Get a list of supported script contexts and their methods. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-contexts.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script-context # def get_script_context(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'get_script_context' } @@ -33,7 +34,7 @@ def get_script_context(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_script_context' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/get_script_languages.rb b/elasticsearch-api/lib/elasticsearch/api/actions/get_script_languages.rb index d8f9d8d77..5787944c9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/get_script_languages.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/get_script_languages.rb @@ -15,17 +15,18 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns available script types, languages and contexts + # Get script languages. + # Get a list of available script types, languages, and contexts. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get-script-languages # def get_script_languages(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'get_script_languages' } @@ -33,7 +34,7 @@ def get_script_languages(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_script_language' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/get_source.rb b/elasticsearch-api/lib/elasticsearch/api/actions/get_source.rb index e66b8c5e6..94b459811 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/get_source.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/get_source.rb @@ -15,33 +15,46 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns the source of a document. + # Get a document's source. + # Get the source of a document. + # For example: + # + + # GET my-index-000001/_source/1 + # + + # You can use the source filtering parameters to control which parts of the +_source+ are returned: + # + + # GET my-index-000001/_source/1/?_source_includes=*.id&_source_excludes=entities + # + # - # @option arguments [String] :id The document ID - # @option arguments [String] :index The name of the index - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode - # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation - # @option arguments [String] :routing Specific routing value - # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return - # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field - # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte) + # @option arguments [String] :id A unique document identifier. (*Required*) + # @option arguments [String] :index The name of the index that contains the document. (*Required*) + # @option arguments [String] :preference The node or shard the operation should be performed on. + # By default, the operation is randomized between the shard replicas. + # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true. + # @option arguments [Boolean] :refresh If +true+, the request refreshes the relevant shards before retrieving the document. + # Setting it to +true+ should be done after careful thought and verification that this does not cause a heavy load on the system (and slow down indexing). + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Boolean, String, Array] :_source Indicates whether to return the +_source+ field (+true+ or +false+) or lists the fields to return. + # @option arguments [String, Array] :_source_excludes A comma-separated list of source fields to exclude in the response. + # @option arguments [String, Array] :_source_includes A comma-separated list of source fields to include in the response. + # @option arguments [String, Array] :stored_fields A comma-separated list of stored fields to return as part of a hit. + # @option arguments [Integer] :version The version number for concurrency control. + # It must match the current version of the document for the request to succeed. + # @option arguments [String] :version_type The version type. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-get.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-get # def get_source(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'get_source' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -59,7 +72,7 @@ def get_source(arguments = {}) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_source/#{Utils.__listify(_id)}" + path = "#{Utils.listify(_index)}/_source/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/graph/explore.rb b/elasticsearch-api/lib/elasticsearch/api/actions/graph/explore.rb index 64306ce43..26743e99f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/graph/explore.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/graph/explore.rb @@ -15,22 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Graph module Actions - # Explore extracted and summarized information about the documents and terms in an index. + # Explore graph analytics. + # Extract and summarize information about the documents and terms in an Elasticsearch data stream or index. + # The easiest way to understand the behavior of this API is to use the Graph UI to explore connections. + # An initial request to the +_explore+ API contains a seed query that identifies the documents of interest and specifies the fields that define the vertices and connections you want to include in the graph. + # Subsequent requests enable you to spider out from one more vertices of interest. + # You can exclude vertices that have already been returned. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - # @option arguments [String] :routing Specific routing value - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :index Name of the index. (*Required*) + # @option arguments [String] :routing Custom value used to route operations to a specific shard. + # @option arguments [Time] :timeout Specifies the period of time to wait for a response from each shard. + # If no response is received before the timeout expires, the request fails and returns an error. + # Defaults to no timeout. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Graph Query DSL + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/graph-explore-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-graph # def explore(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'graph.explore' } @@ -55,7 +62,7 @@ def explore(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "#{Utils.__listify(_index)}/_graph/explore" + path = "#{Utils.listify(_index)}/_graph/explore" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/health_report.rb b/elasticsearch-api/lib/elasticsearch/api/actions/health_report.rb index 7849b2663..fd0c104e8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/health_report.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/health_report.rb @@ -15,21 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns the health of the cluster. + # Get the cluster health. + # Get a report with the health status of an Elasticsearch cluster. + # The report contains a list of indicators that compose Elasticsearch functionality. + # Each indicator has a health status of: green, unknown, yellow or red. + # The indicator will provide an explanation and metadata describing the reason for its current health status. + # The cluster’s status is controlled by the worst indicator status. + # In the event that an indicator’s status is non-green, a list of impacts may be present in the indicator result which detail the functionalities that are negatively affected by the health issue. + # Each impact carries with it a severity level, an area of the system that is affected, and a simple description of the impact on the system. + # Some health indicators can determine the root cause of a health problem and prescribe a set of steps that can be performed in order to improve the health of the system. + # The root cause and remediation steps are encapsulated in a diagnosis. + # A diagnosis contains a cause detailing a root cause analysis, an action containing a brief description of the steps to take to fix the problem, the list of affected resources (if applicable), and a detailed step-by-step troubleshooting guide to fix the diagnosed problem. + # NOTE: The health indicators perform root cause analysis of non-green health statuses. This can be computationally expensive when called frequently. + # When setting up automated polling of the API for health status, set verbose to false to disable the more expensive analysis logic. # - # @option arguments [String] :feature A feature of the cluster, as returned by the top-level health API - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Boolean] :verbose Opt in for more information about the health of the system - # @option arguments [Integer] :size Limit the number of affected resources the health API returns + # @option arguments [String] :feature A feature of the cluster, as returned by the top-level health report API. + # @option arguments [Time] :timeout Explicit operation timeout. + # @option arguments [Boolean] :verbose Opt-in for more information about the health of the system. Server default: true. + # @option arguments [Integer] :size Limit the number of affected resources the health report API returns. Server default: 1000. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/health-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-health-report # def health_report(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'health_report' } @@ -48,7 +60,7 @@ def health_report(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _feature - "_health_report/#{Utils.__listify(_feature)}" + "_health_report/#{Utils.listify(_feature)}" else '_health_report' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index.rb index 311e3d1a3..57456bf28 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index.rb @@ -15,38 +15,138 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Creates or updates a document in an index. + # Create or update a document in an index. + # Add a JSON document to the specified data stream or index and make it searchable. + # If the target is an index and the document already exists, the request updates the document and increments its version. + # NOTE: You cannot use this API to send update requests for existing documents in a data stream. + # If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or index alias: + # * To add or overwrite a document using the +PUT //_doc/<_id>+ request format, you must have the +create+, +index+, or +write+ index privilege. + # * To add a document using the +POST //_doc/+ request format, you must have the +create_doc+, +create+, +index+, or +write+ index privilege. + # * To automatically create a data stream or index with this API request, you must have the +auto_configure+, +create_index+, or +manage+ index privilege. + # Automatic data stream creation requires a matching index template with data stream enabled. + # NOTE: Replica shards might not all be started when an indexing operation returns successfully. + # By default, only the primary is required. Set +wait_for_active_shards+ to change this default behavior. + # **Automatically create data streams and indices** + # If the request's target doesn't exist and matches an index template with a +data_stream+ definition, the index operation automatically creates the data stream. + # If the target doesn't exist and doesn't match a data stream template, the operation automatically creates the index and applies any matching index templates. + # NOTE: Elasticsearch includes several built-in index templates. To avoid naming collisions with these templates, refer to index pattern documentation. + # If no mapping exists, the index operation creates a dynamic mapping. + # By default, new fields and objects are automatically added to the mapping if needed. + # Automatic index creation is controlled by the +action.auto_create_index+ setting. + # If it is +true+, any index can be created automatically. + # You can modify this setting to explicitly allow or block automatic creation of indices that match specified patterns or set it to +false+ to turn off automatic index creation entirely. + # Specify a comma-separated list of patterns you want to allow or prefix each pattern with +++ or +-+ to indicate whether it should be allowed or blocked. + # When a list is specified, the default behaviour is to disallow. + # NOTE: The +action.auto_create_index+ setting affects the automatic creation of indices only. + # It does not affect the creation of data streams. + # **Optimistic concurrency control** + # Index operations can be made conditional and only be performed if the last modification to the document was assigned the sequence number and primary term specified by the +if_seq_no+ and +if_primary_term+ parameters. + # If a mismatch is detected, the operation will result in a +VersionConflictException+ and a status code of +409+. + # **Routing** + # By default, shard placement — or routing — is controlled by using a hash of the document's ID value. + # For more explicit control, the value fed into the hash function used by the router can be directly specified on a per-operation basis using the +routing+ parameter. + # When setting up explicit mapping, you can also use the +_routing+ field to direct the index operation to extract the routing value from the document itself. + # This does come at the (very minimal) cost of an additional document parsing pass. + # If the +_routing+ mapping is defined and set to be required, the index operation will fail if no routing value is provided or extracted. + # NOTE: Data streams do not support custom routing unless they were created with the +allow_custom_routing+ setting enabled in the template. + # **Distributed** + # The index operation is directed to the primary shard based on its route and performed on the actual node containing this shard. + # After the primary shard completes the operation, if needed, the update is distributed to applicable replicas. + # **Active shards** + # To improve the resiliency of writes to the system, indexing operations can be configured to wait for a certain number of active shard copies before proceeding with the operation. + # If the requisite number of active shard copies are not available, then the write operation must wait and retry, until either the requisite shard copies have started or a timeout occurs. + # By default, write operations only wait for the primary shards to be active before proceeding (that is to say +wait_for_active_shards+ is +1+). + # This default can be overridden in the index settings dynamically by setting +index.write.wait_for_active_shards+. + # To alter this behavior per operation, use the +wait_for_active_shards request+ parameter. + # Valid values are all or any positive integer up to the total number of configured copies per shard in the index (which is +number_of_replicas++1). + # Specifying a negative value or a number greater than the number of shard copies will throw an error. + # For example, suppose you have a cluster of three nodes, A, B, and C and you create an index index with the number of replicas set to 3 (resulting in 4 shard copies, one more copy than there are nodes). + # If you attempt an indexing operation, by default the operation will only ensure the primary copy of each shard is available before proceeding. + # This means that even if B and C went down and A hosted the primary shard copies, the indexing operation would still proceed with only one copy of the data. + # If +wait_for_active_shards+ is set on the request to +3+ (and all three nodes are up), the indexing operation will require 3 active shard copies before proceeding. + # This requirement should be met because there are 3 active nodes in the cluster, each one holding a copy of the shard. + # However, if you set +wait_for_active_shards+ to +all+ (or to +4+, which is the same in this situation), the indexing operation will not proceed as you do not have all 4 copies of each shard active in the index. + # The operation will timeout unless a new node is brought up in the cluster to host the fourth copy of the shard. + # It is important to note that this setting greatly reduces the chances of the write operation not writing to the requisite number of shard copies, but it does not completely eliminate the possibility, because this check occurs before the write operation starts. + # After the write operation is underway, it is still possible for replication to fail on any number of shard copies but still succeed on the primary. + # The +_shards+ section of the API response reveals the number of shard copies on which replication succeeded and failed. + # **No operation (noop) updates** + # When updating a document by using this API, a new version of the document is always created even if the document hasn't changed. + # If this isn't acceptable use the +_update+ API with +detect_noop+ set to +true+. + # The +detect_noop+ option isn't available on this API because it doesn’t fetch the old source and isn't able to compare it against the new source. + # There isn't a definitive rule for when noop updates aren't acceptable. + # It's a combination of lots of factors like how frequently your data source sends updates that are actually noops and how many queries per second Elasticsearch runs on the shard receiving the updates. + # **Versioning** + # Each indexed document is given a version number. + # By default, internal versioning is used that starts at 1 and increments with each update, deletes included. + # Optionally, the version number can be set to an external value (for example, if maintained in a database). + # To enable this functionality, +version_type+ should be set to +external+. + # The value provided must be a numeric, long value greater than or equal to 0, and less than around +9.2e+18+. + # NOTE: Versioning is completely real time, and is not affected by the near real time aspects of search operations. + # If no version is provided, the operation runs without any version checks. + # When using the external version type, the system checks to see if the version number passed to the index request is greater than the version of the currently stored document. + # If true, the document will be indexed and the new version number used. + # If the value provided is less than or equal to the stored document's version number, a version conflict will occur and the index operation will fail. For example: + # ``` + # PUT my-index-000001/_doc/1?version=2&version_type=external + # { + # "user": { + # "id": "elkbee" + # } + # } + # In this example, the operation will succeed since the supplied version of 2 is higher than the current document version of 1. + # If the document was already updated and its version was set to 2 or higher, the indexing command will fail and result in a conflict (409 HTTP status code). + # A nice side effect is that there is no need to maintain strict ordering of async indexing operations run as a result of changes to a source database, as long as version numbers from the source database are used. + # Even the simple case of updating the Elasticsearch index using data from a database is simplified if external versioning is used, as only the latest version will be used if the index operations arrive out of order. # - # @option arguments [String] :id Document ID - # @option arguments [String] :index The name of the index - # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the index operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - # @option arguments [String] :op_type Explicit operation type. Defaults to `index` for requests with an explicit document ID, and to `create`for requests without an explicit document ID (options: index, create) - # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for) - # @option arguments [String] :routing Specific routing value - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte) - # @option arguments [Number] :if_seq_no only perform the index operation if the last operation that has changed the document has the specified sequence number - # @option arguments [Number] :if_primary_term only perform the index operation if the last operation that has changed the document has the specified primary term - # @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with - # @option arguments [Boolean] :require_alias When true, requires destination to be an alias. Default is false - # @option arguments [Boolean] :require_data_stream When true, requires the destination to be a data stream (existing or to-be-created). Default is false - # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Defaults to true. + # @option arguments [String] :id A unique identifier for the document. + # To automatically generate a document ID, use the +POST //_doc/+ request format and omit this parameter. + # @option arguments [String] :index The name of the data stream or index to target. + # If the target doesn't exist and matches the name or wildcard (+*+) pattern of an index template with a +data_stream+ definition, this request creates the data stream. + # If the target doesn't exist and doesn't match a data stream template, this request creates the index. + # You can check for existing targets with the resolve index API. (*Required*) + # @option arguments [Integer] :if_primary_term Only perform the operation if the document has this primary term. + # @option arguments [Integer] :if_seq_no Only perform the operation if the document has this sequence number. + # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Server default: true. + # @option arguments [String] :op_type Set to +create+ to only index the document if it does not already exist (put if absent). + # If a document with the specified +_id+ already exists, the indexing operation will fail. + # The behavior is the same as using the +/_create+ endpoint. + # If a document ID is specified, this paramater defaults to +index+. + # Otherwise, it defaults to +create+. + # If the request targets a data stream, an +op_type+ of +create+ is required. + # @option arguments [String] :pipeline The ID of the pipeline to use to preprocess incoming documents. + # If the index has a default ingest pipeline specified, then setting the value to +_none+ disables the default ingest pipeline for this request. + # If a final pipeline is configured it will always run, regardless of the value of this parameter. + # @option arguments [String] :refresh If +true+, Elasticsearch refreshes the affected shards to make this operation visible to search. + # If +wait_for+, it waits for a refresh to make this operation visible to search. + # If +false+, it does nothing with refreshes. Server default: false. + # @option arguments [String] :routing A custom value that is used to route operations to a specific shard. + # @option arguments [Time] :timeout The period the request waits for the following operations: automatic index creation, dynamic mapping updates, waiting for active shards.This parameter is useful for situations where the primary shard assigned to perform the operation might not be available when the operation runs. + # Some reasons for this might be that the primary shard is currently recovering from a gateway or undergoing relocation. + # By default, the operation will wait on the primary shard to become available for at least 1 minute before failing and responding with an error. + # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m. + # @option arguments [Integer] :version An explicit version number for concurrency control. + # It must be a non-negative long number. + # @option arguments [String] :version_type The version type. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # You can set it to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). + # The default value of +1+ means it waits for each primary shard to be active. Server default: 1. + # @option arguments [Boolean] :require_alias If +true+, the destination must be an index alias. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The document (*Required*) + # @option arguments [Hash] :body document # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-create # def index(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'index' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -65,9 +165,9 @@ def index(arguments = {}) method = _id ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST path = if _index && _id - "#{Utils.__listify(_index)}/_doc/#{Utils.__listify(_id)}" + "#{Utils.listify(_index)}/_doc/#{Utils.listify(_id)}" else - "#{Utils.__listify(_index)}/_doc" + "#{Utils.listify(_index)}/_doc" end params = Utils.process_params(arguments) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb index a73ec735a..e9723521a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/delete_lifecycle.rb @@ -15,21 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Deletes the specified lifecycle policy definition. A currently used policy cannot be deleted. + # Delete a lifecycle policy. + # You cannot delete policies that are currently in use. If the policy is being used to manage any indices, the request fails and returns an error. # - # @option arguments [String] :policy The name of the index lifecycle policy - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :policy Identifier for the policy. (*Required*) + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-delete-lifecycle # def delete_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.delete_lifecycle' } @@ -49,7 +50,7 @@ def delete_lifecycle(arguments = {}) _policy = arguments.delete(:policy) method = Elasticsearch::API::HTTP_DELETE - path = "_ilm/policy/#{Utils.__listify(_policy)}" + path = "_ilm/policy/#{Utils.listify(_policy)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb index dc5f6b9dc..57f4cc5f9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/explain_lifecycle.rb @@ -15,22 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Retrieves information about the index's current lifecycle state, such as the currently executing phase, action, and step. + # Explain the lifecycle state. + # Get the current lifecycle status for one or more indices. + # For data streams, the API retrieves the current lifecycle status for the stream's backing indices. + # The response indicates when the index entered each lifecycle state, provides the definition of the running phase, and information about any failures. # - # @option arguments [String] :index The name of the index to explain - # @option arguments [Boolean] :only_managed filters the indices included in the response to ones managed by ILM - # @option arguments [Boolean] :only_errors filters the indices included in the response to ones in an ILM error state, implies only_managed - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :index Comma-separated list of data streams, indices, and aliases to target. Supports wildcards (+*+). + # To target all data streams and indices, use +*+ or +_all+. (*Required*) + # @option arguments [Boolean] :only_errors Filters the returned indices to only indices that are managed by ILM and are in an error state, either due to an encountering an error while executing the policy, or attempting to use a policy that does not exist. + # @option arguments [Boolean] :only_managed Filters the returned indices to only indices that are managed by ILM. + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-explain-lifecycle.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-explain-lifecycle # def explain_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.explain_lifecycle' } @@ -45,12 +49,12 @@ def explain_lifecycle(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_ilm/explain" + path = "#{Utils.listify(_index)}/_ilm/explain" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb index 92b8c607b..beb6d2c6e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_lifecycle.rb @@ -15,21 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Returns the specified policy definition. Includes the policy version and last modified date. + # Get lifecycle policies. # - # @option arguments [String] :policy The name of the index lifecycle policy - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :policy Identifier for the policy. + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-get-lifecycle # def get_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.get_lifecycle' } @@ -48,7 +48,7 @@ def get_lifecycle(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _policy - "_ilm/policy/#{Utils.__listify(_policy)}" + "_ilm/policy/#{Utils.listify(_policy)}" else '_ilm/policy' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_status.rb index 0cf68bc5c..f7fcb8533 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/get_status.rb @@ -15,18 +15,19 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Retrieves the current index lifecycle management (ILM) status. + # Get the ILM status. + # Get the current index lifecycle management status. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-status.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-get-status # def get_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.get_status' } @@ -34,7 +35,7 @@ def get_status(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_ilm/status' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb index f459f1115..82e49b9fb 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/migrate_to_data_tiers.rb @@ -15,21 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Migrates the indices and ILM policies away from custom node attribute allocation routing to data tiers routing + # Migrate to data tiers routing. + # Switch the indices, ILM policies, and legacy, composable, and component templates from using custom node attributes and attribute-based allocation filters to using data tiers. + # Optionally, delete one legacy index template. + # Using node roles enables ILM to automatically move the indices between data tiers. + # Migrating away from custom node attributes routing can be manually performed. + # This API provides an automated way of performing three out of the four manual steps listed in the migration guide: + # 1. Stop setting the custom hot attribute on new indices. + # 1. Remove custom allocation settings from existing ILM policies. + # 1. Replace custom allocation settings from existing indices with the corresponding tier preference. + # ILM must be stopped before performing the migration. + # Use the stop ILM and get ILM status APIs to wait until the reported operation mode is +STOPPED+. # - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Boolean] :dry_run If set to true it will simulate the migration, providing a way to retrieve the ILM policies and indices that need to be migrated. The default is false + # @option arguments [Boolean] :dry_run If true, simulates the migration from node attributes based allocation filters to data tiers, but does not perform the migration. + # This provides a way to retrieve the indices and ILM policies that need to be migrated. + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Optionally specify a legacy index template name to delete and optionally specify a node attribute name used for index shard routing (defaults to "data") + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-migrate-to-data-tiers.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-migrate-to-data-tiers # def migrate_to_data_tiers(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.migrate_to_data_tiers' } @@ -37,7 +50,7 @@ def migrate_to_data_tiers(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_ilm/migrate_to_data_tiers' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb index 212cb8efc..7d0865a81 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/move_to_step.rb @@ -15,20 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Manually moves an index into the specified step and executes that step. + # Move to a lifecycle step. + # Manually move an index into a specific step in the lifecycle policy and run that step. + # WARNING: This operation can result in the loss of data. Manually moving an index into a specific step runs that step even if it has already been performed. This is a potentially destructive action and this should be considered an expert level API. + # You must specify both the current step and the step to be executed in the body of the request. + # The request will fail if the current step does not match the step currently running for the index + # This is to prevent the index from being moved from an unexpected step into the next step. + # When specifying the target (+next_step+) to which the index will be moved, either the name or both the action and name fields are optional. + # If only the phase is specified, the index will move to the first step of the first action in the target phase. + # If the phase and action are specified, the index will move to the first step of the specified action in the specified phase. + # Only actions specified in the ILM policy are considered valid. + # An index cannot move to a step that is not part of its policy. # - # @option arguments [String] :index The name of the index whose lifecycle step is to change + # @option arguments [String] :index The name of the index whose lifecycle step is to change (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The new lifecycle step to move to + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-move-to-step.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-move-to-step # def move_to_step(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.move_to_step' } @@ -43,12 +53,12 @@ def move_to_step(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "_ilm/move/#{Utils.__listify(_index)}" + path = "_ilm/move/#{Utils.listify(_index)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb index 9035c2473..f3d5b822f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/put_lifecycle.rb @@ -15,22 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Creates a lifecycle policy + # Create or update a lifecycle policy. + # If the specified policy exists, it is replaced and the policy version is incremented. + # NOTE: Only the latest version of the policy is stored, you cannot revert to previous versions. # - # @option arguments [String] :policy The name of the index lifecycle policy - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :policy Identifier for the policy. (*Required*) + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The lifecycle policy definition to register + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-put-lifecycle # def put_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.put_lifecycle' } @@ -50,7 +52,7 @@ def put_lifecycle(arguments = {}) _policy = arguments.delete(:policy) method = Elasticsearch::API::HTTP_PUT - path = "_ilm/policy/#{Utils.__listify(_policy)}" + path = "_ilm/policy/#{Utils.listify(_policy)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/remove_policy.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/remove_policy.rb index 96eaed697..d5a5d8cb6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/remove_policy.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/remove_policy.rb @@ -15,19 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Removes the assigned lifecycle policy and stops managing the specified index + # Remove policies from an index. + # Remove the assigned lifecycle policies from an index or a data stream's backing indices. + # It also stops managing the indices. # - # @option arguments [String] :index The name of the index to remove policy on + # @option arguments [String] :index The name of the index to remove policy on (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-remove-policy.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-remove-policy # def remove_policy(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.remove_policy' } @@ -42,12 +44,12 @@ def remove_policy(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_ilm/remove" + path = "#{Utils.listify(_index)}/_ilm/remove" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb index 61fbb1b17..64b423f5a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Retries executing the policy for an index that is in the ERROR step. + # Retry a policy. + # Retry running the lifecycle policy for an index that is in the ERROR step. + # The API sets the policy back to the step where the error occurred and runs the step. + # Use the explain lifecycle state API to determine whether an index is in the ERROR step. # - # @option arguments [String] :index The name of the indices (comma-separated) whose failed lifecycle step is to be retry + # @option arguments [String] :index The name of the indices (comma-separated) whose failed lifecycle step is to be retry (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-retry-policy.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-retry # def retry(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.retry' } @@ -42,12 +45,12 @@ def retry(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_ilm/retry" + path = "#{Utils.listify(_index)}/_ilm/retry" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb index de72ec031..7ef1629a9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/start.rb @@ -15,20 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Start the index lifecycle management (ILM) plugin. + # Start the ILM plugin. + # Start the index lifecycle management plugin if it is currently stopped. + # ILM is started automatically when the cluster is formed. + # Restarting ILM is necessary only when it has been stopped using the stop ILM API. # - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-start.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-start # def start(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.start' } @@ -36,7 +39,7 @@ def start(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_ilm/start' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb index 81009ecb9..69c252164 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/index_lifecycle_management/stop.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module IndexLifecycleManagement module Actions - # Halts all lifecycle management operations and stops the index lifecycle management (ILM) plugin + # Stop the ILM plugin. + # Halt all lifecycle management operations and stop the index lifecycle management plugin. + # This is useful when you are performing maintenance on the cluster and need to prevent ILM from performing any actions on your indices. + # The API returns as soon as the stop request has been acknowledged, but the plugin might continue to run until in-progress operations complete and the plugin can be safely stopped. + # Use the get ILM status API to check whether ILM is running. # - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-stop.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-stop # def stop(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ilm.stop' } @@ -36,7 +40,7 @@ def stop(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_ilm/stop' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/add_block.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/add_block.rb index b04cfd2b6..6d1938659 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/add_block.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/add_block.rb @@ -15,30 +15,43 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Adds a block to an index. + # Add an index block. + # Add an index block to an index. + # Index blocks limit the operations allowed on an index by blocking specific operation types. # - # @option arguments [List] :index A comma separated list of indices to add a block to - # @option arguments [String] :block The block to add (one of read, write, read_only or metadata) - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [String] :index A comma-separated list or wildcard expression of index names used to limit the request. + # By default, you must explicitly name the indices you are adding blocks to. + # To allow the adding of blocks to indices with +_all+, +*+, or other wildcard expressions, change the +action.destructive_requires_name+ setting to +false+. + # You can update this setting in the +elasticsearch.yml+ file or by using the cluster update settings API. (*Required*) + # @option arguments [String] :block The block type to add to the index. (*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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # It supports comma-separated values, such as +open,hidden+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata. + # If no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules-blocks.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-add-block # def add_block(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.add_block' } - defined_params = %i[index block].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :block].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -49,14 +62,14 @@ def add_block(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) _block = arguments.delete(:block) method = Elasticsearch::API::HTTP_PUT - path = "#{Utils.__listify(_index)}/_block/#{Utils.__listify(_block)}" + path = "#{Utils.listify(_index)}/_block/#{Utils.listify(_block)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/analyze.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/analyze.rb index 00e736136..f6fb85a31 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/analyze.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/analyze.rb @@ -15,20 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Performs the analysis process on a text and return the tokens breakdown of the text. + # Get tokens from text analysis. + # The analyze API performs analysis on a text string and returns the resulting tokens. + # Generating excessive amount of tokens may cause a node to run out of memory. + # The +index.analyze.max_token_count+ setting enables you to limit the number of tokens that can be produced. + # If more than this limit of tokens gets generated, an error occurs. + # The +_analyze+ endpoint without a specified index will always use +10000+ as its limit. # - # @option arguments [String] :index The name of the index to scope the operation + # @option arguments [String] :index Index used to derive the analyzer. + # If specified, the +analyzer+ or field parameter overrides this value. + # If no index is specified or the index does not have a default analyzer, the analyze API uses the standard analyzer. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Define analyzer/tokenizer parameters and the text on which the analysis should be performed + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-analyze.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-analyze # def analyze(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.analyze' } @@ -51,12 +58,12 @@ def analyze(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _index - "#{Utils.__listify(_index)}/_analyze" - else - '_analyze' - end - params = Utils.process_params(arguments) + path = if _index + "#{Utils.listify(_index)}/_analyze" + else + '_analyze' + end + params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/cancel_migrate_reindex.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/cancel_migrate_reindex.rb index 45cdae60f..69e7d7fc4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/cancel_migrate_reindex.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/cancel_migrate_reindex.rb @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from commit dcb1c1df18a84a0182caa631b4577d89a4602cfe +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 # @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch @@ -37,9 +37,8 @@ module Actions def cancel_migrate_reindex(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.cancel_migrate_reindex' } - defined_params = [:index].inject({}) do |set_variables, variable| + defined_params = [:index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,7 +52,7 @@ def cancel_migrate_reindex(arguments = {}) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "_migration/reindex/#{Utils.__listify(_index)}/_cancel" + path = "_migration/reindex/#{Utils.listify(_index)}/_cancel" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/clear_cache.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/clear_cache.rb index 0e214b6e4..c09d9a1f8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/clear_cache.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/clear_cache.rb @@ -15,26 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Clears all or specific caches for one or more indices. + # Clear the cache. + # Clear the cache of one or more indices. + # For data streams, the API clears the caches of the stream's backing indices. + # By default, the clear cache API clears all caches. + # To clear only specific caches, use the +fielddata+, +query+, or +request+ parameters. + # To clear the cache only of specific fields, use the +fields+ parameter. # - # @option arguments [List] :index A comma-separated list of index name to limit the operation - # @option arguments [Boolean] :fielddata Clear field data - # @option arguments [List] :fields A comma-separated list of fields to clear when using the `fielddata` parameter (default: all) - # @option arguments [Boolean] :query Clear query caches - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :request Clear request cache + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :fielddata If +true+, clears the fields cache. + # Use the +fields+ parameter to clear the cache of specific fields only. + # @option arguments [String, Array] :fields Comma-separated list of field names used to limit the +fielddata+ parameter. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :query If +true+, clears the query cache. + # @option arguments [Boolean] :request If +true+, clears the request cache. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clearcache.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-clear-cache # def clear_cache(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.clear_cache' } @@ -47,13 +59,13 @@ def clear_cache(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_cache/clear" + "#{Utils.listify(_index)}/_cache/clear" else '_cache/clear' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/clone.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/clone.rb index fd336f75e..cbf8386be 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/clone.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/clone.rb @@ -15,29 +15,62 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Clones an index + # Clone an index. + # Clone an existing index into a new index. + # Each original primary shard is cloned into a new primary shard in the new index. + # IMPORTANT: Elasticsearch does not apply index templates to the resulting index. + # The API also does not copy index metadata from the original index. + # Index metadata includes aliases, index lifecycle management phase definitions, and cross-cluster replication (CCR) follower information. + # For example, if you clone a CCR follower index, the resulting clone will not be a follower index. + # The clone API copies most index settings from the source index to the resulting index, with the exception of +index.number_of_replicas+ and +index.auto_expand_replicas+. + # To set the number of replicas in the resulting index, configure these settings in the clone request. + # Cloning works as follows: + # * First, it creates a new target index with the same definition as the source index. + # * Then it hard-links segments from the source index into the target index. If the file system does not support hard-linking, all segments are copied into the new index, which is a much more time consuming process. + # * Finally, it recovers the target index as though it were a closed index which had just been re-opened. + # IMPORTANT: Indices can only be cloned if they meet the following requirements: + # * The index must be marked as read-only and have a cluster health status of green. + # * The target index must not exist. + # * The source index must have the same number of primary shards as the target index. + # * The node handling the clone process must have sufficient free disk space to accommodate a second copy of the existing index. + # The current write index on a data stream cannot be cloned. + # In order to clone the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be cloned. + # NOTE: Mappings cannot be specified in the +_clone+ request. The mappings of the source index will be used for the target index. + # **Monitor the cloning process** + # The cloning process can be monitored with the cat recovery API or the cluster health API can be used to wait until all primary shards have been allocated by setting the +wait_for_status+ parameter to +yellow+. + # The +_clone+ API returns as soon as the target index has been added to the cluster state, before any shards have been allocated. + # At this point, all shards are in the state unassigned. + # If, for any reason, the target index can't be allocated, its primary shard will remain unassigned until it can be allocated on that node. + # Once the primary shard is allocated, it moves to state initializing, and the clone process begins. + # When the clone operation completes, the shard will become active. + # At that point, Elasticsearch will try to allocate any replicas and may decide to relocate the primary shard to another node. + # **Wait for active shards** + # Because the clone operation creates a new index to clone the shards to, the wait for active shards setting on index creation applies to the clone index action as well. # - # @option arguments [String] :index The name of the source index to clone - # @option arguments [String] :target The name of the target index to clone into - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [String] :wait_for_active_shards Set the number of active shards to wait for on the cloned index before the operation returns. + # @option arguments [String] :index Name of the source index to clone. (*Required*) + # @option arguments [String] :target Name of the target index to create. (*Required*) + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The configuration for the target index (`settings` and `aliases`) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-clone-index.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-clone # def clone(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.clone' } - defined_params = %i[index target].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :target].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -48,14 +81,14 @@ def clone(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) _target = arguments.delete(:target) method = Elasticsearch::API::HTTP_PUT - path = "#{Utils.__listify(_index)}/_clone/#{Utils.__listify(_target)}" + path = "#{Utils.listify(_index)}/_clone/#{Utils.listify(_target)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/close.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/close.rb index e3533f1a2..14590e6b7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/close.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/close.rb @@ -15,25 +15,45 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Closes an index. + # Close an index. + # A closed index is blocked for read or write operations and does not allow all operations that opened indices allow. + # It is not possible to index documents or to search for documents in a closed index. + # Closed indices do not have to maintain internal data structures for indexing or searching documents, which results in a smaller overhead on the cluster. + # When opening or closing an index, the master node is responsible for restarting the index shards to reflect the new state of the index. + # The shards will then go through the normal recovery process. + # The data of opened and closed indices is automatically replicated by the cluster to ensure that enough shard copies are safely kept around at all times. + # You can open and close multiple indices. + # An error is thrown if the request explicitly refers to a missing index. + # This behaviour can be turned off using the +ignore_unavailable=true+ parameter. + # By default, you must explicitly name the indices you are opening or closing. + # To open or close indices with +_all+, +*+, or other wildcard expressions, change the+action.destructive_requires_name+ setting to +false+. This setting can also be changed with the cluster update settings API. + # Closed indices consume a significant amount of disk-space which can cause problems in managed environments. + # Closing indices can be turned off with the cluster settings API by setting +cluster.indices.close.enable+ to +false+. # - # @option arguments [List] :index A comma separated list of indices to close - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [String] :wait_for_active_shards Sets the number of active shards to wait for before the operation returns. + # @option arguments [String, Array] :index Comma-separated list or wildcard expression of index names used to limit the request. (*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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-close # def close(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.close' } @@ -48,12 +68,12 @@ def close(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_close" + path = "#{Utils.listify(_index)}/_close" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/create.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/create.rb index 0135beabd..3fa8aff58 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/create.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/create.rb @@ -15,23 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Creates an index with optional settings and mappings. + # Create an index. + # You can use the create index API to add a new index to an Elasticsearch cluster. + # When creating an index, you can specify the following: + # * Settings for the index. + # * Mappings for fields in the index. + # * Index aliases + # **Wait for active shards** + # By default, index creation will only return a response to the client when the primary copies of each shard have been started, or the request times out. + # The index creation response will indicate what happened. + # For example, +acknowledged+ indicates whether the index was successfully created in the cluster, +while shards_acknowledged+ indicates whether the requisite number of shard copies were started for each shard in the index before timing out. + # Note that it is still possible for either +acknowledged+ or +shards_acknowledged+ to be +false+, but for the index creation to be successful. + # These values simply indicate whether the operation completed before the timeout. + # If +acknowledged+ is false, the request timed out before the cluster state was updated with the newly created index, but it probably will be created sometime soon. + # If +shards_acknowledged+ is false, then the request timed out before the requisite number of shards were started (by default just the primaries), even if the cluster state was successfully updated to reflect the newly created index (that is to say, +acknowledged+ is +true+). + # You can change the default of only waiting for the primary shards to start through the index setting +index.write.wait_for_active_shards+. + # Note that changing this setting will also affect the +wait_for_active_shards+ value on all subsequent write operations. # - # @option arguments [String] :index The name of the index - # @option arguments [String] :wait_for_active_shards Set the number of active shards to wait for before the operation returns. - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :index Name of the index you wish to create. (*Required*) + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The configuration for the index (`settings` and `mappings`) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-create-index.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create # def create(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.create' } @@ -46,12 +64,12 @@ def create(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_PUT - path = "#{Utils.__listify(_index)}" + path = Utils.listify(_index).to_s params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/create_data_stream.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/create_data_stream.rb index 66da1e830..7aad33de3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/create_data_stream.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/create_data_stream.rb @@ -15,21 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Creates a data stream + # Create a data stream. + # You must have a matching index template with data stream enabled. # - # @option arguments [String] :name The name of the data stream - # @option arguments [Time] :timeout Specify timeout for acknowledging the cluster state update - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :name Name of the data stream, which must meet the following criteria: + # Lowercase only; + # Cannot include +\+, +/+, +*+, +?+, +"+, +<+, +>+, +|+, +,+, +#+, +:+, or a space character; + # Cannot start with +-+, +_+, +++, or +.ds-+; + # Cannot be +.+ or +..+; + # Cannot be longer than 255 bytes. Multi-byte characters count towards this limit faster. (*Required*) + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-create-data-stream # def create_data_stream(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.create_data_stream' } @@ -49,7 +55,7 @@ def create_data_stream(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_data_stream/#{Utils.__listify(_name)}" + path = "_data_stream/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/create_from.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/create_from.rb index e3292b439..d57741f8a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/create_from.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/create_from.rb @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from commit dcb1c1df18a84a0182caa631b4577d89a4602cfe +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 # @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch @@ -39,9 +39,8 @@ module Actions def create_from(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.create_from' } - defined_params = [:source, :dest].inject({}) do |set_variables, variable| + defined_params = [:source, :dest].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -59,7 +58,7 @@ def create_from(arguments = {}) _dest = arguments.delete(:dest) method = Elasticsearch::API::HTTP_PUT - path = "_create_from/#{Utils.__listify(_source)}/#{Utils.__listify(_dest)}" + path = "_create_from/#{Utils.listify(_source)}/#{Utils.listify(_dest)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/data_streams_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/data_streams_stats.rb index 4d7087632..6ccf44420 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/data_streams_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/data_streams_stats.rb @@ -15,19 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Provides statistics on operations happening in a data stream. + # Get data stream stats. + # Get statistics for one or more data streams. # - # @option arguments [List] :name A comma-separated list of data stream names; use `_all` or empty string to perform the operation on all data streams + # @option arguments [String] :name Comma-separated list of data streams used to limit the request. + # Wildcard expressions (+*+) are supported. + # To target all data streams in a cluster, omit this parameter or use +*+. + # @option arguments [String, Array] :expand_wildcards Type of data stream that wildcard patterns can match. + # Supports comma-separated values, such as +open,hidden+. Server default: open. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-data-streams-stats-1 # def data_streams_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.data_streams_stats' } @@ -46,11 +51,11 @@ def data_streams_stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_data_stream/#{Utils.__listify(_name)}/_stats" + "_data_stream/#{Utils.listify(_name)}/_stats" else '_data_stream/_stats' end - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete.rb index bb53aaa0c..2337c5761 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete.rb @@ -15,24 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Deletes an index. + # Delete indices. + # Deleting an index deletes its documents, shards, and metadata. + # It does not delete related Kibana components, such as data views, visualizations, or dashboards. + # You cannot delete the current write index of a data stream. + # To delete the index, you must roll over the data stream so a new write index is created. + # You can then use the delete index API to delete the previous write index. # - # @option arguments [List] :index A comma-separated list of indices to delete; use `_all` or `*` string to delete all indices - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false) - # @option arguments [Boolean] :allow_no_indices Ignore if a wildcard expression resolves to no concrete indices (default: false) - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open, closed, or hidden indices (options: open, closed, hidden, none, all) + # @option arguments [String, Array] :index Comma-separated list of indices to delete. + # You cannot specify index aliases. + # By default, this parameter does not support wildcards (+*+) or +_all+. + # To use wildcards or +_all+, set the +action.destructive_requires_name+ cluster setting to +false+. (*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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete # def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.delete' } @@ -47,16 +61,16 @@ def delete(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_DELETE - path = "#{Utils.__listify(_index)}" + path = Utils.listify(_index).to_s params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_alias.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_alias.rb index abfd6ebed..7a3883460 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_alias.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_alias.rb @@ -15,27 +15,32 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Deletes an alias. + # Delete an alias. + # Removes a data stream or index from an alias. # - # @option arguments [List] :index A comma-separated list of index names (supports wildcards); use `_all` for all indices - # @option arguments [List] :name A comma-separated list of aliases to delete (supports wildcards); use `_all` to delete all aliases for the specified indices. - # @option arguments [Time] :timeout Explicit timestamp for the document - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String, Array] :index Comma-separated list of data streams or indices used to limit the request. + # Supports wildcards (+*+). (*Required*) + # @option arguments [String, Array] :name Comma-separated list of aliases to remove. + # Supports wildcards (+*+). To remove all aliases, use +*+ or +_all+. (*Required*) + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-alias # def delete_alias(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_alias' } - defined_params = %i[index name].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -46,14 +51,14 @@ def delete_alias(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = ("#{Utils.__listify(_index)}/_aliases/#{Utils.__listify(_name)}" if _index && _name) + path = ("#{Utils.listify(_index)}/_aliases/#{Utils.listify(_name)}" if _index && _name) params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_data_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_data_lifecycle.rb index a3dd50251..626e52370 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_data_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_data_lifecycle.rb @@ -15,22 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Deletes the data stream lifecycle of the selected data streams. + # Delete data stream lifecycles. + # Removes the data stream lifecycle from a data stream, rendering it not managed by the data stream lifecycle. # - # @option arguments [List] :name A comma-separated list of data streams of which the data stream lifecycle will be deleted; use `*` to get all data streams - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) - # @option arguments [Time] :timeout Explicit timestamp for the document + # @option arguments [String, Array] :name A comma-separated list of data streams of which the data stream lifecycle will be deleted; use +*+ to get all data streams (*Required*) + # @option arguments [String, Array] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [Time] :timeout Explicit timestamp for the document # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-delete-lifecycle.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-lifecycle # def delete_data_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_data_lifecycle' } @@ -50,7 +51,7 @@ def delete_data_lifecycle(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_data_stream/#{Utils.__listify(_name)}/_lifecycle" + path = "_data_stream/#{Utils.listify(_name)}/_lifecycle" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_data_stream.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_data_stream.rb index c773bbc37..d92701514 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_data_stream.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_data_stream.rb @@ -15,21 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Deletes a data stream. + # Delete data streams. + # Deletes one or more data streams and their backing indices. # - # @option arguments [List] :name A comma-separated list of data streams to delete; use `*` to delete all data streams - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String, Array] :name Comma-separated list of data streams to delete. Wildcard (+*+) expressions are supported. (*Required*) + # @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 [String, Array] :expand_wildcards Type of data stream that wildcard patterns can match. Supports comma-separated values,such as +open,hidden+. Server default: open. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-stream # def delete_data_stream(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_data_stream' } @@ -49,7 +50,7 @@ def delete_data_stream(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_data_stream/#{Utils.__listify(_name)}" + path = "_data_stream/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_index_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_index_template.rb index e4e20fad6..7a33af9e9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_index_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_index_template.rb @@ -15,21 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Deletes an index template. + # Delete an index template. + # The provided may contain multiple template names separated by a comma. If multiple template + # names are specified then there is no wildcard support and the provided names should match completely with + # existing templates. # - # @option arguments [String] :name The name of the template - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String, Array] :name Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. (*Required*) + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-template.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-index-template # def delete_index_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_index_template' } @@ -49,7 +52,7 @@ def delete_index_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_index_template/#{Utils.__listify(_name)}" + path = "_index_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_template.rb index ec10ca44a..e08e8914c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/delete_template.rb @@ -15,21 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Deletes an index template. + # Delete a legacy index template. # - # @option arguments [String] :name The name of the template - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :name The name of the legacy index template to delete. + # Wildcard (+*+) expressions are supported. (*Required*) + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-template-v1.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-template # def delete_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.delete_template' } @@ -49,11 +52,11 @@ def delete_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_template/#{Utils.__listify(_name)}" + path = "_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/disk_usage.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/disk_usage.rb index cd3308a1b..2ed7eba8d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/disk_usage.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/disk_usage.rb @@ -15,28 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Analyzes the disk usage of each field of an index or data stream + # Analyze the index disk usage. + # Analyze the disk usage of each field of an index or data stream. + # This API might not support indices created in previous Elasticsearch versions. + # The result of a small index can be inaccurate as some parts of an index might not be analyzed by the API. + # NOTE: The total size of fields of the analyzed shards of the index in the response is usually smaller than the index +store_size+ value because some small metadata files are ignored and some parts of data files might not be scanned by the API. + # Since stored fields are stored together in a compressed format, the sizes of stored fields are also estimates and can be inaccurate. + # The stored size of the +_id+ field is likely underestimated while the +_source+ field is overestimated. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :index Comma-separated list of indices or data streams to analyze the disk usage - # @option arguments [Boolean] :run_expensive_tasks Must be set to [true] in order for the task to be performed. Defaults to false. - # @option arguments [Boolean] :flush Whether flush or not before analyzing the index disk usage. Defaults to true - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. + # It’s recommended to execute this API with a single index (or the latest backing index of a data stream) as the API consumes resources significantly. (*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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. Server default: open. + # @option arguments [Boolean] :flush If +true+, the API performs a flush before analysis. + # If +false+, the response may not include uncommitted data. Server default: true. + # @option arguments [Boolean] :ignore_unavailable If +true+, missing or closed indices are not included in the response. + # @option arguments [Boolean] :run_expensive_tasks Analyzing field disk usage is resource-intensive. + # To use the API, this parameter must be set to +true+. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-disk-usage.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-disk-usage # def disk_usage(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.disk_usage' } @@ -51,12 +64,12 @@ def disk_usage(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_disk_usage" + path = "#{Utils.listify(_index)}/_disk_usage" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/downsample.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/downsample.rb index b08ac1ece..035dddf8c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/downsample.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/downsample.rb @@ -15,30 +15,36 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Downsample an index + # Downsample an index. + # Aggregate a time series (TSDS) index and store pre-computed statistical summaries (+min+, +max+, +sum+, +value_count+ and +avg+) for each metric field grouped by a configured time interval. + # For example, a TSDS index that contains metrics sampled every 10 seconds can be downsampled to an hourly index. + # All documents within an hour interval are summarized and stored as a single document in the downsample index. + # NOTE: Only indices in a time series data stream are supported. + # Neither field nor document level security can be defined on the source index. + # The source index must be read only (+index.blocks.write: true+). # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :index The index to downsample (*Required*) - # @option arguments [String] :target_index The name of the target index to store downsampled data (*Required*) + # @option arguments [String] :index Name of the time series index to downsample. (*Required*) + # @option arguments [String] :target_index Name of the index to create. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The downsampling configuration (*Required*) + # @option arguments [Hash] :body config # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-rollup.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-downsample # def downsample(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.downsample' } - defined_params = %i[index target_index].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :target_index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -50,14 +56,14 @@ def downsample(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) _target_index = arguments.delete(:target_index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_downsample/#{Utils.__listify(_target_index)}" + path = "#{Utils.listify(_index)}/_downsample/#{Utils.listify(_target_index)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists.rb index 34e9b34a5..bde6bd1d1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists.rb @@ -15,25 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns information about whether a particular index exists. + # Check indices. + # Check if one or more indices, index aliases, or data streams exist. # - # @option arguments [List] :index A comma-separated list of index names - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false) - # @option arguments [Boolean] :allow_no_indices Ignore if a wildcard expression resolves to no concrete indices (default: false) - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Boolean] :include_defaults Whether to return all default setting for each of the indices. + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases. Supports wildcards (+*+). (*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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :flat_settings If +true+, returns settings in flat format. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :include_defaults If +true+, return all default settings in the response. + # @option arguments [Boolean] :local If +true+, the request retrieves information from the local node only. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-exists.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists # def exists(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.exists' } @@ -48,15 +53,15 @@ def exists(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_HEAD - path = "#{Utils.__listify(_index)}" + path = Utils.listify(_index).to_s params = Utils.process_params(arguments) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do perform_request(method, path, params, body, headers, request_opts).status == 200 end end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_alias.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_alias.rb index dc414c862..283be9138 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_alias.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_alias.rb @@ -15,29 +15,36 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns information about whether a particular alias exists. + # Check aliases. + # Check if one or more data stream or index aliases exist. # - # @option arguments [List] :name A comma-separated list of alias names to return - # @option arguments [List] :index A comma-separated list of index names to filter aliases - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked + # @option arguments [String, Array] :name Comma-separated list of aliases to check. Supports wildcards (+*+). (*Required*) + # @option arguments [String, Array] :index Comma-separated list of data streams or indices used to limit the request. Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, requests that include a missing data stream or index in the target indices or data streams return an error. + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists-alias # def exists_alias(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.exists_alias' } - defined_params = %i[name index].each_with_object({}) do |variable, set_variables| + defined_params = [:name, :index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -55,13 +62,13 @@ def exists_alias(arguments = {}) method = Elasticsearch::API::HTTP_HEAD path = if _index && _name - "#{Utils.__listify(_index)}/_alias/#{Utils.__listify(_name)}" + "#{Utils.listify(_index)}/_alias/#{Utils.listify(_name)}" else - "_alias/#{Utils.__listify(_name)}" + "_alias/#{Utils.listify(_name)}" end params = Utils.process_params(arguments) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do perform_request(method, path, params, body, headers, request_opts).status == 200 end end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_index_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_index_template.rb index b7c2fbb12..b2cbdf23f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_index_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_index_template.rb @@ -15,22 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns information about whether a particular index template exists. + # Check index templates. + # Check whether index templates exist. # - # @option arguments [String] :name The name of the template - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) + # @option arguments [String] :name Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. (*Required*) + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists-index-template # def exists_index_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.exists_index_template' } @@ -50,7 +49,7 @@ def exists_index_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_HEAD - path = "_index_template/#{Utils.__listify(_name)}" + path = "_index_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_template.rb index 3593eed26..152fe44dd 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/exists_template.rb @@ -15,22 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns information about whether a particular index template exists. + # Check existence of index templates. + # Get information about whether index templates exist. + # Index templates define settings, mappings, and aliases that can be applied automatically to new indices. + # IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. # - # @option arguments [List] :name The comma separated names of the index templates - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated* + # @option arguments [String, Array] :name A comma-separated list of index template names used to limit the request. + # Wildcard (+*+) expressions are supported. (*Required*) + # @option arguments [Boolean] :flat_settings Indicates whether to use a flat format for the response. + # @option arguments [Boolean] :local Indicates whether to get information from the local node only. + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-template-exists-v1.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-exists-template # def exists_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.exists_template' } @@ -50,10 +56,10 @@ def exists_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_HEAD - path = "_template/#{Utils.__listify(_name)}" + path = "_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do perform_request(method, path, params, body, headers, request_opts).status == 200 end end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/explain_data_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/explain_data_lifecycle.rb index 8e5ceca25..3a431f872 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/explain_data_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/explain_data_lifecycle.rb @@ -15,21 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Retrieves information about the index's current data stream lifecycle, such as any potential encountered error, time since creation etc. + # Get the status for a data stream lifecycle. + # Get information about an index or data stream's current data stream lifecycle status, such as time since index creation, time since rollover, the lifecycle configuration managing the index, or any errors encountered during lifecycle execution. # - # @option arguments [String] :index The name of the index to explain + # @option arguments [String, Array] :index The name of the index to explain (*Required*) # @option arguments [Boolean] :include_defaults indicates if the API should return the default values the system uses for the index's lifecycle # @option arguments [Time] :master_timeout Specify timeout for connection to master # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-explain-lifecycle.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-explain-data-lifecycle # def explain_data_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.explain_data_lifecycle' } @@ -44,12 +45,12 @@ def explain_data_lifecycle(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_lifecycle/explain" + path = "#{Utils.listify(_index)}/_lifecycle/explain" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/field_usage_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/field_usage_stats.rb index aaac26351..f011c41b1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/field_usage_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/field_usage_stats.rb @@ -15,27 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns the field usage stats for each field of an index + # Get field usage stats. + # Get field usage information for each shard and field of an index. + # Field usage statistics are automatically captured when queries are running on a cluster. + # A shard-level search request that accesses a given field, even if multiple times during that request, is counted as a single use. + # The response body reports the per-shard usage count of the data structures that back the fields in the index. + # A given request will increment each count by a maximum value of 1, even if the request accesses the same field multiple times. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [List] :fields A comma-separated list of fields to include in the stats if only a subset of fields should be returned (supports wildcards) - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [String, Array] :index Comma-separated list or wildcard expression of index names used to limit the request. (*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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # @option arguments [Boolean] :ignore_unavailable If +true+, missing or closed indices are not included in the response. + # @option arguments [String, Array] :fields Comma-separated list or wildcard expressions of fields to include in the statistics. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to all or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/field-usage-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-field-usage-stats # def field_usage_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.field_usage_stats' } @@ -50,12 +61,12 @@ def field_usage_stats(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_field_usage_stats" + path = "#{Utils.listify(_index)}/_field_usage_stats" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/flush.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/flush.rb index 0e9258373..6aded9150 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/flush.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/flush.rb @@ -15,24 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Performs the flush operation on one or more indices. + # Flush data streams or indices. + # Flushing a data stream or index is the process of making sure that any data that is currently only stored in the transaction log is also permanently stored in the Lucene index. + # When restarting, Elasticsearch replays any unflushed operations from the transaction log into the Lucene index to bring it back into the state that it was in before the restart. + # Elasticsearch automatically triggers flushes as needed, using heuristics that trade off the size of the unflushed transaction log against the cost of performing each flush. + # After each operation has been flushed it is permanently stored in the Lucene index. + # This may mean that there is no need to maintain an additional copy of it in the transaction log. + # The transaction log is made up of multiple files, called generations, and Elasticsearch will delete any generation files when they are no longer needed, freeing up disk space. + # It is also possible to trigger a flush on one or more indices using the flush API, although it is rare for users to need to call this API directly. + # If you call the flush API after indexing some documents then a successful response indicates that Elasticsearch has flushed all the documents that were indexed before the flush API was called. # - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string for all indices - # @option arguments [Boolean] :force Whether a flush should be forced even if it is not necessarily needed ie. if no changes will be committed to the index. This is useful if transaction log IDs should be incremented even if no uncommitted changes are present. (This setting can be considered as internal) - # @option arguments [Boolean] :wait_if_ongoing If set to true the flush operation will block until the flush can be executed if another flush operation is already executing. The default is true. If set to false the flush will be skipped iff if another flush operation is already running. - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to flush. + # Supports wildcards (+*+). + # To flush all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :force If +true+, the request forces a flush even if there are no changes to commit to the index. Server default: true. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :wait_if_ongoing If +true+, the flush operation blocks until execution when another flush operation is running. + # If +false+, Elasticsearch returns an error if you request a flush when another flush operation is running. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-flush.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-flush # def flush(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.flush' } @@ -45,13 +60,13 @@ def flush(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_flush" + "#{Utils.listify(_index)}/_flush" else '_flush' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/forcemerge.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/forcemerge.rb index 6ea744edc..43d5b01fb 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/forcemerge.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/forcemerge.rb @@ -15,26 +15,64 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Performs the force merge operation on one or more indices. + # Force a merge. + # Perform the force merge operation on the shards of one or more indices. + # For data streams, the API forces a merge on the shards of the stream's backing indices. + # Merging reduces the number of segments in each shard by merging some of them together and also frees up the space used by deleted documents. + # Merging normally happens automatically, but sometimes it is useful to trigger a merge manually. + # WARNING: We recommend force merging only a read-only index (meaning the index is no longer receiving writes). + # When documents are updated or deleted, the old version is not immediately removed but instead soft-deleted and marked with a "tombstone". + # These soft-deleted documents are automatically cleaned up during regular segment merges. + # But force merge can cause very large (greater than 5 GB) segments to be produced, which are not eligible for regular merges. + # So the number of soft-deleted documents can then grow rapidly, resulting in higher disk usage and worse search performance. + # If you regularly force merge an index receiving writes, this can also make snapshots more expensive, since the new documents can't be backed up incrementally. + # **Blocks during a force merge** + # Calls to this API block until the merge is complete (unless request contains +wait_for_completion=false+). + # If the client connection is lost before completion then the force merge process will continue in the background. + # Any new requests to force merge the same indices will also block until the ongoing force merge is complete. + # **Running force merge asynchronously** + # If the request contains +wait_for_completion=false+, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to get the status of the task. + # However, you can not cancel this task as the force merge task is not cancelable. + # Elasticsearch creates a record of this task as a document at +_tasks/+. + # When you are done with a task, you should delete the task document so Elasticsearch can reclaim the space. + # **Force merging multiple indices** + # You can force merge multiple indices with a single request by targeting: + # * One or more data streams that contain multiple backing indices + # * Multiple indices + # * One or more aliases + # * All data streams and indices in a cluster + # Each targeted shard is force-merged separately using the force_merge threadpool. + # By default each node only has a single +force_merge+ thread which means that the shards on that node are force-merged one at a time. + # If you expand the +force_merge+ threadpool on a node then it will force merge its shards in parallel + # Force merge makes the storage for the shard being merged temporarily increase, as it may require free space up to triple its size in case +max_num_segments parameter+ is set to +1+, to rewrite all segments into a new one. + # **Data streams and time-based indices** + # Force-merging is useful for managing a data stream's older backing indices and other time-based indices, particularly after a rollover. + # In these cases, each index only receives indexing traffic for a certain period of time. + # Once an index receive no more writes, its shards can be force-merged to a single segment. + # This can be a good idea because single-segment shards can sometimes use simpler and more efficient data structures to perform searches. + # For example: + # + + # POST /.ds-my-data-stream-2099.03.07-000001/_forcemerge?max_num_segments=1 + # + # - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices + # @option arguments [String, Array] :index A comma-separated list of index names; use +_all+ or empty string to perform the operation on all indices + # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes +_all+ string or when no indices have been specified) + # @option arguments [String, Array] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. # @option arguments [Boolean] :flush Specify whether the index should be flushed after performing the operation (default: true) # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Number] :max_num_segments The number of segments the index should be merged into (default: dynamic) + # @option arguments [Integer] :max_num_segments The number of segments the index should be merged into (default: dynamic) # @option arguments [Boolean] :only_expunge_deletes Specify whether the operation should only expunge deleted documents # @option arguments [Boolean] :wait_for_completion Should the request wait until the force merge is completed. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-forcemerge.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-forcemerge # def forcemerge(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.forcemerge' } @@ -47,13 +85,13 @@ def forcemerge(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_forcemerge" + "#{Utils.listify(_index)}/_forcemerge" else '_forcemerge' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get.rb index 33836e4e6..421e1fce0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get.rb @@ -15,27 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns information about one or more indices. + # Get index information. + # Get information about one or more indices. For data streams, the API returns information about the + # stream’s backing indices. # - # @option arguments [List] :index A comma-separated list of index names - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false) - # @option arguments [Boolean] :allow_no_indices Ignore if a wildcard expression resolves to no concrete indices (default: false) - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) - # @option arguments [String] :features Return only information on specified index features (options: aliases, mappings, settings) - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Boolean] :include_defaults Whether to return all default setting for each of the indices. - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and index aliases used to limit the request. + # Wildcard expressions (*) are supported. (*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. This behavior applies even if the request targets other open indices. For example, + # a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard expressions can match. If the request can target data streams, this argument + # determines whether wildcard expressions match hidden data streams. Supports comma-separated values, + # such as open,hidden. Server default: open. + # @option arguments [Boolean] :flat_settings If true, returns settings in flat format. + # @option arguments [Boolean] :ignore_unavailable If false, requests that target a missing index return an error. + # @option arguments [Boolean] :include_defaults If true, return all default settings in the response. + # @option arguments [Boolean] :local If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + # @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 [String, Array] :features Return only information on specified index features Server default: ['aliases', 'mappings', 'settings']. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-index.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get # def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get' } @@ -50,12 +57,12 @@ def get(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}" + path = Utils.listify(_index).to_s params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_alias.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_alias.rb index a216dd6c1..63aef0ac6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_alias.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_alias.rb @@ -15,29 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns an alias. + # Get aliases. + # Retrieves information for one or more data stream or index aliases. # - # @option arguments [List] :name A comma-separated list of alias names to return - # @option arguments [List] :index A comma-separated list of index names to filter aliases - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked + # @option arguments [String, Array] :name Comma-separated list of aliases to retrieve. + # Supports wildcards (+*+). + # To retrieve all aliases, omit this parameter or use +*+ or +_all+. + # @option arguments [String, Array] :index Comma-separated list of data streams or indices used to limit the request. + # Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-alias # def get_alias(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_alias' } - defined_params = %i[name index].each_with_object({}) do |variable, set_variables| + defined_params = [:name, :index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,11 +63,11 @@ def get_alias(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _index && _name - "#{Utils.__listify(_index)}/_alias/#{Utils.__listify(_name)}" + "#{Utils.listify(_index)}/_alias/#{Utils.listify(_name)}" elsif _index - "#{Utils.__listify(_index)}/_alias" + "#{Utils.listify(_index)}/_alias" elsif _name - "_alias/#{Utils.__listify(_name)}" + "_alias/#{Utils.listify(_name)}" else '_alias' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_lifecycle.rb index a67585059..ac8b7fb06 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_lifecycle.rb @@ -15,22 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns the data stream lifecycle of the selected data streams. + # Get data stream lifecycles. + # Get the data stream lifecycle configuration of one or more data streams. # - # @option arguments [List] :name A comma-separated list of data streams to get; use `*` to get all data streams - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :include_defaults Return all relevant default configurations for the data stream (default: false) - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String, Array] :name Comma-separated list of data streams to limit the request. + # Supports wildcards (+*+). + # To target all data streams, omit this parameter or use +*+ or +_all+. (*Required*) + # @option arguments [String, Array] :expand_wildcards Type of data stream that wildcard patterns can match. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :include_defaults If +true+, return all default settings in the response. + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-get-lifecycle.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-lifecycle # def get_data_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_lifecycle' } @@ -50,7 +55,7 @@ def get_data_lifecycle(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_GET - path = "_data_stream/#{Utils.__listify(_name)}/_lifecycle" + path = "_data_stream/#{Utils.listify(_name)}/_lifecycle" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_lifecycle_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_lifecycle_stats.rb index 344698463..e2ac57055 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_lifecycle_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_lifecycle_stats.rb @@ -15,18 +15,19 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Get data stream lifecycle statistics. + # Get data stream lifecycle stats. + # Get statistics about the data streams that are managed by a data stream lifecycle. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-get-lifecycle-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-lifecycle-stats # def get_data_lifecycle_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_lifecycle_stats' } @@ -34,7 +35,7 @@ def get_data_lifecycle_stats(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_lifecycle/stats' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_stream.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_stream.rb index 5e1ff6ff0..9fef6445e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_stream.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_data_stream.rb @@ -15,23 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns data streams. + # Get data streams. + # Get information about one or more data streams. # - # @option arguments [List] :name A comma-separated list of data streams to get; use `*` to get all data streams - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :include_defaults Return all relevant default configurations for the data stream (default: false) - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :verbose Whether the maximum timestamp for each data stream should be calculated and returned (default: false) + # @option arguments [String, Array] :name Comma-separated list of data stream names used to limit the request. + # Wildcard (+*+) expressions are supported. If omitted, all data streams are returned. + # @option arguments [String, Array] :expand_wildcards Type of data stream that wildcard patterns can match. + # Supports comma-separated values, such as +open,hidden+. Server default: open. + # @option arguments [Boolean] :include_defaults If true, returns all relevant default configurations for the index template. + # @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 [Boolean] :verbose Whether the maximum timestamp for each data stream should be calculated and returned. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-data-stream # def get_data_stream(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_data_stream' } @@ -50,7 +53,7 @@ def get_data_stream(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_data_stream/#{Utils.__listify(_name)}" + "_data_stream/#{Utils.listify(_name)}" else '_data_stream' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_field_mapping.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_field_mapping.rb index a28f41d72..d9f2b8112 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_field_mapping.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_field_mapping.rb @@ -15,48 +15,59 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns mapping for one or more fields. + # Get mapping definitions. + # Retrieves mapping definitions for one or more fields. + # For data streams, the API retrieves field mappings for the stream’s backing indices. + # This API is useful if you don't need a complete mapping or if an index mapping contains a large number of fields. # - # @option arguments [List] :fields A comma-separated list of fields - # @option arguments [List] :index A comma-separated list of index names - # @option arguments [Boolean] :include_defaults Whether the default mapping values should be returned as well - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [String, Array] :fields Comma-separated list or wildcard expression of fields used to limit returned information. + # Supports wildcards (+*+). (*Required*) + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :include_defaults If +true+, return all default settings in the response. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping # def get_field_mapping(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_field_mapping' } - defined_params = %i[fields index].each_with_object({}) do |variable, set_variables| + defined_params = [:fields, :index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? - arguments = arguments.clone - _fields = arguments.delete(:field) || arguments.delete(:fields) - raise ArgumentError, "Required argument 'field' missing" unless _fields + raise ArgumentError, "Required argument 'fields' missing" unless arguments[:fields] + arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil + + _fields = arguments.delete(:fields) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index && _fields - "#{Utils.__listify(_index)}/_mapping/field/#{Utils.__listify(_fields)}" + "#{Utils.listify(_index)}/_mapping/field/#{Utils.listify(_fields)}" else - "_mapping/field/#{Utils.__listify(_fields)}" + "_mapping/field/#{Utils.listify(_fields)}" end params = Utils.process_params(arguments) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_index_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_index_template.rb index a56bd6080..b4115a1ed 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_index_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_index_template.rb @@ -15,23 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns an index template. + # Get index templates. + # Get information about one or more index templates. # - # @option arguments [String] :name A pattern that returned template names must match - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated* - # @option arguments [Boolean] :include_defaults Return all relevant default configurations for the index template (default: false) + # @option arguments [String] :name Comma-separated list of index template names used to limit the request. Wildcard (*) expressions are supported. + # @option arguments [Boolean] :local If true, the request retrieves information from the local node only. Defaults to false, which means information is retrieved from the master node. + # @option arguments [Boolean] :flat_settings If true, returns settings in flat format. + # @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 [Boolean] :include_defaults If true, returns all relevant default configurations for the index template. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-index-template # def get_index_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_index_template' } @@ -50,7 +51,7 @@ def get_index_template(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_index_template/#{Utils.__listify(_name)}" + "_index_template/#{Utils.listify(_name)}" else '_index_template' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_mapping.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_mapping.rb index 8160fd20b..4191b1389 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_mapping.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_mapping.rb @@ -15,24 +15,32 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns mappings for one or more indices. + # Get mapping definitions. + # For data streams, the API retrieves mappings for the stream’s backing indices. # - # @option arguments [List] :index A comma-separated list of index names - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated* + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :local If +true+, the request retrieves information from the local node only. + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-mapping # def get_mapping(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_mapping' } @@ -45,13 +53,13 @@ def get_mapping(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "#{Utils.__listify(_index)}/_mapping" + "#{Utils.listify(_index)}/_mapping" else '_mapping' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_migrate_reindex_status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_migrate_reindex_status.rb index de308edeb..60f6975b2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_migrate_reindex_status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_migrate_reindex_status.rb @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from commit dcb1c1df18a84a0182caa631b4577d89a4602cfe +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 # @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch @@ -37,9 +37,8 @@ module Actions def get_migrate_reindex_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_migrate_reindex_status' } - defined_params = [:index].inject({}) do |set_variables, variable| + defined_params = [:index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,7 +52,7 @@ def get_migrate_reindex_status(arguments = {}) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "_migration/reindex/#{Utils.__listify(_index)}/_status" + path = "_migration/reindex/#{Utils.listify(_index)}/_status" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_settings.rb index a38899192..fa21b7640 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_settings.rb @@ -15,32 +15,45 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns settings for one or more indices. + # Get index settings. + # Get setting information for one or more indices. + # For data streams, it returns setting information for the stream's backing indices. # - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [List] :name The name of the settings that should be included - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Boolean] :include_defaults Whether to return all default setting for each of the indices. + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit + # the request. Supports wildcards (+*+). To target all data streams and + # indices, omit this parameter or use +*+ or +_all+. + # @option arguments [String, Array] :name Comma-separated list or wildcard expression of settings to retrieve. + # @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. This + # behavior applies even if the request targets other open indices. For + # example, a request targeting +foo*,bar*+ returns an error if an index + # starts with foo but no index starts with +bar+. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. Server default: open. + # @option arguments [Boolean] :flat_settings If +true+, returns settings in flat format. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :include_defaults If +true+, return all default settings in the response. + # @option arguments [Boolean] :local If +true+, the request retrieves information from the local node only. If + # +false+, information is retrieved from the master node. + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-settings.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-settings # def get_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_settings' } - defined_params = %i[index name].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -48,7 +61,7 @@ def get_settings(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) @@ -56,11 +69,11 @@ def get_settings(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _index && _name - "#{Utils.__listify(_index)}/_settings/#{Utils.__listify(_name)}" + "#{Utils.listify(_index)}/_settings/#{Utils.listify(_name)}" elsif _index - "#{Utils.__listify(_index)}/_settings" + "#{Utils.listify(_index)}/_settings" elsif _name - "_settings/#{Utils.__listify(_name)}" + "_settings/#{Utils.listify(_name)}" else '_settings' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_template.rb index 8c15a38ae..53a503cc3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/get_template.rb @@ -15,22 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns an index template. + # Get index templates. + # Get information about one or more index templates. + # IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. # - # @option arguments [List] :name The comma separated names of the index templates - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated* + # @option arguments [String, Array] :name Comma-separated list of index template names used to limit the request. + # Wildcard (+*+) expressions are supported. + # To return all index templates, omit this parameter or use a value of +_all+ or +*+. + # @option arguments [Boolean] :flat_settings If +true+, returns settings in flat format. + # @option arguments [Boolean] :local If +true+, the request retrieves information from the local node only. + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-template-v1.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-get-template # def get_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.get_template' } @@ -49,7 +54,7 @@ def get_template(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_template/#{Utils.__listify(_name)}" + "_template/#{Utils.listify(_name)}" else '_template' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/migrate_reindex.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/migrate_reindex.rb index de5cc44e6..3e4a7eb87 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/migrate_reindex.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/migrate_reindex.rb @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from commit dcb1c1df18a84a0182caa631b4577d89a4602cfe +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 # @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch @@ -47,7 +47,7 @@ def migrate_reindex(arguments = {}) body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST - path = "_migration/reindex" + path = '_migration/reindex' params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/migrate_to_data_stream.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/migrate_to_data_stream.rb index 7b70036ce..0cd003cac 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/migrate_to_data_stream.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/migrate_to_data_stream.rb @@ -15,21 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Migrates an alias to a data stream + # Convert an index alias to a data stream. + # Converts an index alias to a data stream. + # You must have a matching index template that is data stream enabled. + # The alias must meet the following criteria: + # The alias must have a write index; + # All indices for the alias must have a +@timestamp+ field mapping of a +date+ or +date_nanos+ field type; + # The alias must not have any filters; + # The alias must not use custom routing. + # If successful, the request removes the alias and creates a data stream with the same name. + # The indices for the alias become hidden backing indices for the stream. + # The write index for the alias becomes the write index for the stream. # - # @option arguments [String] :name The name of the alias to migrate - # @option arguments [Time] :timeout Specify timeout for acknowledging the cluster state update - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :name Name of the index alias to convert to a data stream. (*Required*) + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-migrate-to-data-stream # def migrate_to_data_stream(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.migrate_to_data_stream' } @@ -49,7 +59,7 @@ def migrate_to_data_stream(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_POST - path = "_data_stream/_migrate/#{Utils.__listify(_name)}" + path = "_data_stream/_migrate/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/modify_data_stream.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/modify_data_stream.rb index eb8dedc08..157e34c6b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/modify_data_stream.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/modify_data_stream.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Modifies a data stream + # Update data streams. + # Performs one or more data stream modification actions in a single atomic operation. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The data stream modifications (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-modify-data-stream # def modify_data_stream(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.modify_data_stream' } @@ -37,7 +38,7 @@ def modify_data_stream(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_data_stream/_modify' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/open.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/open.rb index b1b6844cc..dca7644c6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/open.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/open.rb @@ -15,25 +15,52 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Opens an index. + # Open a closed index. + # For data streams, the API opens any closed backing indices. + # A closed index is blocked for read/write operations and does not allow all operations that opened indices allow. + # It is not possible to index documents or to search for documents in a closed index. + # This allows closed indices to not have to maintain internal data structures for indexing or searching documents, resulting in a smaller overhead on the cluster. + # When opening or closing an index, the master is responsible for restarting the index shards to reflect the new state of the index. + # The shards will then go through the normal recovery process. + # The data of opened or closed indices is automatically replicated by the cluster to ensure that enough shard copies are safely kept around at all times. + # You can open and close multiple indices. + # An error is thrown if the request explicitly refers to a missing index. + # This behavior can be turned off by using the +ignore_unavailable=true+ parameter. + # By default, you must explicitly name the indices you are opening or closing. + # To open or close indices with +_all+, +*+, or other wildcard expressions, change the +action.destructive_requires_name+ setting to +false+. + # This setting can also be changed with the cluster update settings API. + # Closed indices consume a significant amount of disk-space which can cause problems in managed environments. + # Closing indices can be turned off with the cluster settings API by setting +cluster.indices.close.enable+ to +false+. + # Because opening or closing an index allocates its shards, the +wait_for_active_shards+ setting on index creation applies to the +_open+ and +_close+ index actions as well. # - # @option arguments [List] :index A comma separated list of indices to open - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [String] :wait_for_active_shards Sets the number of active shards to wait for before the operation returns. + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). + # By default, you must explicitly name the indices you using to limit the request. + # To limit a request using +_all+, +*+, or other wildcard expressions, change the +action.destructive_requires_name+ setting to false. + # You can update this setting in the +elasticsearch.yml+ file or using the cluster update settings API. (*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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-open-close.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-open # def open(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.open' } @@ -48,12 +75,12 @@ def open(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_open" + path = "#{Utils.listify(_index)}/_open" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/promote_data_stream.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/promote_data_stream.rb index 1a55479ee..a60371738 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/promote_data_stream.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/promote_data_stream.rb @@ -15,20 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Promotes a data stream from a replicated data stream managed by CCR to a regular data stream + # Promote a data stream. + # Promote a data stream from a replicated data stream managed by cross-cluster replication (CCR) to a regular data stream. + # With CCR auto following, a data stream from a remote cluster can be replicated to the local cluster. + # These data streams can't be rolled over in the local cluster. + # These replicated data streams roll over only if the upstream data stream rolls over. + # In the event that the remote cluster is no longer available, the data stream in the local cluster can be promoted to a regular data stream, which allows these data streams to be rolled over in the local cluster. + # NOTE: When promoting a data stream, ensure the local cluster has a data stream enabled index template that matches the data stream. + # If this is missing, the data stream will not be able to roll over until a matching index template is created. + # This will affect the lifecycle management of the data stream and interfere with the data stream size and retention. # - # @option arguments [String] :name The name of the data stream - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :name The name of the data stream (*Required*) + # @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 [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-promote-data-stream # def promote_data_stream(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.promote_data_stream' } @@ -48,7 +56,7 @@ def promote_data_stream(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_POST - path = "_data_stream/_promote/#{Utils.__listify(_name)}" + path = "_data_stream/_promote/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_alias.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_alias.rb index d18dce338..7548a38c8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_alias.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_alias.rb @@ -15,28 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Creates or updates an alias. + # Create or update an alias. + # Adds a data stream or index to an alias. # - # @option arguments [List] :index A comma-separated list of index names the alias should point to (supports wildcards); use `_all` to perform the operation on all indices. - # @option arguments [String] :name The name of the alias to be created or updated - # @option arguments [Time] :timeout Explicit timestamp for the document - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String, Array] :index Comma-separated list of data streams or indices to add. + # Supports wildcards (+*+). + # Wildcard patterns that match both data streams and indices return an error. (*Required*) + # @option arguments [String] :name Alias to update. + # If the alias doesn’t exist, the request creates it. + # Index alias names support date math. (*Required*) + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The settings for the alias, such as `routing` or `filter` + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-alias # def put_alias(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.put_alias' } - defined_params = %i[index name].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -47,14 +54,14 @@ def put_alias(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = ("#{Utils.__listify(_index)}/_aliases/#{Utils.__listify(_name)}" if _index && _name) + path = ("#{Utils.listify(_index)}/_aliases/#{Utils.listify(_name)}" if _index && _name) params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_data_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_data_lifecycle.rb index 2f03fa0bd..1843ecc83 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_data_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_data_lifecycle.rb @@ -15,23 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Updates the data stream lifecycle of the selected data streams. + # Update data stream lifecycles. + # Update the data stream lifecycle of the specified data streams. # - # @option arguments [List] :name A comma-separated list of data streams whose lifecycle will be updated; use `*` to set the lifecycle to all data streams - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) - # @option arguments [Time] :timeout Explicit timestamp for the document - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String, Array] :name Comma-separated list of data streams used to limit the request. + # Supports wildcards (+*+). + # To target all data streams use +*+ or +_all+. (*Required*) + # @option arguments [String, Array] :expand_wildcards Type of data stream that wildcard patterns can match. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +hidden+, +open+, +closed+, +none+. Server default: open. + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The data stream lifecycle configuration that consist of the data retention + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/data-streams-put-lifecycle.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-lifecycle # def put_data_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.put_data_lifecycle' } @@ -51,7 +59,7 @@ def put_data_lifecycle(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_data_stream/#{Utils.__listify(_name)}/_lifecycle" + path = "_data_stream/#{Utils.listify(_name)}/_lifecycle" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_index_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_index_template.rb index 061f55edb..0c8a5784e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_index_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_index_template.rb @@ -15,23 +15,44 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Creates or updates an index template. + # Create or update an index template. + # Index templates define settings, mappings, and aliases that can be applied automatically to new indices. + # Elasticsearch applies templates to new indices based on an wildcard pattern that matches the index name. + # Index templates are applied during data stream or index creation. + # For data streams, these settings and mappings are applied when the stream's backing indices are created. + # Settings and mappings specified in a create index API request override any settings or mappings specified in an index template. + # Changes to index templates do not affect existing indices, including the existing backing indices of a data stream. + # You can use C-style +/* *\/+ block comments in index templates. + # You can include comments anywhere in the request body, except before the opening curly bracket. + # **Multiple matching templates** + # If multiple index templates match the name of a new index or data stream, the template with the highest priority is used. + # Multiple templates with overlapping index patterns at the same priority are not allowed and an error will be thrown when attempting to create a template matching an existing index template at identical priorities. + # **Composing aliases, mappings, and settings** + # When multiple component templates are specified in the +composed_of+ field for an index template, they are merged in the order specified, meaning that later component templates override earlier component templates. + # Any mappings, settings, or aliases from the parent index template are merged in next. + # Finally, any configuration on the index request itself is merged. + # Mapping definitions are merged recursively, which means that later mapping components can introduce new field mappings and update the mapping configuration. + # If a field mapping is already contained in an earlier component, its definition will be completely overwritten by the later one. + # This recursive merging strategy applies not only to field mappings, but also root options like +dynamic_templates+ and +meta+. + # If an earlier component contains a +dynamic_templates+ block, then by default new +dynamic_templates+ entries are appended onto the end. + # If an entry already exists with the same key, then it is overwritten by the new definition. # - # @option arguments [String] :name The name of the template - # @option arguments [Boolean] :create Whether the index template should only be added if new or can also replace an existing one + # @option arguments [String] :name Index or template name (*Required*) + # @option arguments [Boolean] :create If +true+, this request cannot replace or update existing index templates. + # @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 [String] :cause User defined reason for creating/updating the index template - # @option arguments [Time] :master_timeout Specify timeout for connection to master # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The template definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-template.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template # def put_index_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.put_index_template' } @@ -52,7 +73,7 @@ def put_index_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_index_template/#{Utils.__listify(_name)}" + path = "_index_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( 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 c0c85affa..a92869277 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_mapping.rb @@ -15,26 +15,51 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Updates the index mappings. + # Update field mappings. + # Add new fields to an existing data stream or index. + # You can also use this API to change the search settings of existing fields and add new properties to existing object fields. + # For data streams, these changes are applied to all backing indices by default. + # **Add multi-fields to an existing field** + # Multi-fields let you index the same field in different ways. + # You can use this API to update the fields mapping parameter and enable multi-fields for an existing field. + # WARNING: If an index (or data stream) contains documents when you add a multi-field, those documents will not have values for the new multi-field. + # You can populate the new multi-field with the update by query API. + # **Change supported mapping parameters for an existing field** + # The documentation for each mapping parameter indicates whether you can update it for an existing field using this API. + # For example, you can use the update mapping API to update the +ignore_above+ parameter. + # **Change the mapping of an existing field** + # Except for supported mapping parameters, you can't change the mapping or field type of an existing field. + # Changing an existing field could invalidate data that's already indexed. + # If you need to change the mapping of a field in a data stream's backing indices, refer to documentation about modifying data streams. + # If you need to change the mapping of a field in other indices, create a new index with the correct mapping and reindex your data into that index. + # **Rename a field** + # Renaming a field would invalidate data already indexed under the old field name. + # Instead, add an alias field to create an alternate field name. # - # @option arguments [List] :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. - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :write_index_only When true, applies mappings only to the write index of an alias or data stream + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Boolean] :write_index_only If +true+, the mappings are applied only to the current write index for the target. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The mapping definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-mapping # def put_mapping(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.put_mapping' } @@ -50,12 +75,12 @@ def put_mapping(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_PUT - path = "#{Utils.__listify(_index)}/_mapping" + path = "#{Utils.listify(_index)}/_mapping" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_settings.rb index 887c817ab..7b4802d47 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_settings.rb @@ -15,28 +15,52 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Updates the index settings. + # Update index settings. + # Changes dynamic index settings in real time. + # For data streams, index setting changes are applied to all backing indices by default. + # To revert a setting to the default value, use a null value. + # The list of per-index settings that can be updated dynamically on live indices can be found in index module documentation. + # To preserve existing settings from being updated, set the +preserve_existing+ parameter to +true+. + # NOTE: You can only define new analyzers on closed indices. + # To add an analyzer, you must close the index, define the analyzer, and reopen the index. + # You cannot close the write index of a data stream. + # To update the analyzer for a data stream's write index and future backing indices, update the analyzer in the index template used by the stream. + # Then roll over the data stream to apply the new analyzer to the stream's write index and future backing indices. + # This affects searches and any new data added to the stream after the rollover. + # However, it does not affect the data stream's backing indices or their existing data. + # To change the analyzer for existing backing indices, you must create a new data stream and reindex your data into it. # - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Boolean] :preserve_existing Whether to update existing settings. If set to `true` existing settings on an index remain unchanged, the default is `false` - # @option arguments [Boolean] :reopen Whether to close and reopen the index to apply non-dynamic settings. If set to `true` the indices to which the settings are being applied will be closed temporarily and then reopened in order to apply the changes. The default is `false` - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit + # the request. Supports wildcards (+*+). To target all data streams and + # indices, omit this parameter or use +*+ or +_all+. + # @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. This + # behavior applies even if the request targets other open indices. For + # example, a request targeting +foo*,bar*+ returns an error if an index + # starts with +foo+ but no index starts with +bar+. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. If the request can target + # data streams, this argument determines whether wildcard expressions match + # hidden data streams. Supports comma-separated values, such as + # +open,hidden+. Server default: open. + # @option arguments [Boolean] :flat_settings If +true+, returns settings in flat format. + # @option arguments [Boolean] :ignore_unavailable If +true+, returns settings in flat format. + # @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 [Boolean] :preserve_existing If +true+, existing index settings remain unchanged. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the + # timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The index settings to be updated (*Required*) + # @option arguments [Hash] :body settings # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-update-settings.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-settings # def put_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.put_settings' } @@ -51,13 +75,13 @@ def put_settings(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_PUT path = if _index - "#{Utils.__listify(_index)}/_settings" + "#{Utils.listify(_index)}/_settings" else '_settings' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_template.rb index 93888e523..1a8402419 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/put_template.rb @@ -15,23 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Creates or updates an index template. + # Create or update an index template. + # Index templates define settings, mappings, and aliases that can be applied automatically to new indices. + # Elasticsearch applies templates to new indices based on an index pattern that matches the index name. + # IMPORTANT: This documentation is about legacy index templates, which are deprecated and will be replaced by the composable templates introduced in Elasticsearch 7.8. + # Composable templates always take precedence over legacy templates. + # If no composable template matches a new index, matching legacy templates are applied according to their order. + # Index templates are only applied during index creation. + # Changes to index templates do not affect existing indices. + # Settings and mappings specified in create index API requests override any settings or mappings specified in an index template. + # You can use C-style +/* *\/+ block comments in index templates. + # You can include comments anywhere in the request body, except before the opening curly bracket. + # **Indices matching multiple templates** + # Multiple index templates can potentially match an index, in this case, both the settings and mappings are merged into the final configuration of the index. + # The order of the merging can be controlled using the order parameter, with lower order being applied first, and higher orders overriding them. + # NOTE: Multiple matching templates with the same order value will result in a non-deterministic merging order. # - # @option arguments [String] :name The name of the template - # @option arguments [Number] :order The order for this template when merging multiple matching ones (higher numbers are merged later, overriding the lower numbers) - # @option arguments [Boolean] :create Whether the index template should only be added if new or can also replace an existing one - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :name The name of the template (*Required*) + # @option arguments [Boolean] :create If true, this request cannot replace or update existing index templates. + # @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 [Integer] :order Order in which Elasticsearch applies this template if index + # matches multiple templates.Templates with lower 'order' values are merged first. Templates with higher + # 'order' values are merged later, overriding templates with lower values. + # @option arguments [String] :cause [TODO] # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The template definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates-v1.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-template # def put_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.put_template' } @@ -52,7 +70,7 @@ def put_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_template/#{Utils.__listify(_name)}" + path = "_template/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/recovery.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/recovery.rb index c599681e9..ce0969b78 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/recovery.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/recovery.rb @@ -15,21 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns information about ongoing index shard recoveries. + # Get index recovery information. + # Get information about ongoing and completed shard recoveries for one or more indices. + # For data streams, the API returns information for the stream's backing indices. + # All recoveries, whether ongoing or complete, are kept in the cluster state and may be reported on at any time. + # Shard recovery is the process of initializing a shard copy, such as restoring a primary shard from a snapshot or creating a replica shard from a primary shard. + # When a shard recovery completes, the recovered shard is available for search and indexing. + # Recovery automatically occurs during the following processes: + # * When creating an index for the first time. + # * When a node rejoins the cluster and starts up any missing primary shard copies using the data that it holds in its data path. + # * Creation of new replica shard copies from the primary. + # * Relocation of a shard copy to a different node in the same cluster. + # * A snapshot restore operation. + # * A clone, shrink, or split operation. + # You can determine the cause of a shard recovery using the recovery or cat recovery APIs. + # The index recovery API reports information about completed recoveries only for shard copies that currently exist in the cluster. + # It only reports the last recovery for each shard copy and does not report historical information about earlier recoveries, nor does it report information about the recoveries of shard copies that no longer exist. + # This means that if a shard copy completes a recovery and then Elasticsearch relocates it onto a different node then the information about the original recovery will not be shown in the recovery API. # - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [Boolean] :detailed Whether to display detailed information about shard recovery - # @option arguments [Boolean] :active_only Display only those recoveries that are currently on-going + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @option arguments [Boolean] :active_only If +true+, the response only includes ongoing shard recoveries. + # @option arguments [Boolean] :detailed If +true+, the response includes detailed information about shard recoveries. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-recovery.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-recovery # def recovery(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.recovery' } @@ -42,13 +60,13 @@ def recovery(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "#{Utils.__listify(_index)}/_recovery" + "#{Utils.listify(_index)}/_recovery" else '_recovery' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/refresh.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/refresh.rb index 732d10d41..286063149 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/refresh.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/refresh.rb @@ -15,22 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Performs the refresh operation in one or more indices. + # Refresh an index. + # A refresh makes recent operations performed on one or more indices available for search. + # For data streams, the API runs the refresh operation on the stream’s backing indices. + # By default, Elasticsearch periodically refreshes indices every second, but only on indices that have received one search request or more in the last 30 seconds. + # You can change this default interval with the +index.refresh_interval+ setting. + # Refresh requests are synchronous and do not return a response until the refresh operation completes. + # Refreshes are resource-intensive. + # To ensure good cluster performance, it's recommended to wait for Elasticsearch's periodic refresh rather than performing an explicit refresh when possible. + # If your application workflow indexes documents and then runs a search to retrieve the indexed document, it's recommended to use the index API's +refresh=wait_for+ query parameter option. + # This option ensures the indexing operation waits for a periodic refresh before running the search. # - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-refresh # def refresh(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.refresh' } @@ -43,13 +58,13 @@ def refresh(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_refresh" + "#{Utils.listify(_index)}/_refresh" else '_refresh' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/reload_search_analyzers.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/reload_search_analyzers.rb index 3fb1dcf41..dc84b403e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/reload_search_analyzers.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/reload_search_analyzers.rb @@ -15,23 +15,32 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Reloads an index's search analyzers and their resources. + # Reload search analyzers. + # Reload an index's search analyzers and their resources. + # For data streams, the API reloads search analyzers and resources for the stream's backing indices. + # IMPORTANT: After reloading the search analyzers you should clear the request cache to make sure it doesn't contain responses derived from the previous versions of the analyzer. + # You can use the reload search analyzers API to pick up changes to synonym files used in the +synonym_graph+ or +synonym+ token filter of a search analyzer. + # To be eligible, the token filter must have an +updateable+ flag of +true+ and only be used in search analyzers. + # NOTE: This API does not perform a reload for each shard of an index. + # Instead, it performs a reload for each node containing index shards. + # As a result, the total shard count returned by the API can differ from the number of index shards. + # Because reloading affects every node with an index shard, it is important to update the synonym file on every data node in the cluster--including nodes that don't contain a shard replica--before using this API. + # This ensures the synonym file is updated everywhere in the cluster in case shards are relocated in the future. # - # @option arguments [List] :index A comma-separated list of index names to reload analyzers for + # @option arguments [String, Array] :index A comma-separated list of index names to reload analyzers for (*Required*) + # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes +_all+ string or when no indices have been specified) + # @option arguments [String, Array] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [String] :resource changed resource to reload analyzers from if applicable # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-reload-analyzers.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-reload-search-analyzers # def reload_search_analyzers(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.reload_search_analyzers' } @@ -46,12 +55,12 @@ def reload_search_analyzers(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET - path = "#{Utils.__listify(_index)}/_reload_search_analyzers" + path = "#{Utils.listify(_index)}/_reload_search_analyzers" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/resolve_cluster.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/resolve_cluster.rb index 805528068..4b7c8cd61 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/resolve_cluster.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/resolve_cluster.rb @@ -15,24 +15,72 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Resolves the specified index expressions to return information about each cluster. If no index expression is provided, this endpoint will return information about all the remote clusters that are configured on the local cluster. + # Resolve the cluster. + # Resolve the specified index expressions to return information about each cluster, including the local "querying" cluster, if included. + # If no index expression is provided, the API will return information about all the remote clusters that are configured on the querying cluster. + # This endpoint is useful before doing a cross-cluster search in order to determine which remote clusters should be included in a search. + # You use the same index expression with this endpoint as you would for cross-cluster search. + # Index and cluster exclusions are also supported with this endpoint. + # For each cluster in the index expression, information is returned about: + # * Whether the querying ("local") cluster is currently connected to each remote cluster specified in the index expression. Note that this endpoint actively attempts to contact the remote clusters, unlike the +remote/info+ endpoint. + # * Whether each remote cluster is configured with +skip_unavailable+ as +true+ or +false+. + # * Whether there are any indices, aliases, or data streams on that cluster that match the index expression. + # * Whether the search is likely to have errors returned when you do the cross-cluster search (including any authorization errors if you do not have permission to query the index). + # * Cluster version information, including the Elasticsearch server version. + # For example, +GET /_resolve/cluster/my-index-*,cluster*:my-index-*+ returns information about the local cluster and all remotely configured clusters that start with the alias +cluster*+. + # Each cluster returns information about whether it has any indices, aliases or data streams that match +my-index-*+.The ability to query without an index expression was added in version 8.18, so when + # querying remote clusters older than that, the local cluster will send the index + # expression +dummy*+ to those remote clusters. Thus, if an errors occur, you may see a reference + # to that index expression even though you didn't request it. If it causes a problem, you can + # instead include an index expression like +*:*+ to bypass the issue.You may want to exclude a cluster or index from a search when: + # * A remote cluster is not currently connected and is configured with +skip_unavailable=false+. Running a cross-cluster search under those conditions will cause the entire search to fail. + # * A cluster has no matching indices, aliases or data streams for the index expression (or your user does not have permissions to search them). For example, suppose your index expression is +logs*,remote1:logs*+ and the remote1 cluster has no indices, aliases or data streams that match +logs*+. In that case, that cluster will return no results from that cluster if you include it in a cross-cluster search. + # * The index expression (combined with any query parameters you specify) will likely cause an exception to be thrown when you do the search. In these cases, the "error" field in the +_resolve/cluster+ response will be present. (This is also where security/permission errors will be shown.) + # * A remote cluster is an older version that does not support the feature you want to use in your search.The +remote/info+ endpoint is commonly used to test whether the "local" cluster (the cluster being queried) is connected to its remote clusters, but it does not necessarily reflect whether the remote cluster is available or not. + # The remote cluster may be available, while the local cluster is not currently connected to it. + # You can use the +_resolve/cluster+ API to attempt to reconnect to remote clusters. + # For example with +GET _resolve/cluster+ or +GET _resolve/cluster/*:*+. + # The +connected+ field in the response will indicate whether it was successful. + # If a connection was (re-)established, this will also cause the +remote/info+ endpoint to now indicate a connected status. # - # @option arguments [List] :name A comma-separated list of cluster:index names or wildcard expressions - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed). Only allowed when providing an index expression. - # @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled. Only allowed when providing an index expression. - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). Only allowed when providing an index expression. - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open). Only allowed when providing an index expression. (options: open, closed, hidden, none, all) - # @option arguments [Time] :timeout The maximum time to wait for remote clusters to respond + # @option arguments [String, Array] :name A comma-separated list of names or index patterns for the indices, aliases, and data streams to resolve. + # Resources on remote clusters can be specified using the ++:++ syntax. + # Index and cluster exclusions (e.g., +-cluster1:*+) are also supported. + # If no index expression is specified, information about all remote clusters configured on the local cluster + # is returned without doing any index matching + # @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. This behavior applies even if the request targets other open indices. For example, a request + # targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. + # NOTE: This option is only supported when specifying an index expression. You will get an error if you specify index + # options to the +_resolve/cluster+ API endpoint that takes no index expression. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. + # NOTE: This option is only supported when specifying an index expression. You will get an error if you specify index + # options to the +_resolve/cluster+ API endpoint that takes no index expression. Server default: open. + # @option arguments [Boolean] :ignore_throttled If true, concrete, expanded, or aliased indices are ignored when frozen. + # NOTE: This option is only supported when specifying an index expression. You will get an error if you specify index + # options to the +_resolve/cluster+ API endpoint that takes no index expression. + # @option arguments [Boolean] :ignore_unavailable If false, the request returns an error if it targets a missing or closed index. + # NOTE: This option is only supported when specifying an index expression. You will get an error if you specify index + # options to the +_resolve/cluster+ API endpoint that takes no index expression. + # @option arguments [Time] :timeout The maximum time to wait for remote clusters to respond. + # If a remote cluster does not respond within this timeout period, the API response + # will show the cluster as not connected and include an error message that the + # request timed out.The default timeout is unset and the query can take + # as long as the networking layer is configured to wait for remote clusters that are + # not responding (typically 30 seconds). # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-resolve-cluster-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-resolve-cluster # def resolve_cluster(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.resolve_cluster' } @@ -51,7 +99,7 @@ def resolve_cluster(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_resolve/cluster/#{Utils.__listify(_name)}" + "_resolve/cluster/#{Utils.listify(_name)}" else '_resolve/cluster' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/resolve_index.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/resolve_index.rb index 9c6e38013..b2aeac394 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/resolve_index.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/resolve_index.rb @@ -15,22 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Returns information about any matching indices, aliases, and data streams + # Resolve indices. + # Resolve the names and/or index patterns for indices, aliases, and data streams. + # Multiple patterns and remote clusters are supported. # - # @option arguments [List] :name A comma-separated list of names or wildcard expressions - # @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) + # @option arguments [String, Array] :name Comma-separated name(s) or index pattern(s) of the indices, aliases, and data streams to resolve. + # Resources on remote clusters can be specified using the ++:++ syntax. (*Required*) + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-resolve-index-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-resolve-index # def resolve_index(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.resolve_index' } @@ -50,7 +58,7 @@ def resolve_index(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_GET - path = "_resolve/index/#{Utils.__listify(_name)}" + path = "_resolve/index/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/rollover.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/rollover.rb index fe1c79258..3d2aea201 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/rollover.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/rollover.rb @@ -15,32 +15,60 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Updates an alias to point to a new index when the existing index - # is considered to be too large or too old. + # Roll over to a new index. + # TIP: It is recommended to use the index lifecycle rollover action to automate rollovers. + # The rollover API creates a new index for a data stream or index alias. + # The API behavior depends on the rollover target. + # **Roll over a data stream** + # If you roll over a data stream, the API creates a new write index for the stream. + # The stream's previous write index becomes a regular backing index. + # A rollover also increments the data stream's generation. + # **Roll over an index alias with a write index** + # TIP: Prior to Elasticsearch 7.9, you'd typically use an index alias with a write index to manage time series data. + # Data streams replace this functionality, require less maintenance, and automatically integrate with data tiers. + # If an index alias points to multiple indices, one of the indices must be a write index. + # The rollover API creates a new write index for the alias with +is_write_index+ set to +true+. + # The API also +sets is_write_index+ to +false+ for the previous write index. + # **Roll over an index alias with one index** + # If you roll over an index alias that points to only one index, the API creates a new index for the alias and removes the original index from the alias. + # NOTE: A rollover creates a new index and is subject to the +wait_for_active_shards+ setting. + # **Increment index names for an alias** + # When you roll over an index alias, you can specify a name for the new index. + # If you don't specify a name and the current index ends with +-+ and a number, such as +my-index-000001+ or +my-index-3+, the new index name increments that number. + # For example, if you roll over an alias with a current index of +my-index-000001+, the rollover creates a new index named +my-index-000002+. + # This number is always six characters and zero-padded, regardless of the previous index's name. + # If you use an index alias for time series data, you can use date math in the index name to track the rollover date. + # For example, you can create an alias that points to an index named ++. + # If you create the index on May 6, 2099, the index's name is +my-index-2099.05.06-000001+. + # If you roll over the alias on May 7, 2099, the new index's name is +my-index-2099.05.07-000002+. # - # @option arguments [String] :alias The name of the alias to rollover - # @option arguments [String] :new_index The name of the rollover index - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Boolean] :dry_run If set to true the rollover action will only be validated but not actually performed even if a condition matches. The default is false - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [String] :wait_for_active_shards Set the number of active shards to wait for on the newly created rollover index before the operation returns. - # @option arguments [Boolean] :lazy If set to true, the rollover action will only mark a data stream to signal that it needs to be rolled over at the next write. Only allowed on data streams. + # @option arguments [String] :alias Name of the data stream or index alias to roll over. (*Required*) + # @option arguments [String] :new_index Name of the index to create. + # Supports date math. + # Data streams do not support this parameter. + # @option arguments [Boolean] :dry_run If +true+, checks whether the current index satisfies the specified conditions but does not perform a rollover. + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to all or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The conditions that needs to be met for executing rollover + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-rollover-index.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-rollover # def rollover(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.rollover' } - defined_params = %i[alias new_index].each_with_object({}) do |variable, set_variables| + defined_params = [:alias, :new_index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -50,7 +78,7 @@ def rollover(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _alias = arguments.delete(:alias) @@ -58,9 +86,9 @@ def rollover(arguments = {}) method = Elasticsearch::API::HTTP_POST path = if _alias && _new_index - "#{Utils.__listify(_alias)}/_rollover/#{Utils.__listify(_new_index)}" + "#{Utils.listify(_alias)}/_rollover/#{Utils.listify(_new_index)}" else - "#{Utils.__listify(_alias)}/_rollover" + "#{Utils.listify(_alias)}/_rollover" end params = Utils.process_params(arguments) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/segments.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/segments.rb index 52d5e8c9c..5a893f435 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/segments.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/segments.rb @@ -15,22 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Provides low-level information about segments in a Lucene index. + # Get index segments. + # Get low-level information about the Lucene segments in index shards. + # For data streams, the API returns information about the stream's backing indices. # - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases used to limit the request. + # Supports wildcards (+*+). + # To target all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-segments.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-segments # def segments(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.segments' } @@ -43,13 +51,13 @@ def segments(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "#{Utils.__listify(_index)}/_segments" + "#{Utils.listify(_index)}/_segments" else '_segments' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/shard_stores.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/shard_stores.rb index 04000d4f7..ff0c138a1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/shard_stores.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/shard_stores.rb @@ -15,23 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Provides store information for shard copies of indices. + # Get index shard stores. + # Get store information about replica shards in one or more indices. + # For data streams, the API retrieves store information for the stream's backing indices. + # The index shard stores API returns the following information: + # * The node on which each replica shard exists. + # * The allocation ID for each replica shard. + # * A unique ID for each replica shard. + # * Any errors encountered while opening the shard index or from an earlier failure. + # By default, the API returns store information only for primary shards that are unassigned or have one or more unassigned replica shards. # - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [List] :status A comma-separated list of statuses used to filter on shards to get store information for (options: green, yellow, red, all) - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) + # @option arguments [String, Array] :index List of data streams, indices, and aliases used to limit the request. + # @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. This behavior applies even if the request + # targets other open indices. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, + # this argument determines whether wildcard expressions match hidden data streams. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response. + # @option arguments [Shardstorestatus] :status List of shard health statuses used to limit the request. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shards-stores.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-shard-stores # def shard_stores(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.shard_stores' } @@ -44,13 +55,13 @@ def shard_stores(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "#{Utils.__listify(_index)}/_shard_stores" + "#{Utils.listify(_index)}/_shard_stores" else '_shard_stores' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/shrink.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/shrink.rb index 00a28b5ec..64a96a9a4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/shrink.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/shrink.rb @@ -15,29 +15,54 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Allow to shrink an existing index into a new index with fewer primary shards. + # Shrink an index. + # Shrink an index into a new index with fewer primary shards. + # Before you can shrink an index: + # * The index must be read-only. + # * A copy of every shard in the index must reside on the same node. + # * The index must have a green health status. + # To make shard allocation easier, we recommend you also remove the index's replica shards. + # You can later re-add replica shards as part of the shrink operation. + # The requested number of primary shards in the target index must be a factor of the number of shards in the source index. + # For example an index with 8 primary shards can be shrunk into 4, 2 or 1 primary shards or an index with 15 primary shards can be shrunk into 5, 3 or 1. + # If the number of shards in the index is a prime number it can only be shrunk into a single primary shard + # Before shrinking, a (primary or replica) copy of every shard in the index must be present on the same node. + # The current write index on a data stream cannot be shrunk. In order to shrink the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be shrunk. + # A shrink operation: + # * Creates a new target index with the same definition as the source index, but with a smaller number of primary shards. + # * Hard-links segments from the source index into the target index. If the file system does not support hard-linking, then all segments are copied into the new index, which is a much more time consuming process. Also if using multiple data paths, shards on different data paths require a full copy of segment files if they are not on the same disk since hardlinks do not work across disks. + # * Recovers the target index as though it were a closed index which had just been re-opened. Recovers shards to the +.routing.allocation.initial_recovery._id+ index setting. + # IMPORTANT: Indices can only be shrunk if they satisfy the following requirements: + # * The target index must not exist. + # * The source index must have more primary shards than the target index. + # * The number of primary shards in the target index must be a factor of the number of primary shards in the source index. The source index must have more primary shards than the target index. + # * The index must not contain more than 2,147,483,519 documents in total across all shards that will be shrunk into a single shard on the target index as this is the maximum number of docs that can fit into a single shard. + # * The node handling the shrink process must have sufficient free disk space to accommodate a second copy of the existing index. # - # @option arguments [String] :index The name of the source index to shrink - # @option arguments [String] :target The name of the target index to shrink into - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [String] :wait_for_active_shards Set the number of active shards to wait for on the shrunken index before the operation returns. + # @option arguments [String] :index Name of the source index to shrink. (*Required*) + # @option arguments [String] :target Name of the target index to create. (*Required*) + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The configuration for the target index (`settings` and `aliases`) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-shrink-index.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-shrink # def shrink(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.shrink' } - defined_params = %i[index target].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :target].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -48,14 +73,14 @@ def shrink(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) _target = arguments.delete(:target) method = Elasticsearch::API::HTTP_PUT - path = "#{Utils.__listify(_index)}/_shrink/#{Utils.__listify(_target)}" + path = "#{Utils.listify(_index)}/_shrink/#{Utils.listify(_target)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/simulate_index_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/simulate_index_template.rb index a1f3f7ab5..5c25b779d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/simulate_index_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/simulate_index_template.rb @@ -35,9 +35,8 @@ module Actions def simulate_index_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.simulate_index_template' } - defined_params = [:name].inject({}) do |set_variables, variable| + defined_params = [:name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +50,7 @@ def simulate_index_template(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_POST - path = "_index_template/_simulate_index/#{Utils.__listify(_name)}" + path = "_index_template/_simulate_index/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/simulate_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/simulate_template.rb index afb1e8306..ff23b60c6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/simulate_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/simulate_template.rb @@ -15,24 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Simulate resolving the given template name or body + # Simulate an index template. + # Get the index configuration that would be applied by a particular index template. # - # @option arguments [String] :name The name of the index template - # @option arguments [Boolean] :create Whether the index template we optionally defined in the body should only be dry-run added if new or can also replace an existing one - # @option arguments [String] :cause User defined reason for dry-run creating the new template for simulation purposes - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [Boolean] :include_defaults Return all relevant default configurations for this template simulation (default: false) + # @option arguments [String] :name Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit + # this parameter and specify the template configuration in the request body. + # @option arguments [Boolean] :create If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. + # @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 [Boolean] :include_defaults If true, returns all relevant default configurations for the index template. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body New index template definition to be simulated, if no index template name is specified + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-simulate-template.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-simulate-template # def simulate_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.simulate_template' } @@ -51,7 +52,7 @@ def simulate_template(arguments = {}) method = Elasticsearch::API::HTTP_POST path = if _name - "_index_template/_simulate/#{Utils.__listify(_name)}" + "_index_template/_simulate/#{Utils.listify(_name)}" else '_index_template/_simulate' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/split.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/split.rb index 4bd7412a9..336c9895b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/split.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/split.rb @@ -15,29 +15,55 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Allows you to split an existing index into a new index with more primary shards. + # Split an index. + # Split an index into a new index with more primary shards. + # * Before you can split an index: + # * The index must be read-only. + # * The cluster health status must be green. + # You can do make an index read-only with the following request using the add index block API: + # + + # PUT /my_source_index/_block/write + # + + # The current write index on a data stream cannot be split. + # In order to split the current write index, the data stream must first be rolled over so that a new write index is created and then the previous write index can be split. + # The number of times the index can be split (and the number of shards that each original shard can be split into) is determined by the +index.number_of_routing_shards+ setting. + # The number of routing shards specifies the hashing space that is used internally to distribute documents across shards with consistent hashing. + # For instance, a 5 shard index with +number_of_routing_shards+ set to 30 (5 x 2 x 3) could be split by a factor of 2 or 3. + # A split operation: + # * Creates a new target index with the same definition as the source index, but with a larger number of primary shards. + # * Hard-links segments from the source index into the target index. If the file system doesn't support hard-linking, all segments are copied into the new index, which is a much more time consuming process. + # * Hashes all documents again, after low level files are created, to delete documents that belong to a different shard. + # * Recovers the target index as though it were a closed index which had just been re-opened. + # IMPORTANT: Indices can only be split if they satisfy the following requirements: + # * The target index must not exist. + # * The source index must have fewer primary shards than the target index. + # * The number of primary shards in the target index must be a multiple of the number of primary shards in the source index. + # * The node handling the split process must have sufficient free disk space to accommodate a second copy of the existing index. # - # @option arguments [String] :index The name of the source index to split - # @option arguments [String] :target The name of the target index to split into - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master - # @option arguments [String] :wait_for_active_shards Set the number of active shards to wait for on the shrunken index before the operation returns. + # @option arguments [String] :index Name of the source index to split. (*Required*) + # @option arguments [String] :target Name of the target index to create. (*Required*) + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The configuration for the target index (`settings` and `aliases`) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-split-index.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-split # def split(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.split' } - defined_params = %i[index target].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :target].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -48,14 +74,14 @@ def split(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) _target = arguments.delete(:target) method = Elasticsearch::API::HTTP_PUT - path = "#{Utils.__listify(_index)}/_split/#{Utils.__listify(_target)}" + path = "#{Utils.listify(_index)}/_split/#{Utils.listify(_target)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/stats.rb index c054f9434..ebb4c8bf9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/stats.rb @@ -15,34 +15,43 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Provides statistics on operations happening in an index. + # Get index statistics. + # For data streams, the API retrieves statistics for the stream's backing indices. + # By default, the returned statistics are index-level with +primaries+ and +total+ aggregations. + # +primaries+ are the values for only the primary shards. + # +total+ are the accumulated values for both primary and replica shards. + # To get shard-level statistics, set the +level+ parameter to +shards+. + # NOTE: When moving to another node, the shard-level statistics for a shard are cleared. + # Although the shard is no longer part of the node, that node retains any node-level statistics to which the shard contributed. # - # @option arguments [List] :metric Limit the information returned the specific metrics. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, bulk) - # @option arguments [List] :index A comma-separated list of index names; use `_all` or empty string to perform the operation on all indices - # @option arguments [List] :completion_fields A comma-separated list of fields for the `completion` index metric (supports wildcards) - # @option arguments [List] :fielddata_fields A comma-separated list of fields for the `fielddata` index metric (supports wildcards) - # @option arguments [List] :fields A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - # @option arguments [List] :groups A comma-separated list of search groups for `search` index metric - # @option arguments [String] :level Return stats aggregated at cluster, index or shard level (options: cluster, indices, shards) - # @option arguments [Boolean] :include_segment_file_sizes Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - # @option arguments [Boolean] :include_unloaded_segments If set to true segment stats will include stats for segments that are not currently loaded into memory - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :forbid_closed_indices If set to false stats will also collected from closed indices if explicitly specified or if expand_wildcards expands to closed indices + # @option arguments [String, Array] :metric Limit the information returned the specific metrics. + # @option arguments [String, Array] :index A comma-separated list of index names; use +_all+ or empty string to perform the operation on all indices + # @option arguments [String, Array] :completion_fields Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument + # determines whether wildcard expressions match hidden data streams. Supports comma-separated values, + # such as +open,hidden+. + # @option arguments [String, Array] :fielddata_fields Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + # @option arguments [String, Array] :fields Comma-separated list or wildcard expressions of fields to include in the statistics. + # @option arguments [Boolean] :forbid_closed_indices If true, statistics are not collected from closed indices. Server default: true. + # @option arguments [String] :groups Comma-separated list of search groups to include in the search statistics. + # @option arguments [Boolean] :include_segment_file_sizes If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). + # @option arguments [Boolean] :include_unloaded_segments If true, the response includes information from segments that are not loaded into memory. + # @option arguments [String] :level Indicates whether statistics are aggregated at the cluster, index, or shard level. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-stats # def stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.stats' } - defined_params = %i[metric index].each_with_object({}) do |variable, set_variables| + defined_params = [:metric, :index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -58,11 +67,11 @@ def stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _index && _metric - "#{Utils.__listify(_index)}/_stats/#{Utils.__listify(_metric)}" + "#{Utils.listify(_index)}/_stats/#{Utils.listify(_metric)}" elsif _metric - "_stats/#{Utils.__listify(_metric)}" + "_stats/#{Utils.listify(_metric)}" elsif _index - "#{Utils.__listify(_index)}/_stats" + "#{Utils.listify(_index)}/_stats" else '_stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/update_aliases.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/update_aliases.rb index e7178802b..0c0cd7a1c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/update_aliases.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/update_aliases.rb @@ -15,21 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Updates index aliases. + # Create or update an alias. + # Adds a data stream or index to an alias. # - # @option arguments [Time] :timeout Request timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The definition of `actions` to perform (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-update-aliases # def update_aliases(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.update_aliases' } @@ -39,7 +42,7 @@ def update_aliases(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_aliases' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/indices/validate_query.rb b/elasticsearch-api/lib/elasticsearch/api/actions/indices/validate_query.rb index 03a22a7bc..fe8fbd4a5 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/indices/validate_query.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/indices/validate_query.rb @@ -15,32 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Indices module Actions - # Allows a user to validate a potentially expensive query without executing it. + # Validate a query. + # Validates a query without running it. # - # @option arguments [List] :index A comma-separated list of index names to restrict the operation; use `_all` or empty string to perform the operation on all indices - # @option arguments [Boolean] :explain Return detailed information about the error - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [String] :q Query in the Lucene query string syntax - # @option arguments [String] :analyzer The analyzer to use for the query string - # @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false) - # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR) - # @option arguments [String] :df The field to use as default where no field prefix is given in the query string - # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - # @option arguments [Boolean] :rewrite Provide a more detailed explanation showing the actual Lucene query that will be executed. - # @option arguments [Boolean] :all_shards Execute validation on all shards instead of one random shard per index + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and aliases to search. + # Supports wildcards (+*+). + # To search all data streams or indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. Server default: true. + # @option arguments [Boolean] :all_shards If +true+, the validation is executed on all shards instead of one random shard per index. + # @option arguments [String] :analyzer Analyzer to use for the query string. + # This parameter can only be used when the +q+ query string parameter is specified. + # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed. + # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. Server default: OR. + # @option arguments [String] :df Field to use as default where no field prefix is given in the query string. + # This parameter can only be used when the +q+ query string parameter is specified. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :explain If +true+, the response returns detailed information if an error has occurred. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + # @option arguments [Boolean] :rewrite If +true+, returns a more detailed explanation showing the actual Lucene query that will be executed. + # @option arguments [String] :q Query in the Lucene query string syntax. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The query definition specified with the Query DSL + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-validate.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-validate-query # def validate_query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'indices.validate_query' } @@ -63,11 +72,11 @@ def validate_query(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _index - "#{Utils.__listify(_index)}/_validate/query" - else - '_validate/query' - end + path = if _index + "#{Utils.listify(_index)}/_validate/query" + else + '_validate/query' + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/chat_completion_unified.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/chat_completion_unified.rb index 003f1240b..a1efed012 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/chat_completion_unified.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/chat_completion_unified.rb @@ -34,9 +34,8 @@ module Actions def chat_completion_unified(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.chat_completion_unified' } - defined_params = [:inference_id].inject({}) do |set_variables, variable| + defined_params = [:inference_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -50,7 +49,7 @@ def chat_completion_unified(arguments = {}) _inference_id = arguments.delete(:inference_id) method = Elasticsearch::API::HTTP_POST - path = "_inference/chat_completion/#{Utils.__listify(_inference_id)}/_stream" + path = "_inference/chat_completion/#{Utils.listify(_inference_id)}/_stream" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/completion.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/completion.rb index d32172bcd..cb8b2e181 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/completion.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/completion.rb @@ -34,9 +34,8 @@ module Actions def completion(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.completion' } - defined_params = [:inference_id].inject({}) do |set_variables, variable| + defined_params = [:inference_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -50,7 +49,7 @@ def completion(arguments = {}) _inference_id = arguments.delete(:inference_id) method = Elasticsearch::API::HTTP_POST - path = "_inference/completion/#{Utils.__listify(_inference_id)}" + path = "_inference/completion/#{Utils.listify(_inference_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/delete.rb index 5e9e570d6..4bbbcd4bb 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/delete.rb @@ -35,9 +35,8 @@ module Actions def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.delete' } - defined_params = [:inference_id, :task_type].inject({}) do |set_variables, variable| + defined_params = [:inference_id, :task_type].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -54,9 +53,9 @@ def delete(arguments = {}) method = Elasticsearch::API::HTTP_DELETE path = if _task_type && _inference_id - "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_inference_id)}" + "_inference/#{Utils.listify(_task_type)}/#{Utils.listify(_inference_id)}" else - "_inference/#{Utils.__listify(_inference_id)}" + "_inference/#{Utils.listify(_inference_id)}" end params = Utils.process_params(arguments) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/get.rb index 8c419cb1c..5db62f7c8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/get.rb @@ -33,9 +33,8 @@ module Actions def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.get' } - defined_params = [:inference_id, :task_type].inject({}) do |set_variables, variable| + defined_params = [:inference_id, :task_type].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -50,11 +49,11 @@ def get(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _task_type && _inference_id - "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_inference_id)}" + "_inference/#{Utils.listify(_task_type)}/#{Utils.listify(_inference_id)}" elsif _inference_id - "_inference/#{Utils.__listify(_inference_id)}" + "_inference/#{Utils.listify(_inference_id)}" else - "_inference" + '_inference' end params = {} diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb index 20a984dd4..23fe5e9c1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put.rb @@ -42,9 +42,8 @@ module Actions def put(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.put' } - defined_params = [:inference_id, :task_type].inject({}) do |set_variables, variable| + defined_params = [:inference_id, :task_type].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -62,9 +61,9 @@ def put(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = if _task_type && _inference_id - "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_inference_id)}" + "_inference/#{Utils.listify(_task_type)}/#{Utils.listify(_inference_id)}" else - "_inference/#{Utils.__listify(_inference_id)}" + "_inference/#{Utils.listify(_inference_id)}" end params = {} diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_watsonx.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_watsonx.rb index 255ff5de0..3657cad58 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_watsonx.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_watsonx.rb @@ -23,7 +23,7 @@ module API module Inference module Actions # Create a Watsonx inference endpoint. - # Creates an inference endpoint to perform an inference task with the +watsonxai+ service. + # Create an inference endpoint to perform an inference task with the +watsonxai+ service. # You need an IBM Cloud Databases for Elasticsearch deployment to use the +watsonxai+ inference service. # You can provision one through the IBM catalog, the Cloud Databases CLI plug-in, the Cloud Databases API, or Terraform. # When you create an inference endpoint, the associated machine learning model is automatically deployed if it is not already running. @@ -38,21 +38,22 @@ module Actions # @option arguments [Hash] :headers Custom HTTP headers # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-watsonx-ai.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-watsonx # def put_watsonx(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.put_watsonx' } - defined_params = [:task_type, :watsonx_inference_id].inject({}) do |set_variables, variable| + defined_params = [:task_type, :watsonx_inference_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'task_type' missing" unless arguments[:task_type] - raise ArgumentError, - "Required argument 'watsonx_inference_id' missing" unless arguments[:watsonx_inference_id] + unless arguments[:watsonx_inference_id] + raise ArgumentError, + "Required argument 'watsonx_inference_id' missing" + end arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -64,7 +65,7 @@ def put_watsonx(arguments = {}) _watsonx_inference_id = arguments.delete(:watsonx_inference_id) method = Elasticsearch::API::HTTP_PUT - path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_watsonx_inference_id)}" + path = "_inference/#{Utils.listify(_task_type)}/#{Utils.listify(_watsonx_inference_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/rerank.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/rerank.rb index 065fc63a4..2a61fe585 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/rerank.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/rerank.rb @@ -34,9 +34,8 @@ module Actions def rerank(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.rerank' } - defined_params = [:inference_id].inject({}) do |set_variables, variable| + defined_params = [:inference_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -50,7 +49,7 @@ def rerank(arguments = {}) _inference_id = arguments.delete(:inference_id) method = Elasticsearch::API::HTTP_POST - path = "_inference/rerank/#{Utils.__listify(_inference_id)}" + path = "_inference/rerank/#{Utils.listify(_inference_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/sparse_embedding.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/sparse_embedding.rb index 76acbf89e..1d4e4684b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/sparse_embedding.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/sparse_embedding.rb @@ -34,9 +34,8 @@ module Actions def sparse_embedding(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.sparse_embedding' } - defined_params = [:inference_id].inject({}) do |set_variables, variable| + defined_params = [:inference_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -50,7 +49,7 @@ def sparse_embedding(arguments = {}) _inference_id = arguments.delete(:inference_id) method = Elasticsearch::API::HTTP_POST - path = "_inference/sparse_embedding/#{Utils.__listify(_inference_id)}" + path = "_inference/sparse_embedding/#{Utils.listify(_inference_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/stream_completion.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/stream_completion.rb index bd13f1624..52ed89e63 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/stream_completion.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/stream_completion.rb @@ -37,9 +37,8 @@ module Actions def stream_completion(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.stream_completion' } - defined_params = [:inference_id].inject({}) do |set_variables, variable| + defined_params = [:inference_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,7 +52,7 @@ def stream_completion(arguments = {}) _inference_id = arguments.delete(:inference_id) method = Elasticsearch::API::HTTP_POST - path = "_inference/completion/#{Utils.__listify(_inference_id)}/_stream" + path = "_inference/completion/#{Utils.listify(_inference_id)}/_stream" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/text_embedding.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/text_embedding.rb index 6ad374db6..7be9b6876 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/text_embedding.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/text_embedding.rb @@ -34,9 +34,8 @@ module Actions def text_embedding(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.text_embedding' } - defined_params = [:inference_id].inject({}) do |set_variables, variable| + defined_params = [:inference_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -50,7 +49,7 @@ def text_embedding(arguments = {}) _inference_id = arguments.delete(:inference_id) method = Elasticsearch::API::HTTP_POST - path = "_inference/text_embedding/#{Utils.__listify(_inference_id)}" + path = "_inference/text_embedding/#{Utils.listify(_inference_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/update.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/update.rb index 19b82dedb..b48c08a45 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/inference/update.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/update.rb @@ -38,9 +38,8 @@ module Actions def update(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'inference.update' } - defined_params = [:inference_id, :task_type].inject({}) do |set_variables, variable| + defined_params = [:inference_id, :task_type].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -58,9 +57,9 @@ def update(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = if _task_type && _inference_id - "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_inference_id)}/_update" + "_inference/#{Utils.listify(_task_type)}/#{Utils.listify(_inference_id)}/_update" else - "_inference/#{Utils.__listify(_inference_id)}/_update" + "_inference/#{Utils.listify(_inference_id)}/_update" end params = {} diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/info.rb b/elasticsearch-api/lib/elasticsearch/api/actions/info.rb index ca00f362a..0290eac24 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/info.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/info.rb @@ -15,17 +15,18 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns basic information about the cluster. + # Get cluster info. + # Get basic build, version, and cluster information. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-info # def info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'info' } @@ -33,7 +34,7 @@ def info(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_geoip_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_geoip_database.rb index a242aaea6..02f312f37 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_geoip_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_geoip_database.rb @@ -15,21 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Deletes a geoip database configuration + # Delete GeoIP database configurations. + # Delete one or more IP geolocation database configurations. # - # @option arguments [List] :id A comma-separated list of geoip database configurations to delete - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :id A comma-separated list of geoip database configurations to delete (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-geoip-database-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-delete-geoip-database # def delete_geoip_database(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.delete_geoip_database' } @@ -49,7 +51,7 @@ def delete_geoip_database(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_ingest/geoip/database/#{Utils.__listify(_id)}" + path = "_ingest/geoip/database/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_ip_location_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_ip_location_database.rb index f3a329a18..dcef1cecc 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_ip_location_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_ip_location_database.rb @@ -15,21 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Deletes an ip location database configuration + # Delete IP geolocation database configurations. # - # @option arguments [List] :id A comma-separated list of ip location database configurations to delete - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :id A comma-separated list of IP location database configurations. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # A value of +-1+ indicates that the request should never time out. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. + # A value of +-1+ indicates that the request should never time out. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-ip-location-database-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-delete-ip-location-database # def delete_ip_location_database(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.delete_ip_location_database' } @@ -49,7 +53,7 @@ def delete_ip_location_database(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_ingest/ip_location/database/#{Utils.__listify(_id)}" + path = "_ingest/ip_location/database/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb index d06a96d72..c0650fe9b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/delete_pipeline.rb @@ -15,21 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Deletes a pipeline. + # Delete pipelines. + # Delete one or more ingest pipelines. # - # @option arguments [String] :id Pipeline ID - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :id Pipeline ID or wildcard expression of pipeline IDs used to limit the request. + # To delete all ingest pipelines in a cluster, use a value of +*+. (*Required*) + # @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. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-pipeline-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-delete-pipeline # def delete_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.delete_pipeline' } @@ -49,7 +53,7 @@ def delete_pipeline(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_ingest/pipeline/#{Utils.__listify(_id)}" + path = "_ingest/pipeline/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/geo_ip_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/geo_ip_stats.rb index 6764c9cd6..0ada8ec02 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/geo_ip_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/geo_ip_stats.rb @@ -15,18 +15,19 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Returns statistical information about geoip databases + # Get GeoIP statistics. + # Get download statistics for GeoIP2 databases that are used with the GeoIP processor. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/geoip-stats-api.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/geoip-processor.html # def geo_ip_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.geo_ip_stats' } @@ -34,7 +35,7 @@ def geo_ip_stats(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_ingest/geoip/stats' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_geoip_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_geoip_database.rb index 1cc5f6078..f048c4b25 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_geoip_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_geoip_database.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Returns geoip database configuration. + # Get GeoIP database configurations. + # Get information about one or more IP geolocation database configurations. # - # @option arguments [List] :id A comma-separated list of geoip database configurations to get; use `*` to get all geoip database configurations + # @option arguments [String, Array] :id A comma-separated list of database configuration IDs to retrieve. + # Wildcard (+*+) expressions are supported. + # To get all database configurations, omit this parameter or use +*+. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-geoip-database-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-get-geoip-database # def get_geoip_database(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.get_geoip_database' } @@ -46,7 +49,7 @@ def get_geoip_database(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _id - "_ingest/geoip/database/#{Utils.__listify(_id)}" + "_ingest/geoip/database/#{Utils.listify(_id)}" else '_ingest/geoip/database' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_ip_location_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_ip_location_database.rb index 9292718d0..250b9bb37 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_ip_location_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_ip_location_database.rb @@ -15,19 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Returns the specified ip location database configuration + # Get IP geolocation database configurations. # - # @option arguments [List] :id A comma-separated list of ip location database configurations to get; use `*` to get all ip location database configurations + # @option arguments [String, Array] :id Comma-separated list of database configuration IDs to retrieve. + # Wildcard (+*+) expressions are supported. + # To get all database configurations, omit this parameter or use +*+. + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # A value of +-1+ indicates that the request should never time out. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ip-location-database-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-get-ip-location-database # def get_ip_location_database(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.get_ip_location_database' } @@ -46,11 +51,11 @@ def get_ip_location_database(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _id - "_ingest/ip_location/database/#{Utils.__listify(_id)}" + "_ingest/ip_location/database/#{Utils.listify(_id)}" else '_ingest/ip_location/database' end - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_pipeline.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_pipeline.rb index 250ff6d31..dfdea6e0e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_pipeline.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/get_pipeline.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Returns a pipeline. + # Get pipelines. + # Get information about one or more ingest pipelines. + # This API returns a local reference of the pipeline. # - # @option arguments [String] :id Comma separated list of pipeline ids. Wildcards supported + # @option arguments [String] :id Comma-separated list of pipeline IDs to retrieve. + # Wildcard (+*+) expressions are supported. + # To get all ingest pipelines, omit this parameter or use +*+. + # @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 [Boolean] :summary Return pipelines without their definitions (default: false) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-pipeline-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-get-pipeline # def get_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.get_pipeline' } @@ -48,7 +53,7 @@ def get_pipeline(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _id - "_ingest/pipeline/#{Utils.__listify(_id)}" + "_ingest/pipeline/#{Utils.listify(_id)}" else '_ingest/pipeline' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/processor_grok.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/processor_grok.rb index 6dbfa81bb..eb12d3b19 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/processor_grok.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/processor_grok.rb @@ -15,18 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Returns a list of the built-in patterns. + # Run a grok processor. + # Extract structured fields out of a single text field within a document. + # You must choose which field to extract matched fields from, as well as the grok pattern you expect will match. + # A grok pattern is like a regular expression that supports aliased expressions that can be reused. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html#grok-processor-rest-get + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/grok-processor.html # def processor_grok(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.processor_grok' } @@ -34,7 +37,7 @@ def processor_grok(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_ingest/processor/grok' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_geoip_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_geoip_database.rb index 235affce7..6fe9355da 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_geoip_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_geoip_database.rb @@ -15,22 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Puts the configuration for a geoip database to be downloaded + # Create or update a GeoIP database configuration. + # Refer to the create or update IP geolocation database configuration API. # - # @option arguments [String] :id The id of the database configuration - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :id ID of the database configuration to create or update. (*Required*) + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The database configuration definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-geoip-database-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-put-geoip-database # def put_geoip_database(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.put_geoip_database' } @@ -51,7 +53,7 @@ def put_geoip_database(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT - path = "_ingest/geoip/database/#{Utils.__listify(_id)}" + path = "_ingest/geoip/database/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_ip_location_database.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_ip_location_database.rb index 0305aef83..121aaa773 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_ip_location_database.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_ip_location_database.rb @@ -15,22 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Puts the configuration for a ip location database to be downloaded + # Create or update an IP geolocation database configuration. # - # @option arguments [String] :id The id of the database configuration - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :id The database configuration identifier. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # A value of +-1+ indicates that the request should never time out. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata. + # If no response is received before the timeout expires, the cluster metadata update still applies but the response indicates that it was not completely acknowledged. + # A value of +-1+ indicates that the request should never time out. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The database configuration definition (*Required*) + # @option arguments [Hash] :body configuration # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-ip-location-database-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-put-ip-location-database # def put_ip_location_database(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.put_ip_location_database' } @@ -51,7 +55,7 @@ def put_ip_location_database(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT - path = "_ingest/ip_location/database/#{Utils.__listify(_id)}" + path = "_ingest/ip_location/database/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_pipeline.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_pipeline.rb index 0c626836e..a7408179a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_pipeline.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/put_pipeline.rb @@ -15,23 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Creates or updates a pipeline. + # Create or update a pipeline. + # Changes made using this API take effect immediately. # - # @option arguments [String] :id Pipeline ID + # @option arguments [String] :id ID of the ingest pipeline to create or update. (*Required*) + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Integer] :if_version Required version for optimistic concurrency control for pipeline updates - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The ingest definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-pipeline-api.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ingest.html # def put_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.put_pipeline' } @@ -52,7 +53,7 @@ def put_pipeline(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT - path = "_ingest/pipeline/#{Utils.__listify(_id)}" + path = "_ingest/pipeline/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/simulate.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/simulate.rb index 8ea6e3c71..e2c085a3b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ingest/simulate.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ingest/simulate.rb @@ -15,21 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Ingest module Actions - # Allows to simulate a pipeline with example documents. + # Simulate a pipeline. + # Run an ingest pipeline against a set of provided documents. + # You can either specify an existing pipeline to use with the provided documents or supply a pipeline definition in the body of the request. # - # @option arguments [String] :id Pipeline ID - # @option arguments [Boolean] :verbose Verbose mode. Display data output for each processor in executed pipeline + # @option arguments [String] :id The pipeline to test. + # If you don't specify a +pipeline+ in the request body, this parameter is required. + # @option arguments [Boolean] :verbose If +true+, the response includes output data for each processor in the executed pipeline. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The simulate definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/simulate-pipeline-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ingest-simulate # def simulate(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ingest.simulate' } @@ -50,7 +53,7 @@ def simulate(arguments = {}) method = Elasticsearch::API::HTTP_POST path = if _id - "_ingest/pipeline/#{Utils.__listify(_id)}/_simulate" + "_ingest/pipeline/#{Utils.listify(_id)}/_simulate" else '_ingest/pipeline/_simulate' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/knn_search.rb b/elasticsearch-api/lib/elasticsearch/api/actions/knn_search.rb index 8a94ed052..01fba8fde 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/knn_search.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/knn_search.rb @@ -15,24 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Performs a kNN search. + # Run a knn search. + # NOTE: The kNN search API has been replaced by the +knn+ option in the search API. + # Perform a k-nearest neighbor (kNN) search on a dense_vector field and return the matching documents. + # Given a query vector, the API finds the k closest vectors and returns those documents as search hits. + # Elasticsearch uses the HNSW algorithm to support efficient kNN search. + # Like most kNN algorithms, HNSW is an approximate method that sacrifices result accuracy for improved search speed. + # This means the results returned are not always the true k closest neighbors. + # The kNN search API supports restricting the search using a filter. + # The search will return the top k documents that also match the filter query. + # A kNN search response has the exact same structure as a search API response. + # However, certain sections have a meaning specific to kNN search: + # * The document +_score+ is determined by the similarity between the query and document vector. + # * The +hits.total+ object contains the total number of nearest neighbor candidates considered, which is +num_candidates * num_shards+. The +hits.total.relation+ will always be +eq+, indicating an exact value. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` to perform the operation on all indices - # @option arguments [List] :routing A comma-separated list of specific routing values + # @option arguments [String, Array] :index A comma-separated list of index names to search; + # use +_all+ or to perform the operation on all indices. (*Required*) + # @option arguments [String] :routing A comma-separated list of specific routing values. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search definition + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/knn-search-api.html # def knn_search(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'knn_search' } @@ -57,7 +70,7 @@ def knn_search(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "#{Utils.__listify(_index)}/_knn_search" + path = "#{Utils.listify(_index)}/_knn_search" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/license/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/license/delete.rb index b4a2a5fd9..bf4fd1b49 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/license/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/license/delete.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module License module Actions - # Deletes licensing information for the cluster + # Delete the license. + # When the license expires, your subscription level reverts to Basic. + # If the operator privileges feature is enabled, only operator users can use this API. # - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-license.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-delete # def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'license.delete' } @@ -36,7 +38,7 @@ def delete(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_DELETE path = '_license' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/license/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/license/get.rb index ee9dc4284..5bac819bc 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/license/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/license/get.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module License module Actions - # Retrieves licensing information for the cluster + # Get license information. + # Get information about your Elastic license including its type, its status, when it was issued, and when it expires. # - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Boolean] :accept_enterprise Supported for backwards compatibility with 7.x. If this param is used it must be set to true *Deprecated* + # @option arguments [Boolean] :accept_enterprise If +true+, this parameter returns enterprise for Enterprise license types. If +false+, this parameter returns platinum for both platinum and enterprise license types. This behavior is maintained for backwards compatibility. + # This parameter is deprecated and will always be set to true in 8.x. Server default: true. + # @option arguments [Boolean] :local Specifies whether to retrieve local information. The default value is +false+, which means the information is retrieved from the master node. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-license.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get # def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'license.get' } @@ -36,7 +38,7 @@ def get(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_license' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/license/get_basic_status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/license/get_basic_status.rb index 351df544d..d0c94bf9c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/license/get_basic_status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/license/get_basic_status.rb @@ -15,18 +15,18 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module License module Actions - # Retrieves information about the status of the basic license. + # Get the basic license status. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-basic-status.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get-basic-status # def get_basic_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'license.get_basic_status' } @@ -34,7 +34,7 @@ def get_basic_status(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_license/basic_status' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/license/get_trial_status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/license/get_trial_status.rb index e611a4570..28caa2533 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/license/get_trial_status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/license/get_trial_status.rb @@ -15,18 +15,18 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module License module Actions - # Retrieves information about the status of the trial license. + # Get the trial status. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trial-status.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-get-trial-status # def get_trial_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'license.get_trial_status' } @@ -34,7 +34,7 @@ def get_trial_status(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_license/trial_status' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/license/post.rb b/elasticsearch-api/lib/elasticsearch/api/actions/license/post.rb index 54a72d52e..e7ba4f3d3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/license/post.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/license/post.rb @@ -15,22 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module License module Actions - # Updates the license for the cluster. + # Update the license. + # You can update your license at runtime without shutting down your nodes. + # License updates take effect immediately. + # If the license you are installing does not support all of the features that were available with your previous license, however, you are notified in the response. + # You must then re-submit the API request with the acknowledge parameter set to true. + # NOTE: If Elasticsearch security features are enabled and you are installing a gold or higher license, you must enable TLS on the transport networking layer before you install the license. + # If the operator privileges feature is enabled, only operator users can use this API. # - # @option arguments [Boolean] :acknowledge whether the user has acknowledged acknowledge messages (default: false) - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster + # @option arguments [Boolean] :acknowledge Specifies whether you acknowledge the license changes. + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body licenses to be installed + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-license.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post # def post(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'license.post' } @@ -38,7 +44,7 @@ def post(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_PUT path = '_license' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/license/post_start_basic.rb b/elasticsearch-api/lib/elasticsearch/api/actions/license/post_start_basic.rb index b95eb10bf..735de4b12 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/license/post_start_basic.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/license/post_start_basic.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module License module Actions - # Starts an indefinite basic license. + # Start a basic license. + # Start an indefinite basic license, which gives access to all the basic features. + # NOTE: In order to start a basic license, you must not currently have a basic license. + # If the basic license does not support all of the features that are available with your current license, however, you are notified in the response. + # You must then re-submit the API request with the +acknowledge+ parameter set to +true+. + # To check the status of your basic license, use the get basic license API. # # @option arguments [Boolean] :acknowledge whether the user has acknowledged acknowledge messages (default: false) - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-basic.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post-start-basic # def post_start_basic(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'license.post_start_basic' } @@ -37,7 +42,7 @@ def post_start_basic(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_license/start_basic' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/license/post_start_trial.rb b/elasticsearch-api/lib/elasticsearch/api/actions/license/post_start_trial.rb index 561bb0f06..0ef0cca0a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/license/post_start_trial.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/license/post_start_trial.rb @@ -15,21 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module License module Actions - # starts a limited time trial license. + # Start a trial. + # Start a 30-day trial, which gives access to all subscription features. + # NOTE: You are allowed to start a trial only if your cluster has not already activated a trial for the current major product version. + # For example, if you have already activated a trial for v8.0, you cannot start a new trial until v9.0. You can, however, request an extended trial at https://www.elastic.co/trialextension. + # To check the status of your trial, use the get trial status API. # - # @option arguments [String] :type The type of trial license to generate (default: "trial") # @option arguments [Boolean] :acknowledge whether the user has acknowledged acknowledge messages (default: false) - # @option arguments [Time] :master_timeout Timeout for processing on master node + # @option arguments [String] :type_query_string [TODO] + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-trial.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-license-post-start-trial # def post_start_trial(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'license.post_start_trial' } @@ -37,7 +41,7 @@ def post_start_trial(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_license/start_trial' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/logstash/delete_pipeline.rb b/elasticsearch-api/lib/elasticsearch/api/actions/logstash/delete_pipeline.rb index 3b8a16c6d..30fe90a7c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/logstash/delete_pipeline.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/logstash/delete_pipeline.rb @@ -15,19 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Logstash module Actions - # Deletes Logstash Pipelines used by Central Management + # Delete a Logstash pipeline. + # Delete a pipeline that is used for Logstash Central Management. + # If the request succeeds, you receive an empty response with an appropriate status code. # - # @option arguments [String] :id The ID of the Pipeline + # @option arguments [String] :id An identifier for the pipeline. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-delete-pipeline.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-logstash-delete-pipeline # def delete_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'logstash.delete_pipeline' } @@ -47,7 +49,7 @@ def delete_pipeline(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_logstash/pipeline/#{Utils.__listify(_id)}" + path = "_logstash/pipeline/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/logstash/get_pipeline.rb b/elasticsearch-api/lib/elasticsearch/api/actions/logstash/get_pipeline.rb index eaed065ef..9debcd5da 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/logstash/get_pipeline.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/logstash/get_pipeline.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Logstash module Actions - # Retrieves Logstash Pipelines used by Central Management + # Get Logstash pipelines. + # Get pipelines that are used for Logstash Central Management. # - # @option arguments [String] :id A comma-separated list of Pipeline IDs + # @option arguments [String, Array] :id A comma-separated list of pipeline identifiers. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-get-pipeline.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-logstash-get-pipeline # def get_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'logstash.get_pipeline' } @@ -46,7 +47,7 @@ def get_pipeline(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _id - "_logstash/pipeline/#{Utils.__listify(_id)}" + "_logstash/pipeline/#{Utils.listify(_id)}" else '_logstash/pipeline' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/logstash/put_pipeline.rb b/elasticsearch-api/lib/elasticsearch/api/actions/logstash/put_pipeline.rb index 4e51cb3b1..5b5aa6efd 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/logstash/put_pipeline.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/logstash/put_pipeline.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Logstash module Actions - # Adds and updates Logstash Pipelines used for Central Management + # Create or update a Logstash pipeline. + # Create a pipeline that is used for Logstash Central Management. + # If the specified pipeline exists, it is replaced. # - # @option arguments [String] :id The ID of the Pipeline + # @option arguments [String] :id An identifier for the pipeline. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The Pipeline to add or update (*Required*) + # @option arguments [Hash] :body pipeline # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/logstash-api-put-pipeline.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-logstash-put-pipeline # def put_pipeline(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'logstash.put_pipeline' } @@ -49,7 +51,7 @@ def put_pipeline(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT - path = "_logstash/pipeline/#{Utils.__listify(_id)}" + path = "_logstash/pipeline/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/clear_trained_model_deployment_cache.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/clear_trained_model_deployment_cache.rb index 24d3aa5fc..aa6aa7820 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/clear_trained_model_deployment_cache.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/clear_trained_model_deployment_cache.rb @@ -15,19 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Clear the cached results from a trained model deployment + # Clear trained model deployment cache. + # Cache will be cleared on all nodes where the trained model is assigned. + # A trained model deployment may have an inference cache enabled. + # As requests are handled by each allocated node, their responses may be cached on that individual node. + # Calling this API clears the caches without restarting the deployment. # # @option arguments [String] :model_id The unique identifier of the trained model. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-trained-model-deployment-cache.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-clear-trained-model-deployment-cache # def clear_trained_model_deployment_cache(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.clear_trained_model_deployment_cache' } @@ -47,7 +51,7 @@ def clear_trained_model_deployment_cache(arguments = {}) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/cache/_clear" + path = "_ml/trained_models/#{Utils.listify(_model_id)}/deployment/cache/_clear" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/close_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/close_job.rb index 5683ec564..bb084ad2e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/close_job.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/close_job.rb @@ -15,23 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Closes one or more anomaly detection jobs. A job can be opened and closed multiple times throughout its lifecycle. + # Close anomaly detection jobs. + # A job can be opened and closed multiple times throughout its lifecycle. A closed job cannot receive data or perform analysis operations, but you can still explore and navigate results. + # When you close a job, it runs housekeeping tasks such as pruning the model history, flushing buffers, calculating final results and persisting the model snapshots. Depending upon the size of the job, it could take several minutes to close and the equivalent time to re-open. After it is closed, the job has a minimal overhead on the cluster except for maintaining its meta data. Therefore it is a best practice to close jobs that are no longer required to process data. + # If you close an anomaly detection job whose datafeed is running, the request first tries to stop the datafeed. This behavior is equivalent to calling stop datafeed API with the same timeout and force parameters as the close job request. + # When a datafeed that has a specified end date stops, it automatically closes its associated job. # - # @option arguments [String] :job_id The name of the job to close - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - # @option arguments [Boolean] :force True if the job should be forcefully closed - # @option arguments [Time] :timeout Controls the time to wait until a job has closed. Default to 30 minutes + # @option arguments [String] :job_id Identifier for the anomaly detection job. It can be a job identifier, a group name, or a wildcard expression. You can close multiple anomaly detection jobs in a single API request by using a group name, a comma-separated list of jobs, or a wildcard expression. You can close all jobs by using +_all+ or by specifying +*+ as the job identifier. (*Required*) + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: contains wildcard expressions and there are no jobs that match; contains the +_all+ string or no identifiers and there are no matches; or contains wildcard expressions and there are only partial matches. By default, it returns an empty jobs array when there are no matches and the subset of results when there are partial matches. + # If +false+, the request returns a 404 status code when there are no matches or only partial matches. Server default: true. + # @option arguments [Boolean] :force Use to close a failed job, or to forcefully close a job which has not responded to its initial close request; the request returns without performing the associated actions such as flushing buffers and persisting the model snapshots. + # If you want the job to be in a consistent state after the close job API returns, do not set to +true+. This parameter should be used only in situations where the job has already failed or where you are not interested in results the job might have recently produced or might produce in the future. + # @option arguments [Time] :timeout Controls the time to wait until a job has closed. Server default: 30m. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The URL params optionally sent in the body + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-close-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-close-job # def close_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.close_job' } @@ -51,7 +57,7 @@ def close_job(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_close" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_close" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar.rb index 196d6e25b..2ca3b1044 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes a calendar. + # Delete a calendar. + # Remove all scheduled events from a calendar, then delete it. # - # @option arguments [String] :calendar_id The ID of the calendar to delete + # @option arguments [String] :calendar_id A string that uniquely identifies a calendar. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-calendar # def delete_calendar(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_calendar' } @@ -47,7 +48,7 @@ def delete_calendar(arguments = {}) _calendar_id = arguments.delete(:calendar_id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/calendars/#{Utils.__listify(_calendar_id)}" + path = "_ml/calendars/#{Utils.listify(_calendar_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar_event.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar_event.rb index 2e9d83e65..c24801b25 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar_event.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar_event.rb @@ -15,25 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes scheduled events from a calendar. + # Delete events from a calendar. # - # @option arguments [String] :calendar_id The ID of the calendar to modify - # @option arguments [String] :event_id The ID of the event to remove from the calendar + # @option arguments [String] :calendar_id A string that uniquely identifies a calendar. (*Required*) + # @option arguments [String] :event_id Identifier for the scheduled event. + # You can obtain this identifier by using the get calendar events API. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-event.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-calendar-event # def delete_calendar_event(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_calendar_event' } - defined_params = %i[calendar_id event_id].each_with_object({}) do |variable, set_variables| + defined_params = [:calendar_id, :event_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +52,7 @@ def delete_calendar_event(arguments = {}) _event_id = arguments.delete(:event_id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/events/#{Utils.__listify(_event_id)}" + path = "_ml/calendars/#{Utils.listify(_calendar_id)}/events/#{Utils.listify(_event_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar_job.rb index f13bc4a28..8e49a024d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar_job.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_calendar_job.rb @@ -15,25 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes anomaly detection jobs from a calendar. + # Delete anomaly jobs from a calendar. # - # @option arguments [String] :calendar_id The ID of the calendar to modify - # @option arguments [String] :job_id The ID of the job to remove from the calendar + # @option arguments [String] :calendar_id A string that uniquely identifies a calendar. (*Required*) + # @option arguments [String, Array] :job_id An identifier for the anomaly detection jobs. It can be a job identifier, a group name, or a + # comma-separated list of jobs or groups. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-calendar-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-calendar-job # def delete_calendar_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_calendar_job' } - defined_params = %i[calendar_id job_id].each_with_object({}) do |variable, set_variables| + defined_params = [:calendar_id, :job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +52,7 @@ def delete_calendar_job(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/jobs/#{Utils.__listify(_job_id)}" + path = "_ml/calendars/#{Utils.listify(_calendar_id)}/jobs/#{Utils.listify(_job_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_data_frame_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_data_frame_analytics.rb index 3bb2df554..0cf70a621 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_data_frame_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_data_frame_analytics.rb @@ -15,21 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes an existing data frame analytics job. + # Delete a data frame analytics job. # - # @option arguments [String] :id The ID of the data frame analytics to delete - # @option arguments [Boolean] :force True if the job should be forcefully deleted - # @option arguments [Time] :timeout Controls the time to wait until a job is deleted. Defaults to 1 minute + # @option arguments [String] :id Identifier for the data frame analytics job. (*Required*) + # @option arguments [Boolean] :force If +true+, it deletes a job that is not stopped; this method is quicker than stopping and deleting the job. + # @option arguments [Time] :timeout The time to wait for the job to be deleted. Server default: 1m. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-data-frame-analytics # def delete_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_data_frame_analytics' } @@ -49,7 +49,7 @@ def delete_data_frame_analytics(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}" + path = "_ml/data_frame/analytics/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_datafeed.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_datafeed.rb index d8778a21b..76d29f6ba 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_datafeed.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_datafeed.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes an existing datafeed. + # Delete a datafeed. # - # @option arguments [String] :datafeed_id The ID of the datafeed to delete - # @option arguments [Boolean] :force True if the datafeed should be forcefully deleted + # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed. This + # identifier can contain lowercase alphanumeric characters (a-z and 0-9), + # hyphens, and underscores. It must start and end with alphanumeric + # characters. (*Required*) + # @option arguments [Boolean] :force Use to forcefully delete a started datafeed; this method is quicker than + # stopping and deleting the datafeed. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-datafeed.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-datafeed # def delete_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_datafeed' } @@ -48,7 +52,7 @@ def delete_datafeed(arguments = {}) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}" + path = "_ml/datafeeds/#{Utils.listify(_datafeed_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_expired_data.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_expired_data.rb index 5d9f381d1..e57a00607 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_expired_data.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_expired_data.rb @@ -15,22 +15,32 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes expired and unused machine learning data. + # Delete expired ML data. + # Delete all job results, model snapshots and forecast data that have exceeded + # their retention days period. Machine learning state documents that are not + # associated with any job are also deleted. + # You can limit the request to a single or set of anomaly detection jobs by + # using a job identifier, a group name, a comma-separated list of jobs, or a + # wildcard expression. You can delete expired data for all anomaly detection + # jobs by using +_all+, by specifying +*+ as the ++, or by omitting the + # ++. # - # @option arguments [String] :job_id The ID of the job(s) to perform expired data hygiene for - # @option arguments [Number] :requests_per_second The desired requests per second for the deletion processes. - # @option arguments [Time] :timeout How long can the underlying delete processes run until they are canceled + # @option arguments [String] :job_id Identifier for an anomaly detection job. It can be a job identifier, a + # group name, or a wildcard expression. + # @option arguments [Float] :requests_per_second The desired requests per second for the deletion processes. The default + # behavior is no throttling. + # @option arguments [Time] :timeout How long can the underlying delete processes run until they are canceled. Server default: 8h. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body deleting expired data parameters + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-expired-data.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-expired-data # def delete_expired_data(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_expired_data' } @@ -49,7 +59,7 @@ def delete_expired_data(arguments = {}) method = Elasticsearch::API::HTTP_DELETE path = if _job_id - "_ml/_delete_expired_data/#{Utils.__listify(_job_id)}" + "_ml/_delete_expired_data/#{Utils.listify(_job_id)}" else '_ml/_delete_expired_data' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_filter.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_filter.rb index 1079e0b75..ad0cbf546 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_filter.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_filter.rb @@ -15,19 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes a filter. + # Delete a filter. + # If an anomaly detection job references the filter, you cannot delete the + # filter. You must update or delete the job before you can delete the filter. # - # @option arguments [String] :filter_id The ID of the filter to delete + # @option arguments [String] :filter_id A string that uniquely identifies a filter. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-filter.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-filter # def delete_filter(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_filter' } @@ -47,7 +49,7 @@ def delete_filter(arguments = {}) _filter_id = arguments.delete(:filter_id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/filters/#{Utils.__listify(_filter_id)}" + path = "_ml/filters/#{Utils.listify(_filter_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_forecast.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_forecast.rb index 0a0d52aab..2379ca06d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_forecast.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_forecast.rb @@ -15,27 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes forecasts from a machine learning job. + # Delete forecasts from a job. + # By default, forecasts are retained for 14 days. You can specify a + # different retention period with the +expires_in+ parameter in the forecast + # jobs API. The delete forecast API enables you to delete one or more + # forecasts before they expire. # - # @option arguments [String] :job_id The ID of the job from which to delete forecasts - # @option arguments [String] :forecast_id The ID of the forecast to delete, can be comma delimited list. Leaving blank implies `_all` - # @option arguments [Boolean] :allow_no_forecasts Whether to ignore if `_all` matches no forecasts - # @option arguments [Time] :timeout Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String] :forecast_id A comma-separated list of forecast identifiers. If you do not specify + # this optional parameter or if you specify +_all+ or +*+ the API deletes + # all forecasts from the job. + # @option arguments [Boolean] :allow_no_forecasts Specifies whether an error occurs when there are no forecasts. In + # particular, if this parameter is set to +false+ and there are no + # forecasts associated with the job, attempts to delete all forecasts + # return an error. Server default: true. + # @option arguments [Time] :timeout Specifies the period of time to wait for the completion of the delete + # operation. When this period of time elapses, the API fails and returns an + # error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-forecast.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-forecast # def delete_forecast(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_forecast' } - defined_params = %i[job_id forecast_id].each_with_object({}) do |variable, set_variables| + defined_params = [:job_id, :forecast_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,9 +64,9 @@ def delete_forecast(arguments = {}) method = Elasticsearch::API::HTTP_DELETE path = if _job_id && _forecast_id - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_forecast/#{Utils.__listify(_forecast_id)}" + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_forecast/#{Utils.listify(_forecast_id)}" else - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_forecast" + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_forecast" end params = Utils.process_params(arguments) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_job.rb index 7ae7b88f3..db1a024a0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_job.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_job.rb @@ -15,22 +15,32 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes an existing anomaly detection job. + # Delete an anomaly detection job. + # All job configuration, model state and results are deleted. + # It is not currently possible to delete multiple jobs using wildcards or a + # comma separated list. If you delete a job that has a datafeed, the request + # first tries to delete the datafeed. This behavior is equivalent to calling + # the delete datafeed API with the same timeout and force parameters as the + # delete job request. # - # @option arguments [String] :job_id The ID of the job to delete - # @option arguments [Boolean] :force True if the job should be forcefully deleted - # @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning - # @option arguments [Boolean] :delete_user_annotations Should annotations added by the user be deleted + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [Boolean] :force Use to forcefully delete an opened job; this method is quicker than + # closing and deleting the job. + # @option arguments [Boolean] :delete_user_annotations Specifies whether annotations that have been added by the + # user should be deleted along with any auto-generated annotations when the job is + # reset. + # @option arguments [Boolean] :wait_for_completion Specifies whether the request should return immediately or wait until the + # job deletion completes. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-job # def delete_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_job' } @@ -50,7 +60,7 @@ def delete_job(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_model_snapshot.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_model_snapshot.rb index 85cb5b61f..507287984 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_model_snapshot.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_model_snapshot.rb @@ -15,25 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes an existing model snapshot. + # Delete a model snapshot. + # You cannot delete the active model snapshot. To delete that snapshot, first + # revert to a different one. To identify the active model snapshot, refer to + # the +model_snapshot_id+ in the results from the get jobs API. # - # @option arguments [String] :job_id The ID of the job to fetch - # @option arguments [String] :snapshot_id The ID of the snapshot to delete + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String] :snapshot_id Identifier for the model snapshot. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-delete-snapshot.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-model-snapshot # def delete_model_snapshot(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_model_snapshot' } - defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| + defined_params = [:job_id, :snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +54,7 @@ def delete_model_snapshot(arguments = {}) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/model_snapshots/#{Utils.listify(_snapshot_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_trained_model.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_trained_model.rb index 56ea524b3..0cca4a8ca 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_trained_model.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_trained_model.rb @@ -15,21 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes an existing trained inference model that is currently not referenced by an ingest pipeline. + # Delete an unreferenced trained model. + # The request deletes a trained inference model that is not referenced by an ingest pipeline. # - # @option arguments [String] :model_id The ID of the trained model to delete - # @option arguments [Time] :timeout Controls the amount of time to wait for the model to be deleted. - # @option arguments [Boolean] :force True if the model should be forcefully deleted + # @option arguments [String] :model_id The unique identifier of the trained model. (*Required*) + # @option arguments [Boolean] :force Forcefully deletes a trained model that is referenced by ingest pipelines or has a started deployment. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-trained-model # def delete_trained_model(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_trained_model' } @@ -49,7 +50,7 @@ def delete_trained_model(arguments = {}) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/trained_models/#{Utils.__listify(_model_id)}" + path = "_ml/trained_models/#{Utils.listify(_model_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_trained_model_alias.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_trained_model_alias.rb index cc56b0585..55e1ae300 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_trained_model_alias.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/delete_trained_model_alias.rb @@ -15,25 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Deletes a model alias that refers to the trained model + # Delete a trained model alias. + # This API deletes an existing model alias that refers to a trained model. If + # the model alias is missing or refers to a model other than the one identified + # by the +model_id+, this API returns an error. # - # @option arguments [String] :model_alias The trained model alias to delete - # @option arguments [String] :model_id The trained model where the model alias is assigned + # @option arguments [String] :model_alias The model alias to delete. (*Required*) + # @option arguments [String] :model_id The trained model ID to which the model alias refers. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-trained-models-aliases.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-trained-model-alias # def delete_trained_model_alias(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.delete_trained_model_alias' } - defined_params = %i[model_id model_alias].each_with_object({}) do |variable, set_variables| + defined_params = [:model_id, :model_alias].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +54,7 @@ def delete_trained_model_alias(arguments = {}) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_DELETE - path = "_ml/trained_models/#{Utils.__listify(_model_id)}/model_aliases/#{Utils.__listify(_model_alias)}" + path = "_ml/trained_models/#{Utils.listify(_model_id)}/model_aliases/#{Utils.listify(_model_alias)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb index dc40e34a5..da232f07d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/estimate_model_memory.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Estimates the model memory + # Estimate job model memory usage. + # Make an estimation of the memory usage for an anomaly detection job model. + # The estimate is based on analysis configuration details for the job and cardinality + # estimates for the fields it references. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The analysis config, plus cardinality estimates for fields it references (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-apis.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-estimate-model-memory # def estimate_model_memory(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.estimate_model_memory' } @@ -37,7 +40,7 @@ def estimate_model_memory(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_ml/anomaly_detectors/_estimate_model_memory' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/evaluate_data_frame.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/evaluate_data_frame.rb index 957f20343..513dbd04d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/evaluate_data_frame.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/evaluate_data_frame.rb @@ -15,19 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Evaluates the data frame analytics for an annotated index. + # Evaluate data frame analytics. + # The API packages together commonly used evaluation metrics for various types + # of machine learning features. This has been designed for use on indexes + # created by data frame analytics. Evaluation requires both a ground truth + # field and an analytics result field to be present. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The evaluation definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/evaluate-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-evaluate-data-frame # def evaluate_data_frame(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.evaluate_data_frame' } @@ -37,7 +41,7 @@ def evaluate_data_frame(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_ml/data_frame/_evaluate' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/explain_data_frame_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/explain_data_frame_analytics.rb index 8aef4b83b..04c6a913b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/explain_data_frame_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/explain_data_frame_analytics.rb @@ -15,20 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Explains a data frame analytics config. + # Explain data frame analytics config. + # This API provides explanations for a data frame analytics config that either + # exists already or one that has not been created yet. The following + # explanations are provided: + # * which fields are included or not in the analysis and why, + # * how much memory is estimated to be required. The estimate can be used when deciding the appropriate value for model_memory_limit setting later on. + # If you have object fields or fields that are excluded via source filtering, they are not included in the explanation. # - # @option arguments [String] :id The ID of the data frame analytics to explain + # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain + # lowercase alphanumeric characters (a-z and 0-9), hyphens, and + # underscores. It must start and end with alphanumeric characters. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The data frame analytics config to explain + # @option arguments [Hash] :body request body # - # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/explain-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-explain-data-frame-analytics # def explain_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.explain_data_frame_analytics' } @@ -51,11 +59,11 @@ def explain_data_frame_analytics(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _id - "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_explain" - else - '_ml/data_frame/analytics/_explain' - end + path = if _id + "_ml/data_frame/analytics/#{Utils.listify(_id)}/_explain" + else + '_ml/data_frame/analytics/_explain' + end params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/flush_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/flush_job.rb index 48b8334e3..851d01678 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/flush_job.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/flush_job.rb @@ -15,25 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Forces any buffered data to be processed by the job. + # Force buffered data to be processed. + # The flush jobs API is only applicable when sending data for analysis using + # the post data API. Depending on the content of the buffer, then it might + # additionally calculate new results. Both flush and close operations are + # similar, however the flush is more efficient if you are expecting to send + # more data for analysis. When flushing, the job remains open and is available + # to continue analyzing data. A close operation additionally prunes and + # persists the model state to disk and the job must be opened again before + # analyzing further data. # - # @option arguments [String] :job_id The name of the job to flush - # @option arguments [Boolean] :calc_interim Calculates interim results for the most recent bucket or all buckets within the latency period - # @option arguments [String] :start When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results - # @option arguments [String] :end When used in conjunction with calc_interim, specifies the range of buckets on which to calculate interim results - # @option arguments [String] :advance_time Advances time to the given value generating results and updating the model for the advanced interval - # @option arguments [String] :skip_time Skips time to the given value without generating results or updating the model for the skipped interval + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String, Time] :advance_time Specifies to advance to a particular time value. Results are generated + # and the model is updated for data from the specified time interval. + # @option arguments [Boolean] :calc_interim If true, calculates the interim results for the most recent bucket or all + # buckets within the latency period. + # @option arguments [String, Time] :end When used in conjunction with +calc_interim+ and +start+, specifies the + # range of buckets on which to calculate interim results. + # @option arguments [String, Time] :skip_time Specifies to skip to a particular time value. Results are not generated + # and the model is not updated for data from the specified time interval. + # @option arguments [String, Time] :start When used in conjunction with +calc_interim+, specifies the range of + # buckets on which to calculate interim results. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Flush parameters + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-flush-job # def flush_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.flush_job' } @@ -53,7 +66,7 @@ def flush_job(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_flush" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_flush" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/forecast.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/forecast.rb index fefe7dbdb..d65a0d6ce 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/forecast.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/forecast.rb @@ -15,23 +15,36 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Predicts the future behavior of a time series by using its historical behavior. + # Predict future behavior of a time series. + # Forecasts are not supported for jobs that perform population analysis; an + # error occurs if you try to create a forecast for a job that has an + # +over_field_name+ in its configuration. Forcasts predict future behavior + # based on historical data. # - # @option arguments [String] :job_id The ID of the job to forecast for - # @option arguments [Time] :duration The duration of the forecast - # @option arguments [Time] :expires_in The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity. - # @option arguments [String] :max_model_memory The max memory able to be used by the forecast. Default is 20mb. + # @option arguments [String] :job_id Identifier for the anomaly detection job. The job must be open when you + # create a forecast; otherwise, an error occurs. (*Required*) + # @option arguments [Time] :duration A period of time that indicates how far into the future to forecast. For + # example, +30d+ corresponds to 30 days. The forecast starts at the last + # record that was processed. Server default: 1d. + # @option arguments [Time] :expires_in The period of time that forecast results are retained. After a forecast + # expires, the results are deleted. If set to a value of 0, the forecast is + # never automatically deleted. Server default: 14d. + # @option arguments [String] :max_model_memory The maximum memory the forecast can use. If the forecast needs to use + # more than the provided amount, it will spool to disk. Default is 20mb, + # maximum is 500mb and minimum is 1mb. If set to 40% or more of the job’s + # configured memory limit, it is automatically reduced to below that + # amount. Server default: 20mb. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Query parameters can be specified in the body + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-forecast.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-forecast # def forecast(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.forecast' } @@ -51,7 +64,7 @@ def forecast(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_forecast" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_forecast" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_buckets.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_buckets.rb index a68322b96..f7f371592 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_buckets.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_buckets.rb @@ -15,35 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves anomaly detection job results for one or more buckets. + # Get anomaly detection job results for buckets. + # The API presents a chronological view of the records, grouped by bucket. # - # @option arguments [String] :job_id ID of the job to get bucket results from - # @option arguments [String] :timestamp The timestamp of the desired single bucket result - # @option arguments [Boolean] :expand Include anomaly records - # @option arguments [Boolean] :exclude_interim Exclude interim results - # @option arguments [Integer] :from skips a number of buckets - # @option arguments [Integer] :size specifies a max number of buckets to get - # @option arguments [String] :start Start time filter for buckets - # @option arguments [String] :end End time filter for buckets - # @option arguments [Double] :anomaly_score Filter for the most anomalous buckets - # @option arguments [String] :sort Sort buckets by a particular field - # @option arguments [Boolean] :desc Set the sort direction + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String, Time] :timestamp The timestamp of a single bucket result. If you do not specify this + # parameter, the API returns information about all buckets. + # @option arguments [Float] :anomaly_score Returns buckets with anomaly scores greater or equal than this value. Server default: 0. + # @option arguments [Boolean] :desc If +true+, the buckets are sorted in descending order. + # @option arguments [String, Time] :end Returns buckets with timestamps earlier than this time. +-1+ means it is + # unset and results are not limited to specific timestamps. Server default: -1. + # @option arguments [Boolean] :exclude_interim If +true+, the output excludes interim results. + # @option arguments [Boolean] :expand If true, the output includes anomaly records. + # @option arguments [Integer] :from Skips the specified number of buckets. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of buckets to obtain. Server default: 100. + # @option arguments [String] :sort Specifies the sort field for the requested buckets. Server default: timestamp. + # @option arguments [String, Time] :start Returns buckets with timestamps after this time. +-1+ means it is unset + # and results are not limited to specific timestamps. Server default: -1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Bucket selection details if not provided in URI + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-bucket.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-buckets # def get_buckets(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_buckets' } - defined_params = %i[job_id timestamp].each_with_object({}) do |variable, set_variables| + defined_params = [:job_id, :timestamp].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -65,11 +69,11 @@ def get_buckets(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _job_id && _timestamp - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/buckets/#{Utils.__listify(_timestamp)}" - else - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/buckets" - end + path = if _job_id && _timestamp + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/results/buckets/#{Utils.listify(_timestamp)}" + else + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/results/buckets" + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_calendar_events.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_calendar_events.rb index d207e8872..8e8c9ff29 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_calendar_events.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_calendar_events.rb @@ -15,24 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves information about the scheduled events in calendars. + # Get info about events in calendars. # - # @option arguments [String] :calendar_id The ID of the calendar containing the events - # @option arguments [String] :job_id Get events for the job. When this option is used calendar_id must be '_all' - # @option arguments [String] :start Get events after this time - # @option arguments [Date] :end Get events before this time - # @option arguments [Integer] :from Skips a number of events - # @option arguments [Integer] :size Specifies a max number of events to get + # @option arguments [String] :calendar_id A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids or a wildcard expression. You can get information for all calendars by using +_all+ or +*+ or by omitting the calendar identifier. (*Required*) + # @option arguments [String, Time] :end Specifies to get events with timestamps earlier than this time. + # @option arguments [Integer] :from Skips the specified number of events. Server default: 0. + # @option arguments [String] :job_id Specifies to get events for a specific anomaly detection job identifier or job group. It must be used with a calendar identifier of +_all+ or +*+. + # @option arguments [Integer] :size Specifies the maximum number of events to obtain. Server default: 100. + # @option arguments [String, Time] :start Specifies to get events with timestamps after this time. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar-event.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-calendar-events # def get_calendar_events(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_calendar_events' } @@ -52,7 +52,7 @@ def get_calendar_events(arguments = {}) _calendar_id = arguments.delete(:calendar_id) method = Elasticsearch::API::HTTP_GET - path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/events" + path = "_ml/calendars/#{Utils.listify(_calendar_id)}/events" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_calendars.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_calendars.rb index b068075db..0a2bde4ba 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_calendars.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_calendars.rb @@ -15,22 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves configuration information for calendars. + # Get calendar configuration info. # - # @option arguments [String] :calendar_id The ID of the calendar to fetch - # @option arguments [Integer] :from skips a number of calendars - # @option arguments [Integer] :size specifies a max number of calendars to get + # @option arguments [String] :calendar_id A string that uniquely identifies a calendar. You can get information for multiple calendars by using a comma-separated list of ids or a wildcard expression. You can get information for all calendars by using +_all+ or +*+ or by omitting the calendar identifier. + # @option arguments [Integer] :from Skips the specified number of calendars. This parameter is supported only when you omit the calendar identifier. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of calendars to obtain. This parameter is supported only when you omit the calendar identifier. Server default: 10000. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The from and size parameters optionally sent in the body + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-calendar.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-calendars # def get_calendars(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_calendars' } @@ -53,11 +53,11 @@ def get_calendars(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _calendar_id - "_ml/calendars/#{Utils.__listify(_calendar_id)}" - else - '_ml/calendars' - end + path = if _calendar_id + "_ml/calendars/#{Utils.listify(_calendar_id)}" + else + '_ml/calendars' + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_categories.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_categories.rb index 4bac8ea0e..4410a7080 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_categories.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_categories.rb @@ -15,29 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves anomaly detection job results for one or more categories. + # Get anomaly detection job results for categories. # - # @option arguments [String] :job_id The name of the job - # @option arguments [Long] :category_id The identifier of the category definition of interest - # @option arguments [Integer] :from skips a number of categories - # @option arguments [Integer] :size specifies a max number of categories to get - # @option arguments [String] :partition_field_value Specifies the partition to retrieve categories for. This is optional, and should never be used for jobs where per-partition categorization is disabled. + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String] :category_id Identifier for the category, which is unique in the job. If you specify + # neither the category ID nor the partition_field_value, the API returns + # information about all categories. If you specify only the + # partition_field_value, it returns information about all categories for + # the specified partition. + # @option arguments [Integer] :from Skips the specified number of categories. Server default: 0. + # @option arguments [String] :partition_field_value Only return categories for the specified partition. + # @option arguments [Integer] :size Specifies the maximum number of categories to obtain. Server default: 100. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Category selection details if not provided in URI + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-category.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-categories # def get_categories(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_categories' } - defined_params = %i[job_id category_id].each_with_object({}) do |variable, set_variables| + defined_params = [:job_id, :category_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -59,11 +63,11 @@ def get_categories(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _job_id && _category_id - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/categories/#{Utils.__listify(_category_id)}" - else - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/categories" - end + path = if _job_id && _category_id + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/results/categories/#{Utils.listify(_category_id)}" + else + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/results/categories" + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics.rb index a6a097d65..9d178afa7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics.rb @@ -15,23 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves configuration information for data frame analytics jobs. + # Get data frame analytics job configuration info. + # You can get information for multiple data frame analytics jobs in a single + # API request by using a comma-separated list of data frame analytics jobs or a + # wildcard expression. # - # @option arguments [String] :id The ID of the data frame analytics to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) - # @option arguments [Integer] :from skips a number of analytics - # @option arguments [Integer] :size specifies a max number of analytics to get - # @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on data frame analytics PUT + # @option arguments [String] :id Identifier for the data frame analytics job. If you do not specify this + # option, the API returns information for the first hundred data frame + # analytics jobs. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no data frame analytics + # jobs that match. + # - Contains the +_all+ string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # The default value returns an empty data_frame_analytics array when there + # are no matches and the subset of results when there are partial matches. + # If this parameter is +false+, the request returns a 404 status code when + # there are no matches or only partial matches. Server default: true. + # @option arguments [Integer] :from Skips the specified number of data frame analytics jobs. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of data frame analytics jobs to obtain. Server default: 100. + # @option arguments [Boolean] :exclude_generated Indicates if certain fields should be removed from the configuration on + # retrieval. This allows the configuration to be in an acceptable format to + # be retrieved and then added to another cluster. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-data-frame-analytics # def get_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_data_frame_analytics' } @@ -50,7 +65,7 @@ def get_data_frame_analytics(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _id - "_ml/data_frame/analytics/#{Utils.__listify(_id)}" + "_ml/data_frame/analytics/#{Utils.listify(_id)}" else '_ml/data_frame/analytics' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics_stats.rb index 5a12263db..fa39c69b1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_data_frame_analytics_stats.rb @@ -15,23 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves usage information for data frame analytics jobs. + # Get data frame analytics jobs usage info. # - # @option arguments [String] :id The ID of the data frame analytics stats to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) - # @option arguments [Integer] :from skips a number of analytics - # @option arguments [Integer] :size specifies a max number of analytics to get - # @option arguments [Boolean] :verbose whether the stats response should be verbose + # @option arguments [String] :id Identifier for the data frame analytics job. If you do not specify this + # option, the API returns information for the first hundred data frame + # analytics jobs. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no data frame analytics + # jobs that match. + # - Contains the +_all+ string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # The default value returns an empty data_frame_analytics array when there + # are no matches and the subset of results when there are partial matches. + # If this parameter is +false+, the request returns a 404 status code when + # there are no matches or only partial matches. Server default: true. + # @option arguments [Integer] :from Skips the specified number of data frame analytics jobs. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of data frame analytics jobs to obtain. Server default: 100. + # @option arguments [Boolean] :verbose Defines whether the stats response should be verbose. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-dfanalytics-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-data-frame-analytics-stats # def get_data_frame_analytics_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_data_frame_analytics_stats' } @@ -50,7 +60,7 @@ def get_data_frame_analytics_stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _id - "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_stats" + "_ml/data_frame/analytics/#{Utils.listify(_id)}/_stats" else '_ml/data_frame/analytics/_stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb index 9a527cf53..59be4a353 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_datafeed_stats.rb @@ -15,20 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves usage information for datafeeds. + # Get datafeeds usage info. + # You can get statistics for multiple datafeeds in a single API request by + # using a comma-separated list of datafeeds or a wildcard expression. You can + # get statistics for all datafeeds by using +_all+, by specifying +*+ as the + # ++, or by omitting the ++. If the datafeed is stopped, the + # only information you receive is the +datafeed_id+ and the +state+. + # This API returns a maximum of 10,000 datafeeds. # - # @option arguments [String] :datafeed_id The ID of the datafeeds stats to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) + # @option arguments [String, Array] :datafeed_id Identifier for the datafeed. It can be a datafeed identifier or a + # wildcard expression. If you do not specify one of these options, the API + # returns information about all datafeeds. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no datafeeds that match. + # - Contains the +_all+ string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # The default value is +true+, which returns an empty +datafeeds+ array + # when there are no matches and the subset of results when there are + # partial matches. If this parameter is +false+, the request returns a + # +404+ status code when there are no matches or only partial matches. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-datafeed-stats # def get_datafeed_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_datafeed_stats' } @@ -47,7 +62,7 @@ def get_datafeed_stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _datafeed_id - "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_stats" + "_ml/datafeeds/#{Utils.listify(_datafeed_id)}/_stats" else '_ml/datafeeds/_stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb index f7c0d75e1..2c2bceb6c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_datafeeds.rb @@ -15,21 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves configuration information for datafeeds. + # Get datafeeds configuration info. + # You can get information for multiple datafeeds in a single API request by + # using a comma-separated list of datafeeds or a wildcard expression. You can + # get information for all datafeeds by using +_all+, by specifying +*+ as the + # ++, or by omitting the ++. + # This API returns a maximum of 10,000 datafeeds. # - # @option arguments [String] :datafeed_id The ID of the datafeeds to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - # @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on datafeed PUT + # @option arguments [String, Array] :datafeed_id Identifier for the datafeed. It can be a datafeed identifier or a + # wildcard expression. If you do not specify one of these options, the API + # returns information about all datafeeds. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no datafeeds that match. + # - Contains the +_all+ string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # The default value is +true+, which returns an empty +datafeeds+ array + # when there are no matches and the subset of results when there are + # partial matches. If this parameter is +false+, the request returns a + # +404+ status code when there are no matches or only partial matches. + # @option arguments [Boolean] :exclude_generated Indicates if certain fields should be removed from the configuration on + # retrieval. This allows the configuration to be in an acceptable format to + # be retrieved and then added to another cluster. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-datafeed.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-datafeeds # def get_datafeeds(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_datafeeds' } @@ -48,7 +64,7 @@ def get_datafeeds(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _datafeed_id - "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}" + "_ml/datafeeds/#{Utils.listify(_datafeed_id)}" else '_ml/datafeeds' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_filters.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_filters.rb index 740d6087d..3e17278c2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_filters.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_filters.rb @@ -15,21 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves filters. + # Get filters. + # You can get a single filter or all filters. # - # @option arguments [String] :filter_id The ID of the filter to fetch - # @option arguments [Integer] :from skips a number of filters - # @option arguments [Integer] :size specifies a max number of filters to get + # @option arguments [String, Array] :filter_id A string that uniquely identifies a filter. + # @option arguments [Integer] :from Skips the specified number of filters. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of filters to obtain. Server default: 100. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-filter.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-filters # def get_filters(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_filters' } @@ -48,7 +49,7 @@ def get_filters(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _filter_id - "_ml/filters/#{Utils.__listify(_filter_id)}" + "_ml/filters/#{Utils.listify(_filter_id)}" else '_ml/filters' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_influencers.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_influencers.rb index c26cfe0ee..65b29fbc1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_influencers.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_influencers.rb @@ -15,28 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves anomaly detection job results for one or more influencers. + # Get anomaly detection job results for influencers. + # Influencers are the entities that have contributed to, or are to blame for, + # the anomalies. Influencer results are available only if an + # +influencer_field_name+ is specified in the job configuration. # - # @option arguments [String] :job_id Identifier for the anomaly detection job - # @option arguments [Boolean] :exclude_interim Exclude interim results - # @option arguments [Integer] :from skips a number of influencers - # @option arguments [Integer] :size specifies a max number of influencers to get - # @option arguments [String] :start start timestamp for the requested influencers - # @option arguments [String] :end end timestamp for the requested influencers - # @option arguments [Double] :influencer_score influencer score threshold for the requested influencers - # @option arguments [String] :sort sort field for the requested influencers - # @option arguments [Boolean] :desc whether the results should be sorted in decending order + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [Boolean] :desc If true, the results are sorted in descending order. + # @option arguments [String, Time] :end Returns influencers with timestamps earlier than this time. + # The default value means it is unset and results are not limited to + # specific timestamps. Server default: -1. + # @option arguments [Boolean] :exclude_interim If true, the output excludes interim results. By default, interim results + # are included. + # @option arguments [Float] :influencer_score Returns influencers with anomaly scores greater than or equal to this + # value. Server default: 0. + # @option arguments [Integer] :from Skips the specified number of influencers. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of influencers to obtain. Server default: 100. + # @option arguments [String] :sort Specifies the sort field for the requested influencers. By default, the + # influencers are sorted by the +influencer_score+ value. + # @option arguments [String, Time] :start Returns influencers with timestamps after this time. The default value + # means it is unset and results are not limited to specific timestamps. Server default: -1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Influencer selection criteria + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-influencer.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-influencers # def get_influencers(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_influencers' } @@ -61,7 +70,7 @@ def get_influencers(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/influencers" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/results/influencers" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb index a775aa682..ece204139 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_job_stats.rb @@ -15,20 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves usage information for anomaly detection jobs. + # Get anomaly detection jobs usage info. # - # @option arguments [String] :job_id The ID of the jobs stats to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) + # @option arguments [String] :job_id Identifier for the anomaly detection job. It can be a job identifier, a + # group name, a comma-separated list of jobs, or a wildcard expression. If + # you do not specify one of these options, the API returns information for + # all anomaly detection jobs. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no jobs that match. + # - Contains the _all string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # If +true+, the API returns an empty +jobs+ array when + # there are no matches and the subset of results when there are partial + # matches. If +false+, the API returns a +404+ status + # code when there are no matches or only partial matches. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-job-stats # def get_job_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_job_stats' } @@ -47,7 +57,7 @@ def get_job_stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _job_id - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_stats" + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_stats" else '_ml/anomaly_detectors/_stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_jobs.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_jobs.rb index ed5680106..7fede94ea 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_jobs.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_jobs.rb @@ -15,21 +15,36 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves configuration information for anomaly detection jobs. + # Get anomaly detection jobs configuration info. + # You can get information for multiple anomaly detection jobs in a single API + # request by using a group name, a comma-separated list of jobs, or a wildcard + # expression. You can get information for all anomaly detection jobs by using + # +_all+, by specifying +*+ as the ++, or by omitting the ++. # - # @option arguments [String] :job_id The ID of the jobs to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) - # @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on job PUT + # @option arguments [String, Array] :job_id Identifier for the anomaly detection job. It can be a job identifier, a + # group name, or a wildcard expression. If you do not specify one of these + # options, the API returns information for all anomaly detection jobs. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no jobs that match. + # - Contains the _all string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # The default value is +true+, which returns an empty +jobs+ array when + # there are no matches and the subset of results when there are partial + # matches. If this parameter is +false+, the request returns a +404+ status + # code when there are no matches or only partial matches. Server default: true. + # @option arguments [Boolean] :exclude_generated Indicates if certain fields should be removed from the configuration on + # retrieval. This allows the configuration to be in an acceptable format to + # be retrieved and then added to another cluster. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-jobs # def get_jobs(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_jobs' } @@ -48,7 +63,7 @@ def get_jobs(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _job_id - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}" + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}" else '_ml/anomaly_detectors' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_memory_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_memory_stats.rb index 001adaa2d..082aa30af 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_memory_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_memory_stats.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Returns information on how ML is using memory. + # Get machine learning memory usage info. + # Get information about how machine learning jobs and trained models are using memory, + # on each node, both within the JVM heap, and natively, outside of the JVM. # - # @option arguments [String] :node_id Specifies the node or nodes to retrieve stats for. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :node_id The names of particular nodes in the cluster to target. For example, +nodeId1,nodeId2+ or + # +ml:true+ + # @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. If no response is received before the timeout expires, the request + # fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-memory.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-memory-stats # def get_memory_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_memory_stats' } @@ -48,7 +53,7 @@ def get_memory_stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _node_id - "_ml/memory/#{Utils.__listify(_node_id)}/_stats" + "_ml/memory/#{Utils.listify(_node_id)}/_stats" else '_ml/memory/_stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb index 561bd95ba..0aadfe94b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_model_snapshot_upgrade_stats.rb @@ -15,26 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Gets stats for anomaly detection job model snapshot upgrades that are in progress. + # Get anomaly detection job model snapshot upgrade usage info. # - # @option arguments [String] :job_id The ID of the job. May be a wildcard, comma separated list or `_all`. - # @option arguments [String] :snapshot_id The ID of the snapshot. May be a wildcard, comma separated list or `_all`. - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.) + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String] :snapshot_id A numerical character string that uniquely identifies the model snapshot. You can get information for multiple + # snapshots by using a comma-separated list or a wildcard expression. You can get all snapshots by using +_all+, + # by specifying +*+ as the snapshot ID, or by omitting the snapshot ID. (*Required*) + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no jobs that match. + # - Contains the _all string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # The default value is true, which returns an empty jobs array when there are no matches and the subset of results + # when there are partial matches. If this parameter is false, the request returns a 404 status code when there are + # no matches or only partial matches. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-job-model-snapshot-upgrade-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-model-snapshot-upgrade-stats # def get_model_snapshot_upgrade_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_model_snapshot_upgrade_stats' } - defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| + defined_params = [:job_id, :snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -52,7 +60,7 @@ def get_model_snapshot_upgrade_stats(arguments = {}) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_GET - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_upgrade/_stats" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/model_snapshots/#{Utils.listify(_snapshot_id)}/_upgrade/_stats" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb index df56a11e8..03886805d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_model_snapshots.rb @@ -15,32 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves information about model snapshots. + # Get model snapshots info. # - # @option arguments [String] :job_id The ID of the job to fetch - # @option arguments [String] :snapshot_id The ID of the snapshot to fetch - # @option arguments [Integer] :from Skips a number of documents - # @option arguments [Integer] :size The default number of documents returned in queries as a string. - # @option arguments [Date] :start The filter 'start' query parameter - # @option arguments [Date] :end The filter 'end' query parameter - # @option arguments [String] :sort Name of the field to sort on - # @option arguments [Boolean] :desc True if the results should be sorted in descending order + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String] :snapshot_id A numerical character string that uniquely identifies the model snapshot. You can get information for multiple + # snapshots by using a comma-separated list or a wildcard expression. You can get all snapshots by using +_all+, + # by specifying +*+ as the snapshot ID, or by omitting the snapshot ID. + # @option arguments [Boolean] :desc If true, the results are sorted in descending order. + # @option arguments [String, Time] :end Returns snapshots with timestamps earlier than this time. + # @option arguments [Integer] :from Skips the specified number of snapshots. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of snapshots to obtain. Server default: 100. + # @option arguments [String] :sort Specifies the sort field for the requested snapshots. By default, the + # snapshots are sorted by their timestamp. + # @option arguments [String, Time] :start Returns snapshots with timestamps after this time. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Model snapshot selection criteria + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-snapshot.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-model-snapshots # def get_model_snapshots(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_model_snapshots' } - defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| + defined_params = [:job_id, :snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -62,11 +65,11 @@ def get_model_snapshots(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _job_id && _snapshot_id - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}" - else - "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots" - end + path = if _job_id && _snapshot_id + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/model_snapshots/#{Utils.listify(_snapshot_id)}" + else + "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/model_snapshots" + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb index fa40a1423..4942ad413 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_overall_buckets.rb @@ -15,27 +15,59 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves overall bucket results that summarize the bucket results of multiple anomaly detection jobs. + # Get overall bucket results. + # Retrievs overall bucket results that summarize the bucket results of + # multiple anomaly detection jobs. + # The +overall_score+ is calculated by combining the scores of all the + # buckets within the overall bucket span. First, the maximum + # +anomaly_score+ per anomaly detection job in the overall bucket is + # calculated. Then the +top_n+ of those scores are averaged to result in + # the +overall_score+. This means that you can fine-tune the + # +overall_score+ so that it is more or less sensitive to the number of + # jobs that detect an anomaly at the same time. For example, if you set + # +top_n+ to +1+, the +overall_score+ is the maximum bucket score in the + # overall bucket. Alternatively, if you set +top_n+ to the number of jobs, + # the +overall_score+ is high only when all jobs detect anomalies in that + # overall bucket. If you set the +bucket_span+ parameter (to a value + # greater than its default), the +overall_score+ is the maximum + # +overall_score+ of the overall buckets that have a span equal to the + # jobs' largest bucket span. # - # @option arguments [String] :job_id The job IDs for which to calculate overall bucket results - # @option arguments [Integer] :top_n The number of top job bucket scores to be used in the overall_score calculation - # @option arguments [String] :bucket_span The span of the overall buckets. Defaults to the longest job bucket_span - # @option arguments [Double] :overall_score Returns overall buckets with overall scores higher than this value - # @option arguments [Boolean] :exclude_interim If true overall buckets that include interim buckets will be excluded - # @option arguments [String] :start Returns overall buckets with timestamps after this time - # @option arguments [String] :end Returns overall buckets with timestamps earlier than this time - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified) + # @option arguments [String] :job_id Identifier for the anomaly detection job. It can be a job identifier, a + # group name, a comma-separated list of jobs or groups, or a wildcard + # expression.You can summarize the bucket results for all anomaly detection jobs by + # using +_all+ or by specifying +*+ as the ++. (*Required*) + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no jobs that match. + # - Contains the +_all+ string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # If +true+, the request returns an empty +jobs+ array when there are no + # matches and the subset of results when there are partial matches. If this + # parameter is +false+, the request returns a +404+ status code when there + # are no matches or only partial matches. Server default: true. + # @option arguments [Time] :bucket_span The span of the overall buckets. Must be greater or equal to the largest + # bucket span of the specified anomaly detection jobs, which is the default + # value.By default, an overall bucket has a span equal to the largest bucket span + # of the specified anomaly detection jobs. To override that behavior, use + # the optional +bucket_span+ parameter. + # @option arguments [String, Time] :end Returns overall buckets with timestamps earlier than this time. + # @option arguments [Boolean] :exclude_interim If +true+, the output excludes interim results. + # @option arguments [Double, String] :overall_score Returns overall buckets with overall scores greater than or equal to this + # value. + # @option arguments [String, Time] :start Returns overall buckets with timestamps after this time. + # @option arguments [Integer] :top_n The number of top anomaly detection job bucket scores to be used in the + # +overall_score+ calculation. Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Overall bucket selection details if not provided in URI + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-overall-buckets.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-overall-buckets # def get_overall_buckets(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_overall_buckets' } @@ -60,7 +92,7 @@ def get_overall_buckets(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/overall_buckets" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/results/overall_buckets" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_records.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_records.rb index 66b4f6b7d..bd6b57eb8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_records.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_records.rb @@ -15,28 +15,40 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves anomaly records for an anomaly detection job. + # Get anomaly records for an anomaly detection job. + # Records contain the detailed analytical results. They describe the anomalous + # activity that has been identified in the input data based on the detector + # configuration. + # There can be many anomaly records depending on the characteristics and size + # of the input data. In practice, there are often too many to be able to + # manually process them. The machine learning features therefore perform a + # sophisticated aggregation of the anomaly records into buckets. + # The number of record results depends on the number of anomalies found in each + # bucket, which relates to the number of time series being modeled and the + # number of detectors. # - # @option arguments [String] :job_id The ID of the job - # @option arguments [Boolean] :exclude_interim Exclude interim results - # @option arguments [Integer] :from skips a number of records - # @option arguments [Integer] :size specifies a max number of records to get - # @option arguments [String] :start Start time filter for records - # @option arguments [String] :end End time filter for records - # @option arguments [Double] :record_score Returns records with anomaly scores greater or equal than this value - # @option arguments [String] :sort Sort records by a particular field - # @option arguments [Boolean] :desc Set the sort direction + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [Boolean] :desc If true, the results are sorted in descending order. + # @option arguments [String, Time] :end Returns records with timestamps earlier than this time. The default value + # means results are not limited to specific timestamps. Server default: -1. + # @option arguments [Boolean] :exclude_interim If +true+, the output excludes interim results. + # @option arguments [Integer] :from Skips the specified number of records. Server default: 0. + # @option arguments [Float] :record_score Returns records with anomaly scores greater or equal than this value. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of records to obtain. Server default: 100. + # @option arguments [String] :sort Specifies the sort field for the requested records. Server default: record_score. + # @option arguments [String, Time] :start Returns records with timestamps after this time. The default value means + # results are not limited to specific timestamps. Server default: -1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Record selection criteria + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-get-record.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-records # def get_records(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_records' } @@ -61,7 +73,7 @@ def get_records(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/results/records" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/results/records" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_trained_models.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_trained_models.rb index 09b781394..181f6bd74 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_trained_models.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_trained_models.rb @@ -15,27 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves configuration information for a trained inference model. + # Get trained model configuration info. # - # @option arguments [String] :model_id The ID of the trained models to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) - # @option arguments [String] :include A comma-separate list of fields to optionally include. Valid options are 'definition' and 'total_feature_importance'. Default is none. - # @option arguments [Boolean] :include_model_definition Should the full model definition be included in the results. These definitions can be large. So be cautious when including them. Defaults to false. *Deprecated* - # @option arguments [Boolean] :decompress_definition Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true. - # @option arguments [Integer] :from skips a number of trained models - # @option arguments [Integer] :size specifies a max number of trained models to get - # @option arguments [List] :tags A comma-separated list of tags that the model must have. - # @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on model PUT + # @option arguments [String, Array] :model_id The unique identifier of the trained model or a model alias.You can get information for multiple trained models in a single API + # request by using a comma-separated list of model IDs or a wildcard + # expression. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no models that match. + # - Contains the _all string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # If true, it returns an empty array when there are no matches and the + # subset of results when there are partial matches. Server default: true. + # @option arguments [Boolean] :decompress_definition Specifies whether the included model definition should be returned as a + # JSON map (true) or in a custom compressed format (false). Server default: true. + # @option arguments [Boolean] :exclude_generated Indicates if certain fields should be removed from the configuration on + # retrieval. This allows the configuration to be in an acceptable format to + # be retrieved and then added to another cluster. + # @option arguments [Integer] :from Skips the specified number of models. Server default: 0. + # @option arguments [String] :include A comma delimited string of optional fields to include in the response + # body. + # @option arguments [Integer] :size Specifies the maximum number of models to obtain. Server default: 100. + # @option arguments [String] :tags A comma delimited string of tags. A trained model can have many tags, or + # none. When supplied, only trained models that contain all the supplied + # tags are returned. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-trained-models # def get_trained_models(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_trained_models' } @@ -54,7 +66,7 @@ def get_trained_models(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _model_id - "_ml/trained_models/#{Utils.__listify(_model_id)}" + "_ml/trained_models/#{Utils.listify(_model_id)}" else '_ml/trained_models' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_trained_models_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_trained_models_stats.rb index 0d56ddb20..2b3767b81 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_trained_models_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/get_trained_models_stats.rb @@ -15,22 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Retrieves usage information for trained inference models. + # Get trained models usage info. + # You can get usage information for multiple trained + # models in a single API request by using a comma-separated list of model IDs or a wildcard expression. # - # @option arguments [String] :model_id The ID of the trained models stats to fetch - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified) - # @option arguments [Integer] :from skips a number of trained models - # @option arguments [Integer] :size specifies a max number of trained models to get + # @option arguments [String, Array] :model_id The unique identifier of the trained model or a model alias. It can be a + # comma-separated list or a wildcard expression. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no models that match. + # - Contains the _all string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # If true, it returns an empty array when there are no matches and the + # subset of results when there are partial matches. Server default: true. + # @option arguments [Integer] :from Skips the specified number of models. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of models to obtain. Server default: 100. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-trained-models-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-trained-models-stats # def get_trained_models_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.get_trained_models_stats' } @@ -49,7 +57,7 @@ def get_trained_models_stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _model_id - "_ml/trained_models/#{Utils.__listify(_model_id)}/_stats" + "_ml/trained_models/#{Utils.listify(_model_id)}/_stats" else '_ml/trained_models/_stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/infer_trained_model.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/infer_trained_model.rb index 22631f81f..cf4ee04d6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/infer_trained_model.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/infer_trained_model.rb @@ -29,19 +29,13 @@ module Actions # @option arguments [Hash] :headers Custom HTTP headers # @option arguments [Hash] :body request body # - # *Deprecation notice*: - # /_ml/trained_models/{model_id}/deployment/_infer is deprecated. Use /_ml/trained_models/{model_id}/_infer instead - # Deprecated since version 8.3.0 - # - # # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-infer-trained-model # def infer_trained_model(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.infer_trained_model' } - defined_params = [:model_id].inject({}) do |set_variables, variable| + defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -56,7 +50,7 @@ def infer_trained_model(arguments = {}) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/trained_models/#{Utils.__listify(_model_id)}/_infer" + path = "_ml/trained_models/#{Utils.listify(_model_id)}/_infer" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/info.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/info.rb index c1f3d4667..eaccba1b3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/info.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/info.rb @@ -15,18 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Returns defaults and limits used by machine learning. + # Get machine learning information. + # Get defaults and limits used by machine learning. + # This endpoint is designed to be used by a user interface that needs to fully + # understand machine learning configurations where some options are not + # specified, meaning that the defaults should be used. This endpoint may be + # used to find out what those defaults are. It also provides information about + # the maximum size of machine learning jobs that could run in the current + # cluster configuration. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-ml-info.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-info # def info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.info' } @@ -34,7 +41,7 @@ def info(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_ml/info' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/open_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/open_job.rb index 69ab6ad44..fec9b337a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/open_job.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/open_job.rb @@ -15,20 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Opens one or more anomaly detection jobs. + # Open anomaly detection jobs. + # An anomaly detection job must be opened to be ready to receive and analyze + # data. It can be opened and closed multiple times throughout its lifecycle. + # When you open a new job, it starts with an empty model. + # When you open an existing job, the most recent model state is automatically + # loaded. The job is ready to resume its analysis from where it left off, once + # new data is received. # - # @option arguments [String] :job_id The ID of the job to open + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [Time] :timeout Controls the time to wait until a job has opened. Server default: 30m. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Query parameters can be specified in the body + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-open-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-open-job # def open_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.open_job' } @@ -48,8 +55,8 @@ def open_job(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_open" - params = {} + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_open" + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/post_calendar_events.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/post_calendar_events.rb index c80bc49ea..2fa75ce5f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/post_calendar_events.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/post_calendar_events.rb @@ -15,20 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Posts scheduled events in a calendar. + # Add scheduled events to the calendar. # - # @option arguments [String] :calendar_id The ID of the calendar to modify + # @option arguments [String] :calendar_id A string that uniquely identifies a calendar. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body A list of events (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-calendar-event.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-post-calendar-events # def post_calendar_events(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.post_calendar_events' } @@ -49,7 +49,7 @@ def post_calendar_events(arguments = {}) _calendar_id = arguments.delete(:calendar_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/events" + path = "_ml/calendars/#{Utils.listify(_calendar_id)}/events" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/post_data.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/post_data.rb index f19f58530..4c5c8c8c0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/post_data.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/post_data.rb @@ -15,22 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Sends data to an anomaly detection job for analysis. + # Send data to an anomaly detection job for analysis. + # IMPORTANT: For each job, data can be accepted from only a single connection at a time. + # It is not currently possible to post data to multiple jobs using wildcards or a comma-separated list. # - # @option arguments [String] :job_id The name of the job receiving the data - # @option arguments [String] :reset_start Optional parameter to specify the start of the bucket resetting range - # @option arguments [String] :reset_end Optional parameter to specify the end of the bucket resetting range + # @option arguments [String] :job_id Identifier for the anomaly detection job. The job must have a state of open to receive and process the data. (*Required*) + # @option arguments [String, Time] :reset_end Specifies the end of the bucket resetting range. + # @option arguments [String, Time] :reset_start Specifies the start of the bucket resetting range. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The data to process (*Required*) + # @option arguments [Hash] :body data # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-post-data.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-post-data # def post_data(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.post_data' } @@ -51,7 +53,7 @@ def post_data(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_data" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_data" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/preview_data_frame_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/preview_data_frame_analytics.rb index 33e7ca967..8f42a9eea 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/preview_data_frame_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/preview_data_frame_analytics.rb @@ -15,20 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Previews that will be analyzed given a data frame analytics config. + # Preview features used by data frame analytics. + # Preview the extracted features used by a data frame analytics config. # - # @option arguments [String] :id The ID of the data frame analytics to preview + # @option arguments [String] :id Identifier for the data frame analytics job. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The data frame analytics config to preview + # @option arguments [Hash] :body request body # - # @see http://www.elastic.co/guide/en/elasticsearch/reference/current/preview-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-preview-data-frame-analytics # def preview_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.preview_data_frame_analytics' } @@ -51,11 +52,11 @@ def preview_data_frame_analytics(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _id - "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_preview" - else - '_ml/data_frame/analytics/_preview' - end + path = if _id + "_ml/data_frame/analytics/#{Utils.listify(_id)}/_preview" + else + '_ml/data_frame/analytics/_preview' + end params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/preview_datafeed.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/preview_datafeed.rb index 78f421329..8f165e5b3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/preview_datafeed.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/preview_datafeed.rb @@ -15,22 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Previews a datafeed. + # Preview a datafeed. + # This API returns the first "page" of search results from a datafeed. + # You can preview an existing datafeed or provide configuration details for a datafeed + # and anomaly detection job in the API. The preview shows the structure of the data + # that will be passed to the anomaly detection engine. + # IMPORTANT: When Elasticsearch security features are enabled, the preview uses the credentials of the user that + # called the API. However, when the datafeed starts it uses the roles of the last user that created or updated the + # datafeed. To get a preview that accurately reflects the behavior of the datafeed, use the appropriate credentials. + # You can also use secondary authorization headers to supply the credentials. # - # @option arguments [String] :datafeed_id The ID of the datafeed to preview - # @option arguments [String] :start The start time from where the datafeed preview should begin - # @option arguments [String] :end The end time when the datafeed preview should stop + # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase + # alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric + # characters. NOTE: If you use this path parameter, you cannot provide datafeed or anomaly detection job + # configuration details in the request body. + # @option arguments [String, Time] :start The start time from where the datafeed preview should begin + # @option arguments [String, Time] :end The end time when the datafeed preview should stop # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The datafeed config and job config with which to execute the preview + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-preview-datafeed.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-preview-datafeed # def preview_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.preview_datafeed' } @@ -53,11 +64,11 @@ def preview_datafeed(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _datafeed_id - "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_preview" - else - '_ml/datafeeds/_preview' - end + path = if _datafeed_id + "_ml/datafeeds/#{Utils.listify(_datafeed_id)}/_preview" + else + '_ml/datafeeds/_preview' + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_calendar.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_calendar.rb index 6bac27c8c..7867aa163 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_calendar.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_calendar.rb @@ -15,20 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Instantiates a calendar. + # Create a calendar. # - # @option arguments [String] :calendar_id The ID of the calendar to create + # @option arguments [String] :calendar_id A string that uniquely identifies a calendar. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The calendar details + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-calendar # def put_calendar(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_calendar' } @@ -48,7 +48,7 @@ def put_calendar(arguments = {}) _calendar_id = arguments.delete(:calendar_id) method = Elasticsearch::API::HTTP_PUT - path = "_ml/calendars/#{Utils.__listify(_calendar_id)}" + path = "_ml/calendars/#{Utils.listify(_calendar_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_calendar_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_calendar_job.rb index 5c7b779e8..e7818bd8e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_calendar_job.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_calendar_job.rb @@ -15,25 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Adds an anomaly detection job to a calendar. + # Add anomaly detection job to calendar. # - # @option arguments [String] :calendar_id The ID of the calendar to modify - # @option arguments [String] :job_id The ID of the job to add to the calendar + # @option arguments [String] :calendar_id A string that uniquely identifies a calendar. (*Required*) + # @option arguments [String, Array] :job_id An identifier for the anomaly detection jobs. It can be a job identifier, a group name, or a comma-separated list of jobs or groups. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-calendar-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-calendar-job # def put_calendar_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_calendar_job' } - defined_params = %i[calendar_id job_id].each_with_object({}) do |variable, set_variables| + defined_params = [:calendar_id, :job_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +51,7 @@ def put_calendar_job(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_PUT - path = "_ml/calendars/#{Utils.__listify(_calendar_id)}/jobs/#{Utils.__listify(_job_id)}" + path = "_ml/calendars/#{Utils.listify(_calendar_id)}/jobs/#{Utils.listify(_job_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_data_frame_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_data_frame_analytics.rb index 737b51a73..95bf1b7ca 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_data_frame_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_data_frame_analytics.rb @@ -15,20 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Instantiates a data frame analytics job. + # Create a data frame analytics job. + # This API creates a data frame analytics job that performs an analysis on the + # source indices and stores the outcome in a destination index. + # By default, the query used in the source configuration is +{"match_all": {}}+. + # If the destination index does not exist, it is created automatically when you start the job. + # If you supply only a subset of the regression or classification parameters, hyperparameter optimization occurs. It determines a value for each of the undefined parameters. # - # @option arguments [String] :id The ID of the data frame analytics to create + # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain + # lowercase alphanumeric characters (a-z and 0-9), hyphens, and + # underscores. It must start and end with alphanumeric characters. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The data frame analytics configuration (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-data-frame-analytics # def put_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_data_frame_analytics' } @@ -49,7 +56,7 @@ def put_data_frame_analytics(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT - path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}" + path = "_ml/data_frame/analytics/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_datafeed.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_datafeed.rb index 55ac67956..fb360bcf2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_datafeed.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_datafeed.rb @@ -15,24 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Instantiates a datafeed. + # Create a datafeed. + # Datafeeds retrieve data from Elasticsearch for analysis by an anomaly detection job. + # You can associate only one datafeed with each anomaly detection job. + # The datafeed contains a query that runs at a defined interval (+frequency+). + # If you are concerned about delayed data, you can add a delay (+query_delay') at each interval. + # By default, the datafeed uses the following query:+{"match_all": {"boost": 1}}+. + # When Elasticsearch security features are enabled, your datafeed remembers which roles the user who created it had + # at the time of creation and runs the query using those same roles. If you provide secondary authorization headers, + # those credentials are used instead. + # You must use Kibana, this API, or the create anomaly detection jobs API to create a datafeed. Do not add a datafeed + # directly to the+.ml-config+index. Do not give users+write+privileges on the+.ml-config` index. # - # @option arguments [String] :datafeed_id The ID of the datafeed to create - # @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false) - # @option arguments [Boolean] :allow_no_indices Ignore if the source indices expressions resolves to no concrete indices (default: true) - # @option arguments [Boolean] :ignore_throttled Ignore indices that are marked as throttled (default: true) - # @option arguments [String] :expand_wildcards Whether source index expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) + # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed. + # This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. + # It must start and end with alphanumeric characters. (*Required*) + # @option arguments [Boolean] :allow_no_indices If true, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the +_all+ + # string or when no indices are specified. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines + # whether wildcard expressions match hidden data streams. Supports comma-separated values. Server default: open. + # @option arguments [Boolean] :ignore_throttled If true, concrete, expanded, or aliased indices are ignored when frozen. Server default: true. + # @option arguments [Boolean] :ignore_unavailable If true, unavailable indices (missing or closed) are ignored. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The datafeed config (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-datafeed.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-datafeed # def put_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_datafeed' } @@ -53,7 +67,7 @@ def put_datafeed(arguments = {}) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_PUT - path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}" + path = "_ml/datafeeds/#{Utils.listify(_datafeed_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_filter.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_filter.rb index b08ad3dc1..47a01cbf0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_filter.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_filter.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Instantiates a filter. + # Create a filter. + # A filter contains a list of strings. It can be used by one or more anomaly detection jobs. + # Specifically, filters are referenced in the +custom_rules+ property of detector configuration objects. # - # @option arguments [String] :filter_id The ID of the filter to create + # @option arguments [String] :filter_id A string that uniquely identifies a filter. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The filter details (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-filter.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-filter # def put_filter(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_filter' } @@ -49,7 +51,7 @@ def put_filter(arguments = {}) _filter_id = arguments.delete(:filter_id) method = Elasticsearch::API::HTTP_PUT - path = "_ml/filters/#{Utils.__listify(_filter_id)}" + path = "_ml/filters/#{Utils.listify(_filter_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_job.rb index d5cebda59..610448a92 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_job.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_job.rb @@ -15,24 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Instantiates an anomaly detection job. + # Create an anomaly detection job. + # If you include a +datafeed_config+, you must have read index privileges on the source index. + # If you include a +datafeed_config+ but do not provide a query, the datafeed uses +{"match_all": {"boost": 1}}+. # - # @option arguments [String] :job_id The ID of the job to create - # @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false). Only set if datafeed_config is provided. - # @option arguments [Boolean] :allow_no_indices Ignore if the source indices expressions resolves to no concrete indices (default: true). Only set if datafeed_config is provided. - # @option arguments [Boolean] :ignore_throttled Ignore indices that are marked as throttled (default: true). Only set if datafeed_config is provided. - # @option arguments [String] :expand_wildcards Whether source index expressions should get expanded to open or closed indices (default: open). Only set if datafeed_config is provided. (options: open, closed, hidden, none, all) + # @option arguments [String] :job_id The identifier for the anomaly detection job. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric characters. (*Required*) + # @option arguments [Boolean] :allow_no_indices If +true+, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the + # +_all+ string or when no indices are specified. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines + # whether wildcard expressions match hidden data streams. Supports comma-separated values. Valid values are: + # - +all+: Match any data stream or index, including hidden ones. + # - +closed+: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. + # - +hidden+: Match hidden data streams and hidden indices. Must be combined with +open+, +closed+, or both. + # - +none+: Wildcard patterns are not accepted. + # - +open+: Match open, non-hidden indices. Also matches any non-hidden data stream. Server default: open. + # @option arguments [Boolean] :ignore_throttled If +true+, concrete, expanded or aliased indices are ignored when frozen. Server default: true. + # @option arguments [Boolean] :ignore_unavailable If +true+, unavailable indices (missing or closed) are ignored. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The job (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-put-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-job # def put_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_job' } @@ -53,7 +62,7 @@ def put_job(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_PUT - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model.rb index 5107273c5..026ae8a28 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model.rb @@ -15,22 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Creates an inference trained model. + # Create a trained model. + # Enable you to supply a trained model that is not created by data frame analytics. # - # @option arguments [String] :model_id The ID of the trained models to store - # @option arguments [Boolean] :defer_definition_decompression If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations. - # @option arguments [Boolean] :wait_for_completion Whether to wait for all child operations(e.g. model download) to complete, before returning or not. Default to false + # @option arguments [String] :model_id The unique identifier of the trained model. (*Required*) + # @option arguments [Boolean] :defer_definition_decompression If set to +true+ and a +compressed_definition+ is provided, + # the request defers definition decompression and skips relevant + # validations. + # @option arguments [Boolean] :wait_for_completion Whether to wait for all child operations (e.g. model download) + # to complete. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The trained model configuration (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model # def put_trained_model(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model' } @@ -51,7 +55,7 @@ def put_trained_model(arguments = {}) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_PUT - path = "_ml/trained_models/#{Utils.__listify(_model_id)}" + path = "_ml/trained_models/#{Utils.listify(_model_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_alias.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_alias.rb index 9da28749f..b618ac7e4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_alias.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_alias.rb @@ -15,26 +15,44 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Creates a new model alias (or reassigns an existing one) to refer to the trained model + # Create or update a trained model alias. + # A trained model alias is a logical name used to reference a single trained + # model. + # You can use aliases instead of trained model identifiers to make it easier to + # reference your models. For example, you can use aliases in inference + # aggregations and processors. + # An alias must be unique and refer to only a single trained model. However, + # you can have multiple aliases for each trained model. + # If you use this API to update an alias such that it references a different + # trained model ID and the model uses a different type of data frame analytics, + # an error occurs. For example, this situation occurs if you have a trained + # model for regression analysis and a trained model for classification + # analysis; you cannot reassign an alias from one type of trained model to + # another. + # If you use this API to update an alias and there are very few input fields in + # common between the old and new trained models for the model alias, the API + # returns a warning. # - # @option arguments [String] :model_alias The trained model alias to update - # @option arguments [String] :model_id The trained model where the model alias should be assigned - # @option arguments [Boolean] :reassign If the model_alias already exists and points to a separate model_id, this parameter must be true. Defaults to false. + # @option arguments [String] :model_alias The alias to create or update. This value cannot end in numbers. (*Required*) + # @option arguments [String] :model_id The identifier for the trained model that the alias refers to. (*Required*) + # @option arguments [Boolean] :reassign Specifies whether the alias gets reassigned to the specified trained + # model if it is already assigned to a different model. If the alias is + # already assigned and this parameter is false, the API returns an error. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-models-aliases.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model-alias # def put_trained_model_alias(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_alias' } - defined_params = %i[model_id model_alias].each_with_object({}) do |variable, set_variables| + defined_params = [:model_id, :model_alias].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -52,7 +70,7 @@ def put_trained_model_alias(arguments = {}) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_PUT - path = "_ml/trained_models/#{Utils.__listify(_model_id)}/model_aliases/#{Utils.__listify(_model_alias)}" + path = "_ml/trained_models/#{Utils.listify(_model_id)}/model_aliases/#{Utils.listify(_model_alias)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part.rb index 5fb6155e5..220a93b66 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_definition_part.rb @@ -15,26 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Creates part of a trained model definition + # Create part of a trained model definition. # - # @option arguments [String] :model_id The ID of the trained model for this definition part - # @option arguments [Integer] :part The part number + # @option arguments [String] :model_id The unique identifier of the trained model. (*Required*) + # @option arguments [Integer] :part The definition part number. When the definition is loaded for inference the definition parts are streamed in the + # order of their part number. The first part must be +0+ and the final part must be +total_parts - 1+. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The trained model definition part (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-definition-part.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model-definition-part # def put_trained_model_definition_part(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_definition_part' } - defined_params = %i[model_id part].each_with_object({}) do |variable, set_variables| + defined_params = [:model_id, :part].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,7 +54,7 @@ def put_trained_model_definition_part(arguments = {}) _part = arguments.delete(:part) method = Elasticsearch::API::HTTP_PUT - path = "_ml/trained_models/#{Utils.__listify(_model_id)}/definition/#{Utils.__listify(_part)}" + path = "_ml/trained_models/#{Utils.listify(_model_id)}/definition/#{Utils.listify(_part)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb index f080f5f76..7ef36f9b2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/put_trained_model_vocabulary.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Creates a trained model vocabulary + # Create a trained model vocabulary. + # This API is supported only for natural language processing (NLP) models. + # The vocabulary is stored in the index as described in +inference_config.*.vocabulary+ of the trained model definition. # - # @option arguments [String] :model_id The ID of the trained model for this vocabulary + # @option arguments [String] :model_id The unique identifier of the trained model. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The trained model vocabulary (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-trained-model-vocabulary.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-trained-model-vocabulary # def put_trained_model_vocabulary(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.put_trained_model_vocabulary' } @@ -49,7 +51,7 @@ def put_trained_model_vocabulary(arguments = {}) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_PUT - path = "_ml/trained_models/#{Utils.__listify(_model_id)}/vocabulary" + path = "_ml/trained_models/#{Utils.listify(_model_id)}/vocabulary" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/reset_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/reset_job.rb index a5ce0e1b2..0098ac6f0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/reset_job.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/reset_job.rb @@ -15,21 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Resets an existing anomaly detection job. + # Reset an anomaly detection job. + # All model state and results are deleted. The job is ready to start over as if + # it had just been created. + # It is not currently possible to reset multiple jobs using wildcards or a + # comma separated list. # - # @option arguments [String] :job_id The ID of the job to reset - # @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning - # @option arguments [Boolean] :delete_user_annotations Should annotations added by the user be deleted + # @option arguments [String] :job_id The ID of the job to reset. (*Required*) + # @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before + # returning. Server default: true. + # @option arguments [Boolean] :delete_user_annotations Specifies whether annotations that have been added by the + # user should be deleted along with any auto-generated annotations when the job is + # reset. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-reset-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-reset-job # def reset_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.reset_job' } @@ -49,7 +56,7 @@ def reset_job(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_reset" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_reset" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/revert_model_snapshot.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/revert_model_snapshot.rb index 80f70b212..ed2fa69b8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/revert_model_snapshot.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/revert_model_snapshot.rb @@ -15,27 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Reverts to a specific snapshot. + # Revert to a snapshot. + # The machine learning features react quickly to anomalous input, learning new + # behaviors in data. Highly anomalous input increases the variance in the + # models whilst the system learns whether this is a new step-change in behavior + # or a one-off event. In the case where this anomalous input is known to be a + # one-off, then it might be appropriate to reset the model state to a time + # before this event. For example, you might consider reverting to a saved + # snapshot after Black Friday or a critical system failure. # - # @option arguments [String] :job_id The ID of the job to fetch - # @option arguments [String] :snapshot_id The ID of the snapshot to revert to - # @option arguments [Boolean] :delete_intervening_results Should we reset the results back to the time of the snapshot? + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String] :snapshot_id You can specify +empty+ as the . Reverting to the empty + # snapshot means the anomaly detection job starts learning a new model from + # scratch when it is started. (*Required*) + # @option arguments [Boolean] :delete_intervening_results If true, deletes the results in the time period between the latest + # results and the time of the reverted snapshot. It also resets the model + # to accept records for this time period. If you choose not to delete + # intervening results when reverting a snapshot, the job will not accept + # input data that is older than the current time. If you want to resend + # data, then delete the intervening results. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Reversion options + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-revert-snapshot.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-revert-model-snapshot # def revert_model_snapshot(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.revert_model_snapshot' } - defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| + defined_params = [:job_id, :snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,7 +67,7 @@ def revert_model_snapshot(arguments = {}) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_revert" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/model_snapshots/#{Utils.listify(_snapshot_id)}/_revert" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/set_upgrade_mode.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/set_upgrade_mode.rb index 08bba4812..8658f9791 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/set_upgrade_mode.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/set_upgrade_mode.rb @@ -15,20 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Sets a cluster wide upgrade_mode setting that prepares machine learning indices for an upgrade. + # Set upgrade_mode for ML indices. + # Sets a cluster wide upgrade_mode setting that prepares machine learning + # indices for an upgrade. + # When upgrading your cluster, in some circumstances you must restart your + # nodes and reindex your machine learning indices. In those circumstances, + # there must be no machine learning jobs running. You can close the machine + # learning jobs, do the upgrade, then open all the jobs again. Alternatively, + # you can use this API to temporarily halt tasks associated with the jobs and + # datafeeds and prevent new jobs from opening. You can also use this API + # during upgrades that do not require you to reindex your machine learning + # indices, though stopping jobs is not a requirement in that case. + # You can see the current value for the upgrade_mode setting by using the get + # machine learning info API. # - # @option arguments [Boolean] :enabled Whether to enable upgrade_mode ML setting or not. Defaults to false. - # @option arguments [Time] :timeout Controls the time to wait before action times out. Defaults to 30 seconds + # @option arguments [Boolean] :enabled When +true+, it enables +upgrade_mode+ which temporarily halts all job + # and datafeed tasks and prohibits new job and datafeed tasks from + # starting. + # @option arguments [Time] :timeout The time to wait for the request to be completed. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-set-upgrade-mode.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-set-upgrade-mode # def set_upgrade_mode(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.set_upgrade_mode' } @@ -36,7 +50,7 @@ def set_upgrade_mode(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_ml/set_upgrade_mode' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_data_frame_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_data_frame_analytics.rb index f54893de3..09ae68db2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_data_frame_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_data_frame_analytics.rb @@ -15,21 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Starts a data frame analytics job. + # Start a data frame analytics job. + # A data frame analytics job can be started and stopped multiple times + # throughout its lifecycle. + # If the destination index does not exist, it is created automatically the + # first time you start the data frame analytics job. The + # +index.number_of_shards+ and +index.number_of_replicas+ settings for the + # destination index are copied from the source index. If there are multiple + # source indices, the destination index copies the highest setting values. The + # mappings for the destination index are also copied from the source indices. + # If there are any mapping conflicts, the job fails to start. + # If the destination index exists, it is used as is. You can therefore set up + # the destination index in advance with custom settings and mappings. # - # @option arguments [String] :id The ID of the data frame analytics to start - # @option arguments [Time] :timeout Controls the time to wait until the task has started. Defaults to 20 seconds + # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain + # lowercase alphanumeric characters (a-z and 0-9), hyphens, and + # underscores. It must start and end with alphanumeric characters. (*Required*) + # @option arguments [Time] :timeout Controls the amount of time to wait until the data frame analytics job + # starts. Server default: 20s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The start data frame analytics parameters # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-data-frame-analytics # def start_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.start_data_frame_analytics' } @@ -44,12 +57,12 @@ def start_data_frame_analytics(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_POST - path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_start" + path = "_ml/data_frame/analytics/#{Utils.listify(_id)}/_start" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_datafeed.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_datafeed.rb index ec6b3957d..6cfe5d538 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_datafeed.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_datafeed.rb @@ -15,23 +15,46 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Starts one or more datafeeds. + # Start datafeeds. + # A datafeed must be started in order to retrieve data from Elasticsearch. A datafeed can be started and stopped + # multiple times throughout its lifecycle. + # Before you can start a datafeed, the anomaly detection job must be open. Otherwise, an error occurs. + # If you restart a stopped datafeed, it continues processing input data from the next millisecond after it was stopped. + # If new data was indexed for that exact millisecond between stopping and starting, it will be ignored. + # When Elasticsearch security features are enabled, your datafeed remembers which roles the last user to create or + # update it had at the time of creation or update and runs the query using those same roles. If you provided secondary + # authorization headers when you created or updated the datafeed, those credentials are used instead. # - # @option arguments [String] :datafeed_id The ID of the datafeed to start - # @option arguments [String] :start The start time from where the datafeed should begin - # @option arguments [String] :end The end time when the datafeed should stop. When not set, the datafeed continues in real time - # @option arguments [Time] :timeout Controls the time to wait until a datafeed has started. Default to 20 seconds + # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed. This identifier can contain lowercase + # alphanumeric characters (a-z and 0-9), hyphens, and underscores. It must start and end with alphanumeric + # characters. (*Required*) + # @option arguments [String, Time] :end The time that the datafeed should end, which can be specified by using one of the following formats: + # - ISO 8601 format with milliseconds, for example +2017-01-22T06:00:00.000Z+ + # - ISO 8601 format without milliseconds, for example +2017-01-22T06:00:00+00:00+ + # - Milliseconds since the epoch, for example +1485061200000+ + # Date-time arguments using either of the ISO 8601 formats must have a time zone designator, where +Z+ is accepted + # as an abbreviation for UTC time. When a URL is expected (for example, in browsers), the +++ used in time zone + # designators must be encoded as +%2B+. + # The end time value is exclusive. If you do not specify an end time, the datafeed + # runs continuously. + # @option arguments [String, Time] :start The time that the datafeed should begin, which can be specified by using the same formats as the +end+ parameter. + # This value is inclusive. + # If you do not specify a start time and the datafeed is associated with a new anomaly detection job, the analysis + # starts from the earliest time for which data is available. + # If you restart a stopped datafeed and specify a start value that is earlier than the timestamp of the latest + # processed record, the datafeed continues from 1 millisecond after the timestamp of the latest processed record. + # @option arguments [Time] :timeout Specifies the amount of time to wait until a datafeed starts. Server default: 20s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The start datafeed parameters + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-start-datafeed.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-datafeed # def start_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.start_datafeed' } @@ -51,7 +74,7 @@ def start_datafeed(arguments = {}) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_start" + path = "_ml/datafeeds/#{Utils.listify(_datafeed_id)}/_start" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb index ddb800d1d..28962abf5 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/start_trained_model_deployment.rb @@ -55,9 +55,8 @@ module Actions def start_trained_model_deployment(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.start_trained_model_deployment' } - defined_params = [:model_id].inject({}) do |set_variables, variable| + defined_params = [:model_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -71,7 +70,7 @@ def start_trained_model_deployment(arguments = {}) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_start" + path = "_ml/trained_models/#{Utils.listify(_model_id)}/deployment/_start" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_data_frame_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_data_frame_analytics.rb index 142085941..740e6ca51 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_data_frame_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_data_frame_analytics.rb @@ -15,23 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Stops one or more data frame analytics jobs. + # Stop data frame analytics jobs. + # A data frame analytics job can be started and stopped multiple times + # throughout its lifecycle. # - # @option arguments [String] :id The ID of the data frame analytics to stop - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified) - # @option arguments [Boolean] :force True if the data frame analytics should be forcefully stopped - # @option arguments [Time] :timeout Controls the time to wait until the task has stopped. Defaults to 20 seconds + # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain + # lowercase alphanumeric characters (a-z and 0-9), hyphens, and + # underscores. It must start and end with alphanumeric characters. (*Required*) + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no data frame analytics + # jobs that match. + # - Contains the _all string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # The default value is true, which returns an empty data_frame_analytics + # array when there are no matches and the subset of results when there are + # partial matches. If this parameter is false, the request returns a 404 + # status code when there are no matches or only partial matches. Server default: true. + # @option arguments [Boolean] :force If true, the data frame analytics job is stopped forcefully. + # @option arguments [Time] :timeout Controls the amount of time to wait until the data frame analytics job + # stops. Defaults to 20 seconds. Server default: 20s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The stop data frame analytics parameters # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-data-frame-analytics # def stop_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_data_frame_analytics' } @@ -46,12 +58,12 @@ def stop_data_frame_analytics(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_POST - path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_stop" + path = "_ml/data_frame/analytics/#{Utils.listify(_id)}/_stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb index dd7e8f0ad..03d96f9a3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_datafeed.rb @@ -15,24 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Stops one or more datafeeds. + # Stop datafeeds. + # A datafeed that is stopped ceases to retrieve data from Elasticsearch. A datafeed can be started and stopped + # multiple times throughout its lifecycle. # - # @option arguments [String] :datafeed_id The ID of the datafeed to stop - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) - # @option arguments [Boolean] :allow_no_datafeeds Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified) *Deprecated* - # @option arguments [Boolean] :force True if the datafeed should be forcefully stopped. - # @option arguments [Time] :timeout Controls the time to wait until a datafeed has stopped. Default to 20 seconds + # @option arguments [String] :datafeed_id Identifier for the datafeed. You can stop multiple datafeeds in a single API request by using a comma-separated + # list of datafeeds or a wildcard expression. You can close all datafeeds by using +_all+ or by specifying +*+ as + # the identifier. (*Required*) + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no datafeeds that match. + # - Contains the +_all+ string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # If +true+, the API returns an empty datafeeds array when there are no matches and the subset of results when + # there are partial matches. If +false+, the API returns a 404 status code when there are no matches or only + # partial matches. Server default: true. + # @option arguments [Boolean] :force If +true+, the datafeed is stopped forcefully. + # @option arguments [Time] :timeout Specifies the amount of time to wait until a datafeed stops. Server default: 20s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The URL params optionally sent in the body + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-stop-datafeed.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-datafeed # def stop_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_datafeed' } @@ -52,7 +61,7 @@ def stop_datafeed(arguments = {}) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_stop" + path = "_ml/datafeeds/#{Utils.listify(_datafeed_id)}/_stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_trained_model_deployment.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_trained_model_deployment.rb index df59c9fb7..d43fc75b1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_trained_model_deployment.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/stop_trained_model_deployment.rb @@ -15,8 +15,8 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API @@ -25,12 +25,15 @@ module Actions # Stop a trained model deployment. # # @option arguments [String] :model_id The unique identifier of the trained model. (*Required*) - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no deployments. (This includes `_all` string or when no deployments have been specified) - # @option arguments [Boolean] :force True if the deployment should be forcefully stopped + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: contains wildcard expressions and there are no deployments that match; + # contains the +_all+ string or no identifiers and there are no matches; or contains wildcard expressions and + # there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches. + # If +false+, the request returns a 404 status code when there are no matches or only partial matches. Server default: true. + # @option arguments [Boolean] :force Forcefully stops the deployment, even if it is used by ingest pipelines. You can't use these pipelines until you + # restart the model deployment. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The stop deployment parameters # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-trained-model-deployment.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-trained-model-deployment # def stop_trained_model_deployment(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.stop_trained_model_deployment' } @@ -45,12 +48,12 @@ def stop_trained_model_deployment(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = nil _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_stop" + path = "_ml/trained_models/#{Utils.listify(_model_id)}/deployment/_stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_data_frame_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_data_frame_analytics.rb index fe5c713b4..64430334f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_data_frame_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_data_frame_analytics.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Updates certain properties of a data frame analytics job. + # Update a data frame analytics job. # - # @option arguments [String] :id The ID of the data frame analytics to update + # @option arguments [String] :id Identifier for the data frame analytics job. This identifier can contain + # lowercase alphanumeric characters (a-z and 0-9), hyphens, and + # underscores. It must start and end with alphanumeric characters. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The data frame analytics settings to update (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-dfanalytics.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-data-frame-analytics # def update_data_frame_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_data_frame_analytics' } @@ -49,7 +51,7 @@ def update_data_frame_analytics(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_POST - path = "_ml/data_frame/analytics/#{Utils.__listify(_id)}/_update" + path = "_ml/data_frame/analytics/#{Utils.listify(_id)}/_update" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_datafeed.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_datafeed.rb index 34dc4dc9e..ea0413531 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_datafeed.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_datafeed.rb @@ -15,24 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Updates certain properties of a datafeed. + # Update a datafeed. + # You must stop and start the datafeed for the changes to be applied. + # When Elasticsearch security features are enabled, your datafeed remembers which roles the user who updated it had at + # the time of the update and runs the query using those same roles. If you provide secondary authorization headers, + # those credentials are used instead. # - # @option arguments [String] :datafeed_id The ID of the datafeed to update - # @option arguments [Boolean] :ignore_unavailable Ignore unavailable indexes (default: false) - # @option arguments [Boolean] :allow_no_indices Ignore if the source indices expressions resolves to no concrete indices (default: true) - # @option arguments [Boolean] :ignore_throttled Ignore indices that are marked as throttled (default: true) - # @option arguments [String] :expand_wildcards Whether source index expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all) + # @option arguments [String] :datafeed_id A numerical character string that uniquely identifies the datafeed. + # This identifier can contain lowercase alphanumeric characters (a-z and 0-9), hyphens, and underscores. + # It must start and end with alphanumeric characters. (*Required*) + # @option arguments [Boolean] :allow_no_indices If +true+, wildcard indices expressions that resolve into no concrete indices are ignored. This includes the + # +_all+ string or when no indices are specified. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. If the request can target data streams, this argument determines + # whether wildcard expressions match hidden data streams. Supports comma-separated values. Valid values are: + # - +all+: Match any data stream or index, including hidden ones. + # - +closed+: Match closed, non-hidden indices. Also matches any non-hidden data stream. Data streams cannot be closed. + # - +hidden+: Match hidden data streams and hidden indices. Must be combined with +open+, +closed+, or both. + # - +none+: Wildcard patterns are not accepted. + # - +open+: Match open, non-hidden indices. Also matches any non-hidden data stream. Server default: open. + # @option arguments [Boolean] :ignore_throttled If +true+, concrete, expanded or aliased indices are ignored when frozen. Server default: true. + # @option arguments [Boolean] :ignore_unavailable If +true+, unavailable indices (missing or closed) are ignored. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The datafeed update settings (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-datafeed.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-datafeed # def update_datafeed(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_datafeed' } @@ -53,7 +66,7 @@ def update_datafeed(arguments = {}) _datafeed_id = arguments.delete(:datafeed_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/datafeeds/#{Utils.__listify(_datafeed_id)}/_update" + path = "_ml/datafeeds/#{Utils.listify(_datafeed_id)}/_update" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_filter.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_filter.rb index a54015147..37768e2d6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_filter.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_filter.rb @@ -15,20 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Updates the description of a filter, adds items, or removes items. + # Update a filter. + # Updates the description of a filter, adds items, or removes items from the list. # - # @option arguments [String] :filter_id The ID of the filter to update + # @option arguments [String] :filter_id A string that uniquely identifies a filter. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The filter update (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-filter.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-filter # def update_filter(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_filter' } @@ -49,7 +50,7 @@ def update_filter(arguments = {}) _filter_id = arguments.delete(:filter_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/filters/#{Utils.__listify(_filter_id)}/_update" + path = "_ml/filters/#{Utils.listify(_filter_id)}/_update" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_job.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_job.rb index 6ed25d906..4d4566902 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_job.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_job.rb @@ -15,20 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions + # Update an anomaly detection job. # Updates certain properties of an anomaly detection job. # - # @option arguments [String] :job_id The ID of the job to create + # @option arguments [String] :job_id Identifier for the job. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The job update settings (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-job.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-job # def update_job(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_job' } @@ -49,7 +50,7 @@ def update_job(arguments = {}) _job_id = arguments.delete(:job_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/_update" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/_update" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_model_snapshot.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_model_snapshot.rb index 06c73a0dc..496423f3e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_model_snapshot.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_model_snapshot.rb @@ -15,26 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions + # Update a snapshot. # Updates certain properties of a snapshot. # - # @option arguments [String] :job_id The ID of the job to fetch - # @option arguments [String] :snapshot_id The ID of the snapshot to update + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String] :snapshot_id Identifier for the model snapshot. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The model snapshot properties to update (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-update-snapshot.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-model-snapshot # def update_model_snapshot(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_model_snapshot' } - defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| + defined_params = [:job_id, :snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,7 +54,7 @@ def update_model_snapshot(arguments = {}) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_update" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/model_snapshots/#{Utils.listify(_snapshot_id)}/_update" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_trained_model_deployment.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_trained_model_deployment.rb index 64c623c32..f57e275fc 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_trained_model_deployment.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/update_trained_model_deployment.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Updates certain properties of trained model deployment. + # Update a trained model deployment. # - # @option arguments [String] :model_id The unique identifier of the trained model. - # @option arguments [Integer] :number_of_allocations Update the model deployment to this number of allocations. + # @option arguments [String] :model_id The unique identifier of the trained model. Currently, only PyTorch models are supported. (*Required*) + # @option arguments [Integer] :number_of_allocations The number of model allocations on each node where the model is deployed. + # All allocations on a node share the same copy of the model in memory but use + # a separate set of threads to evaluate the model. + # Increasing this value generally increases the throughput. + # If this setting is greater than the number of hardware threads + # it will automatically be changed to a value less than the number of hardware threads. Server default: 1. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The updated trained model deployment settings + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-trained-model-deployment.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-update-trained-model-deployment # def update_trained_model_deployment(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.update_trained_model_deployment' } @@ -49,7 +54,7 @@ def update_trained_model_deployment(arguments = {}) _model_id = arguments.delete(:model_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/trained_models/#{Utils.__listify(_model_id)}/deployment/_update" + path = "_ml/trained_models/#{Utils.listify(_model_id)}/deployment/_update" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/upgrade_job_snapshot.rb b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/upgrade_job_snapshot.rb index 7d21a2afd..64b9cff28 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/upgrade_job_snapshot.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/machine_learning/upgrade_job_snapshot.rb @@ -15,27 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module MachineLearning module Actions - # Upgrades a given job snapshot to the current major version. + # Upgrade a snapshot. + # Upgrade an anomaly detection model snapshot to the latest major version. + # Over time, older snapshot formats are deprecated and removed. Anomaly + # detection jobs support only snapshots that are from the current or previous + # major version. + # This API provides a means to upgrade a snapshot to the current major version. + # This aids in preparing the cluster for an upgrade to the next major version. + # Only one snapshot per anomaly detection job can be upgraded at a time and the + # upgraded snapshot cannot be the current snapshot of the anomaly detection + # job. # - # @option arguments [String] :job_id The ID of the job - # @option arguments [String] :snapshot_id The ID of the snapshot - # @option arguments [Time] :timeout How long should the API wait for the job to be opened and the old snapshot to be loaded. - # @option arguments [Boolean] :wait_for_completion Should the request wait until the task is complete before responding to the caller. Default is false. + # @option arguments [String] :job_id Identifier for the anomaly detection job. (*Required*) + # @option arguments [String] :snapshot_id A numerical character string that uniquely identifies the model snapshot. (*Required*) + # @option arguments [Boolean] :wait_for_completion When true, the API won’t respond until the upgrade is complete. + # Otherwise, it responds as soon as the upgrade task is assigned to a node. + # @option arguments [Time] :timeout Controls the time to wait for the request to complete. Server default: 30m. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-upgrade-job-model-snapshot.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-upgrade-job-snapshot # def upgrade_job_snapshot(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ml.upgrade_job_snapshot' } - defined_params = %i[job_id snapshot_id].each_with_object({}) do |variable, set_variables| + defined_params = [:job_id, :snapshot_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,7 +63,7 @@ def upgrade_job_snapshot(arguments = {}) _snapshot_id = arguments.delete(:snapshot_id) method = Elasticsearch::API::HTTP_POST - path = "_ml/anomaly_detectors/#{Utils.__listify(_job_id)}/model_snapshots/#{Utils.__listify(_snapshot_id)}/_upgrade" + path = "_ml/anomaly_detectors/#{Utils.listify(_job_id)}/model_snapshots/#{Utils.listify(_snapshot_id)}/_upgrade" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/mget.rb b/elasticsearch-api/lib/elasticsearch/api/actions/mget.rb index ada183568..5bf3aa7c1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/mget.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/mget.rb @@ -15,28 +15,44 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows to get multiple documents in one request. + # Get multiple documents. + # Get multiple JSON documents by ID from one or more indices. + # If you specify an index in the request URI, you only need to specify the document IDs in the request body. + # To ensure fast responses, this multi get (mget) API responds with partial results if one or more shards fail. + # **Filter source fields** + # By default, the +_source+ field is returned for every document (if stored). + # Use the +_source+ and +_source_include+ or +source_exclude+ attributes to filter what fields are returned for a particular document. + # You can include the +_source+, +_source_includes+, and +_source_excludes+ query parameters in the request URI to specify the defaults to use when there are no per-document instructions. + # **Get stored fields** + # Use the +stored_fields+ attribute to specify the set of stored fields you want to retrieve. + # Any requested fields that are not stored are ignored. + # You can include the +stored_fields+ query parameter in the request URI to specify the defaults to use when there are no per-document instructions. # - # @option arguments [String] :index The name of the index - # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index. - # @option arguments [List] :stored_fields A comma-separated list of stored fields to return in the response - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [Boolean] :realtime Specify whether to perform the operation in realtime or search mode - # @option arguments [Boolean] :refresh Refresh the shard containing the document before performing the operation - # @option arguments [String] :routing Specific routing value - # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return - # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field - # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field + # @option arguments [String] :index Name of the index to retrieve documents from when +ids+ are specified, or when a document in the +docs+ array does not specify an index. + # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source? + # Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. + # Fetches with this enabled will be slower the enabling synthetic source natively in the index. + # @option arguments [String] :preference Specifies the node or shard the operation should be performed on. Random by default. + # @option arguments [Boolean] :realtime If +true+, the request is real-time as opposed to near-real-time. Server default: true. + # @option arguments [Boolean] :refresh If +true+, the request refreshes relevant shards before retrieving documents. + # @option arguments [String] :routing Custom value used to route operations to a specific shard. + # @option arguments [Boolean, String, Array] :_source True or false to return the +_source+ field or not, or a list of fields to return. + # @option arguments [String, Array] :_source_excludes A comma-separated list of source fields to exclude from the response. + # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter. + # @option arguments [String, Array] :_source_includes A comma-separated list of source fields to include in the response. + # If this parameter is specified, only these source fields are returned. You can exclude fields from this subset using the +_source_excludes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [String, Array] :stored_fields If +true+, retrieves the document fields stored in the index rather than the document +_source+. Server default: false. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Document identifiers; can be either `docs` (containing full document information) or `ids` (when index is provided in the URL. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-mget # def mget(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'mget' } @@ -51,13 +67,13 @@ def mget(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_mget" + "#{Utils.listify(_index)}/_mget" else '_mget' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/migration/deprecations.rb b/elasticsearch-api/lib/elasticsearch/api/actions/migration/deprecations.rb index 561bfa4c0..7dfb488e7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/migration/deprecations.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/migration/deprecations.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Migration module Actions - # Retrieves information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version. + # Get deprecation information. + # Get information about different cluster, node, and index level settings that use deprecated features that will be removed or changed in the next major version. + # TIP: This APIs is designed for indirect use by the Upgrade Assistant. + # You are strongly recommended to use the Upgrade Assistant. # - # @option arguments [String] :index Index pattern + # @option arguments [String] :index Comma-separate list of data streams or indices to check. Wildcard (*) expressions are supported. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-deprecation.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-deprecations # def deprecations(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'migration.deprecations' } @@ -40,13 +43,13 @@ def deprecations(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "#{Utils.__listify(_index)}/_migration/deprecations" + "#{Utils.listify(_index)}/_migration/deprecations" else '_migration/deprecations' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/migration/get_feature_upgrade_status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/migration/get_feature_upgrade_status.rb index b5263b949..bb86a5559 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/migration/get_feature_upgrade_status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/migration/get_feature_upgrade_status.rb @@ -15,18 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Migration module Actions - # Find out whether system features need to be upgraded or not + # Get feature migration information. + # Version upgrades sometimes require changes to how features store configuration information and data in system indices. + # Check which features need to be migrated and the status of any migrations that are in progress. + # TIP: This API is designed for indirect use by the Upgrade Assistant. + # You are strongly recommended to use the Upgrade Assistant. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-get-feature-upgrade-status # def get_feature_upgrade_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'migration.get_feature_upgrade_status' } @@ -34,7 +38,7 @@ def get_feature_upgrade_status(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_migration/system_features' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/migration/post_feature_upgrade.rb b/elasticsearch-api/lib/elasticsearch/api/actions/migration/post_feature_upgrade.rb index 64f31d63d..d113b40b5 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/migration/post_feature_upgrade.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/migration/post_feature_upgrade.rb @@ -15,18 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Migration module Actions - # Begin upgrades for system features + # Start the feature migration. + # Version upgrades sometimes require changes to how features store configuration information and data in system indices. + # This API starts the automatic migration process. + # Some functionality might be temporarily unavailable during the migration process. + # TIP: The API is designed for indirect use by the Upgrade Assistant. We strongly recommend you use the Upgrade Assistant. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-feature-upgrade.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-migration-get-feature-upgrade-status # def post_feature_upgrade(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'migration.post_feature_upgrade' } @@ -34,7 +38,7 @@ def post_feature_upgrade(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_migration/system_features' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/msearch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/msearch.rb index 4b326a03f..d28a78406 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/msearch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/msearch.rb @@ -15,26 +15,49 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows to execute several search operations in one request. + # Run multiple searches. + # The format of the request is similar to the bulk API format and makes use of the newline delimited JSON (NDJSON) format. + # The structure is as follows: + # + + # header\n + # body\n + # header\n + # body\n + # + + # This structure is specifically optimized to reduce parsing if a specific search ends up redirected to another node. + # IMPORTANT: The final line of data must end with a newline character +\n+. + # Each newline character may be preceded by a carriage return +\r+. + # When sending requests to this endpoint the +Content-Type+ header should be set to +application/x-ndjson+. # - # @option arguments [List] :index A comma-separated list of index names to use as default - # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch) - # @option arguments [Number] :max_concurrent_searches Controls the maximum number of concurrent searches the multi search api will execute - # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response - # @option arguments [Number] :pre_filter_shard_size A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - # @option arguments [Number] :max_concurrent_shard_requests The number of concurrent shard requests each sub search executes concurrently per node. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests - # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether hits.total should be rendered as an integer or an object in the rest search response - # @option arguments [Boolean] :ccs_minimize_roundtrips Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, and index aliases to search. + # @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. This behavior applies even if the request targets other open indices. For example, a request targeting foo*,bar* returns an error if an index starts with foo but no index starts with bar. + # @option arguments [Boolean] :ccs_minimize_roundtrips If true, network roundtrips between the coordinating node and remote clusters are minimized for cross-cluster search requests. Server default: true. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard expressions can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # @option arguments [Boolean] :ignore_throttled If true, concrete, expanded or aliased indices are ignored when frozen. + # @option arguments [Boolean] :ignore_unavailable If true, missing or closed indices are not included in the response. + # @option arguments [Boolean] :include_named_queries_score Indicates whether hit.matched_queries should be rendered as a map that includes + # the name of the matched query associated with its score (true) + # or as an array containing the name of the matched queries (false) + # This functionality reruns each named query on every hit in a search response. + # Typically, this adds a small overhead to a request. + # However, using computationally expensive named queries on a large number of hits may add significant overhead. + # @option arguments [Integer] :max_concurrent_searches Maximum number of concurrent searches the multi search API can execute. + # @option arguments [Integer] :max_concurrent_shard_requests Maximum number of concurrent shard requests that each sub-search request executes per node. Server default: 5. + # @option arguments [Integer] :pre_filter_shard_size Defines a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method i.e., if date filters are mandatory to match but the shard bounds and the query are disjoint. + # @option arguments [Boolean] :rest_total_hits_as_int If true, hits.total are returned as an integer in the response. Defaults to false, which returns an object. + # @option arguments [String] :routing Custom routing value used to route search operations to a specific shard. + # @option arguments [String] :search_type Indicates whether global term and document frequencies should be used when scoring returned documents. + # @option arguments [Boolean] :typed_keys Specifies whether aggregation and suggester names should be prefixed by their respective types in the response. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The request definitions (metadata-search request definition pairs), separated by newlines (*Required*) + # @option arguments [Hash] :body searches # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch # def msearch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'msearch' } @@ -49,19 +72,19 @@ def msearch(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_msearch" + "#{Utils.listify(_index)}/_msearch" else '_msearch' end params = Utils.process_params(arguments) - if body.is_a?(Array) && body.any? { |d| d.has_key? :search } + if body.is_a?(Array) && body.any? { |d| d.key? :search } payload = body.each_with_object([]) do |item, sum| meta = item data = meta.delete(:search) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/msearch_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/msearch_template.rb index 9f8c741f3..5ba499f0d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/msearch_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/msearch_template.rb @@ -15,24 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows to execute several search template operations in one request. + # Run multiple templated searches. + # Run multiple templated searches with a single request. + # If you are providing a text file or text input to +curl+, use the +--data-binary+ flag instead of +-d+ to preserve newlines. + # For example: + # + + # $ cat requests + # { "index": "my-index" } + # { "id": "my-search-template", "params": { "query_string": "hello world", "from": 0, "size": 10 }} + # { "index": "my-other-index" } + # { "id": "my-other-search-template", "params": { "query_type": "match_all" }} + # $ curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch/template --data-binary "@requests"; echo + # + # - # @option arguments [List] :index A comma-separated list of index names to use as default - # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch) - # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response - # @option arguments [Number] :max_concurrent_searches Controls the maximum number of concurrent searches the multi search api will execute - # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether hits.total should be rendered as an integer or an object in the rest search response - # @option arguments [Boolean] :ccs_minimize_roundtrips Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search. + # It supports wildcards (+*+). + # To search all data streams and indices, omit this parameter or use +*+. + # @option arguments [Boolean] :ccs_minimize_roundtrips If +true+, network round-trips are minimized for cross-cluster search requests. Server default: true. + # @option arguments [Integer] :max_concurrent_searches The maximum number of concurrent searches the API can run. + # @option arguments [String] :search_type The type of the search operation. + # @option arguments [Boolean] :rest_total_hits_as_int If +true+, the response returns +hits.total+ as an integer. + # If +false+, it returns +hits.total+ as an object. + # @option arguments [Boolean] :typed_keys If +true+, the response prefixes aggregation and suggester names with their respective types. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The request definitions (metadata-search request definition pairs), separated by newlines (*Required*) + # @option arguments [Hash] :body search_templates # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-multi-search.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-msearch-template # def msearch_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'msearch_template' } @@ -47,13 +61,13 @@ def msearch_template(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_msearch/template" + "#{Utils.listify(_index)}/_msearch/template" else '_msearch/template' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/mtermvectors.rb b/elasticsearch-api/lib/elasticsearch/api/actions/mtermvectors.rb index 2621ff9d5..b99963c16 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/mtermvectors.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/mtermvectors.rb @@ -15,31 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns multiple termvectors in one request. + # Get multiple term vectors. + # Get multiple term vectors with a single request. + # You can specify existing documents by index and ID or provide artificial documents in the body of the request. + # You can specify the index in the request body or request URI. + # The response contains a +docs+ array with all the fetched termvectors. + # Each element has the structure provided by the termvectors API. + # **Artificial documents** + # You can also use +mtermvectors+ to generate term vectors for artificial documents provided in the body of the request. + # The mapping used is determined by the specified +_index+. # - # @option arguments [String] :index The index in which the document resides. - # @option arguments [List] :ids A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body - # @option arguments [Boolean] :term_statistics Specifies if total term frequency and document frequency should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - # @option arguments [Boolean] :field_statistics Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - # @option arguments [List] :fields A comma-separated list of fields to return. Applies to all returned documents unless otherwise specified in body "params" or "docs". - # @option arguments [Boolean] :offsets Specifies if term offsets should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - # @option arguments [Boolean] :positions Specifies if term positions should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - # @option arguments [Boolean] :payloads Specifies if term payloads should be returned. Applies to all returned documents unless otherwise specified in body "params" or "docs". - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) .Applies to all returned documents unless otherwise specified in body "params" or "docs". - # @option arguments [String] :routing Specific routing value. Applies to all returned documents unless otherwise specified in body "params" or "docs". - # @option arguments [Boolean] :realtime Specifies if requests are real-time as opposed to near-real-time (default: true). - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte) + # @option arguments [String] :index The name of the index that contains the documents. + # @option arguments [Array] :ids A comma-separated list of documents ids. You must define ids as parameter or set "ids" or "docs" in the request body + # @option arguments [String, Array] :fields A comma-separated list or wildcard expressions of fields to include in the statistics. + # It is used as the default list unless a specific field list is provided in the +completion_fields+ or +fielddata_fields+ parameters. + # @option arguments [Boolean] :field_statistics If +true+, the response includes the document count, sum of document frequencies, and sum of total term frequencies. Server default: true. + # @option arguments [Boolean] :offsets If +true+, the response includes term offsets. Server default: true. + # @option arguments [Boolean] :payloads If +true+, the response includes term payloads. Server default: true. + # @option arguments [Boolean] :positions If +true+, the response includes term positions. Server default: true. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # It is random by default. + # @option arguments [Boolean] :realtime If true, the request is real-time as opposed to near-real-time. Server default: true. + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Boolean] :term_statistics If true, the response includes term frequency and document frequency. + # @option arguments [Integer] :version If +true+, returns the document version as part of a hit. + # @option arguments [String] :version_type The version type. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Define ids, documents, parameters or a list of parameters per document here. You must at least provide a list of document ids. See documentation. + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-termvectors.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-mtermvectors # def mtermvectors(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'mtermvectors' } @@ -52,11 +62,7 @@ def mtermvectors(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = if (ids = arguments.delete(:ids)) - { ids: ids } - else - arguments.delete(:body) - end + body = arguments.delete(:body) _index = arguments.delete(:index) @@ -66,11 +72,11 @@ def mtermvectors(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _index - "#{Utils.__listify(_index)}/_mtermvectors" - else - '_mtermvectors' - end + path = if _index + "#{Utils.listify(_index)}/_mtermvectors" + else + '_mtermvectors' + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb index 9d26816ac..3ad4c45b1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/clear_repositories_metering_archive.rb @@ -15,35 +15,40 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Nodes module Actions - # Removes the archived repositories metering information present in the cluster. + # Clear the archived repositories metering. + # Clear the archived repositories metering information in the cluster. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [List] :node_id Comma-separated list of node IDs or names used to limit returned information. - # @option arguments [Long] :max_archive_version Specifies the maximum archive_version to be cleared from the archive. + # @option arguments [String, Array] :node_id Comma-separated list of node IDs or names used to limit returned information. (*Required*) + # @option arguments [Integer] :max_archive_version Specifies the maximum +archive_version+ to be cleared from the archive. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-repositories-metering-archive-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-clear-repositories-metering-archive # def clear_repositories_metering_archive(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'nodes.clear_repositories_metering_archive' } - defined_params = %i[node_id max_archive_version].each_with_object({}) do |variable, set_variables| + defined_params = [:node_id, :max_archive_version].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'node_id' missing" unless arguments[:node_id] - raise ArgumentError, "Required argument 'max_archive_version' missing" unless arguments[:max_archive_version] + + unless arguments[:max_archive_version] + raise ArgumentError, + "Required argument 'max_archive_version' missing" + end arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -55,7 +60,7 @@ def clear_repositories_metering_archive(arguments = {}) _max_archive_version = arguments.delete(:max_archive_version) method = Elasticsearch::API::HTTP_DELETE - path = "_nodes/#{Utils.__listify(_node_id)}/_repositories_metering/#{Utils.__listify(_max_archive_version)}" + path = "_nodes/#{Utils.listify(_node_id)}/_repositories_metering/#{Utils.listify(_max_archive_version)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/get_repositories_metering_info.rb b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/get_repositories_metering_info.rb index 9afe42fab..17435353a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/get_repositories_metering_info.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/get_repositories_metering_info.rb @@ -15,23 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Nodes module Actions - # Returns cluster repositories metering information. + # Get cluster repositories metering. + # Get repositories metering information for a cluster. + # This API exposes monotonically non-decreasing counters and it is expected that clients would durably store the information needed to compute aggregations over a period of time. + # Additionally, the information exposed by this API is volatile, meaning that it will not be present after node restarts. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information. + # @option arguments [String, Array] :node_id Comma-separated list of node IDs or names used to limit returned information. + # All the nodes selective options are explained {https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster.html#cluster-nodes here}. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-repositories-metering-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-get-repositories-metering-info # def get_repositories_metering_info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'nodes.get_repositories_metering_info' } @@ -51,7 +55,7 @@ def get_repositories_metering_info(arguments = {}) _node_id = arguments.delete(:node_id) method = Elasticsearch::API::HTTP_GET - path = "_nodes/#{Utils.__listify(_node_id)}/_repositories_metering" + path = "_nodes/#{Utils.listify(_node_id)}/_repositories_metering" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/hot_threads.rb b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/hot_threads.rb index 20465247d..7ad48722b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/hot_threads.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/hot_threads.rb @@ -15,26 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Nodes module Actions - # Returns information about hot threads on each node in the cluster. + # Get the hot threads for nodes. + # Get a breakdown of the hot threads on each selected node in the cluster. + # The output is plain text with a breakdown of the top hot threads for each node. # - # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - # @option arguments [Time] :interval The interval for the second sampling of threads - # @option arguments [Number] :snapshots Number of samples of thread stacktrace (default: 10) - # @option arguments [Number] :threads Specify the number of threads to provide information for (default: 3) - # @option arguments [Boolean] :ignore_idle_threads Don't show threads that are in known-idle places, such as waiting on a socket select or pulling from an empty task queue (default: true) - # @option arguments [String] :type The type to sample (default: cpu) (options: cpu, wait, block, mem) - # @option arguments [String] :sort The sort order for 'cpu' type (default: total) (options: cpu, total) - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :node_id List of node IDs or names used to limit returned information. + # @option arguments [Boolean] :ignore_idle_threads If true, known idle threads (e.g. waiting in a socket select, or to get + # a task from an empty queue) are filtered out. Server default: true. + # @option arguments [Time] :interval The interval to do the second sampling of threads. Server default: 500ms. + # @option arguments [Integer] :snapshots Number of samples of thread stacktrace. Server default: 10. + # @option arguments [Integer] :threads Specifies the number of hot threads to provide information for. Server default: 3. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received + # before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [String] :type The type to sample. Server default: cpu. + # @option arguments [String] :sort The sort order for 'cpu' type (default: total) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-hot-threads.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-hot-threads # def hot_threads(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'nodes.hot_threads' } @@ -53,7 +57,7 @@ def hot_threads(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _node_id - "_nodes/#{Utils.__listify(_node_id)}/hot_threads" + "_nodes/#{Utils.listify(_node_id)}/hot_threads" else '_nodes/hot_threads' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/info.rb b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/info.rb index 0fb398630..00299b151 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/info.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/info.rb @@ -15,27 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Nodes module Actions - # Returns information about nodes in the cluster. + # Get node information. + # By default, the API returns all attributes and core settings for cluster nodes. # - # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - # @option arguments [List] :metric A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics. (options: settings, os, process, jvm, thread_pool, transport, http, plugins, ingest, indices, aggregations, _all, _none) - # @option arguments [Boolean] :flat_settings Return settings in flat format (default: false) - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :node_id Comma-separated list of node IDs or names used to limit returned information. + # @option arguments [String, Array] :metric Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest. + # @option arguments [Boolean] :flat_settings If true, returns settings in flat format. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-info.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-info # def info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'nodes.info' } - defined_params = %i[node_id metric].each_with_object({}) do |variable, set_variables| + defined_params = [:node_id, :metric].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,11 +52,11 @@ def info(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _node_id && _metric - "_nodes/#{Utils.__listify(_node_id)}/#{Utils.__listify(_metric)}" + "_nodes/#{Utils.listify(_node_id)}/#{Utils.listify(_metric)}" elsif _node_id - "_nodes/#{Utils.__listify(_node_id)}" + "_nodes/#{Utils.listify(_node_id)}" elsif _metric - "_nodes/#{Utils.__listify(_metric)}" + "_nodes/#{Utils.listify(_metric)}" else '_nodes' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb index 8c7ed792d..6940da5b9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/reload_secure_settings.rb @@ -15,21 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Nodes module Actions - # Reloads secure settings. + # Reload the keystore on nodes in the cluster. + # Secure settings are stored in an on-disk keystore. Certain of these settings are reloadable. + # That is, you can change them on disk and reload them without restarting any nodes in the cluster. + # When you have updated reloadable secure settings in your keystore, you can use this API to reload those settings on each node. + # When the Elasticsearch keystore is password protected and not simply obfuscated, you must provide the password for the keystore when you reload the secure settings. + # Reloading the settings for the whole cluster assumes that the keystores for all nodes are protected with the same password; this method is allowed only when inter-node communications are encrypted. + # Alternatively, you can reload the secure settings on each node by locally accessing the API and passing the node-specific Elasticsearch keystore password. # - # @option arguments [List] :node_id A comma-separated list of node IDs to span the reload/reinit call. Should stay empty because reloading usually involves all cluster nodes. - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :node_id The names of particular nodes in the cluster to target. + # @option arguments [Time] :timeout Period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object containing the password for the elasticsearch keystore + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/secure-settings.html#reloadable-secure-settings + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-reload-secure-settings # def reload_secure_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'nodes.reload_secure_settings' } @@ -48,7 +55,7 @@ def reload_secure_settings(arguments = {}) method = Elasticsearch::API::HTTP_POST path = if _node_id - "_nodes/#{Utils.__listify(_node_id)}/reload_secure_settings" + "_nodes/#{Utils.listify(_node_id)}/reload_secure_settings" else '_nodes/reload_secure_settings' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/stats.rb index 318d8c217..e9b2bf4d6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/stats.rb @@ -15,35 +15,37 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Nodes module Actions - # Returns statistical information about nodes in the cluster. + # Get node statistics. + # Get statistics for nodes in a cluster. + # By default, all stats are returned. You can limit the returned information by using metrics. # - # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - # @option arguments [List] :metric Limit the information returned to the specified metrics (options: _all, breaker, fs, http, indices, jvm, os, process, thread_pool, transport, discovery, indexing_pressure) - # @option arguments [List] :index_metric Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified. (options: _all, completion, docs, fielddata, query_cache, flush, get, indexing, merge, request_cache, refresh, search, segments, store, warmer, bulk, shard_stats) - # @option arguments [List] :completion_fields A comma-separated list of fields for the `completion` index metric (supports wildcards) - # @option arguments [List] :fielddata_fields A comma-separated list of fields for the `fielddata` index metric (supports wildcards) - # @option arguments [List] :fields A comma-separated list of fields for `fielddata` and `completion` index metric (supports wildcards) - # @option arguments [Boolean] :groups A comma-separated list of search groups for `search` index metric - # @option arguments [String] :level Return indices stats aggregated at index, node or shard level (options: indices, node, shards) - # @option arguments [List] :types A comma-separated list of document types for the `indexing` index metric - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Boolean] :include_segment_file_sizes Whether to report the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested) - # @option arguments [Boolean] :include_unloaded_segments If set to true segment stats will include stats for segments that are not currently loaded into memory + # @option arguments [String, Array] :node_id Comma-separated list of node IDs or names used to limit returned information. + # @option arguments [String, Array] :metric Limit the information returned to the specified metrics + # @option arguments [String, Array] :index_metric Limit the information returned for indices metric to the specific index metrics. It can be used only if indices (or all) metric is specified. + # @option arguments [String, Array] :completion_fields Comma-separated list or wildcard expressions of fields to include in fielddata and suggest statistics. + # @option arguments [String, Array] :fielddata_fields Comma-separated list or wildcard expressions of fields to include in fielddata statistics. + # @option arguments [String, Array] :fields Comma-separated list or wildcard expressions of fields to include in the statistics. + # @option arguments [Boolean] :groups Comma-separated list of search groups to include in the search statistics. + # @option arguments [Boolean] :include_segment_file_sizes If true, the call reports the aggregated disk usage of each one of the Lucene index files (only applies if segment stats are requested). + # @option arguments [String] :level Indicates whether statistics are aggregated at the cluster, index, or shard level. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Array] :types A comma-separated list of document types for the indexing index metric. + # @option arguments [Boolean] :include_unloaded_segments If +true+, the response includes information from segments that are not loaded into memory. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-stats # def stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'nodes.stats' } - defined_params = %i[node_id metric index_metric].each_with_object({}) do |variable, set_variables| + defined_params = [:node_id, :metric, :index_metric].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -61,15 +63,15 @@ def stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _node_id && _metric && _index_metric - "_nodes/#{Utils.__listify(_node_id)}/stats/#{Utils.__listify(_metric)}/#{Utils.__listify(_index_metric)}" + "_nodes/#{Utils.listify(_node_id)}/stats/#{Utils.listify(_metric)}/#{Utils.listify(_index_metric)}" elsif _metric && _index_metric - "_nodes/stats/#{Utils.__listify(_metric)}/#{Utils.__listify(_index_metric)}" + "_nodes/stats/#{Utils.listify(_metric)}/#{Utils.listify(_index_metric)}" elsif _node_id && _metric - "_nodes/#{Utils.__listify(_node_id)}/stats/#{Utils.__listify(_metric)}" + "_nodes/#{Utils.listify(_node_id)}/stats/#{Utils.listify(_metric)}" elsif _node_id - "_nodes/#{Utils.__listify(_node_id)}/stats" + "_nodes/#{Utils.listify(_node_id)}/stats" elsif _metric - "_nodes/stats/#{Utils.__listify(_metric)}" + "_nodes/stats/#{Utils.listify(_metric)}" else '_nodes/stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/usage.rb b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/usage.rb index 9d5150ab6..73a98171b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/nodes/usage.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/nodes/usage.rb @@ -15,26 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Nodes module Actions - # Returns low-level information about REST actions usage on nodes. + # Get feature usage information. # - # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - # @option arguments [List] :metric Limit the information returned to the specified metrics (options: _all, rest_actions) - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :node_id A comma-separated list of node IDs or names to limit the returned information; use +_local+ to return information from the node you're connecting to, leave empty to get information from all nodes + # @option arguments [String, Array] :metric Limits the information returned to the specific metrics. + # A comma-separated list of the following options: +_all+, +rest_actions+. + # @option arguments [Time] :timeout Period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-nodes-usage.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-nodes-usage # def usage(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'nodes.usage' } - defined_params = %i[node_id metric].each_with_object({}) do |variable, set_variables| + defined_params = [:node_id, :metric].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -50,11 +52,11 @@ def usage(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _node_id && _metric - "_nodes/#{Utils.__listify(_node_id)}/usage/#{Utils.__listify(_metric)}" + "_nodes/#{Utils.listify(_node_id)}/usage/#{Utils.listify(_metric)}" elsif _node_id - "_nodes/#{Utils.__listify(_node_id)}/usage" + "_nodes/#{Utils.listify(_node_id)}/usage" elsif _metric - "_nodes/usage/#{Utils.__listify(_metric)}" + "_nodes/usage/#{Utils.listify(_metric)}" else '_nodes/usage' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/open_point_in_time.rb b/elasticsearch-api/lib/elasticsearch/api/actions/open_point_in_time.rb index 79bda5d14..0ec8e149e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/open_point_in_time.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/open_point_in_time.rb @@ -15,25 +15,55 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Open a point in time that can be used in subsequent searches + # Open a point in time. + # A search request by default runs against the most recent visible data of the target indices, + # which is called point in time. Elasticsearch pit (point in time) is a lightweight view into the + # state of the data as it existed when initiated. In some cases, it’s preferred to perform multiple + # search requests using the same point in time. For example, if refreshes happen between + # +search_after+ requests, then the results of those requests might not be consistent as changes happening + # between searches are only visible to the more recent point in time. + # A point in time must be opened explicitly before being used in search requests. + # A subsequent search request with the +pit+ parameter must not specify +index+, +routing+, or +preference+ values as these parameters are copied from the point in time. + # Just like regular searches, you can use +from+ and +size+ to page through point in time search results, up to the first 10,000 hits. + # If you want to retrieve more hits, use PIT with +search_after+. + # IMPORTANT: The open point in time request and each subsequent search request can return different identifiers; always use the most recently received ID for the next search request. + # When a PIT that contains shard failures is used in a search request, the missing are always reported in the search response as a +NoShardAvailableActionException+ exception. + # To get rid of these exceptions, a new PIT needs to be created so that shards missing from the previous PIT can be handled, assuming they become available in the meantime. + # **Keeping point in time alive** + # The +keep_alive+ parameter, which is passed to a open point in time request and search request, extends the time to live of the corresponding point in time. + # The value does not need to be long enough to process all data — it just needs to be long enough for the next request. + # Normally, the background merge process optimizes the index by merging together smaller segments to create new, bigger segments. + # Once the smaller segments are no longer needed they are deleted. + # However, open point-in-times prevent the old segments from being deleted since they are still in use. + # TIP: Keeping older segments alive means that more disk space and file handles are needed. + # Ensure that you have configured your nodes to have ample free file handles. + # Additionally, if a segment contains deleted or updated documents then the point in time must keep track of whether each document in the segment was live at the time of the initial search request. + # Ensure that your nodes have sufficient heap space if you have many open point-in-times on an index that is subject to ongoing deletes or updates. + # Note that a point-in-time doesn't prevent its associated indices from being deleted. + # You can check how many point-in-times (that is, search contexts) are open with the nodes stats API. # - # @option arguments [List] :index A comma-separated list of index names to open point in time; use `_all` or empty string to perform the operation on all indices - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [String] :routing Specific routing value - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [String] :keep_alive Specific the time to live for the point in time (*Required*) - # @option arguments [Boolean] :allow_partial_search_results Specify whether to tolerate shards missing when creating the point-in-time, or otherwise throw an exception. (default: false) + # @option arguments [String, Array] :index A comma-separated list of index names to open point in time; use +_all+ or empty string to perform the operation on all indices (*Required*) + # @option arguments [Time] :keep_alive Extend the length of time that the point in time persists. (*Required*) + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # By default, it is random. + # @option arguments [String] :routing A custom value that is used to route operations to a specific shard. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # It supports comma-separated values, such as +open,hidden+. Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :allow_partial_search_results Indicates whether the point in time tolerates unavailable shards or shard failures when initially creating the PIT. + # If +false+, creating a point in time request when a shard is missing or unavailable will throw an exception. + # If +true+, the point in time will contain all the shards that are available at the time of the request. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An index_filter specified with the Query DSL + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/point-in-time-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time # def open_point_in_time(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'open_point_in_time' } @@ -48,12 +78,12 @@ def open_point_in_time(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_pit" + path = "#{Utils.listify(_index)}/_pit" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ping.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ping.rb index 7f8dd0bbf..e2e7a66f6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ping.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ping.rb @@ -15,17 +15,18 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns whether the cluster is running. + # Ping the cluster. + # Get information about whether the cluster is running. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-cluster # def ping(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ping' } @@ -33,7 +34,7 @@ def ping(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_HEAD path = '' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/put_script.rb b/elasticsearch-api/lib/elasticsearch/api/actions/put_script.rb index b720d7404..0d4c61d57 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/put_script.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/put_script.rb @@ -15,27 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Creates or updates a script. + # Create or update a script or search template. + # Creates or updates a stored script or search template. # - # @option arguments [String] :id Script ID - # @option arguments [String] :context Script context - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [String] :id The identifier for the stored script or search template. + # It must be unique within the cluster. (*Required*) + # @option arguments [String] :context The context in which the script or search template should run. + # To prevent errors, the API immediately compiles the script or template in this context. + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. + # It can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The document (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-scripting.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-put-script # def put_script(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'put_script' } - defined_params = %i[id context].each_with_object({}) do |variable, set_variables| + defined_params = [:id, :context].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -54,9 +61,9 @@ def put_script(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = if _id && _context - "_scripts/#{Utils.__listify(_id)}/#{Utils.__listify(_context)}" + "_scripts/#{Utils.listify(_id)}/#{Utils.listify(_context)}" else - "_scripts/#{Utils.__listify(_id)}" + "_scripts/#{Utils.listify(_id)}" end params = Utils.process_params(arguments) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/delete_rule.rb b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/delete_rule.rb index a7f69d891..06b30468c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/delete_rule.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/delete_rule.rb @@ -15,25 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module QueryRules module Actions - # Deletes an individual query rule within a ruleset. + # Delete a query rule. + # Delete a query rule within a query ruleset. + # This is a destructive action that is only recoverable by re-adding the same rule with the create or update query rule API. # - # @option arguments [String] :ruleset_id The unique identifier of the query ruleset this rule exists in - # @option arguments [String] :rule_id The unique identifier of the rule to delete. + # @option arguments [String] :ruleset_id The unique identifier of the query ruleset containing the rule to delete (*Required*) + # @option arguments [String] :rule_id The unique identifier of the query rule within the specified ruleset to delete (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-query-rule.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-delete-rule # def delete_rule(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'query_rules.delete_rule' } - defined_params = %i[ruleset_id rule_id].each_with_object({}) do |variable, set_variables| + defined_params = [:ruleset_id, :rule_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +53,7 @@ def delete_rule(arguments = {}) _rule_id = arguments.delete(:rule_id) method = Elasticsearch::API::HTTP_DELETE - path = "_query_rules/#{Utils.__listify(_ruleset_id)}/_rule/#{Utils.__listify(_rule_id)}" + path = "_query_rules/#{Utils.listify(_ruleset_id)}/_rule/#{Utils.listify(_rule_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/delete_ruleset.rb b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/delete_ruleset.rb index f6739b40b..34a0884e4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/delete_ruleset.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/delete_ruleset.rb @@ -15,19 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module QueryRules module Actions - # Deletes a query ruleset. + # Delete a query ruleset. + # Remove a query ruleset and its associated data. + # This is a destructive action that is not recoverable. # - # @option arguments [String] :ruleset_id The unique identifier of the query ruleset to delete + # @option arguments [String] :ruleset_id The unique identifier of the query ruleset to delete (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-query-ruleset.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-delete-ruleset # def delete_ruleset(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'query_rules.delete_ruleset' } @@ -47,20 +49,12 @@ def delete_ruleset(arguments = {}) _ruleset_id = arguments.delete(:ruleset_id) method = Elasticsearch::API::HTTP_DELETE - path = "_query_rules/#{Utils.__listify(_ruleset_id)}" - params = Utils.process_params(arguments) + path = "_query_rules/#{Utils.listify(_ruleset_id)}" + params = {} - if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end - else - Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers, request_opts) - ) - end + Elasticsearch::API::Response.new( + perform_request(method, path, params, body, headers, request_opts) + ) end end end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/get_rule.rb b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/get_rule.rb index 579d2a962..415128bed 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/get_rule.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/get_rule.rb @@ -15,25 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module QueryRules module Actions - # Returns the details about an individual query rule within a ruleset. + # Get a query rule. + # Get details about a query rule within a query ruleset. # - # @option arguments [String] :ruleset_id The unique identifier of the query ruleset the rule exists within - # @option arguments [String] :rule_id The unique identifier of the rule to be retrieved. + # @option arguments [String] :ruleset_id The unique identifier of the query ruleset containing the rule to retrieve (*Required*) + # @option arguments [String] :rule_id The unique identifier of the query rule within the specified ruleset to retrieve (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-query-rule.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-get-rule # def get_rule(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'query_rules.get_rule' } - defined_params = %i[ruleset_id rule_id].each_with_object({}) do |variable, set_variables| + defined_params = [:ruleset_id, :rule_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +52,7 @@ def get_rule(arguments = {}) _rule_id = arguments.delete(:rule_id) method = Elasticsearch::API::HTTP_GET - path = "_query_rules/#{Utils.__listify(_ruleset_id)}/_rule/#{Utils.__listify(_rule_id)}" + path = "_query_rules/#{Utils.listify(_ruleset_id)}/_rule/#{Utils.listify(_rule_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/get_ruleset.rb b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/get_ruleset.rb index 3eb2931d9..de912178e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/get_ruleset.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/get_ruleset.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module QueryRules module Actions - # Returns the details about a query ruleset. + # Get a query ruleset. + # Get details about a query ruleset. # - # @option arguments [String] :ruleset_id The unique identifier of the query ruleset + # @option arguments [String] :ruleset_id The unique identifier of the query ruleset (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-query-ruleset.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-get-ruleset # def get_ruleset(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'query_rules.get_ruleset' } @@ -47,7 +48,7 @@ def get_ruleset(arguments = {}) _ruleset_id = arguments.delete(:ruleset_id) method = Elasticsearch::API::HTTP_GET - path = "_query_rules/#{Utils.__listify(_ruleset_id)}" + path = "_query_rules/#{Utils.listify(_ruleset_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/list_rulesets.rb b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/list_rulesets.rb index 46cb469e2..6f9450a03 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/list_rulesets.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/list_rulesets.rb @@ -15,20 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module QueryRules module Actions - # Lists query rulesets. + # Get all query rulesets. + # Get summarized information about the query rulesets. # - # @option arguments [Integer] :from Starting offset (default: 0) - # @option arguments [Integer] :size specifies a max number of results to get (default: 100) + # @option arguments [Integer] :from The offset from the first result to fetch. Server default: 0. + # @option arguments [Integer] :size The maximum number of results to retrieve. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/list-query-rulesets.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-list-rulesets # def list_rulesets(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'query_rules.list_rulesets' } @@ -36,7 +37,7 @@ def list_rulesets(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_query_rules' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/put_rule.rb b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/put_rule.rb index 659f785d6..5e726c4e7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/put_rule.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/put_rule.rb @@ -15,26 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module QueryRules module Actions - # Creates or updates a query rule within a ruleset. + # Create or update a query rule. + # Create or update a query rule within a query ruleset. + # IMPORTANT: Due to limitations within pinned queries, you can only pin documents using ids or docs, but cannot use both in single rule. + # It is advised to use one or the other in query rulesets, to avoid errors. + # Additionally, pinned queries have a maximum limit of 100 pinned hits. + # If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset. # - # @option arguments [String] :ruleset_id The unique identifier of the ruleset this rule should be added to. The ruleset will be created if it does not exist. - # @option arguments [String] :rule_id The unique identifier of the rule to be created or updated. + # @option arguments [String] :ruleset_id The unique identifier of the query ruleset containing the rule to be created or updated. (*Required*) + # @option arguments [String] :rule_id The unique identifier of the query rule within the specified ruleset to be created or updated. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The query rule configuration, including the type of rule, the criteria to match the rule, and the action that should be taken if the rule matches. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-query-rule.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-put-rule # def put_rule(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'query_rules.put_rule' } - defined_params = %i[ruleset_id rule_id].each_with_object({}) do |variable, set_variables| + defined_params = [:ruleset_id, :rule_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,7 +58,7 @@ def put_rule(arguments = {}) _rule_id = arguments.delete(:rule_id) method = Elasticsearch::API::HTTP_PUT - path = "_query_rules/#{Utils.__listify(_ruleset_id)}/_rule/#{Utils.__listify(_rule_id)}" + path = "_query_rules/#{Utils.listify(_ruleset_id)}/_rule/#{Utils.listify(_rule_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/put_ruleset.rb b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/put_ruleset.rb index ed042f396..8d32d0b90 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/put_ruleset.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/put_ruleset.rb @@ -15,20 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module QueryRules module Actions - # Creates or updates a query ruleset. + # Create or update a query ruleset. + # There is a limit of 100 rules per ruleset. + # This limit can be increased by using the +xpack.applications.rules.max_rules_per_ruleset+ cluster setting. + # IMPORTANT: Due to limitations within pinned queries, you can only select documents using +ids+ or +docs+, but cannot use both in single rule. + # It is advised to use one or the other in query rulesets, to avoid errors. + # Additionally, pinned queries have a maximum limit of 100 pinned hits. + # If multiple matching rules pin more than 100 documents, only the first 100 documents are pinned in the order they are specified in the ruleset. # - # @option arguments [String] :ruleset_id The unique identifier of the ruleset to be created or updated. + # @option arguments [String] :ruleset_id The unique identifier of the query ruleset to be created or updated. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The query ruleset configuration, including `rules` (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-query-ruleset.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-put-ruleset # def put_ruleset(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'query_rules.put_ruleset' } @@ -49,7 +55,7 @@ def put_ruleset(arguments = {}) _ruleset_id = arguments.delete(:ruleset_id) method = Elasticsearch::API::HTTP_PUT - path = "_query_rules/#{Utils.__listify(_ruleset_id)}" + path = "_query_rules/#{Utils.listify(_ruleset_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/test.rb b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/test.rb index 0215f0656..66b972cb4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/test.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/query_rules/test.rb @@ -15,24 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module QueryRules module Actions - # Tests a query ruleset to identify the rules that would match input criteria - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Test a query ruleset. + # Evaluate match criteria against a query ruleset to identify the rules that would match that criteria. # - # @option arguments [String] :ruleset_id The unique identifier of the ruleset to test. + # @option arguments [String] :ruleset_id The unique identifier of the query ruleset to be created or updated (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The match criteria to test against the ruleset (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/test-query-ruleset.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-query-rules-test # def test(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'query_rules.test' } @@ -53,7 +50,7 @@ def test(arguments = {}) _ruleset_id = arguments.delete(:ruleset_id) method = Elasticsearch::API::HTTP_POST - path = "_query_rules/#{Utils.__listify(_ruleset_id)}/_test" + path = "_query_rules/#{Utils.listify(_ruleset_id)}/_test" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/rank_eval.rb b/elasticsearch-api/lib/elasticsearch/api/actions/rank_eval.rb index f9477705e..dcdf02dff 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/rank_eval.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/rank_eval.rb @@ -15,23 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows to evaluate the quality of ranked search results over a set of typical search queries + # Evaluate ranked search results. + # Evaluate the quality of ranked search results over a set of typical search queries. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch) + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and index aliases used to limit the request. + # Wildcard (+*+) expressions are supported. + # To target all data streams and indices in a cluster, omit this parameter or use +_all+ or +*+. + # @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. This behavior applies even if the request targets other open indices. For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true. + # @option arguments [String, Array] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. + # @option arguments [Boolean] :ignore_unavailable If +true+, missing or closed indices are not included in the response. + # @option arguments [String] :search_type Search operation type # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The ranking evaluation search definition, including search requests, document ratings and ranking metric definition. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-rank-eval.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-rank-eval # def rank_eval(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'rank_eval' } @@ -46,13 +49,13 @@ def rank_eval(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_rank_eval" + "#{Utils.listify(_index)}/_rank_eval" else '_rank_eval' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/reindex.rb b/elasticsearch-api/lib/elasticsearch/api/actions/reindex.rb index 144756893..55161e453 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/reindex.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/reindex.rb @@ -15,28 +15,167 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows to copy documents from one index to another, optionally filtering the source - # documents by a query, changing the destination index settings, or fetching the - # documents from a remote cluster. + # Reindex documents. + # Copy documents from a source to a destination. + # You can copy all documents to the destination index or reindex a subset of the documents. + # The source can be any existing index, alias, or data stream. + # The destination must differ from the source. + # For example, you cannot reindex a data stream into itself. + # IMPORTANT: Reindex requires +_source+ to be enabled for all documents in the source. + # The destination should be configured as wanted before calling the reindex API. + # Reindex does not copy the settings from the source or its associated template. + # Mappings, shard counts, and replicas, for example, must be configured ahead of time. + # If the Elasticsearch security features are enabled, you must have the following security privileges: + # * The +read+ index privilege for the source data stream, index, or alias. + # * The +write+ index privilege for the destination data stream, index, or index alias. + # * To automatically create a data stream or index with a reindex API request, you must have the +auto_configure+, +create_index+, or +manage+ index privilege for the destination data stream, index, or alias. + # * If reindexing from a remote cluster, the +source.remote.user+ must have the +monitor+ cluster privilege and the +read+ index privilege for the source data stream, index, or alias. + # If reindexing from a remote cluster, you must explicitly allow the remote host in the +reindex.remote.whitelist+ setting. + # Automatic data stream creation requires a matching index template with data stream enabled. + # The +dest+ element can be configured like the index API to control optimistic concurrency control. + # Omitting +version_type+ or setting it to +internal+ causes Elasticsearch to blindly dump documents into the destination, overwriting any that happen to have the same ID. + # Setting +version_type+ to +external+ causes Elasticsearch to preserve the +version+ from the source, create any documents that are missing, and update any documents that have an older version in the destination than they do in the source. + # Setting +op_type+ to +create+ causes the reindex API to create only missing documents in the destination. + # All existing documents will cause a version conflict. + # IMPORTANT: Because data streams are append-only, any reindex request to a destination data stream must have an +op_type+ of +create+. + # A reindex can only add new documents to a destination data stream. + # It cannot update existing documents in a destination data stream. + # By default, version conflicts abort the reindex process. + # To continue reindexing if there are conflicts, set the +conflicts+ request body property to +proceed+. + # 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. + # NOTE: The reindex API makes no effort to handle ID collisions. + # The last document written will "win" but the order isn't usually predictable so it is not a good idea to rely on this behavior. + # Instead, make sure that IDs are unique by using a script. + # **Running reindex asynchronously** + # If the request contains +wait_for_completion=false+, Elasticsearch performs some preflight checks, launches the request, and returns a task you can use to cancel or get the status of the task. + # Elasticsearch creates a record of this task as a document at +_tasks/+. + # **Reindex from multiple sources** + # If you have many sources to reindex it is generally better to reindex them one at a time rather than using a glob pattern to pick up multiple sources. + # That way you can resume the process if there are any errors by removing the partially completed source and starting over. + # It also makes parallelizing the process fairly simple: split the list of sources to reindex and run each list in parallel. + # For example, you can use a bash script like this: + # + + # for index in i1 i2 i3 i4 i5; do + # curl -HContent-Type:application/json -XPOST localhost:9200/_reindex?pretty -d'{ + # "source": { + # "index": "'$index'" + # }, + # "dest": { + # "index": "'$index'-reindexed" + # } + # }' + # done + # + + # **Throttling** + # Set +requests_per_second+ to any positive decimal number (+1.4+, +6+, +1000+, for example) to throttle the rate at which reindex issues batches of index operations. + # Requests are throttled by padding each batch with a wait time. + # To turn off throttling, set +requests_per_second+ to +-1+. + # The throttling is done by waiting between batches so that the scroll that reindex uses internally can be given a timeout that takes into account the padding. + # The padding time is the difference between the batch size divided by the +requests_per_second+ and the time spent writing. + # By default the batch size is +1000+, so if +requests_per_second+ is set to +500+: + # + + # target_time = 1000 / 500 per second = 2 seconds + # wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds + # + + # Since the batch is issued as a single bulk request, large batch sizes cause Elasticsearch to create many requests and then wait for a while before starting the next set. + # This is "bursty" instead of "smooth". + # **Slicing** + # Reindex supports sliced scroll to parallelize the reindexing process. + # This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts. + # NOTE: Reindexing from remote clusters does not support manual or automatic slicing. + # You can slice a reindex request manually by providing a slice ID and total number of slices to each request. + # You can also let reindex automatically parallelize by using sliced scroll to slice on +_id+. + # The +slices+ parameter specifies the number of slices to use. + # Adding +slices+ to the reindex request just automates the manual process, creating sub-requests which means it has some quirks: + # * You can see these requests in the tasks API. These sub-requests are "child" tasks of the task for the request with slices. + # * Fetching the status of the task for the request with +slices+ only contains the status of completed slices. + # * These sub-requests are individually addressable for things like cancellation and rethrottling. + # * Rethrottling the request with +slices+ will rethrottle the unfinished sub-request proportionally. + # * Canceling the request with +slices+ will cancel each sub-request. + # * Due to the nature of +slices+, each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution. + # * Parameters like +requests_per_second+ and +max_docs+ on a request with +slices+ are distributed proportionally to each sub-request. Combine that with the previous point about distribution being uneven and you should conclude that using +max_docs+ with +slices+ might not result in exactly +max_docs+ documents being reindexed. + # * Each sub-request gets a slightly different snapshot of the source, though these are all taken at approximately the same time. + # If slicing automatically, setting +slices+ to +auto+ will choose a reasonable number for most indices. + # If slicing manually or otherwise tuning automatic slicing, use the following guidelines. + # Query performance is most efficient when the number of slices is equal to the number of shards in the index. + # If that number is large (for example, +500+), choose a lower number as too many slices will hurt performance. + # Setting slices higher than the number of shards generally does not improve efficiency and adds overhead. + # Indexing performance scales linearly across available resources with the number of slices. + # Whether query or indexing performance dominates the runtime depends on the documents being reindexed and cluster resources. + # **Modify documents during reindexing** + # Like +_update_by_query+, reindex operations support a script that modifies the document. + # Unlike +_update_by_query+, the script is allowed to modify the document's metadata. + # Just as in +_update_by_query+, you can set +ctx.op+ to change the operation that is run on the destination. + # For example, set +ctx.op+ to +noop+ if your script decides that the document doesn’t have to be indexed in the destination. This "no operation" will be reported in the +noop+ counter in the response body. + # Set +ctx.op+ to +delete+ if your script decides that the document must be deleted from the destination. + # The deletion will be reported in the +deleted+ counter in the response body. + # Setting +ctx.op+ to anything else will return an error, as will setting any other field in +ctx+. + # Think of the possibilities! Just be careful; you are able to change: + # * +_id+ + # * +_index+ + # * +_version+ + # * +_routing+ + # Setting +_version+ to +null+ or clearing it from the +ctx+ map is just like not sending the version in an indexing request. + # It will cause the document to be overwritten in the destination regardless of the version on the target or the version type you use in the reindex API. + # **Reindex from remote** + # Reindex supports reindexing from a remote Elasticsearch cluster. + # The +host+ parameter must contain a scheme, host, port, and optional path. + # The +username+ and +password+ parameters are optional and when they are present the reindex operation will connect to the remote Elasticsearch node using basic authentication. + # Be sure to use HTTPS when using basic authentication or the password will be sent in plain text. + # There are a range of settings available to configure the behavior of the HTTPS connection. + # When using Elastic Cloud, it is also possible to authenticate against the remote cluster through the use of a valid API key. + # Remote hosts must be explicitly allowed with the +reindex.remote.whitelist+ setting. + # It can be set to a comma delimited list of allowed remote host and port combinations. + # Scheme is ignored; only the host and port are used. + # For example: + # + + # reindex.remote.whitelist: [otherhost:9200, another:9200, 127.0.10.*:9200, localhost:*"] + # + + # The list of allowed hosts must be configured on any nodes that will coordinate the reindex. + # This feature should work with remote clusters of any version of Elasticsearch. + # This should enable you to upgrade from any version of Elasticsearch to the current version by reindexing from a cluster of the old version. + # WARNING: Elasticsearch does not support forward compatibility across major versions. + # For example, you cannot reindex from a 7.x cluster into a 6.x cluster. + # To enable queries sent to older versions of Elasticsearch, the +query+ parameter is sent directly to the remote host without validation or modification. + # NOTE: Reindexing from remote clusters does not support manual or automatic slicing. + # Reindexing from a remote server uses an on-heap buffer that defaults to a maximum size of 100mb. + # If the remote index includes very large documents you'll need to use a smaller batch size. + # It is also possible to set the socket read timeout on the remote connection with the +socket_timeout+ field and the connection timeout with the +connect_timeout+ field. + # Both default to 30 seconds. + # **Configuring SSL parameters** + # Reindex from remote supports configurable SSL settings. + # These must be specified in the +elasticsearch.yml+ file, with the exception of the secure settings, which you add in the Elasticsearch keystore. + # It is not possible to configure SSL in the body of the reindex request. # - # @option arguments [Boolean] :refresh Should the affected indexes be refreshed? - # @option arguments [Time] :timeout Time each individual bulk request should wait for shards that are unavailable. - # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the reindex operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - # @option arguments [Boolean] :wait_for_completion Should the request should block until the reindex is complete. - # @option arguments [Number] :requests_per_second The throttle to set on this request in sub-requests per second. -1 means no throttle. - # @option arguments [Time] :scroll Control how long to keep the search context alive - # @option arguments [Number|string] :slices The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. - # @option arguments [Number] :max_docs Maximum number of documents to process (default: all documents) + # @option arguments [Boolean] :refresh If +true+, the request refreshes affected shards to make this operation visible to search. + # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. + # By default, there is no throttle. Server default: -1. + # @option arguments [Time] :scroll The period of time that a consistent view of the index should be maintained for scrolled search. + # @option arguments [Integer, String] :slices The number of slices this task should be divided into. + # It defaults to one slice, which means the task isn't sliced into subtasks.Reindex supports sliced scroll to parallelize the reindexing process. + # This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.NOTE: Reindexing from remote clusters does not support manual or automatic slicing.If set to +auto+, Elasticsearch chooses the number of slices to use. + # This setting will use one slice per shard, up to a certain limit. + # If there are multiple sources, it will choose the number of slices based on the index or backing index with the smallest number of shards. Server default: 1. + # @option arguments [Time] :timeout The period each indexing waits for automatic index creation, dynamic mapping updates, and waiting for active shards. + # By default, Elasticsearch waits for at least one minute before failing. + # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set it to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). + # The default value is one, which means it waits for each primary shard to be active. Server default: 1. + # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete. Server default: true. + # @option arguments [Boolean] :require_alias If +true+, the destination must be an index alias. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search definition using the Query DSL and the prototype for the index request. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex # def reindex(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'reindex' } @@ -46,7 +185,7 @@ def reindex(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_reindex' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/reindex_rethrottle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/reindex_rethrottle.rb index e528d3b6e..130ab943a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/reindex_rethrottle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/reindex_rethrottle.rb @@ -15,19 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Changes the number of requests per second for a particular Reindex operation. + # Throttle a reindex operation. + # Change the number of requests per second for a particular reindex operation. + # For example: + # + + # POST _reindex/r1A2WoRbTwKZ516z6NEs5A:36619/_rethrottle?requests_per_second=-1 + # + + # Rethrottling that speeds up the query takes effect immediately. + # Rethrottling that slows down the query will take effect after completing the current batch. + # This behavior prevents scroll timeouts. # - # @option arguments [String] :task_id The task id to rethrottle - # @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (*Required*) + # @option arguments [String] :task_id The task identifier, which can be found by using the tasks API. (*Required*) + # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. + # It can be either +-1+ to turn off throttling or any decimal number like +1.7+ or +12+ to throttle to that level. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex # def reindex_rethrottle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'reindex_rethrottle' } @@ -47,7 +56,7 @@ def reindex_rethrottle(arguments = {}) _task_id = arguments.delete(:task_id) method = Elasticsearch::API::HTTP_POST - path = "_reindex/#{Utils.__listify(_task_id)}/_rethrottle" + path = "_reindex/#{Utils.listify(_task_id)}/_rethrottle" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/render_search_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/render_search_template.rb index 90de6aaea..04700eae3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/render_search_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/render_search_template.rb @@ -15,19 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows to use the Mustache language to pre-render a search definition. + # Render a search template. + # Render a search template as a search request body. # - # @option arguments [String] :id The id of the stored search template + # @option arguments [String] :id The ID of the search template to render. + # If no +source+ is specified, this or the +id+ request body parameter is required. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search definition template and its params + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/render-search-template-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-render-search-template # def render_search_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'render_search_template' } @@ -50,11 +52,11 @@ def render_search_template(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _id - "_render/template/#{Utils.__listify(_id)}" - else - '_render/template' - end + path = if _id + "_render/template/#{Utils.listify(_id)}" + else + '_render/template' + end params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/scripts_painless_execute.rb b/elasticsearch-api/lib/elasticsearch/api/actions/scripts_painless_execute.rb index e9cc67da6..3deb397c3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/scripts_painless_execute.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/scripts_painless_execute.rb @@ -15,20 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows an arbitrary script to be executed and a result to be returned + # Run a script. + # Runs a script and returns a result. + # Use this API to build and test scripts, such as when defining a script for a runtime field. + # This API requires very few dependencies and is especially useful if you don't have permissions to write documents on a cluster. + # The API uses several _contexts_, which control how scripts are run, what variables are available at runtime, and what the return type is. + # Each context requires a script, but additional parameters depend on the context you're using for that script. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The script to execute + # @option arguments [Hash] :body request body # # @see https://www.elastic.co/guide/en/elasticsearch/painless/current/painless-execute-api.html # @@ -38,7 +43,7 @@ def scripts_painless_execute(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = if body Elasticsearch::API::HTTP_POST @@ -46,7 +51,7 @@ def scripts_painless_execute(arguments = {}) Elasticsearch::API::HTTP_GET end - path = '_scripts/painless/_execute' + path = '_scripts/painless/_execute' params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/scroll.rb b/elasticsearch-api/lib/elasticsearch/api/actions/scroll.rb index 2885c09a8..97dbda729 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/scroll.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/scroll.rb @@ -15,35 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows to retrieve a large numbers of results from a single search request. + # Run a scrolling search. + # IMPORTANT: The scroll API is no longer recommend for deep pagination. If you need to preserve the index state while paging through more than 10,000 hits, use the +search_after+ parameter with a point in time (PIT). + # The scroll API gets large sets of results from a single scrolling search request. + # To get the necessary scroll ID, submit a search API request that includes an argument for the +scroll+ query parameter. + # The +scroll+ parameter indicates how long Elasticsearch should retain the search context for the request. + # The search response returns a scroll ID in the +_scroll_id+ response body parameter. + # You can then use the scroll ID with the scroll API to retrieve the next batch of results for the request. + # If the Elasticsearch security features are enabled, the access to the results of a specific scroll ID is restricted to the user or API key that submitted the search. + # You can also use the scroll API to specify a new scroll parameter that extends or shortens the retention period for the search context. + # IMPORTANT: Results from a scrolling search reflect the state of the index at the time of the initial search request. Subsequent indexing or document changes only affect later search and scroll requests. # - # @option arguments [String] :scroll_id The scroll ID *Deprecated* - # @option arguments [Time] :scroll Specify how long a consistent view of the index should be maintained for scrolled search - # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether hits.total should be rendered as an integer or an object in the rest search response + # @option arguments [String] :scroll_id The scroll ID + # @option arguments [Time] :scroll The period to retain the search context for scrolling. Server default: 1d. + # @option arguments [Boolean] :rest_total_hits_as_int If true, the API response’s hit.total property is returned as an integer. If false, the API response’s hit.total property is returned as an object. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The scroll ID if not passed by URL or query parameter. + # @option arguments [Hash] :body request body # # *Deprecation notice*: # A scroll id can be quite large and should be specified as part of the body # Deprecated since version 7.0.0 # # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-body.html#request-body-search-scroll + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-scroll # def scroll(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'scroll' } - defined_params = [:scroll_id].each_with_object({}) do |variable, set_variables| - set_variables[variable] = arguments[variable] if arguments.key?(variable) - end - request_opts[:defined_params] = defined_params unless defined_params.empty? - arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -57,11 +61,7 @@ def scroll(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _scroll_id - "_search/scroll/#{Utils.__listify(_scroll_id)}" - else - '_search/scroll' - end + path = '_search/scroll' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search.rb index b62d05935..4a58dcea6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search.rb @@ -15,63 +15,142 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns results matching a query. + # Run a search. + # Get search hits that match the query defined in the request. + # You can provide search queries using the +q+ query string parameter or the request body. + # If both are specified, only the query parameter is used. + # If the Elasticsearch security features are enabled, you must have the read index privilege for the target data stream, index, or alias. For cross-cluster search, refer to the documentation about configuring CCS privileges. + # To search a point in time (PIT) for an alias, you must have the +read+ index privilege for the alias's data streams or indices. + # **Search slicing** + # When paging through a large number of documents, it can be helpful to split the search into multiple slices to consume them independently with the +slice+ and +pit+ properties. + # By default the splitting is done first on the shards, then locally on each shard. + # The local splitting partitions the shard into contiguous ranges based on Lucene document IDs. + # For instance if the number of shards is equal to 2 and you request 4 slices, the slices 0 and 2 are assigned to the first shard and the slices 1 and 3 are assigned to the second shard. + # IMPORTANT: The same point-in-time ID should be used for all slices. + # If different PIT IDs are used, slices can overlap and miss documents. + # This situation can occur because the splitting criterion is based on Lucene document IDs, which are not stable across changes to the index. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - # @option arguments [String] :analyzer The analyzer to use for the query string - # @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false) - # @option arguments [Boolean] :ccs_minimize_roundtrips Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution - # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR) - # @option arguments [String] :df The field to use as default where no field prefix is given in the query string - # @option arguments [Boolean] :explain Specify whether to return detailed information about score computation as part of a hit - # @option arguments [List] :stored_fields A comma-separated list of stored fields to return as part of a hit - # @option arguments [List] :docvalue_fields A comma-separated list of fields to return as the docvalue representation of a field for each hit - # @option arguments [Number] :from Starting offset (default: 0) - # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index. - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [String] :q Query in the Lucene query string syntax - # @option arguments [List] :routing A comma-separated list of specific routing values - # @option arguments [Time] :scroll Specify how long a consistent view of the index should be maintained for scrolled search - # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch) - # @option arguments [Number] :size Number of hits to return (default: 10) - # @option arguments [List] :sort A comma-separated list of : pairs - # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return - # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field - # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field - # @option arguments [Number] :terminate_after The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - # @option arguments [List] :stats Specific 'tag' of the request for logging and statistical purposes - # @option arguments [String] :suggest_field Specify which field to use for suggestions - # @option arguments [String] :suggest_mode Specify suggest mode (options: missing, popular, always) - # @option arguments [Number] :suggest_size How many suggestions to return in response - # @option arguments [String] :suggest_text The source text for which the suggestions should be returned - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Boolean] :track_scores Whether to calculate and return scores even if they are not used for sorting - # @option arguments [Boolean|long] :track_total_hits Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. - # @option arguments [Boolean] :allow_partial_search_results Indicate if an error should be returned if there is a partial search failure or timeout - # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response - # @option arguments [Boolean] :version Specify whether to return document version as part of a hit - # @option arguments [Boolean] :seq_no_primary_term Specify whether to return sequence number and primary term of the last modification of each hit - # @option arguments [Boolean] :request_cache Specify if request cache should be used for this request or not, defaults to index level setting - # @option arguments [Number] :batched_reduce_size The number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. - # @option arguments [Number] :max_concurrent_shard_requests The number of concurrent shard requests per node this search executes concurrently. This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests - # @option arguments [Number] :pre_filter_shard_size A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard bounds and the query are disjoint. - # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether hits.total should be rendered as an integer or an object in the rest search response - # @option arguments [Boolean] :include_named_queries_score Indicates whether hit.matched_queries should be rendered as a map that includes the name of the matched query associated with its score (true) or as an array containing the name of the matched queries (false) + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search. + # It supports wildcards (+*+). + # To search all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true. + # @option arguments [Boolean] :allow_partial_search_results If +true+ and there are shard request timeouts or shard failures, the request returns partial results. + # If +false+, it returns an error with no partial results.To override the default behavior, you can set the +search.default_allow_partial_results+ cluster setting to +false+. Server default: true. + # @option arguments [String] :analyzer The analyzer to use for the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Integer] :batched_reduce_size The number of shard results that should be reduced at once on the coordinating node. + # If the potential number of shards in the request can be large, this value should be used as a protection mechanism to reduce the memory overhead per search request. Server default: 512. + # @option arguments [Boolean] :ccs_minimize_roundtrips If +true+, network round-trips between the coordinating node and the remote clusters are minimized when running cross-cluster search (CCS) requests. Server default: true. + # @option arguments [String] :default_operator The default operator for the query string query: +AND+ or +OR+. + # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR. + # @option arguments [String] :df The field to use as a default when no field prefix is given in the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [String, Array] :docvalue_fields A comma-separated list of fields to return as the docvalue representation of a field for each hit. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # It supports comma-separated values such as +open,hidden+. Server default: open. + # @option arguments [Boolean] :explain If +true+, the request returns detailed information about score computation as part of a hit. + # @option arguments [Boolean] :ignore_throttled If +true+, concrete, expanded or aliased indices will be ignored when frozen. Server default: true. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :include_named_queries_score If +true+, the response includes the score contribution from any named queries.This functionality reruns each named query on every hit in a search response. + # Typically, this adds a small overhead to a request. + # However, using computationally expensive named queries on a large number of hits may add significant overhead. + # @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Integer] :max_concurrent_shard_requests The number of concurrent shard requests per node that the search runs concurrently. + # This value should be used to limit the impact of the search on the cluster in order to limit the number of concurrent shard requests. Server default: 5. + # @option arguments [String] :preference The nodes and shards used for the search. + # By default, Elasticsearch selects from eligible nodes and shards using adaptive replica selection, accounting for allocation awareness. + # Valid values are: + # - +_only_local+ to run the search only on shards on the local node. + # - +_local+ to, if possible, run the search on shards on the local node, or if not, select shards using the default method. + # - +_only_nodes:,+ to run the search on only the specified nodes IDs. If suitable shards exist on more than one selected node, use shards on those nodes using the default method. If none of the specified nodes are available, select shards from any available node using the default method. + # - +_prefer_nodes:,+ to if possible, run the search on the specified nodes IDs. If not, select shards using the default method. + # +_shards:,+ to run the search only on the specified shards. You can combine this value with other +preference+ values. However, the +_shards+ value must come first. For example: +_shards:2,3|_local+. + # ++ (any string that does not start with +_+) to route searches with the same ++ to the same shards in the same order. + # @option arguments [Integer] :pre_filter_shard_size A threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting if the number of shards the search request expands to exceeds the threshold. + # This filter roundtrip can limit the number of shards significantly if for instance a shard can not match any documents based on its rewrite method (if date filters are mandatory to match but the shard bounds and the query are disjoint). + # When unspecified, the pre-filter phase is executed if any of these conditions is met: + # - The request targets more than 128 shards. + # - The request targets one or more read-only index. + # - The primary sort of the query targets an indexed field. + # @option arguments [Boolean] :request_cache If +true+, the caching of search results is enabled for requests where +size+ is +0+. + # It defaults to index level settings. + # @option arguments [String] :routing A custom value that is used to route operations to a specific shard. + # @option arguments [Time] :scroll The period to retain the search context for scrolling. + # By default, this value cannot exceed +1d+ (24 hours). + # You can change this limit by using the +search.max_keep_alive+ cluster-level setting. + # @option arguments [String] :search_type Indicates how distributed term frequencies are calculated for relevance scoring. + # @option arguments [Array] :stats Specific +tag+ of the request for logging and statistical purposes. + # @option arguments [String, Array] :stored_fields A comma-separated list of stored fields to return as part of a hit. + # If no fields are specified, no stored fields are included in the response. + # If this field is specified, the +_source+ parameter defaults to +false+. + # You can pass +_source: true+ to return both source fields and stored fields in the search response. + # @option arguments [String] :suggest_field The field to use for suggestions. + # @option arguments [String] :suggest_mode The suggest mode. + # This parameter can be used only when the +suggest_field+ and +suggest_text+ query string parameters are specified. Server default: missing. + # @option arguments [Integer] :suggest_size The number of suggestions to return. + # This parameter can be used only when the +suggest_field+ and +suggest_text+ query string parameters are specified. + # @option arguments [String] :suggest_text The source text for which the suggestions should be returned. + # This parameter can be used only when the +suggest_field+ and +suggest_text+ query string parameters are specified. + # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard. + # If a query reaches this limit, Elasticsearch terminates the query early. + # Elasticsearch collects documents before sorting.IMPORTANT: Use with caution. + # Elasticsearch applies this parameter to each shard handling the request. + # When possible, let Elasticsearch perform early termination automatically. + # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + # If set to +0+ (default), the query does not terminate early. Server default: 0. + # @option arguments [Time] :timeout The period of time to wait for a response from each shard. + # If no response is received before the timeout expires, the request fails and returns an error. + # It defaults to no timeout. + # @option arguments [Boolean, Integer] :track_total_hits The number of hits matching the query to count accurately. + # If +true+, the exact number of hits is returned at the cost of some performance. + # If +false+, the response does not include the total number of hits matching the query. Server default: 10000. + # @option arguments [Boolean] :track_scores If +true+, the request calculates and returns document scores, even if the scores are not used for sorting. + # @option arguments [Boolean] :typed_keys If +true+, aggregation and suggester names are be prefixed by their respective types in the response. + # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether +hits.total+ should be rendered as an integer or an object in the rest search response. + # @option arguments [Boolean] :version If +true+, the request returns the document version as part of a hit. + # @option arguments [Boolean, String, Array] :_source The source fields that are returned for matching documents. + # These fields are returned in the +hits._source+ property of the search response. + # Valid values are: + # - +true+ to return the entire document source. + # - +false+ to not return the document source. + # - ++ to return the source fields that are specified as a comma-separated list that supports wildcard (+*+) patterns. Server default: true. + # @option arguments [String, Array] :_source_excludes A comma-separated list of source fields to exclude from the response. + # You can also use this parameter to exclude fields from the subset specified in +_source_includes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [String, Array] :_source_includes A comma-separated list of source fields to include in the response. + # If this parameter is specified, only these source fields are returned. + # You can exclude fields from this subset using the +_source_excludes+ query parameter. + # If the +_source+ parameter is +false+, this parameter is ignored. + # @option arguments [Boolean] :seq_no_primary_term If +true+, the request returns the sequence number and primary term of the last modification of each hit. + # @option arguments [String] :q A query in the Lucene query string syntax. + # Query parameter searches do not support the full Elasticsearch Query DSL but are handy for testing.IMPORTANT: This parameter overrides the query parameter in the request body. + # If both parameters are specified, documents matching the query request body parameter are not returned. + # @option arguments [Integer] :size The number of hits to return. + # By default, you cannot page through more than 10,000 hits using the +from+ and +size+ parameters. + # To page through more hits, use the +search_after+ parameter. Server default: 10. + # @option arguments [Integer] :from The starting document offset, which must be non-negative. + # By default, you cannot page through more than 10,000 hits using the +from+ and +size+ parameters. + # To page through more hits, use the +search_after+ parameter. Server default: 0. + # @option arguments [String] :sort A comma-separated list of +:+ pairs. + # @option arguments [Boolean] :force_synthetic_source Should this request force synthetic _source? + # Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. + # Fetches with this enabled will be slower the enabling synthetic source natively in the index. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search definition using the Query DSL + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-search.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search # def search(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search' } @@ -94,11 +173,11 @@ def search(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _index - "#{Utils.__listify(_index)}/_search" - else - '_search' - end + path = if _index + "#{Utils.listify(_index)}/_search" + else + '_search' + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/delete.rb index 165e1093d..177b54a31 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/delete.rb @@ -15,23 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions - # Deletes a search application. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Delete a search application. + # Remove a search application and its associated alias. Indices attached to the search application are not removed. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :name The name of the search application + # @option arguments [String] :name The name of the search application to delete. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-search-application.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete # def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.delete' } @@ -51,7 +52,7 @@ def delete(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_application/search_application/#{Utils.__listify(_name)}" + path = "_application/search_application/#{Utils.listify(_name)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/delete_behavioral_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/delete_behavioral_analytics.rb index 38ab030e2..d5a2fc575 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/delete_behavioral_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/delete_behavioral_analytics.rb @@ -15,23 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions # Delete a behavioral analytics collection. + # The associated data stream is also deleted. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :name The name of the analytics collection to be deleted + # @option arguments [String] :name The name of the analytics collection to be deleted (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-analytics-collection.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-delete-behavioral-analytics # def delete_behavioral_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.delete_behavioral_analytics' } @@ -51,7 +52,7 @@ def delete_behavioral_analytics(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_application/analytics/#{Utils.__listify(_name)}" + path = "_application/analytics/#{Utils.listify(_name)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/get.rb index a860983d7..4449134c2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/get.rb @@ -15,23 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions - # Returns the details about a search application. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Get search application details. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :name The name of the search application + # @option arguments [String] :name The name of the search application (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-search-application.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get # def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.get' } @@ -51,7 +51,7 @@ def get(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_GET - path = "_application/search_application/#{Utils.__listify(_name)}" + path = "_application/search_application/#{Utils.listify(_name)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/get_behavioral_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/get_behavioral_analytics.rb index 03162964b..fdcdfc4c7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/get_behavioral_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/get_behavioral_analytics.rb @@ -15,23 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions - # Returns the existing behavioral analytics collections. + # Get behavioral analytics collections. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [List] :name A comma-separated list of analytics collections to limit the returned information + # @option arguments [Array] :name A list of analytics collections to limit the returned information # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/list-analytics-collection.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics # def get_behavioral_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.get_behavioral_analytics' } @@ -50,7 +50,7 @@ def get_behavioral_analytics(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_application/analytics/#{Utils.__listify(_name)}" + "_application/analytics/#{Utils.listify(_name)}" else '_application/analytics' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/list.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/list.rb index e16653f8d..2bf7ecfe7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/list.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/list.rb @@ -15,25 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions - # Returns the existing search applications. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Get search applications. + # Get information about search applications. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :q Query in the Lucene query string syntax - # @option arguments [Integer] :from Starting offset (default: 0) - # @option arguments [Integer] :size specifies a max number of results to get + # @option arguments [String] :q Query in the Lucene query string syntax. + # @option arguments [Integer] :from Starting offset. Server default: 0. + # @option arguments [Integer] :size Specifies a max number of results to get. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/list-search-applications.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-get-behavioral-analytics # def list(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.list' } @@ -41,7 +42,7 @@ def list(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_application/search_application' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/post_behavioral_analytics_event.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/post_behavioral_analytics_event.rb index 73ddcf543..1753a24ee 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/post_behavioral_analytics_event.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/post_behavioral_analytics_event.rb @@ -15,31 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions - # Creates a behavioral analytics event for existing collection. + # Create a behavioral analytics collection event. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :collection_name The name of behavioral analytics collection - # @option arguments [String] :event_type Behavioral analytics event type. Available: page_view, search, search_click - # @option arguments [Boolean] :debug If true, returns event information that will be stored + # @option arguments [String] :collection_name The name of the behavioral analytics collection. (*Required*) + # @option arguments [String] :event_type The analytics event type. (*Required*) + # @option arguments [Boolean] :debug Whether the response type has to include more details # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The event definition (*Required*) + # @option arguments [Hash] :body payload # - # @see http://todo.com/tbd + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-post-behavioral-analytics-event # def post_behavioral_analytics_event(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.post_behavioral_analytics_event' } - defined_params = %i[collection_name event_type].each_with_object({}) do |variable, set_variables| + defined_params = [:collection_name, :event_type].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -58,7 +58,7 @@ def post_behavioral_analytics_event(arguments = {}) _event_type = arguments.delete(:event_type) method = Elasticsearch::API::HTTP_POST - path = "_application/analytics/#{Utils.__listify(_collection_name)}/event/#{Utils.__listify(_event_type)}" + path = "_application/analytics/#{Utils.listify(_collection_name)}/event/#{Utils.listify(_event_type)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/put.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/put.rb index 4b7171558..7b7cdf554 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/put.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/put.rb @@ -15,25 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions - # Creates or updates a search application. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Create or update a search application. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :name The name of the search application to be created or updated - # @option arguments [Boolean] :create If true, requires that a search application with the specified resource_id does not already exist. (default: false) + # @option arguments [String] :name The name of the search application to be created or updated. (*Required*) + # @option arguments [Boolean] :create If +true+, this request cannot replace or update existing Search Applications. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search application configuration, including `indices` (*Required*) + # @option arguments [Hash] :body search_application # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-search-application.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put # def put(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.put' } @@ -54,7 +54,7 @@ def put(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_application/search_application/#{Utils.__listify(_name)}" + path = "_application/search_application/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/put_behavioral_analytics.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/put_behavioral_analytics.rb index b04054239..9eddc3786 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/put_behavioral_analytics.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/put_behavioral_analytics.rb @@ -15,23 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions - # Creates a behavioral analytics collection. + # Create a behavioral analytics collection. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :name The name of the analytics collection to be created or updated + # @option arguments [String] :name The name of the analytics collection to be created or updated. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-analytics-collection.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-put-behavioral-analytics # def put_behavioral_analytics(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.put_behavioral_analytics' } @@ -51,7 +51,7 @@ def put_behavioral_analytics(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_application/analytics/#{Utils.__listify(_name)}" + path = "_application/analytics/#{Utils.listify(_name)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/render_query.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/render_query.rb index b6d21c350..d41ca4da2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/render_query.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/render_query.rb @@ -15,24 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions - # Renders a query for given search application search parameters + # Render a search application query. + # Generate an Elasticsearch query using the specified query parameters and the search template associated with the search application or a default template if none is specified. + # If a parameter used in the search template is not specified in +params+, the parameter's default value will be used. + # The API returns the specific Elasticsearch query that would be generated and run by calling the search application search API. + # You must have +read+ privileges on the backing alias of the search application. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :name The name of the search application to render the query for + # @option arguments [String] :name The name of the search application to render teh query for. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Search parameters, which will override any default search parameters defined in the search application template + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-application-render-query.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-render-query # def render_query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.render_query' } @@ -52,7 +56,7 @@ def render_query(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_POST - path = "_application/search_application/#{Utils.__listify(_name)}/_render_query" + path = "_application/search_application/#{Utils.listify(_name)}/_render_query" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/search.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/search.rb index f3a779735..f90fb133a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_application/search.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_application/search.rb @@ -15,25 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchApplication module Actions - # Perform a search against a search application - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Run a search application search. + # Generate and run an Elasticsearch query that uses the specified query parameteter and the search template associated with the search application or default template. + # Unspecified template parameters are assigned their default values if applicable. + # This functionality is in Beta and is subject to change. The design and + # code is less mature than official GA features and is being provided + # as-is with no warranties. Beta features are not subject to the support + # SLA of official GA features. # - # @option arguments [String] :name The name of the search application to be searched - # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response + # @option arguments [String] :name The name of the search application to be searched. (*Required*) + # @option arguments [Boolean] :typed_keys Determines whether aggregation names are prefixed by their respective types in the response. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Search parameters, including template parameters that override defaults + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-application-search.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-application-search # def search(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_application.search' } @@ -58,7 +60,7 @@ def search(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "_application/search_application/#{Utils.__listify(_name)}/_search" + path = "_application/search_application/#{Utils.listify(_name)}/_search" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_mvt.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_mvt.rb index 80bde3ce4..b7f12e176 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_mvt.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_mvt.rb @@ -15,39 +15,170 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Searches a vector tile for geospatial values. Returns results as a binary Mapbox vector tile. - # This functionality is Experimental and may be changed or removed - # completely in a future release. Elastic will take a best effort approach - # to fix any issues, but experimental features are not subject to the - # support SLA of official GA features. + # Search a vector tile. + # Search a vector tile for geospatial values. + # Before using this API, you should be familiar with the Mapbox vector tile specification. + # The API returns results as a binary mapbox vector tile. + # Internally, Elasticsearch translates a vector tile search API request into a search containing: + # * A +geo_bounding_box+ query on the ++. The query uses the +//+ tile as a bounding box. + # * A +geotile_grid+ or +geohex_grid+ aggregation on the ++. The +grid_agg+ parameter determines the aggregation type. The aggregation uses the +//+ tile as a bounding box. + # * Optionally, a +geo_bounds+ aggregation on the ++. The search only includes this aggregation if the +exact_bounds+ parameter is +true+. + # * If the optional parameter +with_labels+ is +true+, the internal search will include a dynamic runtime field that calls the +getLabelPosition+ function of the geometry doc value. This enables the generation of new point features containing suggested geometry labels, so that, for example, multi-polygons will have only one label. + # For example, Elasticsearch may translate a vector tile search API request with a +grid_agg+ argument of +geotile+ and an +exact_bounds+ argument of +true+ into the following search + # + + # GET my-index/_search + # { + # "size": 10000, + # "query": { + # "geo_bounding_box": { + # "my-geo-field": { + # "top_left": { + # "lat": -40.979898069620134, + # "lon": -45 + # }, + # "bottom_right": { + # "lat": -66.51326044311186, + # "lon": 0 + # } + # } + # } + # }, + # "aggregations": { + # "grid": { + # "geotile_grid": { + # "field": "my-geo-field", + # "precision": 11, + # "size": 65536, + # "bounds": { + # "top_left": { + # "lat": -40.979898069620134, + # "lon": -45 + # }, + # "bottom_right": { + # "lat": -66.51326044311186, + # "lon": 0 + # } + # } + # } + # }, + # "bounds": { + # "geo_bounds": { + # "field": "my-geo-field", + # "wrap_longitude": false + # } + # } + # } + # } + # + + # The API returns results as a binary Mapbox vector tile. + # Mapbox vector tiles are encoded as Google Protobufs (PBF). By default, the tile contains three layers: + # * A +hits+ layer containing a feature for each ++ value matching the +geo_bounding_box+ query. + # * An +aggs+ layer containing a feature for each cell of the +geotile_grid+ or +geohex_grid+. The layer only contains features for cells with matching data. + # * A meta layer containing: + # * A feature containing a bounding box. By default, this is the bounding box of the tile. + # * Value ranges for any sub-aggregations on the +geotile_grid+ or +geohex_grid+. + # * Metadata for the search. + # The API only returns features that can display at its zoom level. + # For example, if a polygon feature has no area at its zoom level, the API omits it. + # The API returns errors as UTF-8 encoded JSON. + # IMPORTANT: You can specify several options for this API as either a query parameter or request body parameter. + # If you specify both parameters, the query parameter takes precedence. + # **Grid precision for geotile** + # For a +grid_agg+ of +geotile+, you can use cells in the +aggs+ layer as tiles for lower zoom levels. + # +grid_precision+ represents the additional zoom levels available through these cells. The final precision is computed by as follows: + + grid_precision+. + # For example, if ++ is 7 and +grid_precision+ is 8, then the +geotile_grid+ aggregation will use a precision of 15. + # The maximum final precision is 29. + # The +grid_precision+ also determines the number of cells for the grid as follows: +(2^grid_precision) x (2^grid_precision)+. + # For example, a value of 8 divides the tile into a grid of 256 x 256 cells. + # The +aggs+ layer only contains features for cells with matching data. + # **Grid precision for geohex** + # For a +grid_agg+ of +geohex+, Elasticsearch uses ++ and +grid_precision+ to calculate a final precision as follows: + + grid_precision+. + # This precision determines the H3 resolution of the hexagonal cells produced by the +geohex+ aggregation. + # The following table maps the H3 resolution for each precision. + # For example, if ++ is 3 and +grid_precision+ is 3, the precision is 6. + # At a precision of 6, hexagonal cells have an H3 resolution of 2. + # If ++ is 3 and +grid_precision+ is 4, the precision is 7. + # At a precision of 7, hexagonal cells have an H3 resolution of 3. + # | Precision | Unique tile bins | H3 resolution | Unique hex bins | Ratio | + # | --------- | ---------------- | ------------- | ----------------| ----- | + # | 1 | 4 | 0 | 122 | 30.5 | + # | 2 | 16 | 0 | 122 | 7.625 | + # | 3 | 64 | 1 | 842 | 13.15625 | + # | 4 | 256 | 1 | 842 | 3.2890625 | + # | 5 | 1024 | 2 | 5882 | 5.744140625 | + # | 6 | 4096 | 2 | 5882 | 1.436035156 | + # | 7 | 16384 | 3 | 41162 | 2.512329102 | + # | 8 | 65536 | 3 | 41162 | 0.6280822754 | + # | 9 | 262144 | 4 | 288122 | 1.099098206 | + # | 10 | 1048576 | 4 | 288122 | 0.2747745514 | + # | 11 | 4194304 | 5 | 2016842 | 0.4808526039 | + # | 12 | 16777216 | 6 | 14117882 | 0.8414913416 | + # | 13 | 67108864 | 6 | 14117882 | 0.2103728354 | + # | 14 | 268435456 | 7 | 98825162 | 0.3681524172 | + # | 15 | 1073741824 | 8 | 691776122 | 0.644266719 | + # | 16 | 4294967296 | 8 | 691776122 | 0.1610666797 | + # | 17 | 17179869184 | 9 | 4842432842 | 0.2818666889 | + # | 18 | 68719476736 | 10 | 33897029882 | 0.4932667053 | + # | 19 | 274877906944 | 11 | 237279209162 | 0.8632167343 | + # | 20 | 1099511627776 | 11 | 237279209162 | 0.2158041836 | + # | 21 | 4398046511104 | 12 | 1660954464122 | 0.3776573213 | + # | 22 | 17592186044416 | 13 | 11626681248842 | 0.6609003122 | + # | 23 | 70368744177664 | 13 | 11626681248842 | 0.165225078 | + # | 24 | 281474976710656 | 14 | 81386768741882 | 0.2891438866 | + # | 25 | 1125899906842620 | 15 | 569707381193162 | 0.5060018015 | + # | 26 | 4503599627370500 | 15 | 569707381193162 | 0.1265004504 | + # | 27 | 18014398509482000 | 15 | 569707381193162 | 0.03162511259 | + # | 28 | 72057594037927900 | 15 | 569707381193162 | 0.007906278149 | + # | 29 | 288230376151712000 | 15 | 569707381193162 | 0.001976569537 | + # Hexagonal cells don't align perfectly on a vector tile. + # Some cells may intersect more than one vector tile. + # To compute the H3 resolution for each precision, Elasticsearch compares the average density of hexagonal bins at each resolution with the average density of tile bins at each zoom level. + # Elasticsearch uses the H3 resolution that is closest to the corresponding geotile density. # - # @option arguments [List] :index Comma-separated list of data streams, indices, or aliases to search - # @option arguments [String] :field Field containing geospatial data to return - # @option arguments [Integer] :zoom Zoom level for the vector tile to search - # @option arguments [Integer] :x X coordinate for the vector tile to search - # @option arguments [Integer] :y Y coordinate for the vector tile to search - # @option arguments [Boolean] :exact_bounds If false, the meta layer's feature is the bounding box of the tile. If true, the meta layer's feature is a bounding box resulting from a `geo_bounds` aggregation. - # @option arguments [Integer] :extent Size, in pixels, of a side of the vector tile. - # @option arguments [Integer] :grid_precision Additional zoom levels available through the aggs layer. Accepts 0-8. - # @option arguments [String] :grid_type Determines the geometry type for features in the aggs layer. (options: grid, point, centroid) + # @option arguments [String, Array] :index Comma-separated list of data streams, indices, or aliases to search (*Required*) + # @option arguments [String] :field Field containing geospatial data to return (*Required*) + # @option arguments [Integer] :zoom Zoom level for the vector tile to search (*Required*) + # @option arguments [Integer] :x X coordinate for the vector tile to search (*Required*) + # @option arguments [Integer] :y Y coordinate for the vector tile to search (*Required*) + # @option arguments [Boolean] :exact_bounds If +false+, the meta layer's feature is the bounding box of the tile. + # If true, the meta layer's feature is a bounding box resulting from a + # geo_bounds aggregation. The aggregation runs on values that intersect + # the // tile with wrap_longitude set to false. The resulting + # bounding box may be larger than the vector tile. + # @option arguments [Integer] :extent The size, in pixels, of a side of the tile. Vector tiles are square with equal sides. Server default: 4096. + # @option arguments [String] :grid_agg Aggregation used to create a grid for +field+. + # @option arguments [Integer] :grid_precision Additional zoom levels available through the aggs layer. For example, if is 7 + # and grid_precision is 8, you can zoom in up to level 15. Accepts 0-8. If 0, results + # don't include the aggs layer. Server default: 8. + # @option arguments [String] :grid_type Determines the geometry type for features in the aggs layer. In the aggs layer, + # each feature represents a geotile_grid cell. If 'grid' each feature is a Polygon + # of the cells bounding box. If 'point' each feature is a Point that is the centroid + # of the cell. Server default: grid. # @option arguments [Integer] :size Maximum number of features to return in the hits layer. Accepts 0-10000. - # @option arguments [Boolean|long] :track_total_hits Indicate if the number of documents that match the query should be tracked. A number can also be specified, to accurately track the total hit count up to the number. - # @option arguments [Boolean] :with_labels If true, the hits and aggs layers will contain additional point features with suggested label positions for the original features. + # If 0, results don't include the hits layer. Server default: 10000. + # @option arguments [Boolean] :with_labels If +true+, the hits and aggs layers will contain additional point features representing + # suggested label positions for the original features. + # - +Point+ and +MultiPoint+ features will have one of the points selected. + # - +Polygon+ and +MultiPolygon+ features will have a single point generated, either the centroid, if it is within the polygon, or another point within the polygon selected from the sorted triangle-tree. + # - +LineString+ features will likewise provide a roughly central point selected from the triangle-tree. + # - The aggregation results will provide one central point for each aggregation bucket. + # All attributes from the original features will also be copied to the new label features. + # In addition, the new features will be distinguishable using the tag +_mvt_label_position+. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Search request body. + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-vector-tile-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-mvt # def search_mvt(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_mvt' } - defined_params = %i[index field zoom x y].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :field, :zoom, :x, :y].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -61,7 +192,7 @@ def search_mvt(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) @@ -74,7 +205,7 @@ def search_mvt(arguments = {}) _y = arguments.delete(:y) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_mvt/#{Utils.__listify(_field)}/#{Utils.__listify(_zoom)}/#{Utils.__listify(_x)}/#{Utils.__listify(_y)}" + path = "#{Utils.listify(_index)}/_mvt/#{Utils.listify(_field)}/#{Utils.listify(_zoom)}/#{Utils.listify(_x)}/#{Utils.listify(_y)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_shards.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_shards.rb index 70189da64..1130b42d1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_shards.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_shards.rb @@ -15,25 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns information about the indices and shards that a search request would be executed against. + # Get the search shards. + # Get the indices and shards that a search request would be run against. + # This information can be useful for working out issues or planning optimizations with routing and shard preferences. + # When filtered aliases are used, the filter is returned as part of the +indices+ section. + # If the Elasticsearch security features are enabled, you must have the +view_index_metadata+ or +manage+ index privilege for the target data stream, index, or alias. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [String] :routing Specific routing value - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search. + # It supports wildcards (+*+). + # To search all data streams and indices, omit this parameter or use +*+ or +_all+. + # @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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. + # @option arguments [String, Array] :expand_wildcards Type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. Server default: open. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :local If +true+, the request retrieves information from the local node only. + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # IT can also be set to +-1+ to indicate that the request should never timeout. Server default: 30s. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # It is random by default. + # @option arguments [String] :routing A custom value used to route operations to a specific shard. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-shards.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-shards # def search_shards(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_shards' } @@ -46,13 +60,13 @@ def search_shards(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "#{Utils.__listify(_index)}/_search_shards" + "#{Utils.listify(_index)}/_search_shards" else '_search_shards' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/search_template.rb b/elasticsearch-api/lib/elasticsearch/api/actions/search_template.rb index 5b67dfb58..93da01315 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/search_template.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/search_template.rb @@ -15,32 +15,41 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Allows to use the Mustache language to pre-render a search definition. + # Run a search with a search template. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [List] :routing A comma-separated list of specific routing values - # @option arguments [Time] :scroll Specify how long a consistent view of the index should be maintained for scrolled search - # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch) - # @option arguments [Boolean] :explain Specify whether to return detailed information about score computation as part of a hit - # @option arguments [Boolean] :profile Specify whether to profile the query execution - # @option arguments [Boolean] :typed_keys Specify whether aggregation and suggester names should be prefixed by their respective types in the response - # @option arguments [Boolean] :rest_total_hits_as_int Indicates whether hits.total should be rendered as an integer or an object in the rest search response - # @option arguments [Boolean] :ccs_minimize_roundtrips Indicates whether network round-trips should be minimized as part of cross-cluster search requests execution + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search. + # It supports wildcards (+*+). + # @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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true. + # @option arguments [Boolean] :ccs_minimize_roundtrips If +true+, network round-trips are minimized for cross-cluster search requests. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # Supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. + # @option arguments [Boolean] :explain If +true+, the response includes additional details about score computation as part of a hit. + # @option arguments [Boolean] :ignore_throttled If +true+, specified concrete, expanded, or aliased indices are not included in the response when throttled. Server default: true. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # It is random by default. + # @option arguments [Boolean] :profile If +true+, the query execution is profiled. + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Time] :scroll Specifies how long a consistent view of the index + # should be maintained for scrolled search. + # @option arguments [String] :search_type The type of the search operation. + # @option arguments [Boolean] :rest_total_hits_as_int If +true+, +hits.total+ is rendered as an integer in the response. + # If +false+, it is rendered as an object. + # @option arguments [Boolean] :typed_keys If +true+, the response prefixes aggregation and suggester names with their respective types. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search definition template and its params (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-template.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-search-template # def search_template(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'search_template' } @@ -55,13 +64,13 @@ def search_template(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_search/template" + "#{Utils.listify(_index)}/_search/template" else '_search/template' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/cache_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/cache_stats.rb index 89b16a6c1..1237da39c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/cache_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/cache_stats.rb @@ -15,23 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchableSnapshots module Actions - # Retrieve node-level cache statistics about searchable snapshots. + # Get cache statistics. + # Get statistics about the shared cache for partially mounted indices. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes + # @option arguments [String, Array] :node_id The names of the nodes in the cluster to target. + # @option arguments [Time] :master_timeout [TODO] # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-cache-stats # def cache_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'searchable_snapshots.cache_stats' } @@ -50,11 +52,11 @@ def cache_stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _node_id - "_searchable_snapshots/#{Utils.__listify(_node_id)}/cache/stats" + "_searchable_snapshots/#{Utils.listify(_node_id)}/cache/stats" else '_searchable_snapshots/cache/stats' end - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/clear_cache.rb b/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/clear_cache.rb index a7d0b6a24..41eb19211 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/clear_cache.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/clear_cache.rb @@ -15,26 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchableSnapshots module Actions - # Clear the cache of searchable snapshots. + # Clear the cache. + # Clear indices and data streams from the shared cache for partially mounted indices. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [List] :index A comma-separated list of index names + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to clear from the cache. + # It supports wildcards (+*+). + # @option arguments [String, Array] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. + # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes +_all+ string or when no indices have been specified) # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, none, all) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-clear-cache # def clear_cache(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'searchable_snapshots.clear_cache' } @@ -47,13 +49,13 @@ def clear_cache(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "#{Utils.__listify(_index)}/_searchable_snapshots/cache/clear" + "#{Utils.listify(_index)}/_searchable_snapshots/cache/clear" else '_searchable_snapshots/cache/clear' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/mount.rb b/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/mount.rb index e8238c98b..06efd2b86 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/mount.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/mount.rb @@ -15,29 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchableSnapshots module Actions - # Mount a snapshot as a searchable index. + # Mount a snapshot. + # Mount a snapshot as a searchable snapshot index. + # Do not use this API for snapshots managed by index lifecycle management (ILM). + # Manually mounting ILM-managed snapshots can interfere with ILM processes. # - # @option arguments [String] :repository The name of the repository containing the snapshot of the index to mount - # @option arguments [String] :snapshot The name of the snapshot of the index to mount - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning - # @option arguments [String] :storage Selects the kind of local storage used to accelerate searches. Experimental, and defaults to `full_copy` + # @option arguments [String] :repository The name of the repository containing the snapshot of the index to mount. (*Required*) + # @option arguments [String] :snapshot The name of the snapshot of the index to mount. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Boolean] :wait_for_completion If true, the request blocks until the operation is complete. + # @option arguments [String] :storage The mount option for the searchable snapshot index. Server default: full_copy. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The restore configuration for mounting the snapshot as searchable (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-api-mount-snapshot.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-mount # def mount(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'searchable_snapshots.mount' } - defined_params = %i[repository snapshot].each_with_object({}) do |variable, set_variables| + defined_params = [:repository, :snapshot].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -56,7 +61,7 @@ def mount(arguments = {}) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_POST - path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}/_mount" + path = "_snapshot/#{Utils.listify(_repository)}/#{Utils.listify(_snapshot)}/_mount" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/stats.rb index eafb705ad..8c9610a0b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/searchable_snapshots/stats.rb @@ -15,20 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SearchableSnapshots module Actions - # Retrieve shard-level statistics about searchable snapshots. + # Get searchable snapshot statistics. # - # @option arguments [List] :index A comma-separated list of index names - # @option arguments [String] :level Return stats aggregated at cluster, index or shard level (options: cluster, indices, shards) + # @option arguments [String, Array] :index A comma-separated list of data streams and indices to retrieve statistics for. + # @option arguments [String] :level Return stats aggregated at cluster, index or shard level # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/searchable-snapshots-apis.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-searchable-snapshots-stats # def stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'searchable_snapshots.stats' } @@ -41,13 +41,13 @@ def stats(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = if _index - "#{Utils.__listify(_index)}/_searchable_snapshots/stats" + "#{Utils.listify(_index)}/_searchable_snapshots/stats" else '_searchable_snapshots/stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/activate_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/activate_user_profile.rb index 113f36a78..73fb59b0c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/activate_user_profile.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/activate_user_profile.rb @@ -49,7 +49,7 @@ def activate_user_profile(arguments = {}) body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST - path = "_security/profile/_activate" + path = '_security/profile/_activate' params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/authenticate.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/authenticate.rb index 03f02c57e..a13dd7385 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/authenticate.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/authenticate.rb @@ -15,18 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Enables authentication as a user and retrieve information about the authenticated user. + # Authenticate a user. + # Authenticates a user and returns information about the authenticated user. + # Include the user information in a {https://en.wikipedia.org/wiki/Basic_access_authentication basic auth header}. + # A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user. + # If the user cannot be authenticated, this API returns a 401 status code. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-authenticate.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-authenticate # def authenticate(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.authenticate' } @@ -34,7 +38,7 @@ def authenticate(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_security/_authenticate' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_delete_role.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_delete_role.rb index ae3d6bbfd..de67518c7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_delete_role.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_delete_role.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Bulk delete roles in the native realm. + # Bulk delete roles. + # The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. + # The bulk delete roles API cannot delete roles that are defined in roles files. # - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The roles to delete (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-delete-role.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-bulk-delete-role # def bulk_delete_role(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.bulk_delete_role' } @@ -38,7 +40,7 @@ def bulk_delete_role(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_DELETE path = '_security/role' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_put_role.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_put_role.rb index 5ec457839..4c9360f17 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_put_role.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_put_role.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Bulk adds and updates roles in the native realm. + # Bulk create or update roles. + # The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. + # The bulk create or update roles API cannot update roles that are defined in roles files. # - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The roles to add (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-put-role.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-bulk-put-role # def bulk_put_role(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.bulk_put_role' } @@ -38,7 +40,7 @@ def bulk_put_role(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/role' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_update_api_keys.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_update_api_keys.rb index bf311c01f..4e18787d0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_update_api_keys.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/bulk_update_api_keys.rb @@ -15,19 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Updates the attributes of multiple existing API keys. + # Bulk update API keys. + # Update the attributes for multiple API keys. + # IMPORTANT: It is not possible to use an API key as the authentication credential for this API. To update API keys, the owner user's credentials are required. + # This API is similar to the update API key API but enables you to apply the same update to multiple API keys in one API call. This operation can greatly improve performance over making individual updates. + # It is not possible to update expired or invalidated API keys. + # This API supports updates to API key access scope, metadata and expiration. + # The access scope of each API key is derived from the +role_descriptors+ you specify in the request and a snapshot of the owner user's permissions at the time of the request. + # The snapshot of the owner's permissions is updated automatically on every call. + # IMPORTANT: If you don't specify +role_descriptors+ in the request, a call to this API might still change an API key's access scope. This change can occur if the owner user's permissions have changed since the API key was created or last modified. + # A successful request returns a JSON structure that contains the IDs of all updated API keys, the IDs of API keys that already had the requested changes and did not require an update, and error details for any failed update. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The API key request to update the attributes of multiple API keys. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-bulk-update-api-keys.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-bulk-update-api-keys # def bulk_update_api_keys(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.bulk_update_api_keys' } @@ -37,7 +46,7 @@ def bulk_update_api_keys(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/api_key/_bulk_update' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/change_password.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/change_password.rb index 186861cdb..85b4e9fea 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/change_password.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/change_password.rb @@ -15,21 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Changes the passwords of users in the native realm and built-in users. + # Change passwords. + # Change the passwords of users in the native realm and built-in users. # - # @option arguments [String] :username The username of the user to change the password for - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :username The user whose password you want to change. If you do not specify this + # parameter, the password is changed for the current user. + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body the new password for the user (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-change-password.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-change-password # def change_password(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.change_password' } @@ -50,7 +52,7 @@ def change_password(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = if _username - "_security/user/#{Utils.__listify(_username)}/_password" + "_security/user/#{Utils.listify(_username)}/_password" else '_security/user/_password' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_api_key_cache.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_api_key_cache.rb index 8eb36221f..dbd845146 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_api_key_cache.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_api_key_cache.rb @@ -15,19 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Clear a subset or all entries from the API key cache. + # Clear the API key cache. + # Evict a subset of all entries from the API key cache. + # The cache is also automatically cleared on state changes of the security index. # - # @option arguments [List] :ids A comma-separated list of IDs of API keys to clear from the cache + # @option arguments [String, Array] :ids Comma-separated list of API key IDs to evict from the API key cache. + # To evict all API keys, use +*+. + # Does not support other wildcard patterns. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-api-key-cache.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-api-key-cache # def clear_api_key_cache(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.clear_api_key_cache' } @@ -42,12 +46,12 @@ def clear_api_key_cache(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil _ids = arguments.delete(:ids) method = Elasticsearch::API::HTTP_POST - path = "_security/api_key/#{Utils.__listify(_ids)}/_clear_cache" + path = "_security/api_key/#{Utils.listify(_ids)}/_clear_cache" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_privileges.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_privileges.rb index 2b6ff2d79..a26071661 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_privileges.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_privileges.rb @@ -15,19 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Evicts application privileges from the native application privileges cache. + # Clear the privileges cache. + # Evict privileges from the native application privilege cache. + # The cache is also automatically cleared for applications that have their privileges updated. # - # @option arguments [List] :application A comma-separated list of application names + # @option arguments [String] :application A comma-separated list of applications. + # To clear all applications, use an asterism (+*+). + # It does not support other wildcard patterns. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-privilege-cache.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-privileges # def clear_cached_privileges(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.clear_cached_privileges' } @@ -47,7 +51,7 @@ def clear_cached_privileges(arguments = {}) _application = arguments.delete(:application) method = Elasticsearch::API::HTTP_POST - path = "_security/privilege/#{Utils.__listify(_application)}/_clear_cache" + path = "_security/privilege/#{Utils.listify(_application)}/_clear_cache" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_realms.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_realms.rb index 9f427c62e..db6f761a8 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_realms.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_realms.rb @@ -15,20 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Evicts users from the user cache. Can completely clear the cache or evict specific users. + # Clear the user cache. + # Evict users from the user cache. + # You can completely clear the cache or evict specific users. + # User credentials are cached in memory on each node to avoid connecting to a remote authentication service or hitting the disk for every incoming request. + # There are realm settings that you can use to configure the user cache. + # For more information, refer to the documentation about controlling the user cache. # - # @option arguments [List] :realms Comma-separated list of realms to clear - # @option arguments [List] :usernames Comma-separated list of usernames to clear from the cache + # @option arguments [String, Array] :realms A comma-separated list of realms. + # To clear all realms, use an asterisk (+*+). + # It does not support other wildcard patterns. (*Required*) + # @option arguments [Array] :usernames A comma-separated list of the users to clear from the cache. + # If you do not specify this parameter, the API evicts all users from the user cache. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-realms # def clear_cached_realms(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.clear_cached_realms' } @@ -48,7 +56,7 @@ def clear_cached_realms(arguments = {}) _realms = arguments.delete(:realms) method = Elasticsearch::API::HTTP_POST - path = "_security/realm/#{Utils.__listify(_realms)}/_clear_cache" + path = "_security/realm/#{Utils.listify(_realms)}/_clear_cache" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_roles.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_roles.rb index 8e253de2d..e5a45f1a6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_roles.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_roles.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Evicts roles from the native role cache. + # Clear the roles cache. + # Evict roles from the native role cache. # - # @option arguments [List] :name Role name + # @option arguments [String, Array] :name A comma-separated list of roles to evict from the role cache. + # To evict all roles, use an asterisk (+*+). + # It does not support other wildcard patterns. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-role-cache.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-roles # def clear_cached_roles(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.clear_cached_roles' } @@ -47,7 +50,7 @@ def clear_cached_roles(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_POST - path = "_security/role/#{Utils.__listify(_name)}/_clear_cache" + path = "_security/role/#{Utils.listify(_name)}/_clear_cache" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_service_tokens.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_service_tokens.rb index e2d0d96d0..4e145bc44 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_service_tokens.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/clear_cached_service_tokens.rb @@ -15,26 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Evicts tokens from the service account token caches. + # Clear service account token caches. + # Evict a subset of all entries from the service account token caches. + # Two separate caches exist for service account tokens: one cache for tokens backed by the +service_tokens+ file, and another for tokens backed by the +.security+ index. + # This API clears matching entries from both caches. + # The cache for service account tokens backed by the +.security+ index is cleared automatically on state changes of the security index. + # The cache for tokens backed by the +service_tokens+ file is cleared automatically on file changes. # - # @option arguments [String] :namespace An identifier for the namespace - # @option arguments [String] :service An identifier for the service name - # @option arguments [List] :name A comma-separated list of service token names + # @option arguments [String] :namespace The namespace, which is a top-level grouping of service accounts. (*Required*) + # @option arguments [String] :service The name of the service, which must be unique within its namespace. (*Required*) + # @option arguments [String, Array] :name A comma-separated list of token names to evict from the service account token caches. + # Use a wildcard (+*+) to evict all tokens that belong to a service account. + # It does not support other wildcard patterns. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-service-token-caches.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-clear-cached-service-tokens # def clear_cached_service_tokens(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.clear_cached_service_tokens' } - defined_params = %i[namespace service name].each_with_object({}) do |variable, set_variables| + defined_params = [:namespace, :service, :name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -55,7 +62,7 @@ def clear_cached_service_tokens(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_POST - path = "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential/token/#{Utils.__listify(_name)}/_clear_cache" + path = "_security/service/#{Utils.listify(_namespace)}/#{Utils.listify(_service)}/credential/token/#{Utils.listify(_name)}/_clear_cache" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/create_api_key.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/create_api_key.rb index eb05c11c8..bee4c4e27 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/create_api_key.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/create_api_key.rb @@ -15,20 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Creates an API key for access without requiring basic authentication. + # Create an API key. + # Create an API key for access without requiring basic authentication. + # IMPORTANT: If the credential that is used to authenticate this request is an API key, the derived API key cannot have any privileges. + # If you specify privileges, the API returns an error. + # A successful request returns a JSON structure that contains the API key, its unique id, and its name. + # If applicable, it also returns expiration information for the API key in milliseconds. + # NOTE: By default, API keys never expire. You can specify expiration information when you create the API keys. + # The API keys are created by the Elasticsearch API key service, which is automatically enabled. + # To configure or turn off the API key service, refer to API key service setting documentation. # - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The api key request to create an API key (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-api-key.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-api-key # def create_api_key(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.create_api_key' } @@ -38,7 +46,7 @@ def create_api_key(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_PUT path = '_security/api_key' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/create_cross_cluster_api_key.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/create_cross_cluster_api_key.rb index 4933f9fbb..8b8bb6edf 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/create_cross_cluster_api_key.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/create_cross_cluster_api_key.rb @@ -15,19 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Creates a cross-cluster API key for API key based remote cluster access. + # Create a cross-cluster API key. + # Create an API key of the +cross_cluster+ type for the API key based remote cluster access. + # A +cross_cluster+ API key cannot be used to authenticate through the REST interface. + # IMPORTANT: To authenticate this request you must use a credential that is not an API key. Even if you use an API key that has the required privilege, the API returns an error. + # Cross-cluster API keys are created by the Elasticsearch API key service, which is automatically enabled. + # NOTE: Unlike REST API keys, a cross-cluster API key does not capture permissions of the authenticated user. The API key’s effective permission is exactly as specified with the +access+ property. + # A successful request returns a JSON structure that contains the API key, its unique ID, and its name. If applicable, it also returns expiration information for the API key in milliseconds. + # By default, API keys never expire. You can specify expiration information when you create the API keys. + # Cross-cluster API keys can only be updated with the update cross-cluster API key API. + # Attempting to update them with the update REST API key API or the bulk update REST API keys API will result in an error. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The request to create a cross-cluster API key (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-cross-cluster-api-key.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-cross-cluster-api-key # def create_cross_cluster_api_key(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.create_cross_cluster_api_key' } @@ -37,7 +46,7 @@ def create_cross_cluster_api_key(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/cross_cluster/api_key' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/create_service_token.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/create_service_token.rb index 9ebfacea3..b9b338a89 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/create_service_token.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/create_service_token.rb @@ -15,27 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Creates a service account token for access without requiring basic authentication. + # Create a service account token. + # Create a service accounts token for access without requiring basic authentication. + # NOTE: Service account tokens never expire. + # You must actively delete them if they are no longer needed. # - # @option arguments [String] :namespace An identifier for the namespace - # @option arguments [String] :service An identifier for the service name - # @option arguments [String] :name An identifier for the token name - # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :namespace The name of the namespace, which is a top-level grouping of service accounts. (*Required*) + # @option arguments [String] :service The name of the service. (*Required*) + # @option arguments [String] :name The name for the service account token. + # If omitted, a random name will be generated.Token names must be at least one and no more than 256 characters. + # They can contain alphanumeric characters (a-z, A-Z, 0-9), dashes (+-+), and underscores (+_+), but cannot begin with an underscore.NOTE: Token names must be unique in the context of the associated service account. + # They must also be globally unique with their fully qualified names, which are comprised of the service account principal and token name, such as +//+. + # @option arguments [String] :refresh If +true+ then refresh the affected shards to make this operation visible to search, if +wait_for+ (the default) then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-create-service-token.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-create-service-token # def create_service_token(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.create_service_token' } - defined_params = %i[namespace service name].each_with_object({}) do |variable, set_variables| + defined_params = [:namespace, :service, :name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -56,9 +62,9 @@ def create_service_token(arguments = {}) method = _name ? Elasticsearch::API::HTTP_PUT : Elasticsearch::API::HTTP_POST path = if _namespace && _service && _name - "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential/token/#{Utils.__listify(_name)}" + "_security/service/#{Utils.listify(_namespace)}/#{Utils.listify(_service)}/credential/token/#{Utils.listify(_name)}" else - "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential/token" + "_security/service/#{Utils.listify(_namespace)}/#{Utils.listify(_service)}/credential/token" end params = Utils.process_params(arguments) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/delegate_pki.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/delegate_pki.rb index 1d637ba77..b232a566b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/delegate_pki.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/delegate_pki.rb @@ -15,19 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions # Delegate PKI authentication. + # This API implements the exchange of an X509Certificate chain for an Elasticsearch access token. + # The certificate chain is validated, according to RFC 5280, by sequentially considering the trust configuration of every installed PKI realm that has +delegation.enabled+ set to +true+. + # A successfully trusted client certificate is also subject to the validation of the subject distinguished name according to thw +username_pattern+ of the respective realm. + # This API is called by smart and trusted proxies, such as Kibana, which terminate the user's TLS session but still want to authenticate the user by using a PKI realm—-​as if the user connected directly to Elasticsearch. + # IMPORTANT: The association between the subject public key in the target certificate and the corresponding private key is not validated. + # This is part of the TLS authentication process and it is delegated to the proxy that calls this API. + # The proxy is trusted to have performed the TLS authentication and this API translates that authentication into an Elasticsearch access token. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The X509Certificate chain. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delegate-pki-authentication.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delegate-pki # def delegate_pki(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.delegate_pki' } @@ -37,7 +44,7 @@ def delegate_pki(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/delegate_pki' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_privileges.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_privileges.rb index fa4260b29..edca42ff9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_privileges.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_privileges.rb @@ -15,26 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Removes application privileges. + # Delete application privileges. + # To use this API, you must have one of the following privileges: + # * The +manage_security+ cluster privilege (or a greater privilege such as +all+). + # * The "Manage Application Privileges" global privilege for the application being referenced in the request. # - # @option arguments [String] :application Application name - # @option arguments [String] :name Privilege name - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :application The name of the application. + # Application privileges are always associated with exactly one application. (*Required*) + # @option arguments [String, Array] :name The name of the privilege. (*Required*) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-privilege.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-privileges # def delete_privileges(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.delete_privileges' } - defined_params = %i[application name].each_with_object({}) do |variable, set_variables| + defined_params = [:application, :name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -52,7 +56,7 @@ def delete_privileges(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_security/privilege/#{Utils.__listify(_application)}/#{Utils.__listify(_name)}" + path = "_security/privilege/#{Utils.listify(_application)}/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_role.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_role.rb index 81a755ea5..c5b992666 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_role.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_role.rb @@ -15,20 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Removes roles in the native realm. + # Delete roles. + # Delete roles in the native realm. + # The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. + # The delete roles API cannot remove roles that are defined in roles files. # - # @option arguments [String] :name Role name - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :name The name of the role. (*Required*) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-role # def delete_role(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.delete_role' } @@ -48,7 +51,7 @@ def delete_role(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_security/role/#{Utils.__listify(_name)}" + path = "_security/role/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_role_mapping.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_role_mapping.rb index 57cc5f425..bab3c8cf2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_role_mapping.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_role_mapping.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Removes role mappings. + # Delete role mappings. + # Role mappings define which roles are assigned to each user. + # The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. + # The delete role mappings API cannot remove role mappings that are defined in role mapping files. # - # @option arguments [String] :name Role-mapping name - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :name The distinct name that identifies the role mapping. + # The name is used solely as an identifier to facilitate interaction via the API; it does not affect the behavior of the mapping in any way. (*Required*) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-role-mapping.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-role-mapping # def delete_role_mapping(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.delete_role_mapping' } @@ -48,7 +52,7 @@ def delete_role_mapping(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_security/role_mapping/#{Utils.__listify(_name)}" + path = "_security/role_mapping/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_service_token.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_service_token.rb index e1e956f28..0fc74f010 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_service_token.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_service_token.rb @@ -15,27 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Deletes a service account token. + # Delete service account tokens. + # Delete service account tokens for a service in a specified namespace. # - # @option arguments [String] :namespace An identifier for the namespace - # @option arguments [String] :service An identifier for the service name - # @option arguments [String] :name An identifier for the token name - # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` (the default) then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :namespace The namespace, which is a top-level grouping of service accounts. (*Required*) + # @option arguments [String] :service The service name. (*Required*) + # @option arguments [String] :name The name of the service account token. (*Required*) + # @option arguments [String] :refresh If +true+ then refresh the affected shards to make this operation visible to search, if +wait_for+ (the default) then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-service-token.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-service-token # def delete_service_token(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.delete_service_token' } - defined_params = %i[namespace service name].each_with_object({}) do |variable, set_variables| + defined_params = [:namespace, :service, :name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -56,7 +57,7 @@ def delete_service_token(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_DELETE - path = "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential/token/#{Utils.__listify(_name)}" + path = "_security/service/#{Utils.listify(_namespace)}/#{Utils.listify(_service)}/credential/token/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_user.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_user.rb index 6c60f97ff..8e1142c8d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_user.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/delete_user.rb @@ -15,20 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Deletes users from the native realm. + # Delete users. + # Delete users from the native realm. # - # @option arguments [String] :username username - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :username An identifier for the user. (*Required*) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-delete-user.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-delete-user # def delete_user(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.delete_user' } @@ -48,7 +49,7 @@ def delete_user(arguments = {}) _username = arguments.delete(:username) method = Elasticsearch::API::HTTP_DELETE - path = "_security/user/#{Utils.__listify(_username)}" + path = "_security/user/#{Utils.listify(_username)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user.rb index cd15f7159..2bc8cb57c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user.rb @@ -15,20 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Disables users in the native realm. + # Disable users. + # Disable users in the native realm. + # By default, when you create users, they are enabled. + # You can use this API to revoke a user's access to Elasticsearch. # - # @option arguments [String] :username The username of the user to disable - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :username An identifier for the user. (*Required*) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-disable-user.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-disable-user # def disable_user(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.disable_user' } @@ -48,7 +51,7 @@ def disable_user(arguments = {}) _username = arguments.delete(:username) method = Elasticsearch::API::HTTP_PUT - path = "_security/user/#{Utils.__listify(_username)}/_disable" + path = "_security/user/#{Utils.listify(_username)}/_disable" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user_profile.rb index 2ec39dbc7..30b86ec2a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user_profile.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/disable_user_profile.rb @@ -41,9 +41,8 @@ module Actions def disable_user_profile(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.disable_user_profile' } - defined_params = [:uid].inject({}) do |set_variables, variable| + defined_params = [:uid].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -57,7 +56,7 @@ def disable_user_profile(arguments = {}) _uid = arguments.delete(:uid) method = Elasticsearch::API::HTTP_PUT - path = "_security/profile/#{Utils.__listify(_uid)}/_disable" + path = "_security/profile/#{Utils.listify(_uid)}/_disable" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user.rb index e6dadc479..811ce4031 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Enables users in the native realm. + # Enable users. + # Enable users in the native realm. + # By default, when you create users, they are enabled. # - # @option arguments [String] :username The username of the user to enable - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :username An identifier for the user. (*Required*) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-enable-user.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enable-user # def enable_user(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.enable_user' } @@ -48,7 +50,7 @@ def enable_user(arguments = {}) _username = arguments.delete(:username) method = Elasticsearch::API::HTTP_PUT - path = "_security/user/#{Utils.__listify(_username)}/_enable" + path = "_security/user/#{Utils.listify(_username)}/_enable" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user_profile.rb index 7b2e01cb0..5e3da8160 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user_profile.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/enable_user_profile.rb @@ -42,9 +42,8 @@ module Actions def enable_user_profile(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.enable_user_profile' } - defined_params = [:uid].inject({}) do |set_variables, variable| + defined_params = [:uid].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -58,7 +57,7 @@ def enable_user_profile(arguments = {}) _uid = arguments.delete(:uid) method = Elasticsearch::API::HTTP_PUT - path = "_security/profile/#{Utils.__listify(_uid)}/_enable" + path = "_security/profile/#{Utils.listify(_uid)}/_enable" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/enroll_kibana.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/enroll_kibana.rb index 9c16f925e..9b18c8e59 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/enroll_kibana.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/enroll_kibana.rb @@ -15,18 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Allows a kibana instance to configure itself to communicate with a secured elasticsearch cluster. + # Enroll Kibana. + # Enable a Kibana instance to configure itself for communication with a secured Elasticsearch cluster. + # NOTE: This API is currently intended for internal use only by Kibana. + # Kibana uses this API internally to configure itself for communications with an Elasticsearch cluster that already has security features enabled. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-kibana-enrollment.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enroll-kibana # def enroll_kibana(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.enroll_kibana' } @@ -34,7 +37,7 @@ def enroll_kibana(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_security/enroll/kibana' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/enroll_node.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/enroll_node.rb index 2a9dc5c0a..55a83981a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/enroll_node.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/enroll_node.rb @@ -15,18 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Allows a new node to enroll to an existing cluster with security enabled. + # Enroll a node. + # Enroll a new node to allow it to join an existing cluster with security features enabled. + # The response contains all the necessary information for the joining node to bootstrap discovery and security related settings so that it can successfully join the cluster. + # The response contains key and certificate material that allows the caller to generate valid signed certificates for the HTTP layer of all nodes in the cluster. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-node-enrollment.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-enroll-node # def enroll_node(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.enroll_node' } @@ -34,7 +37,7 @@ def enroll_node(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_security/enroll/node' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_api_key.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_api_key.rb index b023edb48..c5f9e49cb 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_api_key.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_api_key.rb @@ -15,26 +15,38 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions + # Get API key information. # Retrieves information for one or more API keys. + # NOTE: If you have only the +manage_own_api_key+ privilege, this API returns only the API keys that you own. + # If you have +read_security+, +manage_api_key+ or greater privileges (including +manage_security+), this API returns all API keys regardless of ownership. # - # @option arguments [String] :id API key id of the API key to be retrieved - # @option arguments [String] :name API key name of the API key to be retrieved - # @option arguments [String] :username user name of the user who created this API key to be retrieved - # @option arguments [String] :realm_name realm name of the user who created this API key to be retrieved - # @option arguments [Boolean] :owner flag to query API keys owned by the currently authenticated user - # @option arguments [Boolean] :with_limited_by flag to show the limited-by role descriptors of API Keys - # @option arguments [Boolean] :with_profile_uid flag to also retrieve the API Key's owner profile uid, if it exists - # @option arguments [Boolean] :active_only flag to limit response to only active (not invalidated or expired) API keys + # @option arguments [String] :id An API key id. + # This parameter cannot be used with any of +name+, +realm_name+ or +username+. + # @option arguments [String] :name An API key name. + # This parameter cannot be used with any of +id+, +realm_name+ or +username+. + # It supports prefix search with wildcard. + # @option arguments [Boolean] :owner A boolean flag that can be used to query API keys owned by the currently authenticated user. + # The +realm_name+ or +username+ parameters cannot be specified when this parameter is set to +true+ as they are assumed to be the currently authenticated ones. + # @option arguments [String] :realm_name The name of an authentication realm. + # This parameter cannot be used with either +id+ or +name+ or when +owner+ flag is set to +true+. + # @option arguments [String] :username The username of a user. + # This parameter cannot be used with either +id+ or +name+ or when +owner+ flag is set to +true+. + # @option arguments [Boolean] :with_limited_by Return the snapshot of the owner user's role descriptors + # associated with the API key. An API key's actual + # permission is the intersection of its assigned role + # descriptors and the owner user's role descriptors. + # @option arguments [Boolean] :active_only A boolean flag that can be used to query API keys that are currently active. An API key is considered active if it is neither invalidated, nor expired at query time. You can specify this together with other parameters such as +owner+ or +name+. If +active_only+ is false, the response will include both active and inactive (expired or invalidated) keys. + # @option arguments [Boolean] :with_profile_uid Determines whether to also retrieve the profile uid, for the API key owner principal, if it exists. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-api-key.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-api-key # def get_api_key(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_api_key' } @@ -42,7 +54,7 @@ def get_api_key(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_security/api_key' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_builtin_privileges.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_builtin_privileges.rb index aac95e8a7..730628753 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_builtin_privileges.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_builtin_privileges.rb @@ -15,18 +15,19 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves the list of cluster privileges and index privileges that are available in this version of Elasticsearch. + # Get builtin privileges. + # Get the list of cluster privileges and index privileges that are available in this version of Elasticsearch. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-builtin-privileges.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-builtin-privileges # def get_builtin_privileges(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_builtin_privileges' } @@ -34,7 +35,7 @@ def get_builtin_privileges(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_security/privilege/_builtin' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_privileges.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_privileges.rb index 08b6a96c2..a1f89b146 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_privileges.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_privileges.rb @@ -15,25 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves application privileges. + # Get application privileges. + # To use this API, you must have one of the following privileges: + # * The +read_security+ cluster privilege (or a greater privilege such as +manage_security+ or +all+). + # * The "Manage Application Privileges" global privilege for the application being referenced in the request. # - # @option arguments [String] :application Application name - # @option arguments [String] :name Privilege name + # @option arguments [String] :application The name of the application. + # Application privileges are always associated with exactly one application. + # If you do not specify this parameter, the API returns information about all privileges for all applications. + # @option arguments [String, Array] :name The name of the privilege. + # If you do not specify this parameter, the API returns information about all privileges for the requested application. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-privileges.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-privileges # def get_privileges(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_privileges' } - defined_params = %i[application name].each_with_object({}) do |variable, set_variables| + defined_params = [:application, :name].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -49,9 +55,9 @@ def get_privileges(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _application && _name - "_security/privilege/#{Utils.__listify(_application)}/#{Utils.__listify(_name)}" + "_security/privilege/#{Utils.listify(_application)}/#{Utils.listify(_name)}" elsif _application - "_security/privilege/#{Utils.__listify(_application)}" + "_security/privilege/#{Utils.listify(_application)}" else '_security/privilege' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_role.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_role.rb index 9b8f53398..7f547ed5b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_role.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_role.rb @@ -15,19 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves roles in the native realm. + # Get roles. + # Get roles in the native realm. + # The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. + # The get roles API cannot retrieve roles that are defined in roles files. # - # @option arguments [List] :name A comma-separated list of role names + # @option arguments [String, Array] :name The name of the role. + # You can specify multiple roles as a comma-separated list. + # If you do not specify this parameter, the API returns information about all roles. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-role # def get_role(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_role' } @@ -46,14 +51,14 @@ def get_role(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_security/role/#{Utils.__listify(_name)}" + "_security/role/#{Utils.listify(_name)}" else '_security/role' end params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_role_mapping.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_role_mapping.rb index 2c6a79f93..d3de4c9cd 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_role_mapping.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_role_mapping.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves role mappings. + # Get role mappings. + # Role mappings define which roles are assigned to each user. + # The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. + # The get role mappings API cannot retrieve role mappings that are defined in role mapping files. # - # @option arguments [List] :name A comma-separated list of role-mapping names + # @option arguments [String, Array] :name The distinct name that identifies the role mapping. The name is used solely as an identifier to facilitate interaction via the API; it does not affect the behavior of the mapping in any way. You can specify multiple mapping names as a comma-separated list. If you do not specify this parameter, the API returns information about all role mappings. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-role-mapping.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-role-mapping # def get_role_mapping(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_role_mapping' } @@ -46,7 +49,7 @@ def get_role_mapping(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _name - "_security/role_mapping/#{Utils.__listify(_name)}" + "_security/role_mapping/#{Utils.listify(_name)}" else '_security/role_mapping' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_service_accounts.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_service_accounts.rb index 4bf5a17cf..18f00572f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_service_accounts.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_service_accounts.rb @@ -15,25 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves information about service accounts. + # Get service accounts. + # Get a list of service accounts that match the provided path parameters. + # NOTE: Currently, only the +elastic/fleet-server+ service account is available. # - # @option arguments [String] :namespace An identifier for the namespace - # @option arguments [String] :service An identifier for the service name + # @option arguments [String] :namespace The name of the namespace. + # Omit this parameter to retrieve information about all service accounts. + # If you omit this parameter, you must also omit the +service+ parameter. + # @option arguments [String] :service The service name. + # Omit this parameter to retrieve information about all service accounts that belong to the specified +namespace+. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-accounts.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-service-accounts # def get_service_accounts(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_service_accounts' } - defined_params = %i[namespace service].each_with_object({}) do |variable, set_variables| + defined_params = [:namespace, :service].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -49,9 +54,9 @@ def get_service_accounts(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _namespace && _service - "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}" + "_security/service/#{Utils.listify(_namespace)}/#{Utils.listify(_service)}" elsif _namespace - "_security/service/#{Utils.__listify(_namespace)}" + "_security/service/#{Utils.listify(_namespace)}" else '_security/service' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_service_credentials.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_service_credentials.rb index b66a44c05..4079fed8f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_service_credentials.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_service_credentials.rb @@ -15,25 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves information of all service credentials for a service account. + # Get service account credentials. + # To use this API, you must have at least the +read_security+ cluster privilege (or a greater privilege such as +manage_service_account+ or +manage_security+). + # The response includes service account tokens that were created with the create service account tokens API as well as file-backed tokens from all nodes of the cluster. + # NOTE: For tokens backed by the +service_tokens+ file, the API collects them from all nodes of the cluster. + # Tokens with the same name from different nodes are assumed to be the same token and are only counted once towards the total number of service tokens. # - # @option arguments [String] :namespace An identifier for the namespace - # @option arguments [String] :service An identifier for the service name + # @option arguments [String] :namespace The name of the namespace. (*Required*) + # @option arguments [String] :service The service name. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-service-credentials.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-service-credentials # def get_service_credentials(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_service_credentials' } - defined_params = %i[namespace service].each_with_object({}) do |variable, set_variables| + defined_params = [:namespace, :service].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +55,7 @@ def get_service_credentials(arguments = {}) _service = arguments.delete(:service) method = Elasticsearch::API::HTTP_GET - path = "_security/service/#{Utils.__listify(_namespace)}/#{Utils.__listify(_service)}/credential" + path = "_security/service/#{Utils.listify(_namespace)}/#{Utils.listify(_service)}/credential" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_settings.rb index ce1a6ba85..540acd3be 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_settings.rb @@ -15,19 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieve settings for the security system indices + # Get security index settings. + # Get the user-configurable settings for the security internal index (+.security+ and associated indices). + # Only a subset of the index settings — those that are user-configurable—will be shown. + # This includes: + # * +index.auto_expand_replicas+ + # * +index.number_of_replicas+ # - # @option arguments [Time] :master_timeout Timeout for connection to master + # @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. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-settings.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-settings # def get_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_settings' } @@ -35,7 +41,7 @@ def get_settings(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_security/settings' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_token.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_token.rb index bbe77102b..b2e7feccc 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_token.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_token.rb @@ -15,19 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Creates a bearer token for access without requiring basic authentication. + # Get a token. + # Create a bearer token for access without requiring basic authentication. + # The tokens are created by the Elasticsearch Token Service, which is automatically enabled when you configure TLS on the HTTP interface. + # Alternatively, you can explicitly enable the +xpack.security.authc.token.enabled+ setting. + # When you are running in production mode, a bootstrap check prevents you from enabling the token service unless you also enable TLS on the HTTP interface. + # The get token API takes the same parameters as a typical OAuth 2.0 token API except for the use of a JSON request body. + # A successful get token API call returns a JSON structure that contains the access token, the amount of time (seconds) that the token expires in, the type, and the scope if available. + # The tokens returned by the get token API have a finite period of time for which they are valid and after that time period, they can no longer be used. + # That time period is defined by the +xpack.security.authc.token.timeout+ setting. + # If you want to invalidate a token immediately, you can do so by using the invalidate token API. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The token request to get (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-token.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-token # def get_token(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_token' } @@ -37,7 +46,7 @@ def get_token(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/oauth2/token' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user.rb index 94efebad8..bc2d6b220 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user.rb @@ -15,20 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves information about users in the native realm and built-in users. + # Get users. + # Get information about users in the native realm and built-in users. # - # @option arguments [List] :username A comma-separated list of usernames - # @option arguments [Boolean] :with_profile_uid flag to retrieve profile uid (if exists) associated to the user + # @option arguments [Username] :username An identifier for the user. You can specify multiple usernames as a comma-separated list. If you omit this parameter, the API retrieves information about all users. + # @option arguments [Boolean] :with_profile_uid Determines whether to retrieve the user profile UID, if it exists, for the users. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-user # def get_user(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_user' } @@ -47,14 +48,14 @@ def get_user(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _username - "_security/user/#{Utils.__listify(_username)}" + "_security/user/#{Utils.listify(_username)}" else '_security/user' end params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_privileges.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_privileges.rb index 926460dc9..488950a14 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_privileges.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_privileges.rb @@ -15,18 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves security privileges for the logged in user. + # Get user privileges. + # Get the security privileges for the logged in user. + # All users can use this API, but only to determine their own privileges. + # To check the privileges of other users, you must use the run as feature. + # To check whether a user has a specific list of privileges, use the has privileges API. # + # @option arguments [String] :application The name of the application. Application privileges are always associated with exactly one application. If you do not specify this parameter, the API returns information about all privileges for all applications. + # @option arguments [String] :priviledge The name of the privilege. If you do not specify this parameter, the API returns information about all privileges for the requested application. + # @option arguments [Name, Null] :username [TODO] # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-get-user-privileges.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-get-user-privileges # def get_user_privileges(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_user_privileges' } @@ -34,11 +41,11 @@ def get_user_privileges(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_security/user/_privileges' - params = {} + params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_profile.rb index 6f2a93df9..26ba05491 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_profile.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/get_user_profile.rb @@ -40,9 +40,8 @@ module Actions def get_user_profile(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.get_user_profile' } - defined_params = [:uid].inject({}) do |set_variables, variable| + defined_params = [:uid].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -56,7 +55,7 @@ def get_user_profile(arguments = {}) _uid = arguments.delete(:uid) method = Elasticsearch::API::HTTP_GET - path = "_security/profile/#{Utils.__listify(_uid)}" + path = "_security/profile/#{Utils.listify(_uid)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/grant_api_key.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/grant_api_key.rb index 19567099a..ec1caaca9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/grant_api_key.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/grant_api_key.rb @@ -15,20 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Creates an API key on behalf of another user. + # Grant an API key. + # Create an API key on behalf of another user. + # This API is similar to the create API keys API, however it creates the API key for a user that is different than the user that runs the API. + # The caller must have authentication credentials for the user on whose behalf the API key will be created. + # It is not possible to use this API to create an API key without that user's credentials. + # The supported user authentication credential types are: + # * username and password + # * Elasticsearch access tokens + # * JWTs + # The user, for whom the authentication credentials is provided, can optionally "run as" (impersonate) another user. + # In this case, the API key will be created on behalf of the impersonated user. + # This API is intended be used by applications that need to create and manage API keys for end users, but cannot guarantee that those users have permission to create API keys on their own behalf. + # The API keys are created by the Elasticsearch API key service, which is automatically enabled. + # A successful grant API key API call returns a JSON structure that contains the API key, its unique id, and its name. + # If applicable, it also returns expiration information for the API key in milliseconds. + # By default, API keys never expire. You can specify expiration information when you create the API keys. # - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The api key request to create an API key (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-grant-api-key.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-grant-api-key # def grant_api_key(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.grant_api_key' } @@ -38,11 +52,11 @@ def grant_api_key(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/api_key/grant' - params = Utils.process_params(arguments) + params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges.rb index db564b439..82ac5d28c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges.rb @@ -15,20 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Determines whether the specified user has a specified list of privileges. + # Check user privileges. + # Determine whether the specified user has a specified list of privileges. + # All users can use this API, but only to determine their own privileges. + # To check the privileges of other users, you must use the run as feature. # # @option arguments [String] :user Username # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The privileges to test (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-has-privileges.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-has-privileges # def has_privileges(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.has_privileges' } @@ -49,7 +52,7 @@ def has_privileges(arguments = {}) method = Elasticsearch::API::HTTP_POST path = if _user - "_security/user/#{Utils.__listify(_user)}/_has_privileges" + "_security/user/#{Utils.listify(_user)}/_has_privileges" else '_security/user/_has_privileges' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb index d7b2b4e7b..5bb59b68c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/has_privileges_user_profile.rb @@ -43,7 +43,7 @@ def has_privileges_user_profile(arguments = {}) body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST - path = "_security/profile/_has_privileges" + path = '_security/profile/_has_privileges' params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/invalidate_api_key.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/invalidate_api_key.rb index 4bc0e103f..3c6be088b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/invalidate_api_key.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/invalidate_api_key.rb @@ -15,19 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Invalidates one or more API keys. + # Invalidate API keys. + # This API invalidates API keys created by the create API key or grant API key APIs. + # Invalidated API keys fail authentication, but they can still be viewed using the get API key information and query API key information APIs, for at least the configured retention period, until they are automatically deleted. + # To use this API, you must have at least the +manage_security+, +manage_api_key+, or +manage_own_api_key+ cluster privileges. + # The +manage_security+ privilege allows deleting any API key, including both REST and cross cluster API keys. + # The +manage_api_key+ privilege allows deleting any REST API key, but not cross cluster API keys. + # The +manage_own_api_key+ only allows deleting REST API keys that are owned by the user. + # In addition, with the +manage_own_api_key+ privilege, an invalidation request must be issued in one of the three formats: + # - Set the parameter +owner=true+. + # - Or, set both +username+ and +realm_name+ to match the user's identity. + # - Or, if the request is issued by an API key, that is to say an API key invalidates itself, specify its ID in the +ids+ field. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The api key request to invalidate API key(s) (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-api-key.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-invalidate-api-key # def invalidate_api_key(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.invalidate_api_key' } @@ -37,7 +47,7 @@ def invalidate_api_key(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_DELETE path = '_security/api_key' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/invalidate_token.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/invalidate_token.rb index dcae33c44..b7a690b38 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/invalidate_token.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/invalidate_token.rb @@ -15,19 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Invalidates one or more access tokens or refresh tokens. + # Invalidate a token. + # The access tokens returned by the get token API have a finite period of time for which they are valid. + # After that time period, they can no longer be used. + # The time period is defined by the +xpack.security.authc.token.timeout+ setting. + # The refresh tokens returned by the get token API are only valid for 24 hours. + # They can also be used exactly once. + # If you want to invalidate one or more access or refresh tokens immediately, use this invalidate token API. + # NOTE: While all parameters are optional, at least one of them is required. + # More specifically, either one of +token+ or +refresh_token+ parameters is required. + # If none of these two are specified, then +realm_name+ and/or +username+ need to be specified. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The token to invalidate (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-invalidate-token.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-invalidate-token # def invalidate_token(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.invalidate_token' } @@ -37,7 +46,7 @@ def invalidate_token(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_DELETE path = '_security/oauth2/token' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_authenticate.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_authenticate.rb index e100fc59b..bda8197c4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_authenticate.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_authenticate.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Exchanges an OpenID Connection authentication response message for an Elasticsearch access token and refresh token pair + # Authenticate OpenID Connect. + # Exchange an OpenID Connect authentication response message for an Elasticsearch internal access token and refresh token that can be subsequently used for authentication. + # Elasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs. + # These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The OpenID Connect response to authenticate (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-authenticate.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-authenticate # def oidc_authenticate(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.oidc_authenticate' } @@ -37,7 +40,7 @@ def oidc_authenticate(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/oidc/authenticate' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_logout.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_logout.rb index e39f9d4b3..0d87a6af6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_logout.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_logout.rb @@ -15,19 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Invalidates a refresh token and access token that was generated from the OpenID Connect Authenticate API + # Logout of OpenID Connect. + # Invalidate an access token and a refresh token that were generated as a response to the +/_security/oidc/authenticate+ API. + # If the OpenID Connect authentication realm in Elasticsearch is accordingly configured, the response to this call will contain a URI pointing to the end session endpoint of the OpenID Connect Provider in order to perform single logout. + # Elasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs. + # These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Access token and refresh token to invalidate (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-logout.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-logout # def oidc_logout(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.oidc_logout' } @@ -37,7 +41,7 @@ def oidc_logout(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/oidc/logout' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_prepare_authentication.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_prepare_authentication.rb index 2d9247ecd..06271cea5 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_prepare_authentication.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/oidc_prepare_authentication.rb @@ -15,19 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Creates an OAuth 2.0 authentication request as a URL string + # Prepare OpenID connect authentication. + # Create an oAuth 2.0 authentication request as a URL string based on the configuration of the OpenID Connect authentication realm in Elasticsearch. + # The response of this API is a URL pointing to the Authorization Endpoint of the configured OpenID Connect Provider, which can be used to redirect the browser of the user in order to continue the authentication process. + # Elasticsearch exposes all the necessary OpenID Connect related functionality with the OpenID Connect APIs. + # These APIs are used internally by Kibana in order to provide OpenID Connect based authentication, but can also be used by other, custom web applications or other clients. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The OpenID Connect authentication realm configuration (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-oidc-prepare-authentication.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-oidc-prepare-authentication # def oidc_prepare_authentication(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.oidc_prepare_authentication' } @@ -37,7 +41,7 @@ def oidc_prepare_authentication(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/oidc/prepare' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/put_privileges.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/put_privileges.rb index 0e4b52836..43eb19c56 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/put_privileges.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/put_privileges.rb @@ -15,20 +15,32 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Adds or updates application privileges. + # Create or update application privileges. + # To use this API, you must have one of the following privileges: + # * The +manage_security+ cluster privilege (or a greater privilege such as +all+). + # * The "Manage Application Privileges" global privilege for the application being referenced in the request. + # Application names are formed from a prefix, with an optional suffix that conform to the following rules: + # * The prefix must begin with a lowercase ASCII letter. + # * The prefix must contain only ASCII letters or digits. + # * The prefix must be at least 3 characters long. + # * If the suffix exists, it must begin with either a dash +-+ or +_+. + # * The suffix cannot contain any of the following characters: +\+, +/+, +*+, +?+, +"+, +<+, +>+, +|+, +,+, +*+. + # * No part of the name can contain whitespace. + # Privilege names must begin with a lowercase ASCII letter and must contain only ASCII letters and digits along with the characters +_+, +-+, and +.+. + # Action names can contain any number of printable ASCII characters and must contain at least one of the following characters: +/+, +*+, +:+. # - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The privilege(s) to add (*Required*) + # @option arguments [Hash] :body privileges # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-privileges.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-privileges # def put_privileges(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.put_privileges' } @@ -38,7 +50,7 @@ def put_privileges(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_PUT path = '_security/privilege' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/put_role.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/put_role.rb index a0e102ee7..03b596aa4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/put_role.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/put_role.rb @@ -15,21 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Adds and updates roles in the native realm. + # Create or update roles. + # The role management APIs are generally the preferred way to manage roles in the native realm, rather than using file-based role management. + # The create or update roles API cannot update roles that are defined in roles files. + # File-based role management is not available in Elastic Serverless. # - # @option arguments [String] :name Role name - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :name The name of the role that is being created or updated. On Elasticsearch Serverless, the role name must begin with a letter or digit and can only contain letters, digits and the characters '_', '-', and '.'. Each role must have a unique name, as this will serve as the identifier for that role. (*Required*) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The role to add (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-role # def put_role(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.put_role' } @@ -50,7 +53,7 @@ def put_role(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_security/role/#{Utils.__listify(_name)}" + path = "_security/role/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/put_role_mapping.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/put_role_mapping.rb index 4e238c2d0..10ef366d2 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/put_role_mapping.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/put_role_mapping.rb @@ -15,21 +15,39 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Creates and updates role mappings. + # Create or update role mappings. + # Role mappings define which roles are assigned to each user. + # Each mapping has rules that identify users and a list of roles that are granted to those users. + # The role mapping APIs are generally the preferred way to manage role mappings rather than using role mapping files. The create or update role mappings API cannot update role mappings that are defined in role mapping files. + # NOTE: This API does not create roles. Rather, it maps users to existing roles. + # Roles can be created by using the create or update roles API or roles files. + # **Role templates** + # The most common use for role mappings is to create a mapping from a known value on the user to a fixed role name. + # For example, all users in the +cn=admin,dc=example,dc=com+ LDAP group should be given the superuser role in Elasticsearch. + # The +roles+ field is used for this purpose. + # For more complex needs, it is possible to use Mustache templates to dynamically determine the names of the roles that should be granted to the user. + # The +role_templates+ field is used for this purpose. + # NOTE: To use role templates successfully, the relevant scripting feature must be enabled. + # Otherwise, all attempts to create a role mapping with role templates fail. + # All of the user fields that are available in the role mapping rules are also available in the role templates. + # Thus it is possible to assign a user to a role that reflects their username, their groups, or the name of the realm to which they authenticated. + # By default a template is evaluated to produce a single string that is the name of the role which should be assigned to the user. + # If the format of the template is set to "json" then the template is expected to produce a JSON string or an array of JSON strings for the role names. # - # @option arguments [String] :name Role-mapping name - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :name The distinct name that identifies the role mapping. + # The name is used solely as an identifier to facilitate interaction via the API; it does not affect the behavior of the mapping in any way. (*Required*) + # @option arguments [String] :refresh If +true+ (the default) then refresh the affected shards to make this operation visible to search, if +wait_for+ then wait for a refresh to make this operation visible to search, if +false+ then do nothing with refreshes. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The role mapping to add (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-role-mapping.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-role-mapping # def put_role_mapping(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.put_role_mapping' } @@ -50,7 +68,7 @@ def put_role_mapping(arguments = {}) _name = arguments.delete(:name) method = Elasticsearch::API::HTTP_PUT - path = "_security/role_mapping/#{Utils.__listify(_name)}" + path = "_security/role_mapping/#{Utils.listify(_name)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/put_user.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/put_user.rb index 453d00ef5..5facf778e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/put_user.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/put_user.rb @@ -15,21 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Adds and updates users in the native realm. These users are commonly referred to as native users. + # Create or update users. + # Add and update users in the native realm. + # A password is required for adding a new user but is optional when updating an existing user. + # To change a user's password without updating any other fields, use the change password API. # - # @option arguments [String] :username The username of the User - # @option arguments [String] :refresh If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes. (options: true, false, wait_for) + # @option arguments [String] :username An identifier for the user.NOTE: Usernames must be at least 1 and no more than 507 characters. + # They can contain alphanumeric characters (a-z, A-Z, 0-9), spaces, punctuation, and printable symbols in the Basic Latin (ASCII) block. + # Leading or trailing whitespace is not allowed. (*Required*) + # @option arguments [String] :refresh Valid values are +true+, +false+, and +wait_for+. + # These values have the same meaning as in the index API, but the default value for this API is true. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The user to add (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-put-user.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-user # def put_user(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.put_user' } @@ -50,7 +56,7 @@ def put_user(arguments = {}) _username = arguments.delete(:username) method = Elasticsearch::API::HTTP_PUT - path = "_security/user/#{Utils.__listify(_username)}" + path = "_security/user/#{Utils.listify(_username)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/query_api_keys.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/query_api_keys.rb index 02cf165e1..d84df5583 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/query_api_keys.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/query_api_keys.rb @@ -15,22 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves information for API keys using a subset of query DSL + # Find API keys with a query. + # Get a paginated list of API keys and their information. + # You can optionally filter the results with a query. + # To use this API, you must have at least the +manage_own_api_key+ or the +read_security+ cluster privileges. + # If you have only the +manage_own_api_key+ privilege, this API returns only the API keys that you own. + # If you have the +read_security+, +manage_api_key+, or greater privileges (including +manage_security+), this API returns all API keys regardless of ownership. # - # @option arguments [Boolean] :with_limited_by flag to show the limited-by role descriptors of API Keys - # @option arguments [Boolean] :with_profile_uid flag to also retrieve the API Key's owner profile uid, if it exists - # @option arguments [Boolean] :typed_keys flag to prefix aggregation names by their respective types in the response + # @option arguments [Boolean] :with_limited_by Return the snapshot of the owner user's role descriptors associated with the API key. + # An API key's actual permission is the intersection of its assigned role descriptors and the owner user's role descriptors (effectively limited by it). + # An API key cannot retrieve any API key’s limited-by role descriptors (including itself) unless it has +manage_api_key+ or higher privileges. + # @option arguments [Boolean] :with_profile_uid Determines whether to also retrieve the profile UID for the API key owner principal. + # If it exists, the profile UID is returned under the +profile_uid+ response field for each API key. + # @option arguments [Boolean] :typed_keys Determines whether aggregation names are prefixed by their respective types in the response. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body From, size, query, sort and search_after + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-api-key.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-api-keys # def query_api_keys(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.query_api_keys' } @@ -38,7 +46,7 @@ def query_api_keys(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = if body Elasticsearch::API::HTTP_POST @@ -46,7 +54,7 @@ def query_api_keys(arguments = {}) Elasticsearch::API::HTTP_GET end - path = '_security/_query/api_key' + path = '_security/_query/api_key' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/query_role.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/query_role.rb index c5d84ec15..45f2babd0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/query_role.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/query_role.rb @@ -15,19 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves information for Roles using a subset of query DSL + # Find roles with a query. + # Get roles in a paginated manner. + # The role management APIs are generally the preferred way to manage roles, rather than using file-based role management. + # The query roles API does not retrieve roles that are defined in roles files, nor built-in ones. + # You can optionally filter the results with a query. + # Also, the results can be paginated and sorted. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body From, size, query, sort and search_after + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-role.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-role # def query_role(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.query_role' } @@ -35,7 +40,7 @@ def query_role(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = if body Elasticsearch::API::HTTP_POST @@ -43,7 +48,7 @@ def query_role(arguments = {}) Elasticsearch::API::HTTP_GET end - path = '_security/_query/role' + path = '_security/_query/role' params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/query_user.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/query_user.rb index a4df6bb7e..82b5b1e31 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/query_user.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/query_user.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Retrieves information for Users using a subset of query DSL + # Find users with a query. + # Get information for users in a paginated manner. + # You can optionally filter the results with a query. + # NOTE: As opposed to the get user API, built-in users are excluded from the result. + # This API is only for native users. # - # @option arguments [Boolean] :with_profile_uid flag to retrieve profile uid (if exists) associated with the user + # @option arguments [Boolean] :with_profile_uid Determines whether to retrieve the user profile UID, if it exists, for the users. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body From, size, query, sort and search_after + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-query-user.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-query-user # def query_user(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.query_user' } @@ -36,7 +40,7 @@ def query_user(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = if body Elasticsearch::API::HTTP_POST @@ -44,7 +48,7 @@ def query_user(arguments = {}) Elasticsearch::API::HTTP_GET end - path = '_security/_query/user' + path = '_security/_query/user' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_authenticate.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_authenticate.rb index 7d0486ca5..0b661c21c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_authenticate.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_authenticate.rb @@ -15,19 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Exchanges a SAML Response message for an Elasticsearch access token and refresh token pair + # Authenticate SAML. + # Submit a SAML response message to Elasticsearch for consumption. + # NOTE: This API is intended for use by custom web applications other than Kibana. + # If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack. + # The SAML message that is submitted can be: + # * A response to a SAML authentication request that was previously created using the SAML prepare authentication API. + # * An unsolicited SAML message in the case of an IdP-initiated single sign-on (SSO) flow. + # In either case, the SAML message needs to be a base64 encoded XML document with a root element of ++. + # After successful validation, Elasticsearch responds with an Elasticsearch internal access token and refresh token that can be subsequently used for authentication. + # This API endpoint essentially exchanges SAML responses that indicate successful authentication in the IdP for Elasticsearch access and refresh tokens, which can be used for authentication against Elasticsearch. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The SAML response to authenticate (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-authenticate.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-authenticate # def saml_authenticate(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.saml_authenticate' } @@ -37,7 +46,7 @@ def saml_authenticate(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/saml/authenticate' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_complete_logout.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_complete_logout.rb index 7d0db5fec..0a2d0377e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_complete_logout.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_complete_logout.rb @@ -15,19 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Verifies the logout response sent from the SAML IdP + # Logout of SAML completely. + # Verifies the logout response sent from the SAML IdP. + # NOTE: This API is intended for use by custom web applications other than Kibana. + # If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack. + # The SAML IdP may send a logout response back to the SP after handling the SP-initiated SAML Single Logout. + # This API verifies the response by ensuring the content is relevant and validating its signature. + # An empty response is returned if the verification process is successful. + # The response can be sent by the IdP with either the HTTP-Redirect or the HTTP-Post binding. + # The caller of this API must prepare the request accordingly so that this API can handle either of them. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The logout response to verify (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-complete-logout.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-complete-logout # def saml_complete_logout(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.saml_complete_logout' } @@ -37,7 +45,7 @@ def saml_complete_logout(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/saml/complete_logout' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_invalidate.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_invalidate.rb index 28951664e..8167ee80c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_invalidate.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_invalidate.rb @@ -15,19 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Consumes a SAML LogoutRequest + # Invalidate SAML. + # Submit a SAML LogoutRequest message to Elasticsearch for consumption. + # NOTE: This API is intended for use by custom web applications other than Kibana. + # If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack. + # The logout request comes from the SAML IdP during an IdP initiated Single Logout. + # The custom web application can use this API to have Elasticsearch process the +LogoutRequest+. + # After successful validation of the request, Elasticsearch invalidates the access token and refresh token that corresponds to that specific SAML principal and provides a URL that contains a SAML LogoutResponse message. + # Thus the user can be redirected back to their IdP. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The LogoutRequest message (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-invalidate.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-invalidate # def saml_invalidate(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.saml_invalidate' } @@ -37,7 +44,7 @@ def saml_invalidate(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/saml/invalidate' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_logout.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_logout.rb index 17bccc2dd..3ac13644f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_logout.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_logout.rb @@ -15,19 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Invalidates an access token and a refresh token that were generated via the SAML Authenticate API + # Logout of SAML. + # Submits a request to invalidate an access token and refresh token. + # NOTE: This API is intended for use by custom web applications other than Kibana. + # If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack. + # This API invalidates the tokens that were generated for a user by the SAML authenticate API. + # If the SAML realm in Elasticsearch is configured accordingly and the SAML IdP supports this, the Elasticsearch response contains a URL to redirect the user to the IdP that contains a SAML logout request (starting an SP-initiated SAML Single Logout). # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The tokens to invalidate (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-logout.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-logout # def saml_logout(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.saml_logout' } @@ -37,7 +42,7 @@ def saml_logout(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/saml/logout' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_prepare_authentication.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_prepare_authentication.rb index 81bec3685..2869b4774 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_prepare_authentication.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_prepare_authentication.rb @@ -15,19 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Creates a SAML authentication request + # Prepare SAML authentication. + # Create a SAML authentication request (++) as a URL string based on the configuration of the respective SAML realm in Elasticsearch. + # NOTE: This API is intended for use by custom web applications other than Kibana. + # If you are using Kibana, refer to the documentation for configuring SAML single-sign-on on the Elastic Stack. + # This API returns a URL pointing to the SAML Identity Provider. + # You can use the URL to redirect the browser of the user in order to continue the authentication process. + # The URL includes a single parameter named +SAMLRequest+, which contains a SAML Authentication request that is deflated and Base64 encoded. + # If the configuration dictates that SAML authentication requests should be signed, the URL has two extra parameters named +SigAlg+ and +Signature+. + # These parameters contain the algorithm used for the signature and the signature value itself. + # It also returns a random string that uniquely identifies this SAML Authentication request. + # The caller of this API needs to store this identifier as it needs to be used in a following step of the authentication process. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The realm for which to create the authentication request, identified by either its name or the ACS URL (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-prepare-authentication.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-prepare-authentication # def saml_prepare_authentication(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.saml_prepare_authentication' } @@ -37,7 +47,7 @@ def saml_prepare_authentication(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_security/saml/prepare' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_service_provider_metadata.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_service_provider_metadata.rb index cecd339ee..477c59e74 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_service_provider_metadata.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/saml_service_provider_metadata.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Generates SAML metadata for the Elastic stack SAML 2.0 Service Provider + # Create SAML service provider metadata. + # Generate SAML metadata for a SAML 2.0 Service Provider. + # The SAML 2.0 specification provides a mechanism for Service Providers to describe their capabilities and configuration using a metadata file. + # This API generates Service Provider metadata based on the configuration of a SAML realm in Elasticsearch. # - # @option arguments [String] :realm_name The name of the SAML realm to get the metadata for + # @option arguments [String] :realm_name The name of the SAML realm in Elasticsearch. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-saml-sp-metadata.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-saml-service-provider-metadata # def saml_service_provider_metadata(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.saml_service_provider_metadata' } @@ -47,7 +50,7 @@ def saml_service_provider_metadata(arguments = {}) _realm_name = arguments.delete(:realm_name) method = Elasticsearch::API::HTTP_GET - path = "_security/saml/metadata/#{Utils.__listify(_realm_name)}" + path = "_security/saml/metadata/#{Utils.listify(_realm_name)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/suggest_user_profiles.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/suggest_user_profiles.rb index 3586f601f..8a51c2f29 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/suggest_user_profiles.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/suggest_user_profiles.rb @@ -52,7 +52,7 @@ def suggest_user_profiles(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "_security/profile/_suggest" + path = '_security/profile/_suggest' params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_api_key.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/update_api_key.rb index dad4b5130..e06d97084 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_api_key.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/update_api_key.rb @@ -15,20 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Updates attributes of an existing API key. + # Update an API key. + # Update attributes of an existing API key. + # This API supports updates to an API key's access scope, expiration, and metadata. + # To use this API, you must have at least the +manage_own_api_key+ cluster privilege. + # Users can only update API keys that they created or that were granted to them. + # To update another user’s API key, use the +run_as+ feature to submit a request on behalf of another user. + # IMPORTANT: It's not possible to use an API key as the authentication credential for this API. The owner user’s credentials are required. + # Use this API to update API keys created by the create API key or grant API Key APIs. + # If you need to apply the same update to many API keys, you can use the bulk update API keys API to reduce overhead. + # It's not possible to update expired API keys or API keys that have been invalidated by the invalidate API key API. + # The access scope of an API key is derived from the +role_descriptors+ you specify in the request and a snapshot of the owner user's permissions at the time of the request. + # The snapshot of the owner's permissions is updated automatically on every call. + # IMPORTANT: If you don't specify +role_descriptors+ in the request, a call to this API might still change the API key's access scope. + # This change can occur if the owner user's permissions have changed since the API key was created or last modified. # - # @option arguments [String] :id The ID of the API key to update + # @option arguments [String] :id The ID of the API key to update. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The API key request to update attributes of an API key. + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-api-key.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-api-key # def update_api_key(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.update_api_key' } @@ -48,7 +61,7 @@ def update_api_key(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT - path = "_security/api_key/#{Utils.__listify(_id)}" + path = "_security/api_key/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_cross_cluster_api_key.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/update_cross_cluster_api_key.rb index 141a5cd3a..90ea10d8c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_cross_cluster_api_key.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/update_cross_cluster_api_key.rb @@ -15,20 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Updates attributes of an existing cross-cluster API key. + # Update a cross-cluster API key. + # Update the attributes of an existing cross-cluster API key, which is used for API key based remote cluster access. + # To use this API, you must have at least the +manage_security+ cluster privilege. + # Users can only update API keys that they created. + # To update another user's API key, use the +run_as+ feature to submit a request on behalf of another user. + # IMPORTANT: It's not possible to use an API key as the authentication credential for this API. + # To update an API key, the owner user's credentials are required. + # It's not possible to update expired API keys, or API keys that have been invalidated by the invalidate API key API. + # This API supports updates to an API key's access scope, metadata, and expiration. + # The owner user's information, such as the +username+ and +realm+, is also updated automatically on every call. + # NOTE: This API cannot update REST API keys, which should be updated by either the update API key or bulk update API keys API. # - # @option arguments [String] :id The ID of the cross-cluster API key to update + # @option arguments [String] :id The ID of the cross-cluster API key to update. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The request to update attributes of a cross-cluster API key. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-cross-cluster-api-key.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-cross-cluster-api-key # def update_cross_cluster_api_key(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.update_cross_cluster_api_key' } @@ -49,7 +59,7 @@ def update_cross_cluster_api_key(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT - path = "_security/cross_cluster/api_key/#{Utils.__listify(_id)}" + path = "_security/cross_cluster/api_key/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/update_settings.rb index bd86ffcbc..80f01e9a4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/update_settings.rb @@ -15,21 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Security module Actions - # Update settings for the security system index + # Update security index settings. + # Update the user-configurable settings for the security internal index (+.security+ and associated indices). Only a subset of settings are allowed to be modified. This includes +index.auto_expand_replicas+ and +index.number_of_replicas+. + # NOTE: If +index.auto_expand_replicas+ is set, +index.number_of_replicas+ will be ignored during updates. + # If a specific index is not in use on the system and settings are provided for it, the request will be rejected. + # This API does not yet support configuring the settings for indices before they are in use. # - # @option arguments [Time] :master_timeout Timeout for connection to master - # @option arguments [Time] :timeout Timeout for acknowledgements from all nodes + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object with the new settings for each index, if any (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-update-settings.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-update-settings # def update_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.update_settings' } @@ -39,7 +45,7 @@ def update_settings(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_PUT path = '_security/settings' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_user_profile_data.rb b/elasticsearch-api/lib/elasticsearch/api/actions/security/update_user_profile_data.rb index a8e24acf6..7c1595368 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/security/update_user_profile_data.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/security/update_user_profile_data.rb @@ -50,9 +50,8 @@ module Actions def update_user_profile_data(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'security.update_user_profile_data' } - defined_params = [:uid].inject({}) do |set_variables, variable| + defined_params = [:uid].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) - set_variables end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -67,7 +66,7 @@ def update_user_profile_data(arguments = {}) _uid = arguments.delete(:uid) method = Elasticsearch::API::HTTP_PUT - path = "_security/profile/#{Utils.__listify(_uid)}/_data" + path = "_security/profile/#{Utils.listify(_uid)}/_data" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/simulate/ingest.rb b/elasticsearch-api/lib/elasticsearch/api/actions/simulate/ingest.rb index 19ee6beee..4ab2d42b9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/simulate/ingest.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/simulate/ingest.rb @@ -15,25 +15,40 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Simulate module Actions - # Simulates running ingest with example documents. + # Simulate data ingestion. + # Run ingest pipelines against a set of provided documents, optionally with substitute pipeline definitions, to simulate ingesting data into an index. + # This API is meant to be used for troubleshooting or pipeline development, as it does not actually index any data into Elasticsearch. + # The API runs the default and final pipeline for that index against a set of documents provided in the body of the request. + # If a pipeline contains a reroute processor, it follows that reroute processor to the new index, running that index's pipelines as well the same way that a non-simulated ingest would. + # No data is indexed into Elasticsearch. + # Instead, the transformed document is returned, along with the list of pipelines that have been run and the name of the index where the document would have been indexed if this were not a simulation. + # The transformed document is validated against the mappings that would apply to this index, and any validation error is reported in the result. + # This API differs from the simulate pipeline API in that you specify a single pipeline for that API, and it runs only that one pipeline. + # The simulate pipeline API is more useful for developing a single pipeline, while the simulate ingest API is more useful for troubleshooting the interaction of the various pipelines that get applied when ingesting into an index. + # By default, the pipeline definitions that are currently in the system are used. + # However, you can supply substitute pipeline definitions in the body of the request. + # These will be used in place of the pipeline definitions that are already in the system. This can be used to replace existing pipeline definitions or to create new ones. The pipeline substitutions are used only within this request. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :index Default index for docs which don't provide one - # @option arguments [String] :pipeline The pipeline id to preprocess incoming documents with if no pipeline is given for a particular document + # @option arguments [String] :index The index to simulate ingesting into. + # This value can be overridden by specifying an index on each document. + # If you specify this parameter in the request path, it is used for any documents that do not explicitly specify an index argument. + # @option arguments [String] :pipeline The pipeline to use as the default pipeline. + # This value can be used to override the default pipeline of the index. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The simulate definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/simulate-ingest-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-simulate-ingest # def ingest(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'simulate.ingest' } @@ -48,13 +63,13 @@ def ingest(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index - "_ingest/#{Utils.__listify(_index)}/_simulate" + "_ingest/#{Utils.listify(_index)}/_simulate" else '_ingest/_simulate' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb index dfc7b63c8..5527338a5 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/cleanup_repository.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Removes stale data from repository. + # Clean up the snapshot repository. + # Trigger the review of the contents of a snapshot repository and delete any stale data not referenced by existing snapshots. # - # @option arguments [String] :repository A repository name - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :repository The name of the snapshot repository to clean up. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+ Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata. + # If no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clean-up-snapshot-repo-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-cleanup-repository # def cleanup_repository(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.cleanup_repository' } @@ -49,7 +54,7 @@ def cleanup_repository(arguments = {}) _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_POST - path = "_snapshot/#{Utils.__listify(_repository)}/_cleanup" + path = "_snapshot/#{Utils.listify(_repository)}/_cleanup" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/clone.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/clone.rb index 4771ebf21..925759ff5 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/clone.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/clone.rb @@ -15,28 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Clones indices from one snapshot into another snapshot in the same repository. + # Clone a snapshot. + # Clone part of all of a snapshot into another snapshot in the same repository. # - # @option arguments [String] :repository A repository name - # @option arguments [String] :snapshot The name of the snapshot to clone from - # @option arguments [String] :target_snapshot The name of the cloned snapshot to create - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node + # @option arguments [String] :repository The name of the snapshot repository that both source and target snapshot belong to. (*Required*) + # @option arguments [String] :snapshot The source snapshot name. (*Required*) + # @option arguments [String] :target_snapshot The target snapshot name. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Time] :timeout The period of time to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The snapshot clone definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-clone # def clone(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.clone' } - defined_params = %i[repository snapshot target_snapshot].each_with_object({}) do |variable, set_variables| + defined_params = [:repository, :snapshot, :target_snapshot].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -58,7 +63,7 @@ def clone(arguments = {}) _target_snapshot = arguments.delete(:target_snapshot) method = Elasticsearch::API::HTTP_PUT - path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}/_clone/#{Utils.__listify(_target_snapshot)}" + path = "_snapshot/#{Utils.listify(_repository)}/#{Utils.listify(_snapshot)}/_clone/#{Utils.listify(_target_snapshot)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/create.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/create.rb index 7b6e01d72..a398e747b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/create.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/create.rb @@ -15,28 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Creates a snapshot in a repository. + # Create a snapshot. + # Take a snapshot of a cluster or of data streams and indices. # - # @option arguments [String] :repository A repository name - # @option arguments [String] :snapshot A snapshot name - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning + # @option arguments [String] :repository The name of the repository for the snapshot. (*Required*) + # @option arguments [String] :snapshot The name of the snapshot. + # It supportes date math. + # It must be unique in the repository. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Boolean] :wait_for_completion If +true+, the request returns a response when the snapshot is complete. + # If +false+, the request returns a response when the snapshot initializes. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The snapshot definition + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-create # def create(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.create' } - defined_params = %i[repository snapshot].each_with_object({}) do |variable, set_variables| + defined_params = [:repository, :snapshot].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -54,7 +59,7 @@ def create(arguments = {}) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_PUT - path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}" + path = "_snapshot/#{Utils.listify(_repository)}/#{Utils.listify(_snapshot)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/create_repository.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/create_repository.rb index aa94f85ff..6e90dedd7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/create_repository.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/create_repository.rb @@ -15,23 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Creates a repository. + # Create or update a snapshot repository. + # IMPORTANT: If you are migrating searchable snapshots, the repository name must be identical in the source and destination clusters. + # To register a snapshot repository, the cluster's global metadata must be writeable. + # Ensure there are no cluster blocks (for example, +cluster.blocks.read_only+ and +clsuter.blocks.read_only_allow_delete+ settings) that prevent write access. + # Several options for this API can be specified using a query parameter or a request body parameter. + # If both parameters are specified, only the query parameter is used. # - # @option arguments [String] :repository A repository name - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Boolean] :verify Whether to verify the repository after creation + # @option arguments [String] :repository The name of the snapshot repository to register or update. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata. + # If no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Boolean] :verify If +true+, the request verifies the repository is functional on all master and data nodes in the cluster. + # If +false+, this verification is skipped. + # You can also perform this verification with the verify snapshot repository API. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The repository definition (*Required*) + # @option arguments [Hash] :body repository # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-create-repository # def create_repository(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.create_repository' } @@ -52,7 +63,7 @@ def create_repository(arguments = {}) _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_PUT - path = "_snapshot/#{Utils.__listify(_repository)}" + path = "_snapshot/#{Utils.listify(_repository)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/delete.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/delete.rb index 3489aad39..44bd6dc04 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/delete.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/delete.rb @@ -15,27 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Deletes one or more snapshots. + # Delete snapshots. # - # @option arguments [String] :repository A repository name - # @option arguments [List] :snapshot A comma-separated list of snapshot names - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning + # @option arguments [String] :repository The name of the repository to delete a snapshot from. (*Required*) + # @option arguments [String] :snapshot A comma-separated list of snapshot names to delete. + # It also accepts wildcards (+*+). (*Required*) + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-delete # def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.delete' } - defined_params = %i[repository snapshot].each_with_object({}) do |variable, set_variables| + defined_params = [:repository, :snapshot].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,11 +55,11 @@ def delete(arguments = {}) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_DELETE - path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}" + path = "_snapshot/#{Utils.listify(_repository)}/#{Utils.listify(_snapshot)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/delete_repository.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/delete_repository.rb index c6168a3ff..5cb0453cd 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/delete_repository.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/delete_repository.rb @@ -15,21 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Deletes a repository. + # Delete snapshot repositories. + # When a repository is unregistered, Elasticsearch removes only the reference to the location where the repository is storing the snapshots. + # The snapshots themselves are left untouched and in place. # - # @option arguments [List] :repository Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported. - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :repository The ame of the snapshot repositories to unregister. + # Wildcard (+*+) patterns are supported. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata. + # If no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-delete-repository # def delete_repository(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.delete_repository' } @@ -49,11 +56,11 @@ def delete_repository(arguments = {}) _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_DELETE - path = "_snapshot/#{Utils.__listify(_repository)}" + path = "_snapshot/#{Utils.listify(_repository)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/get.rb index fcb5af696..a5bd37e8e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/get.rb @@ -15,38 +15,56 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Returns information about a snapshot. + # Get snapshot information. + # NOTE: The +after+ parameter and +next+ field enable you to iterate through snapshots with some consistency guarantees regarding concurrent creation or deletion of snapshots. + # It is guaranteed that any snapshot that exists at the beginning of the iteration and is not concurrently deleted will be seen during the iteration. + # Snapshots concurrently created may be seen during an iteration. # - # @option arguments [String] :repository A repository name - # @option arguments [List] :snapshot A comma-separated list of snapshot names - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Boolean] :ignore_unavailable Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown - # @option arguments [Boolean] :index_names Whether to include the name of each index in the snapshot. Defaults to true. - # @option arguments [Boolean] :index_details Whether to include details of each index in the snapshot, if those details are available. Defaults to false. - # @option arguments [Boolean] :include_repository Whether to include the repository name in the snapshot info. Defaults to true. - # @option arguments [String] :sort Allows setting a sort order for the result. Defaults to start_time (options: start_time, duration, name, repository, index_count, shard_count, failed_shard_count) - # @option arguments [Integer] :size Maximum number of snapshots to return. Defaults to 0 which means return all that match without limit. - # @option arguments [String] :order Sort order (options: asc, desc) - # @option arguments [String] :from_sort_value Value of the current sort column at which to start retrieval. - # @option arguments [String] :after Offset identifier to start pagination from as returned by the 'next' field in the response body. - # @option arguments [Integer] :offset Numeric offset to start pagination based on the snapshots matching the request. Defaults to 0 - # @option arguments [String] :slm_policy_filter Filter snapshots by a comma-separated list of SLM policy names that snapshots belong to. Accepts wildcards. Use the special pattern '_none' to match snapshots without an SLM policy - # @option arguments [Boolean] :verbose Whether to show verbose snapshot info or only show the basic info found in the repository index blob + # @option arguments [String] :repository A comma-separated list of snapshot repository names used to limit the request. + # Wildcard (+*+) expressions are supported. (*Required*) + # @option arguments [String, Array] :snapshot A comma-separated list of snapshot names to retrieve + # Wildcards (+*+) are supported. + # - To get information about all snapshots in a registered repository, use a wildcard (+*+) or +_all+. + # - To get information about any snapshots that are currently running, use +_current+. (*Required*) + # @option arguments [String] :after An offset identifier to start pagination from as returned by the next field in the response body. + # @option arguments [String] :from_sort_value The value of the current sort column at which to start retrieval. + # It can be a string +snapshot-+ or a repository name when sorting by snapshot or repository name. + # It can be a millisecond time value or a number when sorting by +index-+ or shard count. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error for any snapshots that are unavailable. + # @option arguments [Boolean] :index_details If +true+, the response includes additional information about each index in the snapshot comprising the number of shards in the index, the total size of the index in bytes, and the maximum number of segments per shard in the index. + # The default is +false+, meaning that this information is omitted. + # @option arguments [Boolean] :index_names If +true+, the response includes the name of each index in each snapshot. Server default: true. + # @option arguments [Boolean] :include_repository If +true+, the response includes the repository name in each snapshot. Server default: true. + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [String] :order The sort order. + # Valid values are +asc+ for ascending and +desc+ for descending order. + # The default behavior is ascending order. Server default: asc. + # @option arguments [Integer] :offset Numeric offset to start pagination from based on the snapshots matching this request. Using a non-zero value for this parameter is mutually exclusive with using the after parameter. Defaults to 0. Server default: 0. + # @option arguments [Integer] :size The maximum number of snapshots to return. + # The default is 0, which means to return all that match the request without limit. Server default: 0. + # @option arguments [String] :slm_policy_filter Filter snapshots by a comma-separated list of snapshot lifecycle management (SLM) policy names that snapshots belong to.You can use wildcards (+*+) and combinations of wildcards followed by exclude patterns starting with +-+. + # For example, the pattern +*,-policy-a-\*+ will return all snapshots except for those that were created by an SLM policy with a name starting with +policy-a-+. + # Note that the wildcard pattern +*+ matches all snapshots created by an SLM policy but not those snapshots that were not created by an SLM policy. + # To include snapshots that were not created by an SLM policy, you can use the special pattern +_none+ that will match all snapshots without an SLM policy. + # @option arguments [String] :sort The sort order for the result. + # The default behavior is sorting by snapshot start time stamp. Server default: start_time. + # @option arguments [Boolean] :verbose If +true+, returns additional information about each snapshot such as the version of Elasticsearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted.NOTE: The parameters +size+, +order+, +after+, +from_sort_value+, +offset+, +slm_policy_filter+, and +sort+ are not supported when you set +verbose=false+ and the sort order for requests with +verbose=false+ is undefined. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-get # def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.get' } - defined_params = %i[repository snapshot].each_with_object({}) do |variable, set_variables| + defined_params = [:repository, :snapshot].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -64,11 +82,11 @@ def get(arguments = {}) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_GET - path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}" + path = "_snapshot/#{Utils.listify(_repository)}/#{Utils.listify(_snapshot)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/get_repository.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/get_repository.rb index 83f3983f5..87aa3a178 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/get_repository.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/get_repository.rb @@ -15,21 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Returns information about a repository. + # Get snapshot repository information. # - # @option arguments [List] :repository A comma-separated list of repository names - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) + # @option arguments [String, Array] :repository A comma-separated list of snapshot repository names used to limit the request. + # Wildcard (+*+) expressions are supported including combining wildcards with exclude patterns starting with +-+.To get information about all snapshot repositories registered in the cluster, omit this parameter or use +*+ or +_all+. + # @option arguments [Boolean] :local If +true+, the request gets information from the local node only. + # If +false+, the request gets information from the master node. + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: to 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-get-repository # def get_repository(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.get_repository' } @@ -48,14 +52,14 @@ def get_repository(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _repository - "_snapshot/#{Utils.__listify(_repository)}" + "_snapshot/#{Utils.listify(_repository)}" else '_snapshot' end params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/repository_analyze.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/repository_analyze.rb index 575313a41..0a77e940a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/repository_analyze.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/repository_analyze.rb @@ -15,30 +15,111 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Analyzes a repository for correctness and performance + # Analyze a snapshot repository. + # Analyze the performance characteristics and any incorrect behaviour found in a repository. + # The response exposes implementation details of the analysis which may change from version to version. + # The response body format is therefore not considered stable and may be different in newer versions. + # There are a large number of third-party storage systems available, not all of which are suitable for use as a snapshot repository by Elasticsearch. + # Some storage systems behave incorrectly, or perform poorly, especially when accessed concurrently by multiple clients as the nodes of an Elasticsearch cluster do. This API performs a collection of read and write operations on your repository which are designed to detect incorrect behaviour and to measure the performance characteristics of your storage system. + # The default values for the parameters are deliberately low to reduce the impact of running an analysis inadvertently and to provide a sensible starting point for your investigations. + # Run your first analysis with the default parameter values to check for simple problems. + # If successful, run a sequence of increasingly large analyses until you encounter a failure or you reach a +blob_count+ of at least +2000+, a +max_blob_size+ of at least +2gb+, a +max_total_data_size+ of at least +1tb+, and a +register_operation_count+ of at least +100+. + # Always specify a generous timeout, possibly +1h+ or longer, to allow time for each analysis to run to completion. + # Perform the analyses using a multi-node cluster of a similar size to your production cluster so that it can detect any problems that only arise when the repository is accessed by many nodes at once. + # If the analysis fails, Elasticsearch detected that your repository behaved unexpectedly. + # This usually means you are using a third-party storage system with an incorrect or incompatible implementation of the API it claims to support. + # If so, this storage system is not suitable for use as a snapshot repository. + # You will need to work with the supplier of your storage system to address the incompatibilities that Elasticsearch detects. + # If the analysis is successful, the API returns details of the testing process, optionally including how long each operation took. + # You can use this information to determine the performance of your storage system. + # If any operation fails or returns an incorrect result, the API returns an error. + # If the API returns an error, it may not have removed all the data it wrote to the repository. + # The error will indicate the location of any leftover data and this path is also recorded in the Elasticsearch logs. + # You should verify that this location has been cleaned up correctly. + # If there is still leftover data at the specified location, you should manually remove it. + # If the connection from your client to Elasticsearch is closed while the client is waiting for the result of the analysis, the test is cancelled. + # Some clients are configured to close their connection if no response is received within a certain timeout. + # An analysis takes a long time to complete so you might need to relax any such client-side timeouts. + # On cancellation the analysis attempts to clean up the data it was writing, but it may not be able to remove it all. + # The path to the leftover data is recorded in the Elasticsearch logs. + # You should verify that this location has been cleaned up correctly. + # If there is still leftover data at the specified location, you should manually remove it. + # If the analysis is successful then it detected no incorrect behaviour, but this does not mean that correct behaviour is guaranteed. + # The analysis attempts to detect common bugs but it does not offer 100% coverage. + # Additionally, it does not test the following: + # * Your repository must perform durable writes. Once a blob has been written it must remain in place until it is deleted, even after a power loss or similar disaster. + # * Your repository must not suffer from silent data corruption. Once a blob has been written, its contents must remain unchanged until it is deliberately modified or deleted. + # * Your repository must behave correctly even if connectivity from the cluster is disrupted. Reads and writes may fail in this case, but they must not return incorrect results. + # IMPORTANT: An analysis writes a substantial amount of data to your repository and then reads it back again. + # This consumes bandwidth on the network between the cluster and the repository, and storage space and I/O bandwidth on the repository itself. + # You must ensure this load does not affect other users of these systems. + # Analyses respect the repository settings +max_snapshot_bytes_per_sec+ and +max_restore_bytes_per_sec+ if available and the cluster setting +indices.recovery.max_bytes_per_sec+ which you can use to limit the bandwidth they consume. + # NOTE: This API is intended for exploratory use by humans. You should expect the request parameters and the response format to vary in future versions. + # NOTE: Different versions of Elasticsearch may perform different checks for repository compatibility, with newer versions typically being stricter than older ones. + # A storage system that passes repository analysis with one version of Elasticsearch may fail with a different version. + # This indicates it behaves incorrectly in ways that the former version did not detect. + # You must work with the supplier of your storage system to address the incompatibilities detected by the repository analysis API in any version of Elasticsearch. + # NOTE: This API may not work correctly in a mixed-version cluster. + # *Implementation details* + # NOTE: This section of documentation describes how the repository analysis API works in this version of Elasticsearch, but you should expect the implementation to vary between versions. The request parameters and response format depend on details of the implementation so may also be different in newer versions. + # The analysis comprises a number of blob-level tasks, as set by the +blob_count+ parameter and a number of compare-and-exchange operations on linearizable registers, as set by the +register_operation_count+ parameter. + # These tasks are distributed over the data and master-eligible nodes in the cluster for execution. + # For most blob-level tasks, the executing node first writes a blob to the repository and then instructs some of the other nodes in the cluster to attempt to read the data it just wrote. + # The size of the blob is chosen randomly, according to the +max_blob_size+ and +max_total_data_size+ parameters. + # If any of these reads fails then the repository does not implement the necessary read-after-write semantics that Elasticsearch requires. + # For some blob-level tasks, the executing node will instruct some of its peers to attempt to read the data before the writing process completes. + # These reads are permitted to fail, but must not return partial data. + # If any read returns partial data then the repository does not implement the necessary atomicity semantics that Elasticsearch requires. + # For some blob-level tasks, the executing node will overwrite the blob while its peers are reading it. + # In this case the data read may come from either the original or the overwritten blob, but the read operation must not return partial data or a mix of data from the two blobs. + # If any of these reads returns partial data or a mix of the two blobs then the repository does not implement the necessary atomicity semantics that Elasticsearch requires for overwrites. + # The executing node will use a variety of different methods to write the blob. + # For instance, where applicable, it will use both single-part and multi-part uploads. + # Similarly, the reading nodes will use a variety of different methods to read the data back again. + # For instance they may read the entire blob from start to end or may read only a subset of the data. + # For some blob-level tasks, the executing node will cancel the write before it is complete. + # In this case, it still instructs some of the other nodes in the cluster to attempt to read the blob but all of these reads must fail to find the blob. + # Linearizable registers are special blobs that Elasticsearch manipulates using an atomic compare-and-exchange operation. + # This operation ensures correct and strongly-consistent behavior even when the blob is accessed by multiple nodes at the same time. + # The detailed implementation of the compare-and-exchange operation on linearizable registers varies by repository type. + # Repository analysis verifies that that uncontended compare-and-exchange operations on a linearizable register blob always succeed. + # Repository analysis also verifies that contended operations either succeed or report the contention but do not return incorrect results. + # If an operation fails due to contention, Elasticsearch retries the operation until it succeeds. + # Most of the compare-and-exchange operations performed by repository analysis atomically increment a counter which is represented as an 8-byte blob. + # Some operations also verify the behavior on small blobs with sizes other than 8 bytes. # - # @option arguments [String] :repository A repository name - # @option arguments [Number] :blob_count Number of blobs to create during the test. Defaults to 100. - # @option arguments [Number] :concurrency Number of operations to run concurrently during the test. Defaults to 10. - # @option arguments [Number] :read_node_count Number of nodes on which to read a blob after writing. Defaults to 10. - # @option arguments [Number] :early_read_node_count Number of nodes on which to perform an early read on a blob, i.e. before writing has completed. Early reads are rare actions so the 'rare_action_probability' parameter is also relevant. Defaults to 2. - # @option arguments [Number] :seed Seed for the random number generator used to create the test workload. Defaults to a random value. - # @option arguments [Number] :rare_action_probability Probability of taking a rare action such as an early read or an overwrite. Defaults to 0.02. - # @option arguments [String] :max_blob_size Maximum size of a blob to create during the test, e.g '1gb' or '100mb'. Defaults to '10mb'. - # @option arguments [String] :max_total_data_size Maximum total size of all blobs to create during the test, e.g '1tb' or '100gb'. Defaults to '1gb'. - # @option arguments [Time] :timeout Explicit operation timeout. Defaults to '30s'. - # @option arguments [Boolean] :detailed Whether to return detailed results or a summary. Defaults to 'false' so that only the summary is returned. - # @option arguments [Boolean] :rarely_abort_writes Whether to rarely abort writes before they complete. Defaults to 'true'. + # @option arguments [String] :repository The name of the repository. (*Required*) + # @option arguments [Integer] :blob_count The total number of blobs to write to the repository during the test. + # For realistic experiments, you should set it to at least +2000+. Server default: 100. + # @option arguments [Integer] :concurrency The number of operations to run concurrently during the test. Server default: 10. + # @option arguments [Boolean] :detailed Indicates whether to return detailed results, including timing information for every operation performed during the analysis. + # If false, it returns only a summary of the analysis. + # @option arguments [Integer] :early_read_node_count The number of nodes on which to perform an early read operation while writing each blob. + # Early read operations are only rarely performed. Server default: 2. + # @option arguments [Integer, String] :max_blob_size The maximum size of a blob to be written during the test. + # For realistic experiments, you should set it to at least +2gb+. Server default: 10mb. + # @option arguments [Integer, String] :max_total_data_size An upper limit on the total size of all the blobs written during the test. + # For realistic experiments, you should set it to at least +1tb+. Server default: 1gb. + # @option arguments [Float] :rare_action_probability The probability of performing a rare action such as an early read, an overwrite, or an aborted write on each blob. Server default: 0.02. + # @option arguments [Boolean] :rarely_abort_writes Indicates whether to rarely cancel writes before they complete. Server default: true. + # @option arguments [Integer] :read_node_count The number of nodes on which to read a blob after writing. Server default: 10. + # @option arguments [Integer] :register_operation_count The minimum number of linearizable register operations to perform in total. + # For realistic experiments, you should set it to at least +100+. Server default: 10. + # @option arguments [Integer] :seed The seed for the pseudo-random number generator used to generate the list of operations performed during the test. + # To repeat the same set of operations in multiple experiments, use the same seed in each experiment. + # Note that the operations are performed concurrently so might not always happen in the same order on each run. + # @option arguments [Time] :timeout The period of time to wait for the test to complete. + # If no response is received before the timeout expires, the test is cancelled and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-repository-analyze # def repository_analyze(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.repository_analyze' } @@ -58,7 +139,7 @@ def repository_analyze(arguments = {}) _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_POST - path = "_snapshot/#{Utils.__listify(_repository)}/_analyze" + path = "_snapshot/#{Utils.listify(_repository)}/_analyze" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/restore.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/restore.rb index 02e05a211..cade7340f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/restore.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/restore.rb @@ -15,28 +15,43 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Restores a snapshot. + # Restore a snapshot. + # Restore a snapshot of a cluster or data streams and indices. + # You can restore a snapshot only to a running cluster with an elected master node. + # The snapshot repository must be registered and available to the cluster. + # The snapshot and cluster versions must be compatible. + # To restore a snapshot, the cluster's global metadata must be writable. Ensure there are't any cluster blocks that prevent writes. The restore operation ignores index blocks. + # Before you restore a data stream, ensure the cluster contains a matching index template with data streams enabled. To check, use the index management feature in Kibana or the get index template API: + # + + # GET _index_template/*?filter_path=index_templates.name,index_templates.index_template.index_patterns,index_templates.index_template.data_stream + # + + # If no such template exists, you can create one or restore a cluster state that contains one. Without a matching index template, a data stream can't roll over or create backing indices. + # If your snapshot contains data from App Search or Workplace Search, you must restore the Enterprise Search encryption key before you restore the snapshot. # - # @option arguments [String] :repository A repository name - # @option arguments [String] :snapshot A snapshot name - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Boolean] :wait_for_completion Should this request wait until the operation has completed before returning + # @option arguments [String] :repository The name of the repository to restore a snapshot from. (*Required*) + # @option arguments [String] :snapshot The name of the snapshot to restore. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Boolean] :wait_for_completion If +true+, the request returns a response when the restore operation completes. + # The operation is complete when it finishes all attempts to recover primary shards for restored indices. + # This applies even if one or more of the recovery attempts fail.If +false+, the request returns a response when the restore operation initializes. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Details of what to restore + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-restore # def restore(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.restore' } - defined_params = %i[repository snapshot].each_with_object({}) do |variable, set_variables| + defined_params = [:repository, :snapshot].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -54,7 +69,7 @@ def restore(arguments = {}) _snapshot = arguments.delete(:snapshot) method = Elasticsearch::API::HTTP_POST - path = "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}/_restore" + path = "_snapshot/#{Utils.listify(_repository)}/#{Utils.listify(_snapshot)}/_restore" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/status.rb index d6fa97d5e..d62a87b00 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/status.rb @@ -15,27 +15,44 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Returns information about the status of a snapshot. + # Get the snapshot status. + # Get a detailed description of the current state for each shard participating in the snapshot. + # Note that this API should be used only to obtain detailed shard-level information for ongoing snapshots. + # If this detail is not needed or you want to obtain information about one or more existing snapshots, use the get snapshot API. + # If you omit the ++ request path parameter, the request retrieves information only for currently running snapshots. + # This usage is preferred. + # If needed, you can specify ++ and ++ to retrieve information for specific snapshots, even if they're not currently running. + # WARNING: Using the API to return the status of any snapshots other than currently running snapshots can be expensive. + # The API requires a read from the repository for each shard in each snapshot. + # For example, if you have 100 snapshots with 1,000 shards each, an API request that includes all snapshots will require 100,000 reads (100 snapshots x 1,000 shards). + # Depending on the latency of your storage, such requests can take an extremely long time to return results. + # These requests can also tax machine resources and, when using cloud storage, incur high processing costs. # - # @option arguments [String] :repository A repository name - # @option arguments [List] :snapshot A comma-separated list of snapshot names - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Boolean] :ignore_unavailable Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown + # @option arguments [String] :repository The snapshot repository name used to limit the request. + # It supports wildcards (+*+) if ++ isn't specified. + # @option arguments [String, Array] :snapshot A comma-separated list of snapshots to retrieve status for. + # The default is currently running snapshots. + # Wildcards (+*+) are not supported. + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error for any snapshots that are unavailable. + # If +true+, the request ignores snapshots that are unavailable, such as those that are corrupted or temporarily cannot be returned. + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-status # def status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.status' } - defined_params = %i[repository snapshot].each_with_object({}) do |variable, set_variables| + defined_params = [:repository, :snapshot].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,16 +68,16 @@ def status(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _repository && _snapshot - "_snapshot/#{Utils.__listify(_repository)}/#{Utils.__listify(_snapshot)}/_status" + "_snapshot/#{Utils.listify(_repository)}/#{Utils.listify(_snapshot)}/_status" elsif _repository - "_snapshot/#{Utils.__listify(_repository)}/_status" + "_snapshot/#{Utils.listify(_repository)}/_status" else '_snapshot/_status' end params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/verify_repository.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/verify_repository.rb index 335d962d3..35d5b2a75 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/verify_repository.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot/verify_repository.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Snapshot module Actions - # Verifies a repository. + # Verify a snapshot repository. + # Check for common misconfigurations in a snapshot repository. # - # @option arguments [String] :repository A repository name - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :repository The name of the snapshot repository to verify. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response from all relevant nodes in the cluster after updating the cluster metadata. + # If no response is received before the timeout expires, the cluster metadata update still applies but the response will indicate that it was not completely acknowledged. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-snapshot-verify-repository # def verify_repository(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'snapshot.verify_repository' } @@ -49,7 +54,7 @@ def verify_repository(arguments = {}) _repository = arguments.delete(:repository) method = Elasticsearch::API::HTTP_POST - path = "_snapshot/#{Utils.__listify(_repository)}/_verify" + path = "_snapshot/#{Utils.listify(_repository)}/_verify" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb index 96088812c..2e2646c24 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/delete_lifecycle.rb @@ -15,21 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SnapshotLifecycleManagement module Actions - # Deletes an existing snapshot lifecycle policy. + # Delete a policy. + # Delete a snapshot lifecycle policy definition. + # This operation prevents any future snapshots from being taken but does not cancel in-progress snapshots or remove previously-taken snapshots. # - # @option arguments [String] :policy_id The id of the snapshot lifecycle policy to remove - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :policy_id The id of the snapshot lifecycle policy to remove (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-delete-policy.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-delete-lifecycle # def delete_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.delete_lifecycle' } @@ -49,7 +53,7 @@ def delete_lifecycle(arguments = {}) _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_DELETE - path = "_slm/policy/#{Utils.__listify(_policy_id)}" + path = "_slm/policy/#{Utils.listify(_policy_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb index de3210fc9..bf07a5a39 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_lifecycle.rb @@ -15,21 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SnapshotLifecycleManagement module Actions - # Immediately creates a snapshot according to the lifecycle policy, without waiting for the scheduled time. + # Run a policy. + # Immediately create a snapshot according to the snapshot lifecycle policy without waiting for the scheduled time. + # The snapshot policy is normally applied according to its schedule, but you might want to manually run a policy before performing an upgrade or other maintenance. # - # @option arguments [String] :policy_id The id of the snapshot lifecycle policy to be executed - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :policy_id The id of the snapshot lifecycle policy to be executed (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-lifecycle.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-execute-lifecycle # def execute_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.execute_lifecycle' } @@ -49,7 +53,7 @@ def execute_lifecycle(arguments = {}) _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_PUT - path = "_slm/policy/#{Utils.__listify(_policy_id)}/_execute" + path = "_slm/policy/#{Utils.listify(_policy_id)}/_execute" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb index 6a16a045e..66ea76d8a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/execute_retention.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SnapshotLifecycleManagement module Actions - # Deletes any snapshots that are expired according to the policy's retention rules. + # Run a retention policy. + # Manually apply the retention policy to force immediate removal of snapshots that are expired according to the snapshot lifecycle policy retention rules. + # The retention policy is normally applied according to its schedule. # - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-execute-retention.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-execute-retention # def execute_retention(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.execute_retention' } @@ -36,7 +40,7 @@ def execute_retention(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_slm/_execute_retention' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb index a697d0624..d6888ebc3 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_lifecycle.rb @@ -15,21 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SnapshotLifecycleManagement module Actions - # Retrieves one or more snapshot lifecycle policy definitions and information about the latest snapshot attempts. + # Get policy information. + # Get snapshot lifecycle policy definitions and information about the latest snapshot attempts. # - # @option arguments [List] :policy_id Comma-separated list of snapshot lifecycle policies to retrieve - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String, Array] :policy_id Comma-separated list of snapshot lifecycle policies to retrieve + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-policy.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-get-lifecycle # def get_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.get_lifecycle' } @@ -48,7 +51,7 @@ def get_lifecycle(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _policy_id - "_slm/policy/#{Utils.__listify(_policy_id)}" + "_slm/policy/#{Utils.listify(_policy_id)}" else '_slm/policy' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb index 2a80670fa..3f26c45fa 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_stats.rb @@ -15,20 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SnapshotLifecycleManagement module Actions - # Returns global and policy-level statistics about actions taken by snapshot lifecycle management. + # Get snapshot lifecycle management statistics. + # Get global and policy-level statistics about actions taken by snapshot lifecycle management. # - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @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. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-get-stats # def get_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.get_stats' } @@ -36,7 +37,7 @@ def get_stats(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_slm/stats' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb index 5e2172e4c..cada77a85 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/get_status.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SnapshotLifecycleManagement module Actions - # Retrieves the status of snapshot lifecycle management (SLM). + # Get the snapshot lifecycle management status. # - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-get-status.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-get-status # def get_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.get_status' } @@ -36,7 +40,7 @@ def get_status(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_slm/status' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb index 23e3d41bd..626083467 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/put_lifecycle.rb @@ -15,22 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SnapshotLifecycleManagement module Actions - # Creates or updates a snapshot lifecycle policy. + # Create or update a policy. + # Create or update a snapshot lifecycle policy. + # If the policy already exists, this request increments the policy version. + # Only the latest version of a policy is stored. # - # @option arguments [String] :policy_id The id of the snapshot lifecycle policy - # @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :policy_id The identifier for the snapshot lifecycle policy you want to create or update. (*Required*) + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The snapshot lifecycle policy definition to register + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-put-policy.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-put-lifecycle # def put_lifecycle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.put_lifecycle' } @@ -50,7 +57,7 @@ def put_lifecycle(arguments = {}) _policy_id = arguments.delete(:policy_id) method = Elasticsearch::API::HTTP_PUT - path = "_slm/policy/#{Utils.__listify(_policy_id)}" + path = "_slm/policy/#{Utils.listify(_policy_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb index 7e5a1d73b..00d132d57 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/start.rb @@ -15,20 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SnapshotLifecycleManagement module Actions - # Turns on snapshot lifecycle management (SLM). + # Start snapshot lifecycle management. + # Snapshot lifecycle management (SLM) starts automatically when a cluster is formed. + # Manually starting SLM is necessary only if it has been stopped using the stop SLM API. # - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-start.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-start # def start(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.start' } @@ -36,7 +42,7 @@ def start(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_slm/start' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb index d5dbab1d1..b2eba1d5f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/snapshot_lifecycle_management/stop.rb @@ -15,20 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SnapshotLifecycleManagement module Actions - # Turns off snapshot lifecycle management (SLM). + # Stop snapshot lifecycle management. + # Stop all snapshot lifecycle management (SLM) operations and the SLM plugin. + # This API is useful when you are performing maintenance on a cluster and need to prevent SLM from performing any actions on your data streams or indices. + # Stopping SLM does not stop any snapshots that are in progress. + # You can manually trigger snapshots with the run snapshot lifecycle policy API even if SLM is stopped. + # The API returns a response as soon as the request is acknowledged, but the plugin might continue to run until in-progress operations complete and it can be safely stopped. + # Use the get snapshot lifecycle management status API to see if SLM is running. # - # @option arguments [Time] :master_timeout Timeout for processing on master node - # @option arguments [Time] :timeout Timeout for acknowledgement of update from all nodes in cluster + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/slm-api-stop.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-slm-stop # def stop(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'slm.stop' } @@ -36,7 +46,7 @@ def stop(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_slm/stop' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/sql/clear_cursor.rb b/elasticsearch-api/lib/elasticsearch/api/actions/sql/clear_cursor.rb index c9ff2560f..c7c6dfe84 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/sql/clear_cursor.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/sql/clear_cursor.rb @@ -15,19 +15,19 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SQL module Actions - # Clears the SQL cursor + # Clear an SQL search cursor. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Specify the cursor value in the `cursor` element to clean the cursor. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/clear-sql-cursor-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-clear-cursor # def clear_cursor(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'sql.clear_cursor' } @@ -37,7 +37,7 @@ def clear_cursor(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_sql/close' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/sql/delete_async.rb b/elasticsearch-api/lib/elasticsearch/api/actions/sql/delete_async.rb index 06b0b77f9..052c0a5ba 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/sql/delete_async.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/sql/delete_async.rb @@ -15,19 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SQL module Actions - # Deletes an async SQL search or a stored synchronous SQL search. If the search is still running, the API cancels it. + # Delete an async SQL search. + # Delete an async SQL search or a stored synchronous SQL search. + # If the search is still running, the API cancels it. + # If the Elasticsearch security features are enabled, only the following users can use this API to delete a search: + # * Users with the +cancel_task+ cluster privilege. + # * The user who first submitted the search. # - # @option arguments [String] :id The async search ID + # @option arguments [String] :id The identifier for the search. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-async-sql-search-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-delete-async # def delete_async(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'sql.delete_async' } @@ -47,7 +52,7 @@ def delete_async(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_sql/async/delete/#{Utils.__listify(_id)}" + path = "_sql/async/delete/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/sql/get_async.rb b/elasticsearch-api/lib/elasticsearch/api/actions/sql/get_async.rb index c1eb5685e..062230494 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/sql/get_async.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/sql/get_async.rb @@ -15,23 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SQL module Actions - # Returns the current status and available results for an async SQL search or stored synchronous SQL search + # Get async SQL search results. + # Get the current status and available results for an async SQL search or stored synchronous SQL search. + # If the Elasticsearch security features are enabled, only the user who first submitted the SQL search can retrieve the search using this API. # - # @option arguments [String] :id The async search ID - # @option arguments [String] :delimiter Separator for CSV results - # @option arguments [String] :format Short version of the Accept header, e.g. json, yaml - # @option arguments [Time] :keep_alive Retention period for the search and its results - # @option arguments [Time] :wait_for_completion_timeout Duration to wait for complete results + # @option arguments [String] :id The identifier for the search. (*Required*) + # @option arguments [String] :delimiter The separator for CSV results. + # The API supports this parameter only for CSV responses. Server default: ,. + # @option arguments [String] :format The format for the response. + # You must specify a format using this parameter or the +Accept+ HTTP header. + # If you specify both, the API uses this parameter. + # @option arguments [Time] :keep_alive The retention period for the search and its results. + # It defaults to the +keep_alive+ period for the original SQL search. + # @option arguments [Time] :wait_for_completion_timeout The period to wait for complete results. + # It defaults to no timeout, meaning the request waits for complete search results. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-async-sql-search-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-get-async # def get_async(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'sql.get_async' } @@ -51,7 +58,7 @@ def get_async(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_sql/async/#{Utils.__listify(_id)}" + path = "_sql/async/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/sql/get_async_status.rb b/elasticsearch-api/lib/elasticsearch/api/actions/sql/get_async_status.rb index a217d9fda..aba738f98 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/sql/get_async_status.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/sql/get_async_status.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SQL module Actions - # Returns the current status of an async SQL search or a stored synchronous SQL search + # Get the async SQL search status. + # Get the current status of an async SQL search or a stored synchronous SQL search. # - # @option arguments [String] :id The async search ID + # @option arguments [String] :id The identifier for the search. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-async-sql-search-status-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-get-async-status # def get_async_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'sql.get_async_status' } @@ -47,7 +48,7 @@ def get_async_status(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_sql/async/status/#{Utils.__listify(_id)}" + path = "_sql/async/status/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/sql/query.rb b/elasticsearch-api/lib/elasticsearch/api/actions/sql/query.rb index 7a187a510..fd4de3da7 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/sql/query.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/sql/query.rb @@ -15,20 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SQL module Actions - # Executes a SQL request + # Get SQL search results. + # Run an SQL request. # - # @option arguments [String] :format a short version of the Accept header, e.g. json, yaml + # @option arguments [String] :format The format for the response. + # You can also specify a format using the +Accept+ HTTP header. + # If you specify both this parameter and the +Accept+ HTTP header, this parameter takes precedence. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Use the `query` element to start a query. Use the `cursor` element to continue a query. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-search-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-query # def query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'sql.query' } @@ -38,7 +41,7 @@ def query(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_sql' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/sql/translate.rb b/elasticsearch-api/lib/elasticsearch/api/actions/sql/translate.rb index 1f872caf6..2064f4e3a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/sql/translate.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/sql/translate.rb @@ -15,19 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SQL module Actions - # Translates SQL into Elasticsearch queries + # Translate SQL into Elasticsearch queries. + # Translate an SQL search into a search API request containing Query DSL. + # It accepts the same request body parameters as the SQL search API, excluding +cursor+. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Specify the query in the `query` element. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-translate-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-sql-translate # def translate(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'sql.translate' } @@ -37,7 +39,7 @@ def translate(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_sql/translate' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/ssl/certificates.rb b/elasticsearch-api/lib/elasticsearch/api/actions/ssl/certificates.rb index 004f33c18..2b27c9a16 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/ssl/certificates.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/ssl/certificates.rb @@ -15,18 +15,28 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module SSL module Actions - # Retrieves information about the X.509 certificates used to encrypt communications in the cluster. + # Get SSL certificates. + # Get information about the X.509 certificates that are used to encrypt communications in the cluster. + # The API returns a list that includes certificates from all TLS contexts including: + # - Settings for transport and HTTP interfaces + # - TLS settings that are used within authentication realms + # - TLS settings for remote monitoring exporters + # The list includes certificates that are used for configuring trust, such as those configured in the +xpack.security.transport.ssl.truststore+ and +xpack.security.transport.ssl.certificate_authorities+ settings. + # It also includes certificates that are used for configuring server identity, such as +xpack.security.http.ssl.keystore+ and +xpack.security.http.ssl.certificate settings+. + # The list does not include certificates that are sourced from the default SSL context of the Java Runtime Environment (JRE), even if those certificates are in use within Elasticsearch. + # NOTE: When a PKCS#11 token is configured as the truststore of the JRE, the API returns all the certificates that are included in the PKCS#11 token irrespective of whether these are used in the Elasticsearch TLS configuration. + # If Elasticsearch is configured to use a keystore or truststore, the API output includes all certificates in that store, even though some of the certificates might not be in active use within the cluster. # # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-ssl.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ssl-certificates # def certificates(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'ssl.certificates' } @@ -34,7 +44,7 @@ def certificates(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_ssl/certificates' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/delete_synonym.rb b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/delete_synonym.rb index 9d91211e7..11bd14316 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/delete_synonym.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/delete_synonym.rb @@ -15,19 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Synonyms module Actions - # Deletes a synonym set + # Delete a synonym set. + # You can only delete a synonyms set that is not in use by any index analyzer. + # Synonyms sets can be used in synonym graph token filters and synonym token filters. + # These synonym filters can be used as part of search analyzers. + # Analyzers need to be loaded when an index is restored (such as when a node starts, or the index becomes open). + # Even if the analyzer is not used on any field mapping, it still needs to be loaded on the index recovery phase. + # If any analyzers cannot be loaded, the index becomes unavailable and the cluster status becomes red or yellow as index shards are not available. + # To prevent that, synonyms sets that are used in analyzers can't be deleted. + # A delete request in this case will return a 400 response code. + # To remove a synonyms set, you must first remove all indices that contain analyzers using it. + # You can migrate an index by creating a new index that does not contain the token filter with the synonyms set, and use the reindex API in order to copy over the index data. + # Once finished, you can delete the index. + # When the synonyms set is not used in analyzers, you will be able to delete it. # - # @option arguments [String] :id The id of the synonyms set to be deleted + # @option arguments [String] :id The synonyms set identifier to delete. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-synonyms-set.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-delete-synonym # def delete_synonym(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'synonyms.delete_synonym' } @@ -47,7 +59,7 @@ def delete_synonym(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_synonyms/#{Utils.__listify(_id)}" + path = "_synonyms/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/delete_synonym_rule.rb b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/delete_synonym_rule.rb index 26183609b..479c7f352 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/delete_synonym_rule.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/delete_synonym_rule.rb @@ -15,25 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Synonyms module Actions - # Deletes a synonym rule in a synonym set + # Delete a synonym rule. + # Delete a synonym rule from a synonym set. # - # @option arguments [String] :set_id The id of the synonym set to be updated - # @option arguments [String] :rule_id The id of the synonym rule to be deleted + # @option arguments [String] :set_id The ID of the synonym set to update. (*Required*) + # @option arguments [String] :rule_id The ID of the synonym rule to delete. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-synonym-rule.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-delete-synonym-rule # def delete_synonym_rule(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'synonyms.delete_synonym_rule' } - defined_params = %i[set_id rule_id].each_with_object({}) do |variable, set_variables| + defined_params = [:set_id, :rule_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +52,7 @@ def delete_synonym_rule(arguments = {}) _rule_id = arguments.delete(:rule_id) method = Elasticsearch::API::HTTP_DELETE - path = "_synonyms/#{Utils.__listify(_set_id)}/#{Utils.__listify(_rule_id)}" + path = "_synonyms/#{Utils.listify(_set_id)}/#{Utils.listify(_rule_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonym.rb b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonym.rb index c09fddeac..caaf07bb4 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonym.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonym.rb @@ -15,21 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Synonyms module Actions - # Retrieves a synonym set + # Get a synonym set. # - # @option arguments [String] :id The name of the synonyms set to be retrieved - # @option arguments [Integer] :from Starting offset - # @option arguments [Integer] :size specifies a max number of results to get + # @option arguments [String] :id The synonyms set identifier to retrieve. (*Required*) + # @option arguments [Integer] :from The starting offset for query rules to retrieve. Server default: 0. + # @option arguments [Integer] :size The max number of query rules to retrieve. Server default: 10. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-synonyms-set.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-get-synonym # def get_synonym(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'synonyms.get_synonym' } @@ -49,7 +49,7 @@ def get_synonym(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_synonyms/#{Utils.__listify(_id)}" + path = "_synonyms/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonym_rule.rb b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonym_rule.rb index 59769ec74..fec5854a1 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonym_rule.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonym_rule.rb @@ -15,25 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Synonyms module Actions - # Retrieves a synonym rule from a synonym set + # Get a synonym rule. + # Get a synonym rule from a synonym set. # - # @option arguments [String] :set_id The id of the synonym set to retrieve the synonym rule from - # @option arguments [String] :rule_id The id of the synonym rule to retrieve + # @option arguments [String] :set_id The ID of the synonym set to retrieve the synonym rule from. (*Required*) + # @option arguments [String] :rule_id The ID of the synonym rule to retrieve. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-synonym-rule.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-get-synonym-rule # def get_synonym_rule(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'synonyms.get_synonym_rule' } - defined_params = %i[set_id rule_id].each_with_object({}) do |variable, set_variables| + defined_params = [:set_id, :rule_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,7 +52,7 @@ def get_synonym_rule(arguments = {}) _rule_id = arguments.delete(:rule_id) method = Elasticsearch::API::HTTP_GET - path = "_synonyms/#{Utils.__listify(_set_id)}/#{Utils.__listify(_rule_id)}" + path = "_synonyms/#{Utils.listify(_set_id)}/#{Utils.listify(_rule_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonyms_sets.rb b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonyms_sets.rb index 3580303fb..cce4b22e6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonyms_sets.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/get_synonyms_sets.rb @@ -15,20 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Synonyms module Actions - # Retrieves a summary of all defined synonym sets + # Get all synonym sets. + # Get a summary of all defined synonym sets. # - # @option arguments [Integer] :from Starting offset - # @option arguments [Integer] :size specifies a max number of results to get + # @option arguments [Integer] :from The starting offset for synonyms sets to retrieve. Server default: 0. + # @option arguments [Integer] :size The maximum number of synonyms sets to retrieve. Server default: 10. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/list-synonyms-sets.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-get-synonym # def get_synonyms_sets(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'synonyms.get_synonyms_sets' } @@ -36,7 +37,7 @@ def get_synonyms_sets(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_synonyms' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/put_synonym.rb b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/put_synonym.rb index 99a76d651..2f4e78806 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/put_synonym.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/put_synonym.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Synonyms module Actions - # Creates or updates a synonyms set + # Create or update a synonym set. + # Synonyms sets are limited to a maximum of 10,000 synonym rules per set. + # If you need to manage more synonym rules, you can create multiple synonym sets. + # When an existing synonyms set is updated, the search analyzers that use the synonyms set are reloaded automatically for all indices. + # This is equivalent to invoking the reload search analyzers API for all indices that use the synonyms set. # - # @option arguments [String] :id The id of the synonyms set to be created or updated + # @option arguments [String] :id The ID of the synonyms set to be created or updated. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Synonyms set rules (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-synonyms-set.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-put-synonym # def put_synonym(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'synonyms.put_synonym' } @@ -49,7 +53,7 @@ def put_synonym(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT - path = "_synonyms/#{Utils.__listify(_id)}" + path = "_synonyms/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/put_synonym_rule.rb b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/put_synonym_rule.rb index cc7804380..f73755d61 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/put_synonym_rule.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/synonyms/put_synonym_rule.rb @@ -15,26 +15,29 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Synonyms module Actions - # Creates or updates a synonym rule in a synonym set + # Create or update a synonym rule. + # Create or update a synonym rule in a synonym set. + # If any of the synonym rules included is invalid, the API returns an error. + # When you update a synonym rule, all analyzers using the synonyms set will be reloaded automatically to reflect the new rule. # - # @option arguments [String] :set_id The id of the synonym set to be updated with the synonym rule - # @option arguments [String] :rule_id The id of the synonym rule to be updated or created + # @option arguments [String] :set_id The ID of the synonym set. (*Required*) + # @option arguments [String] :rule_id The ID of the synonym rule to be updated or created. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Synonym rule (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-synonym-rule.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-put-synonym-rule # def put_synonym_rule(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'synonyms.put_synonym_rule' } - defined_params = %i[set_id rule_id].each_with_object({}) do |variable, set_variables| + defined_params = [:set_id, :rule_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -53,7 +56,7 @@ def put_synonym_rule(arguments = {}) _rule_id = arguments.delete(:rule_id) method = Elasticsearch::API::HTTP_PUT - path = "_synonyms/#{Utils.__listify(_set_id)}/#{Utils.__listify(_rule_id)}" + path = "_synonyms/#{Utils.listify(_set_id)}/#{Utils.listify(_rule_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/tasks/cancel.rb b/elasticsearch-api/lib/elasticsearch/api/actions/tasks/cancel.rb index 9ce81d2af..dd20ab97d 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/tasks/cancel.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/tasks/cancel.rb @@ -15,27 +15,35 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Tasks module Actions - # Cancels a task, if it can be cancelled through an API. + # Cancel a task. + # WARNING: The task management API is new and should still be considered a beta feature. + # The API may change in ways that are not backwards compatible. + # A task may continue to run for some time after it has been cancelled because it may not be able to safely stop its current activity straight away. + # It is also possible that Elasticsearch must complete its work on other tasks before it can process the cancellation. + # The get task information API will continue to list these cancelled tasks until they complete. + # The cancelled flag in the response indicates that the cancellation command has been processed and the task will stop as soon as possible. + # 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. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :task_id Cancel the task with specified task id (node_id:task_number) - # @option arguments [List] :nodes A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - # @option arguments [List] :actions A comma-separated list of actions that should be cancelled. Leave empty to cancel all. - # @option arguments [String] :parent_task_id Cancel tasks with specified parent task id (node_id:task_number). Set to -1 to cancel all. - # @option arguments [Boolean] :wait_for_completion Should the request block until the cancellation of the task and its descendant tasks is completed. Defaults to false + # @option arguments [String, Integer] :task_id The task identifier. + # @option arguments [String] :actions A comma-separated list or wildcard expression of actions that is used to limit the request. + # @option arguments [Array] :nodes A comma-separated list of node IDs or names that is used to limit the request. + # @option arguments [String] :parent_task_id A parent task ID that is used to limit the tasks. + # @option arguments [Boolean] :wait_for_completion If true, the request blocks until all found tasks are complete. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks # def cancel(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'tasks.cancel' } @@ -54,7 +62,7 @@ def cancel(arguments = {}) method = Elasticsearch::API::HTTP_POST path = if _task_id - "_tasks/#{Utils.__listify(_task_id)}/_cancel" + "_tasks/#{Utils.listify(_task_id)}/_cancel" else '_tasks/_cancel' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/tasks/get.rb b/elasticsearch-api/lib/elasticsearch/api/actions/tasks/get.rb index 49f700537..4ab7f321f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/tasks/get.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/tasks/get.rb @@ -15,25 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Tasks module Actions - # Returns information about a task. + # Get task information. + # Get information about a task currently running in the cluster. + # WARNING: The task management API is new and should still be considered a beta feature. + # The API may change in ways that are not backwards compatible. + # If the task identifier is not found, a 404 response code indicates that there are no resources that match the request. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [String] :task_id Return the task with specified id (node_id:task_number) - # @option arguments [Boolean] :wait_for_completion Wait for the matching tasks to complete (default: false) - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :task_id The task identifier. (*Required*) + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the task has completed. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks # def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'tasks.get' } @@ -43,6 +48,8 @@ def get(arguments = {}) end request_opts[:defined_params] = defined_params unless defined_params.empty? + raise ArgumentError, "Required argument 'task_id' missing" unless arguments[:task_id] + arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -51,7 +58,7 @@ def get(arguments = {}) _task_id = arguments.delete(:task_id) method = Elasticsearch::API::HTTP_GET - path = "_tasks/#{Utils.__listify(_task_id)}" + path = "_tasks/#{Utils.listify(_task_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/tasks/list.rb b/elasticsearch-api/lib/elasticsearch/api/actions/tasks/list.rb index 52c522cbe..97ced1665 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/tasks/list.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/tasks/list.rb @@ -15,29 +15,87 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Tasks module Actions - # Returns a list of tasks. + # Get all tasks. + # Get information about the tasks currently running on one or more nodes in the cluster. + # WARNING: The task management API is new and should still be considered a beta feature. + # The API may change in ways that are not backwards compatible. + # **Identifying running tasks** + # The +X-Opaque-Id header+, when provided on the HTTP request header, is going to be returned as a header in the response as well as in the headers field for in the task information. + # This enables you to track certain calls or associate certain tasks with the client that started them. + # For example: + # + + # curl -i -H "X-Opaque-Id: 123456" "http://localhost:9200/_tasks?group_by=parents" + # + + # The API returns the following result: + # + + # HTTP/1.1 200 OK + # X-Opaque-Id: 123456 + # content-type: application/json; charset=UTF-8 + # content-length: 831 + # { + # "tasks" : { + # "u5lcZHqcQhu-rUoFaqDphA:45" : { + # "node" : "u5lcZHqcQhu-rUoFaqDphA", + # "id" : 45, + # "type" : "transport", + # "action" : "cluster:monitor/tasks/lists", + # "start_time_in_millis" : 1513823752749, + # "running_time_in_nanos" : 293139, + # "cancellable" : false, + # "headers" : { + # "X-Opaque-Id" : "123456" + # }, + # "children" : [ + # { + # "node" : "u5lcZHqcQhu-rUoFaqDphA", + # "id" : 46, + # "type" : "direct", + # "action" : "cluster:monitor/tasks/lists[n]", + # "start_time_in_millis" : 1513823752750, + # "running_time_in_nanos" : 92133, + # "cancellable" : false, + # "parent_task_id" : "u5lcZHqcQhu-rUoFaqDphA:45", + # "headers" : { + # "X-Opaque-Id" : "123456" + # } + # } + # ] + # } + # } + # } + # + + # In this example, +X-Opaque-Id: 123456+ is the ID as a part of the response header. + # The +X-Opaque-Id+ in the task +headers+ is the ID for the task that was initiated by the REST request. + # The +X-Opaque-Id+ in the children +headers+ is the child task of the task that was initiated by the REST request. # This functionality is Experimental and may be changed or removed # completely in a future release. Elastic will take a best effort approach # to fix any issues, but experimental features are not subject to the # support SLA of official GA features. # - # @option arguments [List] :nodes A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you're connecting to, leave empty to get information from all nodes - # @option arguments [List] :actions A comma-separated list of actions that should be returned. Leave empty to return all. - # @option arguments [Boolean] :detailed Return detailed task information (default: false) - # @option arguments [String] :parent_task_id Return tasks with specified parent task id (node_id:task_number). Set to -1 to return all. - # @option arguments [Boolean] :wait_for_completion Wait for the matching tasks to complete (default: false) - # @option arguments [String] :group_by Group tasks by nodes or parent/child relationships (options: nodes, parents, none) - # @option arguments [Time] :timeout Explicit operation timeout + # @option arguments [String] :actions A comma-separated list or wildcard expression of actions used to limit the request. + # For example, you can use +cluser:*+ to retrieve all cluster-related tasks. + # @option arguments [Boolean] :detailed If +true+, the response includes detailed information about the running tasks. + # This information is useful to distinguish tasks from each other but is more costly to run. + # @option arguments [String] :group_by A key that is used to group tasks in the response. + # The task lists can be grouped either by nodes or by parent tasks. + # @option arguments [String, Array] :nodes A comma-separated list of node IDs or names that is used to limit the returned information. + # @option arguments [String] :parent_task_id A parent task identifier that is used to limit returned information. + # To return all tasks, omit this parameter or use a value of +-1+. + # If the parent task is not found, the API does not return a 404 response code. + # @option arguments [Time] :timeout The period to wait for each node to respond. + # If a node does not respond before its timeout expires, the response does not include its information. + # However, timed out nodes are included in the +node_failures+ property. Server default: 30s. + # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks # def list(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'tasks.list' } @@ -45,7 +103,7 @@ def list(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_tasks' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/terms_enum.rb b/elasticsearch-api/lib/elasticsearch/api/actions/terms_enum.rb index 93cbc80f7..6b0c1d731 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/terms_enum.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/terms_enum.rb @@ -15,19 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios. + # Get terms in an index. + # Discover terms that match a partial string in an index. + # This API is designed for low-latency look-ups used in auto-complete scenarios. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices + # @option arguments [String] :index A comma-separated list of data streams, indices, and index aliases to search. + # Wildcard (+*+) expressions are supported. + # To search all data streams or indices, omit this parameter or use +*+ or +_all+. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body field name, string which is the prefix expected in matching terms, timeout and size for max number of results + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-terms-enum.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-terms-enum # def terms_enum(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'terms_enum' } @@ -52,7 +56,7 @@ def terms_enum(arguments = {}) Elasticsearch::API::HTTP_GET end - path = "#{Utils.__listify(_index)}/_terms_enum" + path = "#{Utils.listify(_index)}/_terms_enum" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/termvectors.rb b/elasticsearch-api/lib/elasticsearch/api/actions/termvectors.rb index 8b834d9ab..75508e31f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/termvectors.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/termvectors.rb @@ -15,36 +15,63 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Returns information and statistics about terms in the fields of a particular document. + # Get term vector information. + # Get information and statistics about terms in the fields of a particular document. + # You can retrieve term vectors for documents stored in the index or for artificial documents passed in the body of the request. + # You can specify the fields you are interested in through the +fields+ parameter or by adding the fields to the request body. + # For example: + # + + # GET /my-index-000001/_termvectors/1?fields=message + # + + # Fields can be specified using wildcards, similar to the multi match query. + # Term vectors are real-time by default, not near real-time. + # This can be changed by setting +realtime+ parameter to +false+. + # You can request three types of values: _term information_, _term statistics_, and _field statistics_. + # By default, all term information and field statistics are returned for all fields but term statistics are excluded. + # **Term information** + # * term frequency in the field (always returned) + # * term positions (+positions: true+) + # * start and end offsets (+offsets: true+) + # * term payloads (+payloads: true+), as base64 encoded bytes + # If the requested information wasn't stored in the index, it will be computed on the fly if possible. + # Additionally, term vectors could be computed for documents not even existing in the index, but instead provided by the user. # - # @option arguments [String] :index The index in which the document resides. - # @option arguments [String] :id The id of the document, when not specified a doc param should be supplied. - # @option arguments [Boolean] :term_statistics Specifies if total term frequency and document frequency should be returned. - # @option arguments [Boolean] :field_statistics Specifies if document count, sum of document frequencies and sum of total term frequencies should be returned. - # @option arguments [List] :fields A comma-separated list of fields to return. - # @option arguments [Boolean] :offsets Specifies if term offsets should be returned. - # @option arguments [Boolean] :positions Specifies if term positions should be returned. - # @option arguments [Boolean] :payloads Specifies if term payloads should be returned. - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random). - # @option arguments [String] :routing Specific routing value. - # @option arguments [Boolean] :realtime Specifies if request is real-time as opposed to near-real-time (default: true). - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [String] :version_type Specific version type (options: internal, external, external_gte) + # @option arguments [String] :index The name of the index that contains the document. (*Required*) + # @option arguments [String] :id A unique identifier for the document. + # @option arguments [String, Array] :fields A comma-separated list or wildcard expressions of fields to include in the statistics. + # It is used as the default list unless a specific field list is provided in the +completion_fields+ or +fielddata_fields+ parameters. + # @option arguments [Boolean] :field_statistics If +true+, the response includes: + # - The document count (how many documents contain this field). + # - The sum of document frequencies (the sum of document frequencies for all terms in this field). + # - The sum of total term frequencies (the sum of total term frequencies of each term in this field). Server default: true. + # @option arguments [Boolean] :offsets If +true+, the response includes term offsets. Server default: true. + # @option arguments [Boolean] :payloads If +true+, the response includes term payloads. Server default: true. + # @option arguments [Boolean] :positions If +true+, the response includes term positions. Server default: true. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # It is random by default. + # @option arguments [Boolean] :realtime If true, the request is real-time as opposed to near-real-time. Server default: true. + # @option arguments [String] :routing A custom value that is used to route operations to a specific shard. + # @option arguments [Boolean] :term_statistics If +true+, the response includes: + # - The total term frequency (how often a term occurs in all documents). + # - The document frequency (the number of documents containing the current term). + # By default these values are not returned since term statistics can have a serious performance impact. + # @option arguments [Integer] :version If +true+, returns the document version as part of a hit. + # @option arguments [String] :version_type The version type. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Define parameters and or supply a document to get termvectors for. See documentation. + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-termvectors.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-termvectors # def termvectors(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'termvectors' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -68,9 +95,9 @@ def termvectors(arguments = {}) arguments.delete(:endpoint) path = if _index && _id - "#{Utils.__listify(_index)}/_termvectors/#{Utils.__listify(_id)}" + "#{Utils.listify(_index)}/_termvectors/#{Utils.listify(_id)}" else - "#{Utils.__listify(_index)}/_termvectors" + "#{Utils.listify(_index)}/_termvectors" end params = Utils.process_params(arguments) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_field_structure.rb b/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_field_structure.rb index 8464acff6..f4137ad0a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_field_structure.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_field_structure.rb @@ -15,32 +15,95 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module TextStructure module Actions - # Finds the structure of a text field in an index. + # Find the structure of a text field. + # Find the structure of a text field in an Elasticsearch index. + # This API provides a starting point for extracting further information from log messages already ingested into Elasticsearch. + # For example, if you have ingested data into a very simple index that has just +@timestamp+ and message fields, you can use this API to see what common structure exists in the message field. + # The response from the API contains: + # * Sample messages. + # * Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields. + # * Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text. + # * Appropriate mappings for an Elasticsearch index, which you could use to ingest the text. + # All this information can be calculated by the structure finder with no guidance. + # However, you can optionally override some of the decisions about the text structure by specifying one or more query parameters. + # If the structure finder produces unexpected results, specify the +explain+ query parameter and an explanation will appear in the response. + # It helps determine why the returned structure was chosen. # - # @option arguments [String] :index The index containing the analyzed field (*Required*) - # @option arguments [String] :field The field that should be analyzed (*Required*) - # @option arguments [Integer] :documents_to_sample How many documents should be included in the analysis - # @option arguments [Time] :timeout Timeout after which the analysis will be aborted - # @option arguments [String] :format Optional parameter to specify the high level file format (options: ndjson, xml, delimited, semi_structured_text) - # @option arguments [List] :column_names Optional parameter containing a comma separated list of the column names for a delimited file - # @option arguments [String] :delimiter Optional parameter to specify the delimiter character for a delimited file - must be a single character - # @option arguments [String] :quote Optional parameter to specify the quote character for a delimited file - must be a single character - # @option arguments [Boolean] :should_trim_fields Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them - # @option arguments [String] :grok_pattern Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file - # @option arguments [String] :ecs_compatibility Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' - # @option arguments [String] :timestamp_field Optional parameter to specify the timestamp field in the file - # @option arguments [String] :timestamp_format Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format - # @option arguments [Boolean] :explain Whether to include a commentary on how the structure was derived + # @option arguments [String] :column_names If +format+ is set to +delimited+, you can specify the column names in a comma-separated list. + # If this parameter is not specified, the structure finder uses the column names from the header row of the text. + # If the text does not have a header row, columns are named "column1", "column2", "column3", for example. + # @option arguments [String] :delimiter If you have set +format+ to +delimited+, you can specify the character used to delimit the values in each row. + # Only a single character is supported; the delimiter cannot have multiple characters. + # By default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (+|+). + # In this default scenario, all rows must have the same number of fields for the delimited format to be detected. + # If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row. + # @option arguments [Integer] :documents_to_sample The number of documents to include in the structural analysis. + # The minimum value is 2. Server default: 1000. + # @option arguments [String] :ecs_compatibility The mode of compatibility with ECS compliant Grok patterns. + # Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern. + # This setting primarily has an impact when a whole message Grok pattern such as +%{CATALINALOG}+ matches the input. + # If the structure finder identifies a common structure but has no idea of the meaning then generic field names such as +path+, +ipaddress+, +field1+, and +field2+ are used in the +grok_pattern+ output. + # The intention in that situation is that a user who knows the meanings will rename the fields before using them. Server default: disabled. + # @option arguments [Boolean] :explain If +true+, the response includes a field named +explanation+, which is an array of strings that indicate how the structure finder produced its result. + # @option arguments [String] :field The field that should be analyzed. (*Required*) + # @option arguments [String] :format The high level structure of the text. + # By default, the API chooses the format. + # In this default scenario, all rows must have the same number of fields for a delimited format to be detected. + # If the format is set to delimited and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row. + # @option arguments [String] :grok_pattern If the format is +semi_structured_text+, you can specify a Grok pattern that is used to extract fields from every message in the text. + # The name of the timestamp field in the Grok pattern must match what is specified in the +timestamp_field+ parameter. + # If that parameter is not specified, the name of the timestamp field in the Grok pattern must match "timestamp". + # If +grok_pattern+ is not specified, the structure finder creates a Grok pattern. + # @option arguments [String] :index The name of the index that contains the analyzed field. (*Required*) + # @option arguments [String] :quote If the format is +delimited+, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character. + # Only a single character is supported. + # If this parameter is not specified, the default value is a double quote (+"+). + # If your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample. + # @option arguments [Boolean] :should_trim_fields If the format is +delimited+, you can specify whether values between delimiters should have whitespace trimmed from them. + # If this parameter is not specified and the delimiter is pipe (+|+), the default value is true. + # Otherwise, the default value is +false+. + # @option arguments [Time] :timeout The maximum amount of time that the structure analysis can take. + # If the analysis is still running when the timeout expires, it will be stopped. Server default: 25s. + # @option arguments [String] :timestamp_field The name of the field that contains the primary timestamp of each record in the text. + # In particular, if the text was ingested into an index, this is the field that would be used to populate the +@timestamp+ field.If the format is +semi_structured_text+, this field must match the name of the appropriate extraction in the +grok_pattern+. + # Therefore, for semi-structured text, it is best not to specify this parameter unless +grok_pattern+ is also specified.For structured text, if you specify this parameter, the field must exist within the text.If this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field. + # For structured text, it is not compulsory to have a timestamp in the text. + # @option arguments [String] :timestamp_format The Java time format of the timestamp field in the text. + # Only a subset of Java time format letter groups are supported: + # - +a+ + # - +d+ + # - +dd+ + # - +EEE+ + # - +EEEE+ + # - +H+ + # - +HH+ + # - +h+ + # - +M+ + # - +MM+ + # - +MMM+ + # - +MMMM+ + # - +mm+ + # - +ss+ + # - +XX+ + # - +XXX+ + # - +yy+ + # - +yyyy+ + # - +zzz+ + # Additionally +S+ letter groups (fractional seconds) of length one to nine are supported providing they occur after +ss+ and are separated from the +ss+ by a period (+.+), comma (+,+), or colon (+:+). + # Spacing and punctuation is also permitted with the exception a question mark (+?+), newline, and carriage return, together with literal text enclosed in single quotes. + # For example, +MM/dd HH.mm.ss,SSSSSS 'in' yyyy+ is a valid override format.One valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full +grok_pattern+. + # Another is when the timestamp format is one that the structure finder does not consider by default.If this parameter is not specified, the structure finder chooses the best format from a built-in set.If the special value +null+ is specified, the structure finder will not look for a primary timestamp in the text. + # When the format is semi-structured text, this will result in the structure finder treating the text as single-line messages. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/find-field-structure.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-text_structure # def find_field_structure(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'text_structure.find_field_structure' } @@ -48,7 +111,7 @@ def find_field_structure(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_text_structure/find_field_structure' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_message_structure.rb b/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_message_structure.rb index fcd745647..75146cb1a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_message_structure.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_message_structure.rb @@ -15,30 +15,92 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module TextStructure module Actions - # Finds the structure of a list of messages. The messages must contain data that is suitable to be ingested into Elasticsearch. + # Find the structure of text messages. + # Find the structure of a list of text messages. + # The messages must contain data that is suitable to be ingested into Elasticsearch. + # This API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality. + # Use this API rather than the find text structure API if your input text has already been split up into separate messages by some other process. + # The response from the API contains: + # * Sample messages. + # * Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields. + # * Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text. + # Appropriate mappings for an Elasticsearch index, which you could use to ingest the text. + # All this information can be calculated by the structure finder with no guidance. + # However, you can optionally override some of the decisions about the text structure by specifying one or more query parameters. + # If the structure finder produces unexpected results, specify the +explain+ query parameter and an explanation will appear in the response. + # It helps determine why the returned structure was chosen. # - # @option arguments [Time] :timeout Timeout after which the analysis will be aborted - # @option arguments [String] :format Optional parameter to specify the high level file format (options: ndjson, xml, delimited, semi_structured_text) - # @option arguments [List] :column_names Optional parameter containing a comma separated list of the column names for a delimited file - # @option arguments [String] :delimiter Optional parameter to specify the delimiter character for a delimited file - must be a single character - # @option arguments [String] :quote Optional parameter to specify the quote character for a delimited file - must be a single character - # @option arguments [Boolean] :should_trim_fields Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them - # @option arguments [String] :grok_pattern Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file - # @option arguments [String] :ecs_compatibility Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' - # @option arguments [String] :timestamp_field Optional parameter to specify the timestamp field in the file - # @option arguments [String] :timestamp_format Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format - # @option arguments [Boolean] :explain Whether to include a commentary on how the structure was derived + # @option arguments [String] :column_names If the format is +delimited+, you can specify the column names in a comma-separated list. + # If this parameter is not specified, the structure finder uses the column names from the header row of the text. + # If the text does not have a header role, columns are named "column1", "column2", "column3", for example. + # @option arguments [String] :delimiter If you the format is +delimited+, you can specify the character used to delimit the values in each row. + # Only a single character is supported; the delimiter cannot have multiple characters. + # By default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (+|+). + # In this default scenario, all rows must have the same number of fields for the delimited format to be detected. + # If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row. + # @option arguments [String] :ecs_compatibility The mode of compatibility with ECS compliant Grok patterns. + # Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern. + # This setting primarily has an impact when a whole message Grok pattern such as +%{CATALINALOG}+ matches the input. + # If the structure finder identifies a common structure but has no idea of meaning then generic field names such as +path+, +ipaddress+, +field1+, and +field2+ are used in the +grok_pattern+ output, with the intention that a user who knows the meanings rename these fields before using it. Server default: disabled. + # @option arguments [Boolean] :explain If this parameter is set to true, the response includes a field named +explanation+, which is an array of strings that indicate how the structure finder produced its result. + # @option arguments [String] :format The high level structure of the text. + # By default, the API chooses the format. + # In this default scenario, all rows must have the same number of fields for a delimited format to be detected. + # If the format is +delimited+ and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row. + # @option arguments [String] :grok_pattern If the format is +semi_structured_text+, you can specify a Grok pattern that is used to extract fields from every message in the text. + # The name of the timestamp field in the Grok pattern must match what is specified in the +timestamp_field+ parameter. + # If that parameter is not specified, the name of the timestamp field in the Grok pattern must match "timestamp". + # If +grok_pattern+ is not specified, the structure finder creates a Grok pattern. + # @option arguments [String] :quote If the format is +delimited+, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character. + # Only a single character is supported. + # If this parameter is not specified, the default value is a double quote (+"+). + # If your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample. + # @option arguments [Boolean] :should_trim_fields If the format is +delimited+, you can specify whether values between delimiters should have whitespace trimmed from them. + # If this parameter is not specified and the delimiter is pipe (+|+), the default value is true. + # Otherwise, the default value is +false+. + # @option arguments [Time] :timeout The maximum amount of time that the structure analysis can take. + # If the analysis is still running when the timeout expires, it will be stopped. Server default: 25s. + # @option arguments [String] :timestamp_field The name of the field that contains the primary timestamp of each record in the text. + # In particular, if the text was ingested into an index, this is the field that would be used to populate the +@timestamp+ field.If the format is +semi_structured_text+, this field must match the name of the appropriate extraction in the +grok_pattern+. + # Therefore, for semi-structured text, it is best not to specify this parameter unless +grok_pattern+ is also specified.For structured text, if you specify this parameter, the field must exist within the text.If this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field. + # For structured text, it is not compulsory to have a timestamp in the text. + # @option arguments [String] :timestamp_format The Java time format of the timestamp field in the text. + # Only a subset of Java time format letter groups are supported: + # - +a+ + # - +d+ + # - +dd+ + # - +EEE+ + # - +EEEE+ + # - +H+ + # - +HH+ + # - +h+ + # - +M+ + # - +MM+ + # - +MMM+ + # - +MMMM+ + # - +mm+ + # - +ss+ + # - +XX+ + # - +XXX+ + # - +yy+ + # - +yyyy+ + # - +zzz+ + # Additionally +S+ letter groups (fractional seconds) of length one to nine are supported providing they occur after +ss+ and are separated from the +ss+ by a period (+.+), comma (+,+), or colon (+:+). + # Spacing and punctuation is also permitted with the exception a question mark (+?+), newline, and carriage return, together with literal text enclosed in single quotes. + # For example, +MM/dd HH.mm.ss,SSSSSS 'in' yyyy+ is a valid override format.One valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full +grok_pattern+. + # Another is when the timestamp format is one that the structure finder does not consider by default.If this parameter is not specified, the structure finder chooses the best format from a built-in set.If the special value +null+ is specified, the structure finder will not look for a primary timestamp in the text. + # When the format is semi-structured text, this will result in the structure finder treating the text as single-line messages. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body JSON object with one field [messages], containing an array of messages to be analyzed (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/find-message-structure.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-find-message-structure # def find_message_structure(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'text_structure.find_message_structure' } @@ -48,7 +110,7 @@ def find_message_structure(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_text_structure/find_message_structure' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_structure.rb b/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_structure.rb index 099d91ebc..6eef39943 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_structure.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/find_structure.rb @@ -15,34 +15,106 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module TextStructure module Actions - # Finds the structure of a text file. The text file must contain data that is suitable to be ingested into Elasticsearch. + # Find the structure of a text file. + # The text file must contain data that is suitable to be ingested into Elasticsearch. + # This API provides a starting point for ingesting data into Elasticsearch in a format that is suitable for subsequent use with other Elastic Stack functionality. + # Unlike other Elasticsearch endpoints, the data that is posted to this endpoint does not need to be UTF-8 encoded and in JSON format. + # It must, however, be text; binary text formats are not currently supported. + # The size is limited to the Elasticsearch HTTP receive buffer size, which defaults to 100 Mb. + # The response from the API contains: + # * A couple of messages from the beginning of the text. + # * Statistics that reveal the most common values for all fields detected within the text and basic numeric statistics for numeric fields. + # * Information about the structure of the text, which is useful when you write ingest configurations to index it or similarly formatted text. + # * Appropriate mappings for an Elasticsearch index, which you could use to ingest the text. + # All this information can be calculated by the structure finder with no guidance. + # However, you can optionally override some of the decisions about the text structure by specifying one or more query parameters. # - # @option arguments [Integer] :lines_to_sample How many lines of the file should be included in the analysis - # @option arguments [Integer] :line_merge_size_limit Maximum number of characters permitted in a single message when lines are merged to create messages. - # @option arguments [Time] :timeout Timeout after which the analysis will be aborted - # @option arguments [String] :charset Optional parameter to specify the character set of the file - # @option arguments [String] :format Optional parameter to specify the high level file format (options: ndjson, xml, delimited, semi_structured_text) - # @option arguments [Boolean] :has_header_row Optional parameter to specify whether a delimited file includes the column names in its first row - # @option arguments [List] :column_names Optional parameter containing a comma separated list of the column names for a delimited file - # @option arguments [String] :delimiter Optional parameter to specify the delimiter character for a delimited file - must be a single character - # @option arguments [String] :quote Optional parameter to specify the quote character for a delimited file - must be a single character - # @option arguments [Boolean] :should_trim_fields Optional parameter to specify whether the values between delimiters in a delimited file should have whitespace trimmed from them - # @option arguments [String] :grok_pattern Optional parameter to specify the Grok pattern that should be used to extract fields from messages in a semi-structured text file - # @option arguments [String] :ecs_compatibility Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' - # @option arguments [String] :timestamp_field Optional parameter to specify the timestamp field in the file - # @option arguments [String] :timestamp_format Optional parameter to specify the timestamp format in the file - may be either a Joda or Java time format - # @option arguments [Boolean] :explain Whether to include a commentary on how the structure was derived + # @option arguments [String] :charset The text's character set. + # It must be a character set that is supported by the JVM that Elasticsearch uses. + # For example, +UTF-8+, +UTF-16LE+, +windows-1252+, or +EUC-JP+. + # If this parameter is not specified, the structure finder chooses an appropriate character set. + # @option arguments [String] :column_names If you have set format to +delimited+, you can specify the column names in a comma-separated list. + # If this parameter is not specified, the structure finder uses the column names from the header row of the text. + # If the text does not have a header role, columns are named "column1", "column2", "column3", for example. + # @option arguments [String] :delimiter If you have set +format+ to +delimited+, you can specify the character used to delimit the values in each row. + # Only a single character is supported; the delimiter cannot have multiple characters. + # By default, the API considers the following possibilities: comma, tab, semi-colon, and pipe (+|+). + # In this default scenario, all rows must have the same number of fields for the delimited format to be detected. + # If you specify a delimiter, up to 10% of the rows can have a different number of columns than the first row. + # @option arguments [String] :ecs_compatibility The mode of compatibility with ECS compliant Grok patterns. + # Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern. + # Valid values are +disabled+ and +v1+. + # This setting primarily has an impact when a whole message Grok pattern such as +%{CATALINALOG}+ matches the input. + # If the structure finder identifies a common structure but has no idea of meaning then generic field names such as +path+, +ipaddress+, +field1+, and +field2+ are used in the +grok_pattern+ output, with the intention that a user who knows the meanings rename these fields before using it. Server default: disabled. + # @option arguments [Boolean] :explain If this parameter is set to +true+, the response includes a field named explanation, which is an array of strings that indicate how the structure finder produced its result. + # If the structure finder produces unexpected results for some text, use this query parameter to help you determine why the returned structure was chosen. + # @option arguments [String] :format The high level structure of the text. + # Valid values are +ndjson+, +xml+, +delimited+, and +semi_structured_text+. + # By default, the API chooses the format. + # In this default scenario, all rows must have the same number of fields for a delimited format to be detected. + # If the format is set to +delimited+ and the delimiter is not set, however, the API tolerates up to 5% of rows that have a different number of columns than the first row. + # @option arguments [String] :grok_pattern If you have set +format+ to +semi_structured_text+, you can specify a Grok pattern that is used to extract fields from every message in the text. + # The name of the timestamp field in the Grok pattern must match what is specified in the +timestamp_field+ parameter. + # If that parameter is not specified, the name of the timestamp field in the Grok pattern must match "timestamp". + # If +grok_pattern+ is not specified, the structure finder creates a Grok pattern. + # @option arguments [Boolean] :has_header_row If you have set +format+ to +delimited+, you can use this parameter to indicate whether the column names are in the first row of the text. + # If this parameter is not specified, the structure finder guesses based on the similarity of the first row of the text to other rows. + # @option arguments [Integer] :line_merge_size_limit The maximum number of characters in a message when lines are merged to form messages while analyzing semi-structured text. + # If you have extremely long messages you may need to increase this, but be aware that this may lead to very long processing times if the way to group lines into messages is misdetected. Server default: 10000. + # @option arguments [Integer] :lines_to_sample The number of lines to include in the structural analysis, starting from the beginning of the text. + # The minimum is 2. + # If the value of this parameter is greater than the number of lines in the text, the analysis proceeds (as long as there are at least two lines in the text) for all of the lines.NOTE: The number of lines and the variation of the lines affects the speed of the analysis. + # For example, if you upload text where the first 1000 lines are all variations on the same message, the analysis will find more commonality than would be seen with a bigger sample. + # If possible, however, it is more efficient to upload sample text with more variety in the first 1000 lines than to request analysis of 100000 lines to achieve some variety. Server default: 1000. + # @option arguments [String] :quote If you have set +format+ to +delimited+, you can specify the character used to quote the values in each row if they contain newlines or the delimiter character. + # Only a single character is supported. + # If this parameter is not specified, the default value is a double quote (+"+). + # If your delimited text format does not use quoting, a workaround is to set this argument to a character that does not appear anywhere in the sample. + # @option arguments [Boolean] :should_trim_fields If you have set +format+ to +delimited+, you can specify whether values between delimiters should have whitespace trimmed from them. + # If this parameter is not specified and the delimiter is pipe (+|+), the default value is +true+. + # Otherwise, the default value is +false+. + # @option arguments [Time] :timeout The maximum amount of time that the structure analysis can take. + # If the analysis is still running when the timeout expires then it will be stopped. Server default: 25s. + # @option arguments [String] :timestamp_field The name of the field that contains the primary timestamp of each record in the text. + # In particular, if the text were ingested into an index, this is the field that would be used to populate the +@timestamp+ field.If the +format+ is +semi_structured_text+, this field must match the name of the appropriate extraction in the +grok_pattern+. + # Therefore, for semi-structured text, it is best not to specify this parameter unless +grok_pattern+ is also specified.For structured text, if you specify this parameter, the field must exist within the text.If this parameter is not specified, the structure finder makes a decision about which field (if any) is the primary timestamp field. + # For structured text, it is not compulsory to have a timestamp in the text. + # @option arguments [String] :timestamp_format The Java time format of the timestamp field in the text.Only a subset of Java time format letter groups are supported: + # - +a+ + # - +d+ + # - +dd+ + # - +EEE+ + # - +EEEE+ + # - +H+ + # - +HH+ + # - +h+ + # - +M+ + # - +MM+ + # - +MMM+ + # - +MMMM+ + # - +mm+ + # - +ss+ + # - +XX+ + # - +XXX+ + # - +yy+ + # - +yyyy+ + # - +zzz+ + # Additionally +S+ letter groups (fractional seconds) of length one to nine are supported providing they occur after +ss+ and separated from the +ss+ by a +.+, +,+ or +:+. + # Spacing and punctuation is also permitted with the exception of +?+, newline and carriage return, together with literal text enclosed in single quotes. + # For example, +MM/dd HH.mm.ss,SSSSSS 'in' yyyy+ is a valid override format.One valuable use case for this parameter is when the format is semi-structured text, there are multiple timestamp formats in the text, and you know which format corresponds to the primary timestamp, but you do not want to specify the full +grok_pattern+. + # Another is when the timestamp format is one that the structure finder does not consider by default.If this parameter is not specified, the structure finder chooses the best format from a built-in set.If the special value +null+ is specified the structure finder will not look for a primary timestamp in the text. + # When the format is semi-structured text this will result in the structure finder treating the text as single-line messages. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The contents of the file to be analyzed (*Required*) + # @option arguments [Hash] :body text_files # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/find-structure.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-find-structure # def find_structure(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'text_structure.find_structure' } @@ -52,14 +124,14 @@ def find_structure(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_text_structure/find_structure' params = Utils.process_params(arguments) payload = if body.is_a? Array - Elasticsearch::API::Utils.__bulkify(body) + Elasticsearch::API::Utils.bulkify(body) else body end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/test_grok_pattern.rb b/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/test_grok_pattern.rb index 49fad35ec..4de2efc11 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/test_grok_pattern.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/text_structure/test_grok_pattern.rb @@ -15,20 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module TextStructure module Actions - # Tests a Grok pattern on some text. + # Test a Grok pattern. + # Test a Grok pattern on one or more lines of text. + # The API indicates whether the lines match the pattern together with the offsets and lengths of the matched substrings. # - # @option arguments [String] :ecs_compatibility Optional parameter to specify the compatibility mode with ECS Grok patterns - may be either 'v1' or 'disabled' + # @option arguments [String] :ecs_compatibility The mode of compatibility with ECS compliant Grok patterns. + # Use this parameter to specify whether to use ECS Grok patterns instead of legacy ones when the structure finder creates a Grok pattern. + # Valid values are +disabled+ and +v1+. Server default: disabled. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The Grok pattern and text. (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/test-grok-pattern.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-text-structure-test-grok-pattern # def test_grok_pattern(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'text_structure.test_grok_pattern' } @@ -38,7 +42,7 @@ def test_grok_pattern(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_POST path = '_text_structure/test_grok_pattern' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/delete_transform.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/delete_transform.rb index 9bf20808c..6ab9705f5 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/delete_transform.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/delete_transform.rb @@ -15,22 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions - # Deletes an existing transform. + # Delete a transform. # - # @option arguments [String] :transform_id The id of the transform to delete - # @option arguments [Boolean] :force When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted. - # @option arguments [Boolean] :delete_dest_index When `true`, the destination index is deleted together with the transform. The default value is `false`, meaning that the destination index will not be deleted. - # @option arguments [Time] :timeout Controls the time to wait for the transform deletion + # @option arguments [String] :transform_id Identifier for the transform. (*Required*) + # @option arguments [Boolean] :force If this value is false, the transform must be stopped before it can be deleted. If true, the transform is + # deleted regardless of its current state. + # @option arguments [Boolean] :delete_dest_index If this value is true, the destination index is deleted together with the transform. If false, the destination + # index will not be deleted + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/delete-transform.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-delete-transform # def delete_transform(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.delete_transform' } @@ -50,7 +52,7 @@ def delete_transform(arguments = {}) _transform_id = arguments.delete(:transform_id) method = Elasticsearch::API::HTTP_DELETE - path = "_transform/#{Utils.__listify(_transform_id)}" + path = "_transform/#{Utils.listify(_transform_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_node_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_node_stats.rb index 69d76d747..26ac55beb 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_node_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_node_stats.rb @@ -15,8 +15,8 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API @@ -34,9 +34,14 @@ def get_node_stats(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = arguments.delete(:body) + + method = if body + Elasticsearch::API::HTTP_POST + else + Elasticsearch::API::HTTP_GET + end - method = Elasticsearch::API::HTTP_GET path = '_transform/_node_stats' params = {} diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_transform.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_transform.rb index 5065124f1..938d5792b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_transform.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_transform.rb @@ -15,23 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions - # Retrieves configuration information for transforms. + # Get transforms. + # Get configuration information for transforms. # - # @option arguments [String] :transform_id The id or comma delimited list of id expressions of the transforms to get, '_all' or '*' implies get all transforms - # @option arguments [Integer] :from skips a number of transform configs, defaults to 0 - # @option arguments [Integer] :size specifies a max number of transforms to get, defaults to 100 - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) - # @option arguments [Boolean] :exclude_generated Omits fields that are illegal to set on transform PUT + # @option arguments [String, Array] :transform_id Identifier for the transform. It can be a transform identifier or a + # wildcard expression. You can get information for all transforms by using + # +_all+, by specifying +*+ as the ++, or by omitting the + # ++. + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no transforms that match. + # - Contains the _all string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # If this parameter is false, the request returns a 404 status code when + # there are no matches or only partial matches. Server default: true. + # @option arguments [Integer] :from Skips the specified number of transforms. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of transforms to obtain. Server default: 100. + # @option arguments [Boolean] :exclude_generated Excludes fields that were automatically added when creating the + # transform. This allows the configuration to be in an acceptable format to + # be retrieved and then added to another cluster. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform # def get_transform(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.get_transform' } @@ -50,7 +61,7 @@ def get_transform(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _transform_id - "_transform/#{Utils.__listify(_transform_id)}" + "_transform/#{Utils.listify(_transform_id)}" else '_transform' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_transform_stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_transform_stats.rb index abdf7014d..4cbe67f41 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_transform_stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/get_transform_stats.rb @@ -15,23 +15,32 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions - # Retrieves usage information for transforms. + # Get transform stats. + # Get usage information for transforms. # - # @option arguments [String] :transform_id The id of the transform for which to get stats. '_all' or '*' implies all transforms - # @option arguments [Number] :from skips a number of transform stats, defaults to 0 - # @option arguments [Number] :size specifies a max number of transform stats to get, defaults to 100 + # @option arguments [String, Array] :transform_id Identifier for the transform. It can be a transform identifier or a + # wildcard expression. You can get information for all transforms by using + # +_all+, by specifying +*+ as the ++, or by omitting the + # ++. (*Required*) + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: + # - Contains wildcard expressions and there are no transforms that match. + # - Contains the _all string or no identifiers and there are no matches. + # - Contains wildcard expressions and there are only partial matches. + # If this parameter is false, the request returns a 404 status code when + # there are no matches or only partial matches. Server default: true. + # @option arguments [Integer] :from Skips the specified number of transforms. Server default: 0. + # @option arguments [Integer] :size Specifies the maximum number of transforms to obtain. Server default: 100. # @option arguments [Time] :timeout Controls the time to wait for the stats - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/get-transform-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-get-transform-stats # def get_transform_stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.get_transform_stats' } @@ -51,7 +60,7 @@ def get_transform_stats(arguments = {}) _transform_id = arguments.delete(:transform_id) method = Elasticsearch::API::HTTP_GET - path = "_transform/#{Utils.__listify(_transform_id)}/_stats" + path = "_transform/#{Utils.listify(_transform_id)}/_stats" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/preview_transform.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/preview_transform.rb index 8ab4f59a7..61ebee6a9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/preview_transform.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/preview_transform.rb @@ -15,21 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions - # Previews a transform. + # Preview a transform. + # Generates a preview of the results that you will get when you create a transform with the same configuration. + # It returns a maximum of 100 results. The calculations are based on all the current data in the source index. It also + # generates a list of mappings and settings for the destination index. These values are determined based on the field + # types of the source index and the transform aggregations. # - # @option arguments [String] :transform_id The id of the transform to preview. - # @option arguments [Time] :timeout Controls the time to wait for the preview + # @option arguments [String] :transform_id Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform + # configuration details in the request body. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the + # timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The definition for the transform to preview + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/preview-transform.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-preview-transform # def preview_transform(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.preview_transform' } @@ -52,11 +58,11 @@ def preview_transform(arguments = {}) Elasticsearch::API::HTTP_GET end - path = if _transform_id - "_transform/#{Utils.__listify(_transform_id)}/_preview" - else - '_transform/_preview' - end + path = if _transform_id + "_transform/#{Utils.listify(_transform_id)}/_preview" + else + '_transform/_preview' + end params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/put_transform.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/put_transform.rb index 222912fe2..3c96caf5c 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/put_transform.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/put_transform.rb @@ -15,22 +15,44 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions - # Instantiates a transform. + # Create a transform. + # Creates a transform. + # A transform copies data from source indices, transforms it, and persists it into an entity-centric destination index. You can also think of the destination index as a two-dimensional tabular data structure (known as + # a data frame). The ID for each document in the data frame is generated from a hash of the entity, so there is a + # unique row per entity. + # You must choose either the latest or pivot method for your transform; you cannot use both in a single transform. If + # you choose to use the pivot method for your transform, the entities are defined by the set of +group_by+ fields in + # the pivot object. If you choose to use the latest method, the entities are defined by the +unique_key+ field values + # in the latest object. + # You must have +create_index+, +index+, and +read+ privileges on the destination index and +read+ and + # +view_index_metadata+ privileges on the source indices. When Elasticsearch security features are enabled, the + # transform remembers which roles the user that created it had at the time of creation and uses those same roles. If + # those roles do not have the required privileges on the source and destination indices, the transform fails when it + # attempts unauthorized operations. + # NOTE: You must use Kibana or this API to create a transform. Do not add a transform directly into any + # +.transform-internal*+ indices using the Elasticsearch index API. If Elasticsearch security features are enabled, do + # not give users any privileges on +.transform-internal*+ indices. If you used transforms prior to 7.5, also do not + # give users any privileges on +.data-frame-internal*+ indices. # - # @option arguments [String] :transform_id The id of the new transform. - # @option arguments [Boolean] :defer_validation If validations should be deferred until transform starts, defaults to false. - # @option arguments [Time] :timeout Controls the time to wait for the transform to start + # @option arguments [String] :transform_id Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), + # hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (*Required*) + # @option arguments [Boolean] :defer_validation When the transform is created, a series of validations occur to ensure its success. For example, there is a + # check for the existence of the source indices and a check that the destination index is not part of the source + # index pattern. You can use this parameter to skip the checks, for example when the source index does not exist + # until after the transform is created. The validations are always run when you start the transform, however, with + # the exception of privilege checks. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The transform definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/put-transform.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-put-transform # def put_transform(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.put_transform' } @@ -51,7 +73,7 @@ def put_transform(arguments = {}) _transform_id = arguments.delete(:transform_id) method = Elasticsearch::API::HTTP_PUT - path = "_transform/#{Utils.__listify(_transform_id)}" + path = "_transform/#{Utils.listify(_transform_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/reset_transform.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/reset_transform.rb index dab3b5e94..75424a0a0 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/reset_transform.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/reset_transform.rb @@ -15,21 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions - # Resets an existing transform. + # Reset a transform. + # Before you can reset it, you must stop it; alternatively, use the +force+ query parameter. + # If the destination index was created by the transform, it is deleted. # - # @option arguments [String] :transform_id The id of the transform to reset - # @option arguments [Boolean] :force When `true`, the transform is reset regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be reset. - # @option arguments [Time] :timeout Controls the time to wait for the transform to reset + # @option arguments [String] :transform_id Identifier for the transform. This identifier can contain lowercase alphanumeric characters (a-z and 0-9), + # hyphens, and underscores. It has a 64 character limit and must start and end with alphanumeric characters. (*Required*) + # @option arguments [Boolean] :force If this value is +true+, the transform is reset regardless of its current state. If it's +false+, the transform + # must be stopped before it can be reset. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/reset-transform.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-reset-transform # def reset_transform(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.reset_transform' } @@ -49,7 +53,7 @@ def reset_transform(arguments = {}) _transform_id = arguments.delete(:transform_id) method = Elasticsearch::API::HTTP_POST - path = "_transform/#{Utils.__listify(_transform_id)}/_reset" + path = "_transform/#{Utils.listify(_transform_id)}/_reset" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/schedule_now_transform.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/schedule_now_transform.rb index 74716246b..0210cf500 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/schedule_now_transform.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/schedule_now_transform.rb @@ -15,20 +15,25 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions - # Schedules now a transform. + # Schedule a transform to start now. + # Instantly run a transform to process data. + # If you run this API, the transform will process the new data instantly, + # without waiting for the configured frequency interval. After the API is called, + # the transform will be processed again at +now + frequency+ unless the API + # is called again in the meantime. # - # @option arguments [String] :transform_id The id of the transform. (*Required*) - # @option arguments [Time] :timeout Controls the time to wait for the scheduling to take place + # @option arguments [String] :transform_id Identifier for the transform. (*Required*) + # @option arguments [Time] :timeout Controls the time to wait for the scheduling to take place Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/schedule-now-transform.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-schedule-now-transform # def schedule_now_transform(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.schedule_now_transform' } @@ -48,7 +53,7 @@ def schedule_now_transform(arguments = {}) _transform_id = arguments.delete(:transform_id) method = Elasticsearch::API::HTTP_POST - path = "_transform/#{Utils.__listify(_transform_id)}/_schedule_now" + path = "_transform/#{Utils.listify(_transform_id)}/_schedule_now" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/start_transform.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/start_transform.rb index 4f18b6a0b..ab098407b 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/start_transform.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/start_transform.rb @@ -15,21 +15,34 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions - # Starts one or more transforms. + # Start a transform. + # When you start a transform, it creates the destination index if it does not already exist. The +number_of_shards+ is + # set to +1+ and the +auto_expand_replicas+ is set to +0-1+. If it is a pivot transform, it deduces the mapping + # definitions for the destination index from the source indices and the transform aggregations. If fields in the + # destination index are derived from scripts (as in the case of +scripted_metric+ or +bucket_script+ aggregations), + # the transform uses dynamic mappings unless an index template exists. If it is a latest transform, it does not deduce + # mapping definitions; it uses dynamic mappings. To use explicit mappings, create the destination index before you + # start the transform. Alternatively, you can create an index template, though it does not affect the deduced mappings + # in a pivot transform. + # When the transform starts, a series of validations occur to ensure its success. If you deferred validation when you + # created the transform, they occur when you start the transform—​with the exception of privilege checks. When + # Elasticsearch security features are enabled, the transform remembers which roles the user that created it had at the + # time of creation and uses those same roles. If those roles do not have the required privileges on the source and + # destination indices, the transform fails when it attempts unauthorized operations. # - # @option arguments [String] :transform_id The id of the transform to start - # @option arguments [String] :from Restricts the set of transformed entities to those changed after this time - # @option arguments [Time] :timeout Controls the time to wait for the transform to start + # @option arguments [String] :transform_id Identifier for the transform. (*Required*) + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Server default: 30s. + # @option arguments [String] :from Restricts the set of transformed entities to those changed after this time. Relative times like now-30d are supported. Only applicable for continuous transforms. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/start-transform.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-start-transform # def start_transform(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.start_transform' } @@ -49,7 +62,7 @@ def start_transform(arguments = {}) _transform_id = arguments.delete(:transform_id) method = Elasticsearch::API::HTTP_POST - path = "_transform/#{Utils.__listify(_transform_id)}/_start" + path = "_transform/#{Utils.listify(_transform_id)}/_start" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/stop_transform.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/stop_transform.rb index 00a4c4135..281cda5b6 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/stop_transform.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/stop_transform.rb @@ -15,24 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions + # Stop transforms. # Stops one or more transforms. # - # @option arguments [String] :transform_id The id of the transform to stop - # @option arguments [Boolean] :force Whether to force stop a failed transform or not. Default to false - # @option arguments [Boolean] :wait_for_completion Whether to wait for the transform to fully stop before returning or not. Default to false - # @option arguments [Time] :timeout Controls the time to wait until the transform has stopped. Default to 30 seconds - # @option arguments [Boolean] :allow_no_match Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified) - # @option arguments [Boolean] :wait_for_checkpoint Whether to wait for the transform to reach a checkpoint before stopping. Default to false + # @option arguments [String] :transform_id Identifier for the transform. To stop multiple transforms, use a comma-separated list or a wildcard expression. + # To stop all transforms, use +_all+ or +*+ as the identifier. (*Required*) + # @option arguments [Boolean] :allow_no_match Specifies what to do when the request: contains wildcard expressions and there are no transforms that match; + # contains the +_all+ string or no identifiers and there are no matches; contains wildcard expressions and there + # are only partial matches.If it is true, the API returns a successful acknowledgement message when there are no matches. When there are + # only partial matches, the API stops the appropriate transforms.If it is false, the request returns a 404 status code when there are no matches or only partial matches. Server default: true. + # @option arguments [Boolean] :force If it is true, the API forcefully stops the transforms. + # @option arguments [Time] :timeout Period to wait for a response when +wait_for_completion+ is +true+. If no response is received before the + # timeout expires, the request returns a timeout exception. However, the request continues processing and + # eventually moves the transform to a STOPPED state. Server default: 30s. + # @option arguments [Boolean] :wait_for_checkpoint If it is true, the transform does not completely stop until the current checkpoint is completed. If it is false, + # the transform stops as soon as possible. + # @option arguments [Boolean] :wait_for_completion If it is true, the API blocks until the indexer state completely stops. If it is false, the API returns + # immediately and the indexer is stopped asynchronously in the background. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/stop-transform.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform # def stop_transform(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.stop_transform' } @@ -52,7 +61,7 @@ def stop_transform(arguments = {}) _transform_id = arguments.delete(:transform_id) method = Elasticsearch::API::HTTP_POST - path = "_transform/#{Utils.__listify(_transform_id)}/_stop" + path = "_transform/#{Utils.listify(_transform_id)}/_stop" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/update_transform.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/update_transform.rb index 44e04a7ee..6ab8a3c88 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/update_transform.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/update_transform.rb @@ -15,22 +15,31 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions + # Update a transform. # Updates certain properties of a transform. + # All updated properties except +description+ do not take effect until after the transform starts the next checkpoint, + # thus there is data consistency in each checkpoint. To use this API, you must have +read+ and +view_index_metadata+ + # privileges for the source indices. You must also have +index+ and +read+ privileges for the destination index. When + # Elasticsearch security features are enabled, the transform remembers which roles the user who updated it had at the + # time of update and runs with those privileges. # - # @option arguments [String] :transform_id The id of the transform. (*Required*) - # @option arguments [Boolean] :defer_validation If validations should be deferred until transform starts, defaults to false. - # @option arguments [Time] :timeout Controls the time to wait for the update + # @option arguments [String] :transform_id Identifier for the transform. (*Required*) + # @option arguments [Boolean] :defer_validation When true, deferrable validations are not run. This behavior may be + # desired if the source index does not exist until after the transform is + # created. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the + # timeout expires, the request fails and returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The update transform definition (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/update-transform.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-update-transform # def update_transform(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.update_transform' } @@ -51,7 +60,7 @@ def update_transform(arguments = {}) _transform_id = arguments.delete(:transform_id) method = Elasticsearch::API::HTTP_POST - path = "_transform/#{Utils.__listify(_transform_id)}/_update" + path = "_transform/#{Utils.listify(_transform_id)}/_update" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/transform/upgrade_transforms.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/upgrade_transforms.rb index b2d1a84cd..31c430ce5 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/transform/upgrade_transforms.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/upgrade_transforms.rb @@ -15,20 +15,32 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Transform module Actions - # Upgrades all transforms. + # Upgrade all transforms. + # Transforms are compatible across minor versions and between supported major versions. + # However, over time, the format of transform configuration information may change. + # This API identifies transforms that have a legacy configuration format and upgrades them to the latest version. + # It also cleans up the internal data structures that store the transform state and checkpoints. + # The upgrade does not affect the source and destination indices. + # The upgrade also does not affect the roles that transforms use when Elasticsearch security features are enabled; the role used to read source data and write to the destination index remains unchanged. + # If a transform upgrade step fails, the upgrade stops and an error is returned about the underlying issue. + # Resolve the issue then re-run the process again. + # A summary is returned when the upgrade is finished. + # To ensure continuous transforms remain running during a major version upgrade of the cluster – for example, from 7.16 to 8.0 – it is recommended to upgrade transforms before upgrading the cluster. + # You may want to perform a recent cluster backup prior to the upgrade. # - # @option arguments [Boolean] :dry_run Whether to only check for updates but don't execute - # @option arguments [Time] :timeout Controls the time to wait for the upgrade + # @option arguments [Boolean] :dry_run When true, the request checks for updates but does not run them. + # @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and + # returns an error. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/upgrade-transforms.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-upgrade-transforms # def upgrade_transforms(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'transform.upgrade_transforms' } @@ -36,7 +48,7 @@ def upgrade_transforms(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_transform/_upgrade' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/update.rb b/elasticsearch-api/lib/elasticsearch/api/actions/update.rb index 1454a5e59..ece85b95f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/update.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/update.rb @@ -15,38 +15,58 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Updates a document with a script or partial document. + # Update a document. + # Update a document by running a script or passing a partial document. + # If the Elasticsearch security features are enabled, you must have the +index+ or +write+ index privilege for the target index or index alias. + # The script can update, delete, or skip modifying the document. + # The API also supports passing a partial document, which is merged into the existing document. + # To fully replace an existing document, use the index API. + # This operation: + # * Gets the document (collocated with the shard) from the index. + # * Runs the specified script. + # * Indexes the result. + # The document must still be reindexed, but using this API removes some network roundtrips and reduces chances of version conflicts between the GET and the index operation. + # The +_source+ field must be enabled to use this API. + # In addition to +_source+, you can access the following variables through the +ctx+ map: +_index+, +_type+, +_id+, +_version+, +_routing+, and +_now+ (the current timestamp). # - # @option arguments [String] :id Document ID - # @option arguments [String] :index The name of the index - # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the update operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - # @option arguments [List] :_source True or false to return the _source field or not, or a list of fields to return - # @option arguments [List] :_source_excludes A list of fields to exclude from the returned _source field - # @option arguments [List] :_source_includes A list of fields to extract and return from the _source field - # @option arguments [String] :lang The script language (default: painless) - # @option arguments [String] :refresh If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes. (options: true, false, wait_for) - # @option arguments [Number] :retry_on_conflict Specify how many times should the operation be retried when a conflict occurs (default: 0) - # @option arguments [String] :routing Specific routing value - # @option arguments [Time] :timeout Explicit operation timeout - # @option arguments [Number] :if_seq_no only perform the update operation if the last operation that has changed the document has the specified sequence number - # @option arguments [Number] :if_primary_term only perform the update operation if the last operation that has changed the document has the specified primary term - # @option arguments [Boolean] :require_alias When true, requires destination is an alias. Default is false - # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Defaults to true. + # @option arguments [String] :id A unique identifier for the document to be updated. (*Required*) + # @option arguments [String] :index The name of the target index. + # By default, the index is created automatically if it doesn't exist. (*Required*) + # @option arguments [Integer] :if_primary_term Only perform the operation if the document has this primary term. + # @option arguments [Integer] :if_seq_no Only perform the operation if the document has this sequence number. + # @option arguments [Boolean] :include_source_on_error True or false if to include the document source in the error message in case of parsing errors. Server default: true. + # @option arguments [String] :lang The script language. Server default: painless. + # @option arguments [String] :refresh If 'true', Elasticsearch refreshes the affected shards to make this operation visible to search. + # If 'wait_for', it waits for a refresh to make this operation visible to search. + # If 'false', it does nothing with refreshes. Server default: false. + # @option arguments [Boolean] :require_alias If +true+, the destination must be an index alias. + # @option arguments [Integer] :retry_on_conflict The number of times the operation should be retried when a conflict occurs. Server default: 0. + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Time] :timeout The period to wait for the following operations: dynamic mapping updates and waiting for active shards. + # Elasticsearch waits for at least the timeout period before failing. + # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m. + # @option arguments [Integer, String] :wait_for_active_shards The number of copies of each shard that must be active before proceeding with the operation. + # Set to 'all' or any positive integer up to the total number of shards in the index (+number_of_replicas++1). + # The default value of +1+ means it waits for each primary shard to be active. Server default: 1. + # @option arguments [Boolean, String, Array] :_source If +false+, source retrieval is turned off. + # You can also specify a comma-separated list of the fields you want to retrieve. Server default: true. + # @option arguments [String, Array] :_source_excludes The source fields you want to exclude. + # @option arguments [String, Array] :_source_includes The source fields you want to retrieve. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The request definition requires either `script` or partial `doc` (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update # def update(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'update' } - defined_params = %i[index id].each_with_object({}) do |variable, set_variables| + defined_params = [:index, :id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -65,11 +85,11 @@ def update(arguments = {}) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_update/#{Utils.__listify(_id)}" + path = "#{Utils.listify(_index)}/_update/#{Utils.listify(_id)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/update_by_query.rb b/elasticsearch-api/lib/elasticsearch/api/actions/update_by_query.rb index fb65ca356..d61bbfb99 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/update_by_query.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/update_by_query.rb @@ -15,51 +15,142 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Performs an update on every document in the index without changing the source, - # for example to pick up a mapping change. + # Update documents. + # Updates documents that match the specified query. + # If no query is specified, performs an update on every document in the data stream or index without modifying the source, which is useful for picking up mapping changes. + # If the Elasticsearch security features are enabled, you must have the following index privileges for the target data stream, index, or alias: + # * +read+ + # * +index+ or +write+ + # You can specify the query criteria in the request URI or the request body using the same syntax as the search API. + # When you submit an update by query request, Elasticsearch gets a snapshot of the data stream or index when it begins processing the request and updates matching documents using internal versioning. + # When the versions match, the document is updated and the version number is incremented. + # If a document changes between the time that the snapshot is taken and the update operation is processed, it results in a version conflict and the operation fails. + # You can opt to count version conflicts instead of halting and returning by setting +conflicts+ to +proceed+. + # Note that if you opt to count version conflicts, the operation could attempt to update more documents from the source than +max_docs+ until it has successfully updated +max_docs+ documents or it has gone through every document in the source query. + # NOTE: Documents with a version equal to 0 cannot be updated using update by query because internal versioning does not support 0 as a valid version number. + # While processing an update by query request, Elasticsearch performs multiple search requests sequentially to find all of the matching documents. + # A bulk update request is performed for each batch of matching documents. + # Any query or update failures cause the update by query request to fail and the failures are shown in the response. + # Any update requests that completed successfully still stick, they are not rolled back. + # **Throttling update requests** + # To control the rate at which update by query issues batches of update operations, you can set +requests_per_second+ to any positive decimal number. + # This pads each batch with a wait time to throttle the rate. + # Set +requests_per_second+ to +-1+ to turn off throttling. + # Throttling uses a wait time between batches so that the internal scroll requests can be given a timeout that takes the request padding into account. + # The padding time is the difference between the batch size divided by the +requests_per_second+ and the time spent writing. + # By default the batch size is 1000, so if +requests_per_second+ is set to +500+: + # + + # target_time = 1000 / 500 per second = 2 seconds + # wait_time = target_time - write_time = 2 seconds - .5 seconds = 1.5 seconds + # + + # Since the batch is issued as a single _bulk request, large batch sizes cause Elasticsearch to create many requests and wait before starting the next set. + # This is "bursty" instead of "smooth". + # **Slicing** + # Update by query supports sliced scroll to parallelize the update process. + # This can improve efficiency and provide a convenient way to break the request down into smaller parts. + # Setting +slices+ to +auto+ chooses a reasonable number for most data streams and indices. + # This setting will use one slice per shard, up to a certain limit. + # If there are multiple source data streams or indices, it will choose the number of slices based on the index or backing index with the smallest number of shards. + # Adding +slices+ to +_update_by_query+ just automates the manual process of creating sub-requests, which means it has some quirks: + # * You can see these requests in the tasks APIs. These sub-requests are "child" tasks of the task for the request with slices. + # * Fetching the status of the task for the request with +slices+ only contains the status of completed slices. + # * These sub-requests are individually addressable for things like cancellation and rethrottling. + # * Rethrottling the request with +slices+ will rethrottle the unfinished sub-request proportionally. + # * Canceling the request with slices will cancel each sub-request. + # * Due to the nature of slices each sub-request won't get a perfectly even portion of the documents. All documents will be addressed, but some slices may be larger than others. Expect larger slices to have a more even distribution. + # * Parameters like +requests_per_second+ and +max_docs+ on a request with slices are distributed proportionally to each sub-request. Combine that with the point above about distribution being uneven and you should conclude that using +max_docs+ with +slices+ might not result in exactly +max_docs+ documents being updated. + # * Each sub-request gets a slightly different snapshot of the source data stream or index though these are all taken at approximately the same time. + # If you're slicing manually or otherwise tuning automatic slicing, keep in mind that: + # * Query performance is most efficient when the number of slices is equal to the number of shards in the index or backing index. If that number is large (for example, 500), choose a lower number as too many slices hurts performance. Setting slices higher than the number of shards generally does not improve efficiency and adds overhead. + # * Update performance scales linearly across available resources with the number of slices. + # Whether query or update performance dominates the runtime depends on the documents being reindexed and cluster resources. + # **Update the document source** + # Update by query supports scripts to update the document source. + # As with the update API, you can set +ctx.op+ to change the operation that is performed. + # Set +ctx.op = "noop"+ if your script decides that it doesn't have to make any changes. + # The update by query operation skips updating the document and increments the +noop+ counter. + # Set +ctx.op = "delete"+ if your script decides that the document should be deleted. + # The update by query operation deletes the document and increments the +deleted+ counter. + # Update by query supports only +index+, +noop+, and +delete+. + # Setting +ctx.op+ to anything else is an error. + # Setting any other field in +ctx+ is an error. + # This API enables you to only modify the source of matching documents; you cannot move them. # - # @option arguments [List] :index A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices - # @option arguments [String] :analyzer The analyzer to use for the query string - # @option arguments [Boolean] :analyze_wildcard Specify whether wildcard and prefix queries should be analyzed (default: false) - # @option arguments [String] :default_operator The default operator for query string query (AND or OR) (options: AND, OR) - # @option arguments [String] :df The field to use as default where no field prefix is given in the query string - # @option arguments [Number] :from Starting offset (default: 0) - # @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed) - # @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified) - # @option arguments [String] :conflicts What to do when the update by query hits version conflicts? (options: abort, proceed) - # @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all) - # @option arguments [Boolean] :lenient Specify whether format-based query failures (such as providing text to a numeric field) should be ignored - # @option arguments [String] :pipeline Ingest pipeline to set on index requests made by this action. (default: none) - # @option arguments [String] :preference Specify the node or shard the operation should be performed on (default: random) - # @option arguments [String] :q Query in the Lucene query string syntax - # @option arguments [List] :routing A comma-separated list of specific routing values - # @option arguments [Time] :scroll Specify how long a consistent view of the index should be maintained for scrolled search - # @option arguments [String] :search_type Search operation type (options: query_then_fetch, dfs_query_then_fetch) - # @option arguments [Time] :search_timeout Explicit timeout for each search request. Defaults to no timeout. - # @option arguments [Number] :max_docs Maximum number of documents to process (default: all documents) - # @option arguments [List] :sort A comma-separated list of : pairs - # @option arguments [Number] :terminate_after The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early. - # @option arguments [List] :stats Specific 'tag' of the request for logging and statistical purposes - # @option arguments [Boolean] :version Specify whether to return document version as part of a hit + # @option arguments [String, Array] :index A comma-separated list of data streams, indices, and aliases to search. + # It supports wildcards (+*+). + # To search all data streams or indices, omit this parameter or use +*+ or +_all+. (*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. + # This behavior applies even if the request targets other open indices. + # For example, a request targeting +foo*,bar*+ returns an error if an index starts with +foo+ but no index starts with +bar+. Server default: true. + # @option arguments [String] :analyzer The analyzer to use for the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Boolean] :analyze_wildcard If +true+, wildcard and prefix queries are analyzed. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [String] :conflicts The preferred behavior when update by query hits version conflicts: +abort+ or +proceed+. Server default: abort. + # @option arguments [String] :default_operator The default operator for query string query: +AND+ or +OR+. + # This parameter can be used only when the +q+ query string parameter is specified. Server default: OR. + # @option arguments [String] :df The field to use as default where no field prefix is given in the query string. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [String, Array] :expand_wildcards The type of index that wildcard patterns can match. + # If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. + # It supports comma-separated values, such as +open,hidden+. + # Valid values are: +all+, +open+, +closed+, +hidden+, +none+. + # @option arguments [Integer] :from Starting offset (default: 0) + # @option arguments [Boolean] :ignore_unavailable If +false+, the request returns an error if it targets a missing or closed index. + # @option arguments [Boolean] :lenient If +true+, format-based query failures (such as providing text to a numeric field) in the query string will be ignored. + # This parameter can be used only when the +q+ query string parameter is specified. + # @option arguments [Integer] :max_docs The maximum number of documents to process. + # It defaults to all documents. + # When set to a value less then or equal to +scroll_size+ then a scroll will not be used to retrieve the results for the operation. + # @option arguments [String] :pipeline The ID of the pipeline to use to preprocess incoming documents. + # If the index has a default ingest pipeline specified, then setting the value to +_none+ disables the default ingest pipeline for this request. + # If a final pipeline is configured it will always run, regardless of the value of this parameter. + # @option arguments [String] :preference The node or shard the operation should be performed on. + # It is random by default. + # @option arguments [String] :q A query in the Lucene query string syntax. + # @option arguments [Boolean] :refresh If +true+, Elasticsearch refreshes affected shards to make the operation visible to search after the request completes. + # This is different than the update API's +refresh+ parameter, which causes just the shard that received the request to be refreshed. + # @option arguments [Boolean] :request_cache If +true+, the request cache is used for this request. + # It defaults to the index-level setting. + # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. Server default: -1. + # @option arguments [String] :routing A custom value used to route operations to a specific shard. + # @option arguments [Time] :scroll The period to retain the search context for scrolling. Server default: 5m. + # @option arguments [Integer] :scroll_size The size of the scroll request that powers the operation. Server default: 1000. + # @option arguments [Time] :search_timeout An explicit timeout for each search request. + # By default, there is no timeout. + # @option arguments [String] :search_type The type of the search operation. Available options include +query_then_fetch+ and +dfs_query_then_fetch+. + # @option arguments [Integer, String] :slices The number of slices this task should be divided into. Server default: 1. + # @option arguments [Array] :sort A comma-separated list of : pairs. + # @option arguments [Array] :stats The specific +tag+ of the request for logging and statistical purposes. + # @option arguments [Integer] :terminate_after The maximum number of documents to collect for each shard. + # If a query reaches this limit, Elasticsearch terminates the query early. + # Elasticsearch collects documents before sorting.IMPORTANT: Use with caution. + # Elasticsearch applies this parameter to each shard handling the request. + # When possible, let Elasticsearch perform early termination automatically. + # Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers. + # @option arguments [Time] :timeout The period each update request waits for the following operations: dynamic mapping updates, waiting for active shards. + # By default, it is one minute. + # This guarantees Elasticsearch waits for at least the timeout before failing. + # The actual wait time could be longer, particularly when multiple waits occur. Server default: 1m. + # @option arguments [Boolean] :version If +true+, returns the document version as part of a hit. # @option arguments [Boolean] :version_type Should the document increment the version number (internal) on hit or not (reindex) - # @option arguments [Boolean] :request_cache Specify if request cache should be used for this request or not, defaults to index level setting - # @option arguments [Boolean] :refresh Should the affected indexes be refreshed? - # @option arguments [Time] :timeout Time each individual bulk request should wait for shards that are unavailable. - # @option arguments [String] :wait_for_active_shards Sets the number of shard copies that must be active before proceeding with the update by query operation. Defaults to 1, meaning the primary shard only. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) - # @option arguments [Number] :scroll_size Size on the scroll request powering the update by query - # @option arguments [Boolean] :wait_for_completion Should the request should block until the update by query operation is complete. - # @option arguments [Number] :requests_per_second The throttle to set on this request in sub-requests per second. -1 means no throttle. - # @option arguments [Number|string] :slices The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks. Can be set to `auto`. + # @option arguments [Integer, String] :wait_for_active_shards The number of shard copies that must be active before proceeding with the operation. + # Set to +all+ or any positive integer up to the total number of shards in the index (+number_of_replicas+1+). + # The +timeout+ parameter controls how long each write request waits for unavailable shards to become available. + # Both work exactly the way they work in the bulk API. Server default: 1. + # @option arguments [Boolean] :wait_for_completion If +true+, the request blocks until the operation is complete. + # If +false+, Elasticsearch performs some preflight checks, launches the request, and returns a task ID that you can use to cancel or get the status of the task. + # Elasticsearch creates a record of this task as a document at +.tasks/task/${taskId}+. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The search definition using the Query DSL + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update-by-query # def update_by_query(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'update_by_query' } @@ -74,12 +165,12 @@ def update_by_query(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST - path = "#{Utils.__listify(_index)}/_update_by_query" + path = "#{Utils.listify(_index)}/_update_by_query" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb b/elasticsearch-api/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb index 801ed1bcd..2bd65039e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/update_by_query_rethrottle.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Actions - # Changes the number of requests per second for a particular Update By Query operation. + # Throttle an update by query operation. + # Change the number of requests per second for a particular update by query operation. + # Rethrottling that speeds up the query takes effect immediately but rethrotting that slows down the query takes effect after completing the current batch to prevent scroll timeouts. # - # @option arguments [String] :task_id The task id to rethrottle - # @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (*Required*) + # @option arguments [String] :task_id The ID for the task. (*Required*) + # @option arguments [Float] :requests_per_second The throttle for this request in sub-requests per second. + # To turn off throttling, set it to +-1+. Server default: -1. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update-by-query.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-update-by-query-rethrottle # def update_by_query_rethrottle(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'update_by_query_rethrottle' } @@ -47,7 +50,7 @@ def update_by_query_rethrottle(arguments = {}) _task_id = arguments.delete(:task_id) method = Elasticsearch::API::HTTP_POST - path = "_update_by_query/#{Utils.__listify(_task_id)}/_rethrottle" + path = "_update_by_query/#{Utils.listify(_task_id)}/_rethrottle" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/ack_watch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/ack_watch.rb index 653966268..9f307aa63 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/ack_watch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/ack_watch.rb @@ -15,25 +15,32 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Acknowledges a watch, manually throttling the execution of the watch's actions. + # Acknowledge a watch. + # Acknowledging a watch enables you to manually throttle the execution of the watch's actions. + # The acknowledgement state of an action is stored in the +status.actions..ack.state+ structure. + # IMPORTANT: If the specified watch is currently being executed, this API will return an error + # The reason for this behavior is to prevent overwriting the watch status from a watch execution. + # Acknowledging an action throttles further executions of that action until its +ack.state+ is reset to +awaits_successful_execution+. + # This happens when the condition of the watch is not met (the condition evaluates to false). # - # @option arguments [String] :watch_id Watch ID - # @option arguments [List] :action_id A comma-separated list of the action ids to be acked + # @option arguments [String] :watch_id The watch identifier. (*Required*) + # @option arguments [String, Array] :action_id A comma-separated list of the action identifiers to acknowledge. + # If you omit this parameter, all of the actions of the watch are acknowledged. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-ack-watch.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-ack-watch # def ack_watch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.ack_watch' } - defined_params = %i[watch_id action_id].each_with_object({}) do |variable, set_variables| + defined_params = [:watch_id, :action_id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? @@ -51,9 +58,9 @@ def ack_watch(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = if _watch_id && _action_id - "_watcher/watch/#{Utils.__listify(_watch_id)}/_ack/#{Utils.__listify(_action_id)}" + "_watcher/watch/#{Utils.listify(_watch_id)}/_ack/#{Utils.listify(_action_id)}" else - "_watcher/watch/#{Utils.__listify(_watch_id)}/_ack" + "_watcher/watch/#{Utils.listify(_watch_id)}/_ack" end params = {} diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/activate_watch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/activate_watch.rb index 739a1d774..00b486517 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/activate_watch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/activate_watch.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Activates a currently inactive watch. + # Activate a watch. + # A watch can be either active or inactive. # - # @option arguments [String] :watch_id Watch ID + # @option arguments [String] :watch_id The watch identifier. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-activate-watch.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-activate-watch # def activate_watch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.activate_watch' } @@ -47,7 +48,7 @@ def activate_watch(arguments = {}) _watch_id = arguments.delete(:watch_id) method = Elasticsearch::API::HTTP_PUT - path = "_watcher/watch/#{Utils.__listify(_watch_id)}/_activate" + path = "_watcher/watch/#{Utils.listify(_watch_id)}/_activate" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/deactivate_watch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/deactivate_watch.rb index 645558f54..82505ddec 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/deactivate_watch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/deactivate_watch.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Deactivates a currently active watch. + # Deactivate a watch. + # A watch can be either active or inactive. # - # @option arguments [String] :watch_id Watch ID + # @option arguments [String] :watch_id The watch identifier. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-deactivate-watch.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-deactivate-watch # def deactivate_watch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.deactivate_watch' } @@ -47,7 +48,7 @@ def deactivate_watch(arguments = {}) _watch_id = arguments.delete(:watch_id) method = Elasticsearch::API::HTTP_PUT - path = "_watcher/watch/#{Utils.__listify(_watch_id)}/_deactivate" + path = "_watcher/watch/#{Utils.listify(_watch_id)}/_deactivate" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/delete_watch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/delete_watch.rb index 8a6ae856d..d5448f2fa 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/delete_watch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/delete_watch.rb @@ -15,19 +15,24 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Removes a watch from Watcher. + # Delete a watch. + # When the watch is removed, the document representing the watch in the +.watches+ index is gone and it will never be run again. + # Deleting a watch does not delete any watch execution records related to this watch from the watch history. + # IMPORTANT: Deleting a watch must be done by using only this API. + # Do not delete the watch directly from the +.watches+ index using the Elasticsearch delete document API + # When Elasticsearch security features are enabled, make sure no write privileges are granted to anyone for the +.watches+ index. # - # @option arguments [String] :id Watch ID + # @option arguments [String] :id The watch identifier. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-delete-watch.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-delete-watch # def delete_watch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.delete_watch' } @@ -47,11 +52,11 @@ def delete_watch(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE - path = "_watcher/watch/#{Utils.__listify(_id)}" + path = "_watcher/watch/#{Utils.listify(_id)}" params = Utils.process_params(arguments) if Array(arguments[:ignore]).include?(404) - Utils.__rescue_from_not_found do + Utils.rescue_from_not_found do Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/execute_watch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/execute_watch.rb index 72d49ad08..2387f7ee9 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/execute_watch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/execute_watch.rb @@ -15,21 +15,30 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Forces the execution of a stored watch. + # Run a watch. + # This API can be used to force execution of the watch outside of its triggering logic or to simulate the watch execution for debugging purposes. + # For testing and debugging purposes, you also have fine-grained control on how the watch runs. + # You can run the watch without running all of its actions or alternatively by simulating them. + # You can also force execution by ignoring the watch condition and control whether a watch record would be written to the watch history after it runs. + # You can use the run watch API to run watches that are not yet registered by specifying the watch definition inline. + # This serves as great tool for testing and debugging your watches prior to adding them to Watcher. + # When Elasticsearch security features are enabled on your cluster, watches are run with the privileges of the user that stored the watches. + # If your user is allowed to read index +a+, but not index +b+, then the exact same set of rules will apply during execution of a watch. + # When using the run watch API, the authorization data of the user that called the API will be used as a base, instead of the information who stored the watch. # - # @option arguments [String] :id Watch ID - # @option arguments [Boolean] :debug indicates whether the watch should execute in debug mode + # @option arguments [String] :id The watch identifier. + # @option arguments [Boolean] :debug Defines whether the watch runs in debug mode. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body Execution control + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-execute-watch.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-execute-watch # def execute_watch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.execute_watch' } @@ -48,7 +57,7 @@ def execute_watch(arguments = {}) method = Elasticsearch::API::HTTP_PUT path = if _id - "_watcher/watch/#{Utils.__listify(_id)}/_execute" + "_watcher/watch/#{Utils.listify(_id)}/_execute" else '_watcher/watch/_execute' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/get_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/get_settings.rb index 00eb7f13f..408a7b04e 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/get_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/get_settings.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Retrieve settings for the watcher system index + # Get Watcher index settings. + # Get settings for the Watcher internal index (+.watches+). + # Only a subset of settings are shown, for example +index.auto_expand_replicas+ and +index.number_of_replicas+. # - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-settings.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-get-settings # def get_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.get_settings' } @@ -35,7 +38,7 @@ def get_settings(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_watcher/settings' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/get_watch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/get_watch.rb index bb2f184ba..a283afede 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/get_watch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/get_watch.rb @@ -15,19 +15,19 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Retrieves a watch by its ID. + # Get a watch. # - # @option arguments [String] :id Watch ID + # @option arguments [String] :id The watch identifier. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-get-watch.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-get-watch # def get_watch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.get_watch' } @@ -47,7 +47,7 @@ def get_watch(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET - path = "_watcher/watch/#{Utils.__listify(_id)}" + path = "_watcher/watch/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/put_watch.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/put_watch.rb index 111294f4e..590620685 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/put_watch.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/put_watch.rb @@ -15,24 +15,33 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Creates a new watch, or updates an existing one. + # Create or update a watch. + # When a watch is registered, a new document that represents the watch is added to the +.watches+ index and its trigger is immediately registered with the relevant trigger engine. + # Typically for the +schedule+ trigger, the scheduler is the trigger engine. + # IMPORTANT: You must use Kibana or this API to create a watch. + # Do not add a watch directly to the +.watches+ index by using the Elasticsearch index API. + # If Elasticsearch security features are enabled, do not give users write privileges on the +.watches+ index. + # When you add a watch you can also define its initial active state by setting the *active* parameter. + # When Elasticsearch security features are enabled, your watch can index or search only on indices for which the user that stored the watch has privileges. + # If the user is able to read index +a+, but not index +b+, the same will apply when the watch runs. # - # @option arguments [String] :id Watch ID - # @option arguments [Boolean] :active Specify whether the watch is in/active by default - # @option arguments [Number] :version Explicit version number for concurrency control - # @option arguments [Number] :if_seq_no only update the watch if the last operation that has changed the watch has the specified sequence number - # @option arguments [Number] :if_primary_term only update the watch if the last operation that has changed the watch has the specified primary term + # @option arguments [String] :id The identifier for the watch. (*Required*) + # @option arguments [Boolean] :active The initial state of the watch. + # The default value is +true+, which means the watch is active by default. Server default: true. + # @option arguments [Integer] :if_primary_term only update the watch if the last operation that has changed the watch has the specified primary term + # @option arguments [Integer] :if_seq_no only update the watch if the last operation that has changed the watch has the specified sequence number + # @option arguments [Integer] :version Explicit version number for concurrency control # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body The watch + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-put-watch.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-put-watch # def put_watch(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.put_watch' } @@ -52,7 +61,7 @@ def put_watch(arguments = {}) _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_PUT - path = "_watcher/watch/#{Utils.__listify(_id)}" + path = "_watcher/watch/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/query_watches.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/query_watches.rb index 83d9bc057..23055bd54 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/query_watches.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/query_watches.rb @@ -15,19 +15,21 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Retrieves stored watches. + # Query watches. + # Get all registered watches in a paginated manner and optionally filter watches by a query. + # Note that only the +_id+ and +metadata.*+ fields are queryable or sortable. # # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body From, size, query, sort and search_after + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-query-watches.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-query-watches # def query_watches(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.query_watches' } @@ -35,7 +37,7 @@ def query_watches(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = if body Elasticsearch::API::HTTP_POST @@ -43,7 +45,7 @@ def query_watches(arguments = {}) Elasticsearch::API::HTTP_GET end - path = '_watcher/_query/watches' + path = '_watcher/_query/watches' params = {} Elasticsearch::API::Response.new( diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/start.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/start.rb index ef2b8ea8e..cd07f8afd 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/start.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/start.rb @@ -15,19 +15,20 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Starts Watcher if it is not already running. + # Start the watch service. + # Start the Watcher service if it is not already running. # - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [Time] :master_timeout Period to wait for a connection to the master node. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-start.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-start # def start(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.start' } @@ -35,7 +36,7 @@ def start(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_watcher/_start' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/stats.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/stats.rb index 4ef01863d..ac7f26b57 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/stats.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/stats.rb @@ -15,20 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Retrieves the current Watcher metrics. + # Get Watcher statistics. + # This API always returns basic metrics. + # You retrieve more metrics by using the metric parameter. # - # @option arguments [List] :metric Controls what additional stat metrics should be include in the response (options: _all, queued_watches, current_watches, pending_watches) - # @option arguments [Boolean] :emit_stacktraces Emits stack traces of currently running watches + # @option arguments [Watchermetric] :metric Defines which additional metrics are included in the response. + # @option arguments [Boolean] :emit_stacktraces Defines whether stack traces are generated for each watch that is running. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stats.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stats # def stats(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.stats' } @@ -47,7 +49,7 @@ def stats(arguments = {}) method = Elasticsearch::API::HTTP_GET path = if _metric - "_watcher/stats/#{Utils.__listify(_metric)}" + "_watcher/stats/#{Utils.listify(_metric)}" else '_watcher/stats' end diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/stop.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/stop.rb index 2f112aedd..e12f35c0a 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/stop.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/stop.rb @@ -15,19 +15,22 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Stops Watcher if it is running. + # Stop the watch service. + # Stop the Watcher service if it is running. # - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [Time] :master_timeout The period to wait for the master node. + # If the master node is not available before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-stop.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-stop # def stop(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.stop' } @@ -35,7 +38,7 @@ def stop(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_POST path = '_watcher/_stop' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/update_settings.rb b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/update_settings.rb index b316761c9..ca087b1fd 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/watcher/update_settings.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/watcher/update_settings.rb @@ -15,21 +15,26 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module Watcher module Actions - # Update settings for the watcher system index + # Update Watcher index settings. + # Update settings for the Watcher internal index (+.watches+). + # Only a subset of settings can be modified. + # This includes +index.auto_expand_replicas+ and +index.number_of_replicas+. # - # @option arguments [Time] :timeout Specify timeout for waiting for acknowledgement from all nodes - # @option arguments [Time] :master_timeout Specify timeout for connection to master + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # @option arguments [Time] :timeout The period to wait for a response. + # If no response is received before the timeout expires, the request fails and returns an error. # @option arguments [Hash] :headers Custom HTTP headers - # @option arguments [Hash] :body An object with the new index settings (*Required*) + # @option arguments [Hash] :body request body # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/watcher-api-update-settings.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-watcher-update-settings # def update_settings(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'watcher.update_settings' } @@ -39,7 +44,7 @@ def update_settings(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = arguments.delete(:body) + body = arguments.delete(:body) method = Elasticsearch::API::HTTP_PUT path = '_watcher/settings' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/xpack/info.rb b/elasticsearch-api/lib/elasticsearch/api/actions/xpack/info.rb index 89cb11878..a9c6fdc7f 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/xpack/info.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/xpack/info.rb @@ -15,21 +15,27 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module XPack module Actions - # Retrieves information about the installed X-Pack features. + # Get information. + # The information provided by the API includes: + # * Build information including the build number and timestamp. + # * License information about the currently installed license. + # * Feature information for the features that are currently enabled and available under the current license. # - # @option arguments [Boolean] :human Defines whether additional human-readable information is included in the response. In particular, it adds descriptions and a tag line. The default value is true. - # @option arguments [List] :categories Comma-separated list of info categories. Can be any of: build, license, features - # @option arguments [Boolean] :accept_enterprise If this param is used it must be set to true *Deprecated* + # @option arguments [Array] :categories A comma-separated list of the information categories to include in the response. + # For example, +build,license,features+. + # @option arguments [Boolean] :accept_enterprise If this param is used it must be set to true + # @option arguments [Boolean] :human Defines whether additional human-readable information is included in the response. + # In particular, it adds descriptions and a tag line. Server default: true. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/info-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-info # def info(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'xpack.info' } @@ -37,7 +43,7 @@ def info(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_xpack' diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/xpack/usage.rb b/elasticsearch-api/lib/elasticsearch/api/actions/xpack/usage.rb index 2317ef931..6fdc8e725 100644 --- a/elasticsearch-api/lib/elasticsearch/api/actions/xpack/usage.rb +++ b/elasticsearch-api/lib/elasticsearch/api/actions/xpack/usage.rb @@ -15,19 +15,23 @@ # specific language governing permissions and limitations # under the License. # -# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80 -# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec +# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80 +# @see https://github.com/elastic/elasticsearch-specification # module Elasticsearch module API module XPack module Actions - # Retrieves usage information about the installed X-Pack features. + # Get usage information. + # Get information about the features that are currently enabled and available under the current license. + # The API also provides some usage statistics. # - # @option arguments [Time] :master_timeout Specify timeout for watch write operation + # @option arguments [Time] :master_timeout The period to wait for a connection to the master node. + # If no response is received before the timeout expires, the request fails and returns an error. + # To indicate that the request should never timeout, set it to +-1+. Server default: 30s. # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/current/usage-api.html + # @see https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-xpack # def usage(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'xpack.usage' } @@ -35,7 +39,7 @@ def usage(arguments = {}) arguments = arguments.clone headers = arguments.delete(:headers) || {} - body = nil + body = nil method = Elasticsearch::API::HTTP_GET path = '_xpack/usage' From 3680ee1ddd5d53e0d983bede8509d73ddddd1ff6 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 13 Mar 2025 11:45:38 +0000 Subject: [PATCH 10/11] [API] Updates specs --- .../spec/unit/actions/clear_scroll_spec.rb | 27 ++---------- .../spec/unit/actions/cluster/reroute_spec.rb | 25 ++++++----- .../actions/indices/get_field_mapping_spec.rb | 9 ++-- .../ingest/get_ip_location_database_spec.rb | 2 +- .../spec/unit/actions/mtermvectors_spec.rb | 41 +++++++++++-------- .../spec/unit/actions/scroll_spec.rb | 4 +- .../spec/unit/perform_request_spec.rb | 6 ++- 7 files changed, 53 insertions(+), 61 deletions(-) diff --git a/elasticsearch-api/spec/unit/actions/clear_scroll_spec.rb b/elasticsearch-api/spec/unit/actions/clear_scroll_spec.rb index 041c13d83..f61f40b30 100644 --- a/elasticsearch-api/spec/unit/actions/clear_scroll_spec.rb +++ b/elasticsearch-api/spec/unit/actions/clear_scroll_spec.rb @@ -18,37 +18,18 @@ require 'spec_helper' describe 'client#clear_scroll' do - let(:expected_args) do [ 'DELETE', - '_search/scroll/abc123', + '_search/scroll', {}, - nil, + { scroll_id: 123 }, {}, - { defined_params: { scroll_id: 'abc123' }, endpoint: 'clear_scroll' } + { endpoint: 'clear_scroll' } ] end it 'performs the request' do - expect(client_double.clear_scroll(scroll_id: 'abc123')).to be_a Elasticsearch::API::Response - end - - context 'when a list of scroll ids is provided' do - - let(:expected_args) do - [ - 'DELETE', - '_search/scroll/abc123,def456', - {}, - nil, - {}, - { defined_params: { scroll_id: ['abc123', 'def456'] }, endpoint: 'clear_scroll' } - ] - end - - it 'performs the request' do - expect(client_double.clear_scroll(scroll_id: ['abc123', 'def456'])).to be_a Elasticsearch::API::Response - end + expect(client_double.clear_scroll(body: { scroll_id: 123 })).to be_a Elasticsearch::API::Response end end diff --git a/elasticsearch-api/spec/unit/actions/cluster/reroute_spec.rb b/elasticsearch-api/spec/unit/actions/cluster/reroute_spec.rb index 49848ce10..b0278bbab 100644 --- a/elasticsearch-api/spec/unit/actions/cluster/reroute_spec.rb +++ b/elasticsearch-api/spec/unit/actions/cluster/reroute_spec.rb @@ -21,12 +21,12 @@ let(:expected_args) do [ - 'POST', - '_cluster/reroute', - {}, - {}, - {}, - { endpoint: 'cluster.reroute' } + 'POST', + '_cluster/reroute', + {}, + nil, + {}, + { endpoint: 'cluster.reroute' } ] end @@ -35,15 +35,14 @@ end context 'when a body is specified' do - let(:expected_args) do [ - 'POST', - '_cluster/reroute', - {}, - { commands: [ move: { index: 'myindex', shard: 0 }] }, - {}, - { endpoint: 'cluster.reroute' } + 'POST', + '_cluster/reroute', + {}, + { commands: [ move: { index: 'myindex', shard: 0 }] }, + {}, + { endpoint: 'cluster.reroute' } ] end diff --git a/elasticsearch-api/spec/unit/actions/indices/get_field_mapping_spec.rb b/elasticsearch-api/spec/unit/actions/indices/get_field_mapping_spec.rb index cd12bf16b..e9550b65e 100644 --- a/elasticsearch-api/spec/unit/actions/indices/get_field_mapping_spec.rb +++ b/elasticsearch-api/spec/unit/actions/indices/get_field_mapping_spec.rb @@ -26,7 +26,7 @@ {}, nil, {}, - { endpoint: 'indices.get_field_mapping' } + { endpoint: 'indices.get_field_mapping', defined_params: { fields: 'foo' } } ] end @@ -35,11 +35,10 @@ end it 'performs the request' do - expect(client_double.indices.get_field_mapping(field: 'foo')).to be_a Elasticsearch::API::Response + expect(client_double.indices.get_field_mapping(fields: 'foo')).to be_a Elasticsearch::API::Response end context 'when an index is specified' do - let(:url) do 'foo/_mapping/field/bam' end @@ -51,12 +50,12 @@ {}, nil, {}, - { defined_params: { index: 'foo' }, endpoint: 'indices.get_field_mapping' } + { defined_params: { index: 'foo', fields: 'bam' }, endpoint: 'indices.get_field_mapping' } ] end it 'performs the request' do - expect(client_double.indices.get_field_mapping(index: 'foo', field: 'bam')).to be_a Elasticsearch::API::Response + expect(client_double.indices.get_field_mapping(index: 'foo', fields: 'bam')).to be_a Elasticsearch::API::Response end end end diff --git a/elasticsearch-api/spec/unit/actions/ingest/get_ip_location_database_spec.rb b/elasticsearch-api/spec/unit/actions/ingest/get_ip_location_database_spec.rb index 41c356c3d..e8aeb2504 100644 --- a/elasticsearch-api/spec/unit/actions/ingest/get_ip_location_database_spec.rb +++ b/elasticsearch-api/spec/unit/actions/ingest/get_ip_location_database_spec.rb @@ -22,7 +22,7 @@ [ 'GET', '_ingest/ip_location/database/foo', - {}, + { body: {} }, nil, {}, { defined_params: { id: 'foo' }, endpoint: 'ingest.get_ip_location_database' } diff --git a/elasticsearch-api/spec/unit/actions/mtermvectors_spec.rb b/elasticsearch-api/spec/unit/actions/mtermvectors_spec.rb index 1bbc458fb..cc4265f39 100644 --- a/elasticsearch-api/spec/unit/actions/mtermvectors_spec.rb +++ b/elasticsearch-api/spec/unit/actions/mtermvectors_spec.rb @@ -18,26 +18,35 @@ require 'spec_helper' describe 'client#mtermvectors' do - let(:expected_args) do - [ - 'POST', - 'my-index/_mtermvectors', - {}, - body, - {}, - { defined_params: { index: 'my-index' }, endpoint: 'mtermvectors' } - ] - end - - let(:body) do - { ids: [1, 2, 3] } - end + context 'in body' do + let(:expected_args) do + [ + 'POST', + 'my-index/_mtermvectors', + {}, + { ids: [1, 2, 3] }, + {}, + { defined_params: { index: 'my-index' }, endpoint: 'mtermvectors' } + ] + end - it 'performs the request' do - expect(client_double.mtermvectors(index: 'my-index', body: { ids: [1, 2, 3] })).to be_a Elasticsearch::API::Response + it 'performs the request' do + expect(client_double.mtermvectors(index: 'my-index', body: { ids: [1, 2, 3] })).to be_a Elasticsearch::API::Response + end end context 'when a list of ids is passed instead of a body' do + let(:expected_args) do + [ + 'GET', + 'my-index/_mtermvectors', + { ids: '1,2,3' }, + nil, + {}, + { defined_params: { index: 'my-index' }, endpoint: 'mtermvectors' } + ] + end + it 'performs the request' do expect(client_double.mtermvectors(index: 'my-index', ids: [1, 2, 3])).to be_a Elasticsearch::API::Response end diff --git a/elasticsearch-api/spec/unit/actions/scroll_spec.rb b/elasticsearch-api/spec/unit/actions/scroll_spec.rb index 36ba03120..d7b2b3aee 100644 --- a/elasticsearch-api/spec/unit/actions/scroll_spec.rb +++ b/elasticsearch-api/spec/unit/actions/scroll_spec.rb @@ -22,11 +22,11 @@ let(:expected_args) do [ 'GET', - '_search/scroll/cXVlcn...', + '_search/scroll', {}, nil, {}, - { defined_params: { scroll_id: 'cXVlcn...' }, endpoint: 'scroll' } + { endpoint: 'scroll' } ] end diff --git a/elasticsearch-api/spec/unit/perform_request_spec.rb b/elasticsearch-api/spec/unit/perform_request_spec.rb index 6fb47ae02..0b6757070 100644 --- a/elasticsearch-api/spec/unit/perform_request_spec.rb +++ b/elasticsearch-api/spec/unit/perform_request_spec.rb @@ -23,7 +23,11 @@ describe 'Perform request args' do Elasticsearch::API::FilesHelper.files.each do |filepath| spec = Elasticsearch::API::EndpointSpec.new(filepath) - next if spec.module_namespace.flatten.first == '_internal' || spec.visibility != 'public' + next if spec.module_namespace.flatten.first == '_internal' || + spec.visibility != 'public' || + # TODO: Once the test suite is migrated to elasticsearch-specification, these should be removed + spec.module_namespace.flatten.first == 'rollup' || + ['scroll', 'clear_scroll', 'connector.last_sync'].include?(spec.endpoint_name) # These are the path parts defined by the user in the method argument defined_path_parts = spec.path_params.inject({}) do |params, part| From 2b29f2adb62423390b76bf8ae63c78cb27db40ce Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Thu, 13 Mar 2025 16:02:14 +0000 Subject: [PATCH 11/11] [DOCS] Updates Changelog 9.x --- CHANGELOG-9.x.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-9.x.md b/CHANGELOG-9.x.md index ef1d09842..1b16cd0f7 100644 --- a/CHANGELOG-9.x.md +++ b/CHANGELOG-9.x.md @@ -2,7 +2,7 @@ ## Gem -The size of both `elasticsearch` and `elasticsearch-api` gems will be smaller, since some unnecessary files that were being included in the gem have been removed. +The size of both `elasticsearch` and `elasticsearch-api` gems will be smaller, since some unnecessary files that were being included in the gem have been removed. There's also been a lot of old code cleanup for `9.x`. The required Ruby version is set to `2.6` to keep compatiblity wit JRuby 9.3. However, we only test the code against currently supported Ruby versions. @@ -12,6 +12,11 @@ The CI build now runs tests to ensure compatibility with Elasticsearch Serverles ## Elasticsearch API +* The source code is now based on `elasticsearch-specification`, so the API documentation is much more detailed and extensive. +* Scroll APIs: Since sending the `scroll_id` as a parameter was deprecated, now it needs to be sent in the body for `clear_scroll`, `scroll`. +* `indices.get_field_mapping` - `:fields` is a required parameter. +* The functions in `utils.rb` that had names starting with double underscore have been renamed to remove these. + ### Development #### Testing