diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index cf0cc0171b..bc0960e180 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -5,7 +5,7 @@ steps: env: RUBY_VERSION: "{{ matrix.ruby }}" TEST_SUITE: "{{ matrix.suite }}" - STACK_VERSION: 8.18.4-SNAPSHOT + STACK_VERSION: 8.18.6-SNAPSHOT TRANSPORT_VERSION: "{{ matrix.transport }}" RUBY_SOURCE: "{{ matrix.ruby_source }}" QUIET: false @@ -62,7 +62,7 @@ steps: provider: "gcp" env: RUBY_VERSION: "3.4" - STACK_VERSION: 8.18.4-SNAPSHOT + STACK_VERSION: 8.18.6-SNAPSHOT ES_YAML_TESTS_BRANCH: "8.18" TRANSPORT_VERSION: "8.3" RUBY_SOURCE: "ruby" diff --git a/.github/workflows/8.18.yml b/.github/workflows/8.18.yml index 40ccce6adf..9e97a9179a 100644 --- a/.github/workflows/8.18.yml +++ b/.github/workflows/8.18.yml @@ -26,7 +26,7 @@ jobs: sudo sysctl -w vm.max_map_count=262144 - uses: elastic/elastic-github-actions/elasticsearch@master with: - stack-version: 8.18.4-SNAPSHOT + stack-version: 8.18.6-SNAPSHOT security-enabled: false - uses: ruby/setup-ruby@v1 with: @@ -40,4 +40,4 @@ jobs: - name: elasticsearch run: cd elasticsearch && bundle exec rake test:all - name: elasticsearch-api - run: rake es:download_artifacts[8.18.4-SNAPSHOT] && cd elasticsearch-api && bundle exec rake test:spec test:platinum:unit + run: rake es:download_artifacts[8.18.6-SNAPSHOT] && cd elasticsearch-api && bundle exec rake test:spec test:platinum:unit diff --git a/.github/workflows/otel.yml b/.github/workflows/otel.yml index 53365c4159..b022a8b1e5 100644 --- a/.github/workflows/otel.yml +++ b/.github/workflows/otel.yml @@ -28,7 +28,7 @@ jobs: sudo sysctl -w vm.max_map_count=262144 - uses: elastic/elastic-github-actions/elasticsearch@master with: - stack-version: 8.18.4-SNAPSHOT + stack-version: 8.18.6-SNAPSHOT security-enabled: false - uses: ruby/setup-ruby@v1 with: @@ -42,4 +42,4 @@ jobs: - name: elasticsearch run: cd elasticsearch && bundle exec rake test:all - name: elasticsearch-api - run: rake es:download_artifacts[8.18.4-SNAPSHOT] && cd elasticsearch-api && bundle exec rake test:spec test:platinum:unit + run: rake es:download_artifacts[8.18.6-SNAPSHOT] && cd elasticsearch-api && bundle exec rake test:spec test:platinum:unit diff --git a/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_custom.rb b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_custom.rb new file mode 100644 index 0000000000..51f3435223 --- /dev/null +++ b/elasticsearch-api/lib/elasticsearch/api/actions/inference/put_custom.rb @@ -0,0 +1,65 @@ +# 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 Inference + module Actions + # Configure a custom inference endpoint + # + # @option arguments [String] :task_type The task type + # @option arguments [String] :custom_inference_id The inference Id + # @option arguments [Hash] :headers Custom HTTP headers + # @option arguments [Hash] :body The inference endpoint's task and service settings + # + # @see https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom + # + def put_custom(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || 'inference.put_custom' } + + defined_params = %i[task_type custom_inference_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 'task_type' missing" unless arguments[:task_type] + raise ArgumentError, "Required argument 'custom_inference_id' missing" unless arguments[:custom_inference_id] + + arguments = arguments.clone + headers = arguments.delete(:headers) || {} + + body = arguments.delete(:body) + + _task_type = arguments.delete(:task_type) + + _custom_inference_id = arguments.delete(:custom_inference_id) + + method = Elasticsearch::API::HTTP_PUT + path = "_inference/#{Utils.__listify(_task_type)}/#{Utils.__listify(_custom_inference_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/transform/set_upgrade_mode.rb b/elasticsearch-api/lib/elasticsearch/api/actions/transform/set_upgrade_mode.rb new file mode 100644 index 0000000000..aa808b4ac1 --- /dev/null +++ b/elasticsearch-api/lib/elasticsearch/api/actions/transform/set_upgrade_mode.rb @@ -0,0 +1,52 @@ +# 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 Transform + module Actions + # Sets a cluster wide upgrade_mode setting that prepares transform indices for an upgrade. + # + # @option arguments [Boolean] :enabled Whether to enable upgrade_mode Transform 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 [Hash] :headers Custom HTTP headers + # + # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.18/transform-set-upgrade-mode.html + # + def set_upgrade_mode(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || 'transform.set_upgrade_mode' } + + arguments = arguments.clone + headers = arguments.delete(:headers) || {} + + body = nil + + method = Elasticsearch::API::HTTP_POST + path = '_transform/set_upgrade_mode' + params = 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/spec/elasticsearch/api/actions/inference/put_custom_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/inference/put_custom_spec.rb new file mode 100644 index 0000000000..a409676f1b --- /dev/null +++ b/elasticsearch-api/spec/elasticsearch/api/actions/inference/put_custom_spec.rb @@ -0,0 +1,36 @@ +# 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#inference.put_custom' do + let(:expected_args) do + [ + 'PUT', + '_inference/foo/baz', + {}, + nil, + {}, + { defined_params: { custom_inference_id: 'baz', task_type: 'foo' }, + endpoint: 'inference.put_custom' } + ] + end + + it 'performs the request' do + expect(client_double.inference.put_custom(task_type: 'foo', custom_inference_id: 'baz')).to be_a Elasticsearch::API::Response + end +end diff --git a/elasticsearch-api/spec/elasticsearch/api/actions/transform/set_upgrade_mode_spec.rb b/elasticsearch-api/spec/elasticsearch/api/actions/transform/set_upgrade_mode_spec.rb new file mode 100644 index 0000000000..9dd1b158c1 --- /dev/null +++ b/elasticsearch-api/spec/elasticsearch/api/actions/transform/set_upgrade_mode_spec.rb @@ -0,0 +1,35 @@ +# Licensed to Elasticsearch B.V. under one or more contributor +# license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright +# ownership. Elasticsearch B.V. licenses this file to you under +# the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +require 'spec_helper' + +describe 'client.transform#set_upgrade_mode' do + let(:expected_args) do + [ + 'POST', + '_transform/set_upgrade_mode', + {}, + nil, + {}, + { endpoint: 'transform.set_upgrade_mode' } + ] + end + + it 'performs the request' do + expect(client_double.transform.set_upgrade_mode).to be_a Elasticsearch::API::Response + end +end