diff --git a/CHANGELOG.md b/CHANGELOG.md index d804f492c..6a823ad7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,6 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ## [Unreleased] ### Added ### Changed -- Update rubygems public key setting expiry to 20260707 ([#308](https://github.com/opensearch-project/opensearch-ruby/pull/308)) ### Deprecated ### Removed ### Fixed @@ -16,16 +15,22 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added a workflow to generate API methods from OpenSearch API Spec ([261](https://github.com/opensearch-project/opensearch-ruby/pull/261)) - Added support for Ruby 3.4 ([#265](https://github.com/opensearch-project/opensearch-ruby/pull/265)) - Added ability to sign requests ([#281](https://github.com/opensearch-project/opensearch-ruby/pull/281)) +- Added `ml` memory container, agentic memory, and streaming actions (`create_memory_container`, `add_agentic_memory`, `search_agentic_memory`, `execute_agent_stream`, `predict_model_stream`, `execute_tool`, and related) from the latest OpenSearch API spec +- Added `search_relevance` scheduled experiment actions (`get_scheduled_experiments`, `post_scheduled_experiments`, `delete_scheduled_experiments`) from the latest OpenSearch API spec ### Changed - Restructured the API methods and modules to be more efficient and intuitive ([261](https://github.com/opensearch-project/opensearch-ruby/pull/261)) - Moved ignore-404-on-deletion feature into the client options ([#277](https://github.com/opensearch-project/opensearch-ruby/pull/277)) - Changed the default json serializer from `multi_json` to the `json` gem ([#290](https://github.com/opensearch-project/opensearch-ruby/pull/290)) +- Updated the API to reflect the latest OpenSearch API spec ([#271](https://github.com/opensearch-project/opensearch-ruby/pull/271), [#276](https://github.com/opensearch-project/opensearch-ruby/pull/276), [#279](https://github.com/opensearch-project/opensearch-ruby/pull/279), [#280](https://github.com/opensearch-project/opensearch-ruby/pull/280), [#282](https://github.com/opensearch-project/opensearch-ruby/pull/282), [#284](https://github.com/opensearch-project/opensearch-ruby/pull/284), [#286](https://github.com/opensearch-project/opensearch-ruby/pull/286), [#296](https://github.com/opensearch-project/opensearch-ruby/pull/296), [#299](https://github.com/opensearch-project/opensearch-ruby/pull/299), [#314](https://github.com/opensearch-project/opensearch-ruby/pull/314), [#318](https://github.com/opensearch-project/opensearch-ruby/pull/318), [#320](https://github.com/opensearch-project/opensearch-ruby/pull/320)) and regenerated against the latest spec for the 4.0.0 release, adding a `msearch` `allow_partial_results` parameter +- Wrapped unreachable host exceptions in `OpenSearch::Transport::Transport::Error` ([#317](https://github.com/opensearch-project/opensearch-ruby/pull/317)) +- Only require what is necessary from `cgi` for Ruby 3.5 ([#298](https://github.com/opensearch-project/opensearch-ruby/pull/298)) +- Update rubygems public key setting expiry to 20260707 ([#308](https://github.com/opensearch-project/opensearch-ruby/pull/308)) +- Update RubyGems signing certificate ([#330](https://github.com/opensearch-project/opensearch-ruby/pull/330)) ### Removed - Removed support for Ruby 2.x ([261](https://github.com/opensearch-project/opensearch-ruby/pull/261)) - Removed the ability to ignore any error code by passing the `ignore: Array` to each API method invocation ([#277](https://github.com/opensearch-project/opensearch-ruby/pull/277)) - Removed ability to set `X-Opaque-Id` header value via the `opaque_id` parameter. ([#287](https://github.com/opensearch-project/opensearch-ruby/pull/287)) - Removed support for Faraday 1.x. ([#293](https://github.com/opensearch-project/opensearch-ruby/pull/293)) -- Wrapped unreachable host exceptions in `OpenSearch::Transport::Transport::Error`. ([#317](https://github.com/opensearch-project/opensearch-ruby/pull/317)) ## [3.4.0] ### Added diff --git a/lib/opensearch/api/actions/ml/add_agentic_memory.rb b/lib/opensearch/api/actions/ml/add_agentic_memory.rb new file mode 100644 index 000000000..fc4e82f4b --- /dev/null +++ b/lib/opensearch/api/actions/ml/add_agentic_memory.rb @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Add agentic memory to a memory container. + # + # @option args [String] :memory_container_id *Required* + # @option args [Hash] :body + def add_agentic_memory(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + + _memory_container_id = args.delete('memory_container_id') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'POST' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories') + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/create_memory_container.rb b/lib/opensearch/api/actions/ml/create_memory_container.rb new file mode 100644 index 000000000..565317787 --- /dev/null +++ b/lib/opensearch/api/actions/ml/create_memory_container.rb @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Create a memory container. + # + # @option args [Hash] :body + def create_memory_container(args = {}) + args = Utils.clone_and_normalize_arguments(args) + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'POST' + url = '_plugins/_ml/memory_containers/_create' + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/create_memory_container_session.rb b/lib/opensearch/api/actions/ml/create_memory_container_session.rb new file mode 100644 index 000000000..e2509a4a3 --- /dev/null +++ b/lib/opensearch/api/actions/ml/create_memory_container_session.rb @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Create session in a memory container. + # + # @option args [String] :memory_container_id *Required* + # @option args [Hash] :body + def create_memory_container_session(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + + _memory_container_id = args.delete('memory_container_id') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'POST' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories/sessions') + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/delete_agentic_memory.rb b/lib/opensearch/api/actions/ml/delete_agentic_memory.rb new file mode 100644 index 000000000..6dfe0eb62 --- /dev/null +++ b/lib/opensearch/api/actions/ml/delete_agentic_memory.rb @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Delete a specific memory by its type and ID. + # + # @option args [String] :id *Required* + # @option args [String] :memory_container_id *Required* + # @option args [String] :type *Required* + def delete_agentic_memory(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + raise ArgumentError, "Required argument 'type' missing" if args['type'].nil? + + _id = args.delete('id') + _memory_container_id = args.delete('memory_container_id') + _type = args.delete('type') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'DELETE' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories', _type, _id) + + Utils.validate_query_params! args + transport.perform_delete_request method, url, args, body, headers + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/delete_agentic_memory_query.rb b/lib/opensearch/api/actions/ml/delete_agentic_memory_query.rb new file mode 100644 index 000000000..685c67e81 --- /dev/null +++ b/lib/opensearch/api/actions/ml/delete_agentic_memory_query.rb @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Delete multiple memories using a query to match specific criteria. + # + # @option args [String] :memory_container_id *Required* + # @option args [String] :type *Required* + # @option args [Hash] :body + def delete_agentic_memory_query(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + raise ArgumentError, "Required argument 'type' missing" if args['type'].nil? + + _memory_container_id = args.delete('memory_container_id') + _type = args.delete('type') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'POST' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories', _type, '_delete_by_query') + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/delete_memory_container.rb b/lib/opensearch/api/actions/ml/delete_memory_container.rb new file mode 100644 index 000000000..b1a0a3d10 --- /dev/null +++ b/lib/opensearch/api/actions/ml/delete_memory_container.rb @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Delete a memory container. + # + # @option args [String] :memory_container_id *Required* + # @option args [Boolean] :delete_all_memories + # @option args [Enumerable] :delete_memories + def delete_memory_container(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + + _memory_container_id = args.delete('memory_container_id') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'DELETE' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id) + + Utils.validate_query_params! args, DELETE_MEMORY_CONTAINER_QUERY_PARAMS + transport.perform_delete_request method, url, args, body, headers + end + + DELETE_MEMORY_CONTAINER_QUERY_PARAMS = Set.new(%w[ + delete_all_memories + delete_memories + ]).freeze + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/execute_agent_stream.rb b/lib/opensearch/api/actions/ml/execute_agent_stream.rb new file mode 100644 index 000000000..07dcc59d8 --- /dev/null +++ b/lib/opensearch/api/actions/ml/execute_agent_stream.rb @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Execute an agent in streaming mode. + # + # @option args [String] :agent_id *Required* + # @option args [Hash] :body + def execute_agent_stream(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'agent_id' missing" if args['agent_id'].nil? + + _agent_id = args.delete('agent_id') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'POST' + url = Utils.build_url('_plugins/_ml/agents', _agent_id, '_execute/stream') + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/execute_tool.rb b/lib/opensearch/api/actions/ml/execute_tool.rb new file mode 100644 index 000000000..d8f7771b4 --- /dev/null +++ b/lib/opensearch/api/actions/ml/execute_tool.rb @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Execute a tool. + # + # @option args [String] :tool_name *Required* + # @option args [Hash] :body + def execute_tool(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'tool_name' missing" if args['tool_name'].nil? + + _tool_name = args.delete('tool_name') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'POST' + url = Utils.build_url('_plugins/_ml/tools/_execute', _tool_name) + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/get_agentic_memory.rb b/lib/opensearch/api/actions/ml/get_agentic_memory.rb new file mode 100644 index 000000000..1917e44e4 --- /dev/null +++ b/lib/opensearch/api/actions/ml/get_agentic_memory.rb @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Get a specific memory by its type and ID. + # + # @option args [String] :id *Required* + # @option args [String] :memory_container_id *Required* + # @option args [String] :type *Required* + def get_agentic_memory(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + raise ArgumentError, "Required argument 'type' missing" if args['type'].nil? + + _id = args.delete('id') + _memory_container_id = args.delete('memory_container_id') + _type = args.delete('type') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'GET' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories', _type, _id) + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/get_memory_container.rb b/lib/opensearch/api/actions/ml/get_memory_container.rb new file mode 100644 index 000000000..3bf79bfe8 --- /dev/null +++ b/lib/opensearch/api/actions/ml/get_memory_container.rb @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Get a memory container. + # + # @option args [String] :memory_container_id *Required* + def get_memory_container(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + + _memory_container_id = args.delete('memory_container_id') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'GET' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id) + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/predict_model_stream.rb b/lib/opensearch/api/actions/ml/predict_model_stream.rb new file mode 100644 index 000000000..3bf98eea4 --- /dev/null +++ b/lib/opensearch/api/actions/ml/predict_model_stream.rb @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Predicts a model in streaming mode. + # + # @option args [String] :model_id *Required* + # @option args [Hash] :body + def predict_model_stream(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'model_id' missing" if args['model_id'].nil? + + _model_id = args.delete('model_id') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'POST' + url = Utils.build_url('_plugins/_ml/models', _model_id, '_predict/stream') + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/search_agentic_memory.rb b/lib/opensearch/api/actions/ml/search_agentic_memory.rb new file mode 100644 index 000000000..0fee5a8c0 --- /dev/null +++ b/lib/opensearch/api/actions/ml/search_agentic_memory.rb @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Search for memories of a specific type within a memory container. + # + # @option args [String] :memory_container_id *Required* + # @option args [String] :type *Required* + # @option args [Hash] :body + def search_agentic_memory(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + raise ArgumentError, "Required argument 'type' missing" if args['type'].nil? + + _memory_container_id = args.delete('memory_container_id') + _type = args.delete('type') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'GET' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories', _type, '_search') + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/search_memory_container.rb b/lib/opensearch/api/actions/ml/search_memory_container.rb new file mode 100644 index 000000000..c0ba5cd0a --- /dev/null +++ b/lib/opensearch/api/actions/ml/search_memory_container.rb @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Search memory containers. + # + # @option args [Hash] :body + def search_memory_container(args = {}) + args = Utils.clone_and_normalize_arguments(args) + headers = args.delete('headers') || {} + body = args.delete('body') + method = body ? 'POST' : 'GET' + url = '_plugins/_ml/memory_containers/_search' + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/update_agentic_memory.rb b/lib/opensearch/api/actions/ml/update_agentic_memory.rb new file mode 100644 index 000000000..2a0c1d766 --- /dev/null +++ b/lib/opensearch/api/actions/ml/update_agentic_memory.rb @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Update a specific memory by its type and ID. + # + # @option args [String] :id *Required* + # @option args [String] :memory_container_id *Required* + # @option args [String] :type *Required* + # @option args [Hash] :body + def update_agentic_memory(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'id' missing" if args['id'].nil? + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + raise ArgumentError, "Required argument 'type' missing" if args['type'].nil? + + _id = args.delete('id') + _memory_container_id = args.delete('memory_container_id') + _type = args.delete('type') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'PUT' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id, 'memories', _type, _id) + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/ml/update_memory_container.rb b/lib/opensearch/api/actions/ml/update_memory_container.rb new file mode 100644 index 000000000..da1d469ac --- /dev/null +++ b/lib/opensearch/api/actions/ml/update_memory_container.rb @@ -0,0 +1,37 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module Ml + module Actions + # Update a memory container. + # + # @option args [String] :memory_container_id *Required* + # @option args [Hash] :body + def update_memory_container(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'memory_container_id' missing" if args['memory_container_id'].nil? + + _memory_container_id = args.delete('memory_container_id') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'PUT' + url = Utils.build_url('_plugins/_ml/memory_containers', _memory_container_id) + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/msearch.rb b/lib/opensearch/api/actions/msearch.rb index a7d05bb26..3746f0c0a 100644 --- a/lib/opensearch/api/actions/msearch.rb +++ b/lib/opensearch/api/actions/msearch.rb @@ -15,6 +15,7 @@ module Root module Actions # Allows to execute several search operations in one request. # + # @option args [Boolean] :allow_partial_results (default: true) Specifies whether to return partial results if there are shard request timeouts or shard failures # @option args [Boolean] :ccs_minimize_roundtrips (default: true) If `true`, network round-trips between the coordinating node and remote clusters are minimized for cross-cluster search requests. # @option args [Integer] :max_concurrent_searches Maximum number of concurrent searches the multi search API can execute. # @option args [Integer] :max_concurrent_shard_requests (default: 5) Maximum number of concurrent shard requests that each sub-search request executes per node. @@ -40,6 +41,7 @@ def msearch(args = {}) end MSEARCH_QUERY_PARAMS = Set.new(%w[ + allow_partial_results ccs_minimize_roundtrips max_concurrent_searches max_concurrent_shard_requests diff --git a/lib/opensearch/api/actions/search_relevance/delete_scheduled_experiments.rb b/lib/opensearch/api/actions/search_relevance/delete_scheduled_experiments.rb new file mode 100644 index 000000000..5b381a210 --- /dev/null +++ b/lib/opensearch/api/actions/search_relevance/delete_scheduled_experiments.rb @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module SearchRelevance + module Actions + # Deletes a specified scheduled experiment. + # + # @option args [String] :experiment_id *Required* The experiment id + def delete_scheduled_experiments(args = {}) + args = Utils.clone_and_normalize_arguments(args) + raise ArgumentError, "Required argument 'experiment_id' missing" if args['experiment_id'].nil? + + _experiment_id = args.delete('experiment_id') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'DELETE' + url = Utils.build_url('_plugins/_search_relevance/experiments/schedule', _experiment_id) + + Utils.validate_query_params! args + transport.perform_delete_request method, url, args, body, headers + end + end + end + end +end diff --git a/lib/opensearch/api/actions/search_relevance/get_scheduled_experiments.rb b/lib/opensearch/api/actions/search_relevance/get_scheduled_experiments.rb new file mode 100644 index 000000000..41eb10012 --- /dev/null +++ b/lib/opensearch/api/actions/search_relevance/get_scheduled_experiments.rb @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module SearchRelevance + module Actions + # Gets the scheduled experiments. + # + # @option args [String] :experiment_id The experiment id + def get_scheduled_experiments(args = {}) + args = Utils.clone_and_normalize_arguments(args) + _experiment_id = args.delete('experiment_id') + + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'GET' + url = Utils.build_url('_plugins/_search_relevance/experiments/schedule', _experiment_id) + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/search_relevance/post_query_sets.rb b/lib/opensearch/api/actions/search_relevance/post_query_sets.rb index 89fcf33f6..24dc3e474 100644 --- a/lib/opensearch/api/actions/search_relevance/post_query_sets.rb +++ b/lib/opensearch/api/actions/search_relevance/post_query_sets.rb @@ -15,7 +15,7 @@ module SearchRelevance module Actions # Creates a new query set by sampling queries from the user behavior data. # - # @option args [Hash] :body + # @option args [Hash] :body The schema for creating a query set. def post_query_sets(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/api/actions/search_relevance/post_scheduled_experiments.rb b/lib/opensearch/api/actions/search_relevance/post_scheduled_experiments.rb new file mode 100644 index 000000000..b9f8433a5 --- /dev/null +++ b/lib/opensearch/api/actions/search_relevance/post_scheduled_experiments.rb @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. + +# This file is generated from the OpenSearch REST API spec. +# Do not modify it by hand. Instead, modify the generator or the spec. + +# frozen_string_literal: true + +module OpenSearch + module API + module SearchRelevance + module Actions + # Creates a scheduled experiment. + # + # @option args [Hash] :body The schema for scheduling experiments. + def post_scheduled_experiments(args = {}) + args = Utils.clone_and_normalize_arguments(args) + headers = args.delete('headers') || {} + body = args.delete('body') + method = 'POST' + url = '_plugins/_search_relevance/experiments/schedule' + + Utils.validate_query_params! args + transport.perform_request(method, url, args, body, headers).body + end + end + end + end +end diff --git a/lib/opensearch/api/actions/search_relevance/put_query_sets.rb b/lib/opensearch/api/actions/search_relevance/put_query_sets.rb index 652cf62b4..13bce98cf 100644 --- a/lib/opensearch/api/actions/search_relevance/put_query_sets.rb +++ b/lib/opensearch/api/actions/search_relevance/put_query_sets.rb @@ -15,7 +15,7 @@ module SearchRelevance module Actions # Creates a new query set by uploading manually. # - # @option args [Hash] :body + # @option args [Hash] :body The schema for updating a query set. def put_query_sets(args = {}) args = Utils.clone_and_normalize_arguments(args) headers = args.delete('headers') || {} diff --git a/lib/opensearch/version.rb b/lib/opensearch/version.rb index 0728573c4..071541299 100644 --- a/lib/opensearch/version.rb +++ b/lib/opensearch/version.rb @@ -25,5 +25,5 @@ # under the License. module OpenSearch - VERSION = '4.0.0-beta.5'.freeze + VERSION = '4.0.0'.freeze end