diff --git a/api_generator/lib/components/api_path.rb b/api_generator/lib/components/api_path.rb new file mode 100644 index 000000000..6be09572c --- /dev/null +++ b/api_generator/lib/components/api_path.rb @@ -0,0 +1,33 @@ +# 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. + +# frozen_string_literal: true + +class ApiPath + # @param [String] url + def initialize(url) + @url = url + puts url + puts "COMPONENTS: #{components}" + puts "BUILD: #{build}" + end + + + def build + return components.join('') if components.none? { |comp| comp.start_with?('_') } + "[#{components.join(', ')}].filter(&:present?).join('/').squeeze('/')" + end + + def components + @components ||= @url.split('{').flat_map { |part| part.split('}') }.map do |comp| + next "_#{comp}" unless comp.include?('/') # path param + comp = comp.sub(%r{^/}, '').sub(%r{/$}, '') # remove leading/trailing slashes + "'#{comp}'" if comp.present? + end.compact + end + + private +end \ No newline at end of file diff --git a/api_generator/lib/generators/action_generator.rb b/api_generator/lib/generators/action_generator.rb index 3c4ae3800..372c4d826 100644 --- a/api_generator/lib/generators/action_generator.rb +++ b/api_generator/lib/generators/action_generator.rb @@ -8,6 +8,7 @@ require_relative 'base_generator' require_relative '../components/action' +require_relative '../components/api_path' # Render an API Action via Mustache class ActionRenderer < BaseGenerator @@ -22,7 +23,6 @@ def initialize(gem_folder, namespace, action) output_file = gem_folder.join('lib', 'opensearch', 'api', 'actions', namespace.name, "#{action.name.underscore}.rb") super(output_file) @action = action - @urls = action.urls.map { |u| u.split('/').select(&:present?) }.uniq @api_reference = action.api_reference @module_name = namespace.root ? 'Root' : namespace.name.camelize @method_name = action.name.underscore @@ -41,10 +41,9 @@ def argument_descriptions end end - def url_components - @urls.max_by(&:length) - .map { |e| e.starts_with?('{') ? "_#{e[/{(.+)}/, 1]}" : "'#{e}'" } - .join(', ') + def url + api_path = ApiPath.new(@action.urls.max_by(&:length)) + api_path.build end def http_verb diff --git a/api_generator/lib/templates/action.mustache b/api_generator/lib/templates/action.mustache index 99dc3fb9c..2d3425866 100644 --- a/api_generator/lib/templates/action.mustache +++ b/api_generator/lib/templates/action.mustache @@ -44,8 +44,8 @@ module OpenSearch headers = args.delete('headers') || {} body = args.delete('body') {{/bulk_body}} - url = [{{{url_components}}}].filter(&:present?).join('/').squeeze('/') method = {{{http_verb}}} + url = {{{url}}} Utils.validate_query_params args, {{valid_params_constant_name}} {{{perform_request}}} diff --git a/lib/opensearch.rb b/lib/opensearch.rb index fbf035acc..243d0b649 100644 --- a/lib/opensearch.rb +++ b/lib/opensearch.rb @@ -7,7 +7,6 @@ # This file is generated from the OpenSearch REST API spec. # Do not modify it by hand. Instead, modify the generator or the spec. -require 'active_support/all' require 'opensearch/transport' require 'opensearch/api' Dir[File.expand_path('opensearch/api/**/*.rb', __dir__)].sort.each { |f| require f } diff --git a/lib/opensearch/api/actions/asynchronous_search/delete.rb b/lib/opensearch/api/actions/asynchronous_search/delete.rb index d82d63689..dddb763f3 100644 --- a/lib/opensearch/api/actions/asynchronous_search/delete.rb +++ b/lib/opensearch/api/actions/asynchronous_search/delete.rb @@ -26,8 +26,8 @@ def delete(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_asynchronous_search', _id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_asynchronous_search', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/asynchronous_search/get.rb b/lib/opensearch/api/actions/asynchronous_search/get.rb index ccd69e3ae..6dff2ba71 100644 --- a/lib/opensearch/api/actions/asynchronous_search/get.rb +++ b/lib/opensearch/api/actions/asynchronous_search/get.rb @@ -24,8 +24,8 @@ def get(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_asynchronous_search', _id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_asynchronous_search', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/asynchronous_search/search.rb b/lib/opensearch/api/actions/asynchronous_search/search.rb index 4476c7538..864593bad 100644 --- a/lib/opensearch/api/actions/asynchronous_search/search.rb +++ b/lib/opensearch/api/actions/asynchronous_search/search.rb @@ -24,8 +24,8 @@ def search(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_asynchronous_search'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_asynchronous_search' Utils.validate_query_params args, SEARCH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/asynchronous_search/stats.rb b/lib/opensearch/api/actions/asynchronous_search/stats.rb index 6b29346dc..59c0e2aab 100644 --- a/lib/opensearch/api/actions/asynchronous_search/stats.rb +++ b/lib/opensearch/api/actions/asynchronous_search/stats.rb @@ -19,8 +19,8 @@ def stats(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_asynchronous_search', 'stats'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_asynchronous_search/stats' Utils.validate_query_params args, STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/bulk.rb b/lib/opensearch/api/actions/bulk.rb index 573d9f07f..8b5844720 100644 --- a/lib/opensearch/api/actions/bulk.rb +++ b/lib/opensearch/api/actions/bulk.rb @@ -35,8 +35,8 @@ def bulk(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = [_index, '_bulk'].filter(&:present?).join('/').squeeze('/') method = _index.present? ? 'PUT' : 'POST' + url = [_index, '_bulk'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, BULK_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/bulk_stream.rb b/lib/opensearch/api/actions/bulk_stream.rb index d3cefbdb0..624c0e69c 100644 --- a/lib/opensearch/api/actions/bulk_stream.rb +++ b/lib/opensearch/api/actions/bulk_stream.rb @@ -37,8 +37,8 @@ def bulk_stream(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = [_index, '_bulk', 'stream'].filter(&:present?).join('/').squeeze('/') method = _index.present? ? 'PUT' : 'POST' + url = [_index, '_bulk/stream'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, BULK_STREAM_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/aliases.rb b/lib/opensearch/api/actions/cat/aliases.rb index da422b6a5..32704fbec 100644 --- a/lib/opensearch/api/actions/cat/aliases.rb +++ b/lib/opensearch/api/actions/cat/aliases.rb @@ -29,8 +29,8 @@ def aliases(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'aliases', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/aliases', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, ALIASES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/all_pit_segments.rb b/lib/opensearch/api/actions/cat/all_pit_segments.rb index 825ee2cec..6b489f8b6 100644 --- a/lib/opensearch/api/actions/cat/all_pit_segments.rb +++ b/lib/opensearch/api/actions/cat/all_pit_segments.rb @@ -25,8 +25,8 @@ def all_pit_segments(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'pit_segments', '_all'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/pit_segments/_all' Utils.validate_query_params args, ALL_PIT_SEGMENTS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/allocation.rb b/lib/opensearch/api/actions/cat/allocation.rb index 3ffd4c37e..677de63dd 100644 --- a/lib/opensearch/api/actions/cat/allocation.rb +++ b/lib/opensearch/api/actions/cat/allocation.rb @@ -31,8 +31,8 @@ def allocation(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'allocation', _node_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/allocation', _node_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, ALLOCATION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/cluster_manager.rb b/lib/opensearch/api/actions/cat/cluster_manager.rb index fa0b48ce7..c1ef1fd79 100644 --- a/lib/opensearch/api/actions/cat/cluster_manager.rb +++ b/lib/opensearch/api/actions/cat/cluster_manager.rb @@ -27,8 +27,8 @@ def cluster_manager(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'cluster_manager'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/cluster_manager' Utils.validate_query_params args, CLUSTER_MANAGER_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/count.rb b/lib/opensearch/api/actions/cat/count.rb index dfcb46884..2990bf6e5 100644 --- a/lib/opensearch/api/actions/cat/count.rb +++ b/lib/opensearch/api/actions/cat/count.rb @@ -27,8 +27,8 @@ def count(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'count', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/count', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, COUNT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/fielddata.rb b/lib/opensearch/api/actions/cat/fielddata.rb index 085665d7d..03a973565 100644 --- a/lib/opensearch/api/actions/cat/fielddata.rb +++ b/lib/opensearch/api/actions/cat/fielddata.rb @@ -28,8 +28,8 @@ def fielddata(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'fielddata', _fields].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/fielddata', _fields].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, FIELDDATA_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/health.rb b/lib/opensearch/api/actions/cat/health.rb index 3fc871fba..826527a3b 100644 --- a/lib/opensearch/api/actions/cat/health.rb +++ b/lib/opensearch/api/actions/cat/health.rb @@ -26,8 +26,8 @@ def health(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'health'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/health' Utils.validate_query_params args, HEALTH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/help.rb b/lib/opensearch/api/actions/cat/help.rb index 1827f90cb..666be05a4 100644 --- a/lib/opensearch/api/actions/cat/help.rb +++ b/lib/opensearch/api/actions/cat/help.rb @@ -19,8 +19,8 @@ def help(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat' Utils.validate_query_params args, HELP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/indices.rb b/lib/opensearch/api/actions/cat/indices.rb index 533464b3a..c4aebbcdf 100644 --- a/lib/opensearch/api/actions/cat/indices.rb +++ b/lib/opensearch/api/actions/cat/indices.rb @@ -36,8 +36,8 @@ def indices(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'indices', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/indices', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, INDICES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/master.rb b/lib/opensearch/api/actions/cat/master.rb index 2d2c5eb68..afdfbd241 100644 --- a/lib/opensearch/api/actions/cat/master.rb +++ b/lib/opensearch/api/actions/cat/master.rb @@ -27,8 +27,8 @@ def master(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'master'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/master' Utils.validate_query_params args, MASTER_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/nodeattrs.rb b/lib/opensearch/api/actions/cat/nodeattrs.rb index e37011ae5..57ad77e99 100644 --- a/lib/opensearch/api/actions/cat/nodeattrs.rb +++ b/lib/opensearch/api/actions/cat/nodeattrs.rb @@ -27,8 +27,8 @@ def nodeattrs(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'nodeattrs'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/nodeattrs' Utils.validate_query_params args, NODEATTRS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/nodes.rb b/lib/opensearch/api/actions/cat/nodes.rb index c64933f5c..ce637324f 100644 --- a/lib/opensearch/api/actions/cat/nodes.rb +++ b/lib/opensearch/api/actions/cat/nodes.rb @@ -30,8 +30,8 @@ def nodes(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'nodes'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/nodes' Utils.validate_query_params args, NODES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/pending_tasks.rb b/lib/opensearch/api/actions/cat/pending_tasks.rb index 390ceb1bc..b060e3503 100644 --- a/lib/opensearch/api/actions/cat/pending_tasks.rb +++ b/lib/opensearch/api/actions/cat/pending_tasks.rb @@ -28,8 +28,8 @@ def pending_tasks(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'pending_tasks'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/pending_tasks' Utils.validate_query_params args, PENDING_TASKS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/pit_segments.rb b/lib/opensearch/api/actions/cat/pit_segments.rb index f463dd02a..64419a017 100644 --- a/lib/opensearch/api/actions/cat/pit_segments.rb +++ b/lib/opensearch/api/actions/cat/pit_segments.rb @@ -26,8 +26,8 @@ def pit_segments(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'pit_segments'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/pit_segments' Utils.validate_query_params args, PIT_SEGMENTS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/plugins.rb b/lib/opensearch/api/actions/cat/plugins.rb index 486495470..bc7f518fe 100644 --- a/lib/opensearch/api/actions/cat/plugins.rb +++ b/lib/opensearch/api/actions/cat/plugins.rb @@ -27,8 +27,8 @@ def plugins(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'plugins'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/plugins' Utils.validate_query_params args, PLUGINS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/recovery.rb b/lib/opensearch/api/actions/cat/recovery.rb index 95cd8e4c0..230c54758 100644 --- a/lib/opensearch/api/actions/cat/recovery.rb +++ b/lib/opensearch/api/actions/cat/recovery.rb @@ -31,8 +31,8 @@ def recovery(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'recovery', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/recovery', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, RECOVERY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/repositories.rb b/lib/opensearch/api/actions/cat/repositories.rb index 041285a7d..64e5f615e 100644 --- a/lib/opensearch/api/actions/cat/repositories.rb +++ b/lib/opensearch/api/actions/cat/repositories.rb @@ -27,8 +27,8 @@ def repositories(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'repositories'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/repositories' Utils.validate_query_params args, REPOSITORIES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/segment_replication.rb b/lib/opensearch/api/actions/cat/segment_replication.rb index efe84e45f..5c6e8b0ea 100644 --- a/lib/opensearch/api/actions/cat/segment_replication.rb +++ b/lib/opensearch/api/actions/cat/segment_replication.rb @@ -38,8 +38,8 @@ def segment_replication(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'segment_replication', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/segment_replication', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SEGMENT_REPLICATION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/segments.rb b/lib/opensearch/api/actions/cat/segments.rb index 4c443fd2a..1fa9620f7 100644 --- a/lib/opensearch/api/actions/cat/segments.rb +++ b/lib/opensearch/api/actions/cat/segments.rb @@ -30,8 +30,8 @@ def segments(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'segments', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/segments', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SEGMENTS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/shards.rb b/lib/opensearch/api/actions/cat/shards.rb index f6e1ebfef..36a08872b 100644 --- a/lib/opensearch/api/actions/cat/shards.rb +++ b/lib/opensearch/api/actions/cat/shards.rb @@ -32,8 +32,8 @@ def shards(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'shards', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/shards', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SHARDS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/snapshots.rb b/lib/opensearch/api/actions/cat/snapshots.rb index 97900e885..a8655d5ea 100644 --- a/lib/opensearch/api/actions/cat/snapshots.rb +++ b/lib/opensearch/api/actions/cat/snapshots.rb @@ -33,8 +33,8 @@ def snapshots(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'snapshots', _repository].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/snapshots', _repository].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SNAPSHOTS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/tasks.rb b/lib/opensearch/api/actions/cat/tasks.rb index f99e2a82b..559f1c3bc 100644 --- a/lib/opensearch/api/actions/cat/tasks.rb +++ b/lib/opensearch/api/actions/cat/tasks.rb @@ -29,8 +29,8 @@ def tasks(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'tasks'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cat/tasks' Utils.validate_query_params args, TASKS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/templates.rb b/lib/opensearch/api/actions/cat/templates.rb index aef5dfefc..89f8c908c 100644 --- a/lib/opensearch/api/actions/cat/templates.rb +++ b/lib/opensearch/api/actions/cat/templates.rb @@ -30,8 +30,8 @@ def templates(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'templates', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/templates', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, TEMPLATES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cat/thread_pool.rb b/lib/opensearch/api/actions/cat/thread_pool.rb index 4c1c3c3d8..4ad5290ac 100644 --- a/lib/opensearch/api/actions/cat/thread_pool.rb +++ b/lib/opensearch/api/actions/cat/thread_pool.rb @@ -32,8 +32,8 @@ def thread_pool(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cat', 'thread_pool', _thread_pool_patterns].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cat/thread_pool', _thread_pool_patterns].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, THREAD_POOL_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/clear_scroll.rb b/lib/opensearch/api/actions/clear_scroll.rb index aecb4eb63..5168d86f2 100644 --- a/lib/opensearch/api/actions/clear_scroll.rb +++ b/lib/opensearch/api/actions/clear_scroll.rb @@ -25,8 +25,8 @@ def clear_scroll(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_search', 'scroll', _scroll_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_search/scroll', _scroll_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CLEAR_SCROLL_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/cluster/allocation_explain.rb b/lib/opensearch/api/actions/cluster/allocation_explain.rb index 1fb8e79be..5650c207b 100644 --- a/lib/opensearch/api/actions/cluster/allocation_explain.rb +++ b/lib/opensearch/api/actions/cluster/allocation_explain.rb @@ -22,8 +22,8 @@ def allocation_explain(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'allocation', 'explain'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = '_cluster/allocation/explain' Utils.validate_query_params args, ALLOCATION_EXPLAIN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/delete_component_template.rb b/lib/opensearch/api/actions/cluster/delete_component_template.rb index a44e4e65e..929b81f8c 100644 --- a/lib/opensearch/api/actions/cluster/delete_component_template.rb +++ b/lib/opensearch/api/actions/cluster/delete_component_template.rb @@ -29,8 +29,8 @@ def delete_component_template(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_component_template', _name].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_component_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_COMPONENT_TEMPLATE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb index b6d139f2e..37c1c565c 100644 --- a/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/delete_decommission_awareness.rb @@ -21,8 +21,8 @@ def delete_decommission_awareness(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'decommission', 'awareness'].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = '_cluster/decommission/awareness' Utils.validate_query_params args, DELETE_DECOMMISSION_AWARENESS_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb b/lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb index 5ec48e97d..4d0c8c90e 100644 --- a/lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb +++ b/lib/opensearch/api/actions/cluster/delete_voting_config_exclusions.rb @@ -22,8 +22,8 @@ def delete_voting_config_exclusions(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'voting_config_exclusions'].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = '_cluster/voting_config_exclusions' Utils.validate_query_params args, DELETE_VOTING_CONFIG_EXCLUSIONS_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/cluster/delete_weighted_routing.rb b/lib/opensearch/api/actions/cluster/delete_weighted_routing.rb index 14a27c015..c58e68d2a 100644 --- a/lib/opensearch/api/actions/cluster/delete_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/delete_weighted_routing.rb @@ -22,8 +22,8 @@ def delete_weighted_routing(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'routing', 'awareness', 'weights'].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = '_cluster/routing/awareness/weights' Utils.validate_query_params args, DELETE_WEIGHTED_ROUTING_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/cluster/exists_component_template.rb b/lib/opensearch/api/actions/cluster/exists_component_template.rb index 6ed4b0867..4c4f15e3b 100644 --- a/lib/opensearch/api/actions/cluster/exists_component_template.rb +++ b/lib/opensearch/api/actions/cluster/exists_component_template.rb @@ -27,8 +27,8 @@ def exists_component_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_component_template', _name].filter(&:present?).join('/').squeeze('/') method = 'HEAD' + url = ['_component_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXISTS_COMPONENT_TEMPLATE_QUERY_PARAMS transport.perform_head_request method, url, args, body, headers diff --git a/lib/opensearch/api/actions/cluster/get_component_template.rb b/lib/opensearch/api/actions/cluster/get_component_template.rb index e3a0784f9..b7f19fa7b 100644 --- a/lib/opensearch/api/actions/cluster/get_component_template.rb +++ b/lib/opensearch/api/actions/cluster/get_component_template.rb @@ -25,8 +25,8 @@ def get_component_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_component_template', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_component_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_COMPONENT_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb index 614bdf3ad..710acacf0 100644 --- a/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/get_decommission_awareness.rb @@ -24,8 +24,8 @@ def get_decommission_awareness(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'decommission', 'awareness', _awareness_attribute_name, '_status'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cluster/decommission/awareness', _awareness_attribute_name, '_status'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_DECOMMISSION_AWARENESS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/get_settings.rb b/lib/opensearch/api/actions/cluster/get_settings.rb index 3e670dc87..0674b2cf0 100644 --- a/lib/opensearch/api/actions/cluster/get_settings.rb +++ b/lib/opensearch/api/actions/cluster/get_settings.rb @@ -24,8 +24,8 @@ def get_settings(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'settings'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cluster/settings' Utils.validate_query_params args, GET_SETTINGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/get_weighted_routing.rb b/lib/opensearch/api/actions/cluster/get_weighted_routing.rb index 6a3ce4804..93df34b7c 100644 --- a/lib/opensearch/api/actions/cluster/get_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/get_weighted_routing.rb @@ -24,8 +24,8 @@ def get_weighted_routing(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'routing', 'awareness', _attribute, 'weights'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cluster/routing/awareness', _attribute, 'weights'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_WEIGHTED_ROUTING_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/health.rb b/lib/opensearch/api/actions/cluster/health.rb index 4e4ec7af9..2c2fe4f7c 100644 --- a/lib/opensearch/api/actions/cluster/health.rb +++ b/lib/opensearch/api/actions/cluster/health.rb @@ -35,8 +35,8 @@ def health(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'health', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cluster/health', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, HEALTH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/pending_tasks.rb b/lib/opensearch/api/actions/cluster/pending_tasks.rb index 21dec5c82..2da3c1c70 100644 --- a/lib/opensearch/api/actions/cluster/pending_tasks.rb +++ b/lib/opensearch/api/actions/cluster/pending_tasks.rb @@ -23,8 +23,8 @@ def pending_tasks(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'pending_tasks'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_cluster/pending_tasks' Utils.validate_query_params args, PENDING_TASKS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/post_voting_config_exclusions.rb b/lib/opensearch/api/actions/cluster/post_voting_config_exclusions.rb index 1c1fb7f8a..aa28b6a57 100644 --- a/lib/opensearch/api/actions/cluster/post_voting_config_exclusions.rb +++ b/lib/opensearch/api/actions/cluster/post_voting_config_exclusions.rb @@ -22,8 +22,8 @@ def post_voting_config_exclusions(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'voting_config_exclusions'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_cluster/voting_config_exclusions' Utils.validate_query_params args, POST_VOTING_CONFIG_EXCLUSIONS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/put_component_template.rb b/lib/opensearch/api/actions/cluster/put_component_template.rb index 49c611fb4..081349e8b 100644 --- a/lib/opensearch/api/actions/cluster/put_component_template.rb +++ b/lib/opensearch/api/actions/cluster/put_component_template.rb @@ -30,8 +30,8 @@ def put_component_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_component_template', _name].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_component_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_COMPONENT_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb b/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb index 493971f4d..f252e7d5e 100644 --- a/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb +++ b/lib/opensearch/api/actions/cluster/put_decommission_awareness.rb @@ -27,8 +27,8 @@ def put_decommission_awareness(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'decommission', 'awareness', _awareness_attribute_name, _awareness_attribute_value].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_cluster/decommission/awareness', _awareness_attribute_name, _awareness_attribute_value].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_DECOMMISSION_AWARENESS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/put_settings.rb b/lib/opensearch/api/actions/cluster/put_settings.rb index 47e418a7a..1df2d8680 100644 --- a/lib/opensearch/api/actions/cluster/put_settings.rb +++ b/lib/opensearch/api/actions/cluster/put_settings.rb @@ -26,8 +26,8 @@ def put_settings(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'settings'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_cluster/settings' Utils.validate_query_params args, PUT_SETTINGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/put_weighted_routing.rb b/lib/opensearch/api/actions/cluster/put_weighted_routing.rb index ee066f2b1..ca67baae1 100644 --- a/lib/opensearch/api/actions/cluster/put_weighted_routing.rb +++ b/lib/opensearch/api/actions/cluster/put_weighted_routing.rb @@ -25,8 +25,8 @@ def put_weighted_routing(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'routing', 'awareness', _attribute, 'weights'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_cluster/routing/awareness', _attribute, 'weights'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_WEIGHTED_ROUTING_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/remote_info.rb b/lib/opensearch/api/actions/cluster/remote_info.rb index c06330435..c329286c5 100644 --- a/lib/opensearch/api/actions/cluster/remote_info.rb +++ b/lib/opensearch/api/actions/cluster/remote_info.rb @@ -19,8 +19,8 @@ def remote_info(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_remote', 'info'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_remote/info' Utils.validate_query_params args, REMOTE_INFO_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/reroute.rb b/lib/opensearch/api/actions/cluster/reroute.rb index c22b8b730..5f675cc01 100644 --- a/lib/opensearch/api/actions/cluster/reroute.rb +++ b/lib/opensearch/api/actions/cluster/reroute.rb @@ -27,8 +27,8 @@ def reroute(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'reroute'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_cluster/reroute' Utils.validate_query_params args, REROUTE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/state.rb b/lib/opensearch/api/actions/cluster/state.rb index 807ea1888..10fceea98 100644 --- a/lib/opensearch/api/actions/cluster/state.rb +++ b/lib/opensearch/api/actions/cluster/state.rb @@ -33,8 +33,8 @@ def state(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'state', _metric, _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cluster/state', _metric, _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/cluster/stats.rb b/lib/opensearch/api/actions/cluster/stats.rb index 8941b7d64..80b5ede66 100644 --- a/lib/opensearch/api/actions/cluster/stats.rb +++ b/lib/opensearch/api/actions/cluster/stats.rb @@ -28,8 +28,8 @@ def stats(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_cluster', 'stats', _metric, _index_metric, 'nodes', _node_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_cluster/stats', _metric, _index_metric, 'nodes', _node_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/count.rb b/lib/opensearch/api/actions/count.rb index 9718b0caa..32345d778 100644 --- a/lib/opensearch/api/actions/count.rb +++ b/lib/opensearch/api/actions/count.rb @@ -37,8 +37,8 @@ def count(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_count'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_count'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, COUNT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/create.rb b/lib/opensearch/api/actions/create.rb index 8d9aedc12..2e1ef4695 100644 --- a/lib/opensearch/api/actions/create.rb +++ b/lib/opensearch/api/actions/create.rb @@ -38,8 +38,8 @@ def create(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_create', _id].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_create', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/create_pit.rb b/lib/opensearch/api/actions/create_pit.rb index bbd01b874..f433cc0ec 100644 --- a/lib/opensearch/api/actions/create_pit.rb +++ b/lib/opensearch/api/actions/create_pit.rb @@ -29,8 +29,8 @@ def create_pit(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_search', 'point_in_time'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_search/point_in_time'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_PIT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb b/lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb index 94aeda680..c24721890 100644 --- a/lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb +++ b/lib/opensearch/api/actions/dangling_indices/delete_dangling_index.rb @@ -31,8 +31,8 @@ def delete_dangling_index(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_dangling', _index_uuid].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_dangling', _index_uuid].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_DANGLING_INDEX_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb b/lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb index e873af958..7c0618c80 100644 --- a/lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb +++ b/lib/opensearch/api/actions/dangling_indices/import_dangling_index.rb @@ -29,8 +29,8 @@ def import_dangling_index(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_dangling', _index_uuid].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_dangling', _index_uuid].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, IMPORT_DANGLING_INDEX_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb b/lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb index 87b9f5de2..024f00733 100644 --- a/lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb +++ b/lib/opensearch/api/actions/dangling_indices/list_dangling_indices.rb @@ -19,8 +19,8 @@ def list_dangling_indices(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_dangling'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_dangling' Utils.validate_query_params args, LIST_DANGLING_INDICES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/delete.rb b/lib/opensearch/api/actions/delete.rb index f51c006f1..2c06289bf 100644 --- a/lib/opensearch/api/actions/delete.rb +++ b/lib/opensearch/api/actions/delete.rb @@ -37,8 +37,8 @@ def delete(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_doc', _id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = [_index, '_doc', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/delete_all_pits.rb b/lib/opensearch/api/actions/delete_all_pits.rb index 85852e580..be6009475 100644 --- a/lib/opensearch/api/actions/delete_all_pits.rb +++ b/lib/opensearch/api/actions/delete_all_pits.rb @@ -21,8 +21,8 @@ def delete_all_pits(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_search', 'point_in_time', '_all'].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = '_search/point_in_time/_all' Utils.validate_query_params args, DELETE_ALL_PITS_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/delete_by_query.rb b/lib/opensearch/api/actions/delete_by_query.rb index 5c39136e6..cae638de4 100644 --- a/lib/opensearch/api/actions/delete_by_query.rb +++ b/lib/opensearch/api/actions/delete_by_query.rb @@ -59,8 +59,8 @@ def delete_by_query(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_delete_by_query'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_delete_by_query'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_BY_QUERY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/delete_by_query_rethrottle.rb b/lib/opensearch/api/actions/delete_by_query_rethrottle.rb index 0cf48b02a..f4a58f831 100644 --- a/lib/opensearch/api/actions/delete_by_query_rethrottle.rb +++ b/lib/opensearch/api/actions/delete_by_query_rethrottle.rb @@ -25,8 +25,8 @@ def delete_by_query_rethrottle(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_delete_by_query', _task_id, '_rethrottle'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_delete_by_query', _task_id, '_rethrottle'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_BY_QUERY_RETHROTTLE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/delete_pit.rb b/lib/opensearch/api/actions/delete_pit.rb index ece8c0184..74976244f 100644 --- a/lib/opensearch/api/actions/delete_pit.rb +++ b/lib/opensearch/api/actions/delete_pit.rb @@ -22,8 +22,8 @@ def delete_pit(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_search', 'point_in_time'].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = '_search/point_in_time' Utils.validate_query_params args, DELETE_PIT_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/delete_script.rb b/lib/opensearch/api/actions/delete_script.rb index 8159cf3e4..3e035a3b8 100644 --- a/lib/opensearch/api/actions/delete_script.rb +++ b/lib/opensearch/api/actions/delete_script.rb @@ -29,8 +29,8 @@ def delete_script(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_scripts', _id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_scripts', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_SCRIPT_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/exists.rb b/lib/opensearch/api/actions/exists.rb index cc478c1ea..ff9e268fe 100644 --- a/lib/opensearch/api/actions/exists.rb +++ b/lib/opensearch/api/actions/exists.rb @@ -37,8 +37,8 @@ def exists(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_doc', _id].filter(&:present?).join('/').squeeze('/') method = 'HEAD' + url = [_index, '_doc', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXISTS_QUERY_PARAMS transport.perform_head_request method, url, args, body, headers diff --git a/lib/opensearch/api/actions/exists_source.rb b/lib/opensearch/api/actions/exists_source.rb index b42557c94..9fcc9981a 100644 --- a/lib/opensearch/api/actions/exists_source.rb +++ b/lib/opensearch/api/actions/exists_source.rb @@ -36,8 +36,8 @@ def exists_source(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_source', _id].filter(&:present?).join('/').squeeze('/') method = 'HEAD' + url = [_index, '_source', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXISTS_SOURCE_QUERY_PARAMS transport.perform_head_request method, url, args, body, headers diff --git a/lib/opensearch/api/actions/explain.rb b/lib/opensearch/api/actions/explain.rb index f16eac7ad..f8115c4f8 100644 --- a/lib/opensearch/api/actions/explain.rb +++ b/lib/opensearch/api/actions/explain.rb @@ -40,8 +40,8 @@ def explain(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_explain', _id].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_explain', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXPLAIN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/field_caps.rb b/lib/opensearch/api/actions/field_caps.rb index 0d41b6ebb..eae0f4a8b 100644 --- a/lib/opensearch/api/actions/field_caps.rb +++ b/lib/opensearch/api/actions/field_caps.rb @@ -28,8 +28,8 @@ def field_caps(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_field_caps'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_field_caps'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, FIELD_CAPS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/flow_framework/create.rb b/lib/opensearch/api/actions/flow_framework/create.rb index 3fa718a12..7d9e34815 100644 --- a/lib/opensearch/api/actions/flow_framework/create.rb +++ b/lib/opensearch/api/actions/flow_framework/create.rb @@ -25,8 +25,8 @@ def create(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_flow_framework/workflow' Utils.validate_query_params args, CREATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/flow_framework/delete.rb b/lib/opensearch/api/actions/flow_framework/delete.rb index 206a856ea..6bad19359 100644 --- a/lib/opensearch/api/actions/flow_framework/delete.rb +++ b/lib/opensearch/api/actions/flow_framework/delete.rb @@ -27,8 +27,8 @@ def delete(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow', _workflow_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_flow_framework/workflow', _workflow_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/flow_framework/deprovision.rb b/lib/opensearch/api/actions/flow_framework/deprovision.rb index 5b443d5fc..046e7c0fd 100644 --- a/lib/opensearch/api/actions/flow_framework/deprovision.rb +++ b/lib/opensearch/api/actions/flow_framework/deprovision.rb @@ -25,8 +25,8 @@ def deprovision(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow', _workflow_id, '_deprovision'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_flow_framework/workflow', _workflow_id, '_deprovision'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DEPROVISION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/flow_framework/get.rb b/lib/opensearch/api/actions/flow_framework/get.rb index f3b4be6d6..62fdbfd91 100644 --- a/lib/opensearch/api/actions/flow_framework/get.rb +++ b/lib/opensearch/api/actions/flow_framework/get.rb @@ -24,8 +24,8 @@ def get(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow', _workflow_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_flow_framework/workflow', _workflow_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/flow_framework/get_status.rb b/lib/opensearch/api/actions/flow_framework/get_status.rb index 94bcc4ef7..df18f98be 100644 --- a/lib/opensearch/api/actions/flow_framework/get_status.rb +++ b/lib/opensearch/api/actions/flow_framework/get_status.rb @@ -25,8 +25,8 @@ def get_status(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow', _workflow_id, '_status'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_flow_framework/workflow', _workflow_id, '_status'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_STATUS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/flow_framework/get_steps.rb b/lib/opensearch/api/actions/flow_framework/get_steps.rb index 6c3658dd7..fbd88f12a 100644 --- a/lib/opensearch/api/actions/flow_framework/get_steps.rb +++ b/lib/opensearch/api/actions/flow_framework/get_steps.rb @@ -20,8 +20,8 @@ def get_steps(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow', '_steps'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_flow_framework/workflow/_steps' Utils.validate_query_params args, GET_STEPS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/flow_framework/provision.rb b/lib/opensearch/api/actions/flow_framework/provision.rb index e6e0e953f..7134da62a 100644 --- a/lib/opensearch/api/actions/flow_framework/provision.rb +++ b/lib/opensearch/api/actions/flow_framework/provision.rb @@ -25,8 +25,8 @@ def provision(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow', _workflow_id, '_provision'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_flow_framework/workflow', _workflow_id, '_provision'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PROVISION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/flow_framework/search.rb b/lib/opensearch/api/actions/flow_framework/search.rb index 6dfe029ec..def6cf9fa 100644 --- a/lib/opensearch/api/actions/flow_framework/search.rb +++ b/lib/opensearch/api/actions/flow_framework/search.rb @@ -22,8 +22,8 @@ def search(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow', '_search'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = '_plugins/_flow_framework/workflow/_search' Utils.validate_query_params args, SEARCH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/flow_framework/search_state.rb b/lib/opensearch/api/actions/flow_framework/search_state.rb index 5b875f417..c021695c2 100644 --- a/lib/opensearch/api/actions/flow_framework/search_state.rb +++ b/lib/opensearch/api/actions/flow_framework/search_state.rb @@ -22,8 +22,8 @@ def search_state(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow', 'state', '_search'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = '_plugins/_flow_framework/workflow/state/_search' Utils.validate_query_params args, SEARCH_STATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/flow_framework/update.rb b/lib/opensearch/api/actions/flow_framework/update.rb index dcc32d255..85e7f8197 100644 --- a/lib/opensearch/api/actions/flow_framework/update.rb +++ b/lib/opensearch/api/actions/flow_framework/update.rb @@ -30,8 +30,8 @@ def update(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_flow_framework', 'workflow', _workflow_id].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_flow_framework/workflow', _workflow_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/get.rb b/lib/opensearch/api/actions/get.rb index 833448017..86dc4b50b 100644 --- a/lib/opensearch/api/actions/get.rb +++ b/lib/opensearch/api/actions/get.rb @@ -37,8 +37,8 @@ def get(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_doc', _id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_doc', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/get_all_pits.rb b/lib/opensearch/api/actions/get_all_pits.rb index 32fe0b068..028ca7bdf 100644 --- a/lib/opensearch/api/actions/get_all_pits.rb +++ b/lib/opensearch/api/actions/get_all_pits.rb @@ -19,8 +19,8 @@ def get_all_pits(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_search', 'point_in_time', '_all'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_search/point_in_time/_all' Utils.validate_query_params args, GET_ALL_PITS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/get_script.rb b/lib/opensearch/api/actions/get_script.rb index cfc0e9293..1539499d8 100644 --- a/lib/opensearch/api/actions/get_script.rb +++ b/lib/opensearch/api/actions/get_script.rb @@ -26,8 +26,8 @@ def get_script(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_scripts', _id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_scripts', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_SCRIPT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/get_script_context.rb b/lib/opensearch/api/actions/get_script_context.rb index 3d9593d70..d847c2436 100644 --- a/lib/opensearch/api/actions/get_script_context.rb +++ b/lib/opensearch/api/actions/get_script_context.rb @@ -19,8 +19,8 @@ def get_script_context(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_script_context'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_script_context' Utils.validate_query_params args, GET_SCRIPT_CONTEXT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/get_script_languages.rb b/lib/opensearch/api/actions/get_script_languages.rb index 428e82ffa..217c71d73 100644 --- a/lib/opensearch/api/actions/get_script_languages.rb +++ b/lib/opensearch/api/actions/get_script_languages.rb @@ -19,8 +19,8 @@ def get_script_languages(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_script_language'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_script_language' Utils.validate_query_params args, GET_SCRIPT_LANGUAGES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/get_source.rb b/lib/opensearch/api/actions/get_source.rb index 2b7108fb0..0d12098cc 100644 --- a/lib/opensearch/api/actions/get_source.rb +++ b/lib/opensearch/api/actions/get_source.rb @@ -36,8 +36,8 @@ def get_source(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_source', _id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_source', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_SOURCE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/index.rb b/lib/opensearch/api/actions/index.rb index 2ff37ea24..630877858 100644 --- a/lib/opensearch/api/actions/index.rb +++ b/lib/opensearch/api/actions/index.rb @@ -39,8 +39,8 @@ def index(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_doc', _id].filter(&:present?).join('/').squeeze('/') method = _id.present? ? 'PUT' : 'POST' + url = [_index, '_doc', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, INDEX_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/add_block.rb b/lib/opensearch/api/actions/indices/add_block.rb index 5510826a2..c90461be1 100644 --- a/lib/opensearch/api/actions/indices/add_block.rb +++ b/lib/opensearch/api/actions/indices/add_block.rb @@ -33,8 +33,8 @@ def add_block(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_block', _block].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = [_index, '_block', _block].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, ADD_BLOCK_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/analyze.rb b/lib/opensearch/api/actions/indices/analyze.rb index ca30d6930..330272f33 100644 --- a/lib/opensearch/api/actions/indices/analyze.rb +++ b/lib/opensearch/api/actions/indices/analyze.rb @@ -23,8 +23,8 @@ def analyze(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_analyze'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_analyze'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, ANALYZE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/clear_cache.rb b/lib/opensearch/api/actions/indices/clear_cache.rb index 3e317c428..64709e4c8 100644 --- a/lib/opensearch/api/actions/indices/clear_cache.rb +++ b/lib/opensearch/api/actions/indices/clear_cache.rb @@ -30,8 +30,8 @@ def clear_cache(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_cache', 'clear'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_cache/clear'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CLEAR_CACHE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/clone.rb b/lib/opensearch/api/actions/indices/clone.rb index 178f309eb..b55da4e4b 100644 --- a/lib/opensearch/api/actions/indices/clone.rb +++ b/lib/opensearch/api/actions/indices/clone.rb @@ -34,8 +34,8 @@ def clone(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_clone', _target].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_clone', _target].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CLONE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/close.rb b/lib/opensearch/api/actions/indices/close.rb index 019ab56e5..02634d786 100644 --- a/lib/opensearch/api/actions/indices/close.rb +++ b/lib/opensearch/api/actions/indices/close.rb @@ -31,8 +31,8 @@ def close(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_close'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_close'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CLOSE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/create.rb b/lib/opensearch/api/actions/indices/create.rb index fe7ac50ca..87aad172f 100644 --- a/lib/opensearch/api/actions/indices/create.rb +++ b/lib/opensearch/api/actions/indices/create.rb @@ -29,8 +29,8 @@ def create(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = [_index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/create_data_stream.rb b/lib/opensearch/api/actions/indices/create_data_stream.rb index 384d2715f..5bd0a5015 100644 --- a/lib/opensearch/api/actions/indices/create_data_stream.rb +++ b/lib/opensearch/api/actions/indices/create_data_stream.rb @@ -25,8 +25,8 @@ def create_data_stream(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_data_stream', _name].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_data_stream', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_DATA_STREAM_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/data_streams_stats.rb b/lib/opensearch/api/actions/indices/data_streams_stats.rb index c17d61a95..0798a4d75 100644 --- a/lib/opensearch/api/actions/indices/data_streams_stats.rb +++ b/lib/opensearch/api/actions/indices/data_streams_stats.rb @@ -22,8 +22,8 @@ def data_streams_stats(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_data_stream', _name, '_stats'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_data_stream', _name, '_stats'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DATA_STREAMS_STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/delete.rb b/lib/opensearch/api/actions/indices/delete.rb index dc5eb6fee..a2414ae35 100644 --- a/lib/opensearch/api/actions/indices/delete.rb +++ b/lib/opensearch/api/actions/indices/delete.rb @@ -32,8 +32,8 @@ def delete(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = [_index].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = [_index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/indices/delete_alias.rb b/lib/opensearch/api/actions/indices/delete_alias.rb index 1959afefd..f048088aa 100644 --- a/lib/opensearch/api/actions/indices/delete_alias.rb +++ b/lib/opensearch/api/actions/indices/delete_alias.rb @@ -32,8 +32,8 @@ def delete_alias(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_alias', _name].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = [_index, '_aliases', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_ALIAS_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/indices/delete_data_stream.rb b/lib/opensearch/api/actions/indices/delete_data_stream.rb index 222964138..3be7eb1d4 100644 --- a/lib/opensearch/api/actions/indices/delete_data_stream.rb +++ b/lib/opensearch/api/actions/indices/delete_data_stream.rb @@ -26,8 +26,8 @@ def delete_data_stream(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_data_stream', _name].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_data_stream', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_DATA_STREAM_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/indices/delete_index_template.rb b/lib/opensearch/api/actions/indices/delete_index_template.rb index c080f2ea1..c0aac7063 100644 --- a/lib/opensearch/api/actions/indices/delete_index_template.rb +++ b/lib/opensearch/api/actions/indices/delete_index_template.rb @@ -29,8 +29,8 @@ def delete_index_template(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_index_template', _name].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_index_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_INDEX_TEMPLATE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/indices/delete_template.rb b/lib/opensearch/api/actions/indices/delete_template.rb index 05db76fef..699928eb4 100644 --- a/lib/opensearch/api/actions/indices/delete_template.rb +++ b/lib/opensearch/api/actions/indices/delete_template.rb @@ -29,8 +29,8 @@ def delete_template(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_template', _name].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_TEMPLATE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/indices/exists.rb b/lib/opensearch/api/actions/indices/exists.rb index b5da063ec..f7b9f3e7c 100644 --- a/lib/opensearch/api/actions/indices/exists.rb +++ b/lib/opensearch/api/actions/indices/exists.rb @@ -31,8 +31,8 @@ def exists(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index].filter(&:present?).join('/').squeeze('/') method = 'HEAD' + url = [_index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXISTS_QUERY_PARAMS transport.perform_head_request method, url, args, body, headers diff --git a/lib/opensearch/api/actions/indices/exists_alias.rb b/lib/opensearch/api/actions/indices/exists_alias.rb index db0bf1d56..4a3f344e8 100644 --- a/lib/opensearch/api/actions/indices/exists_alias.rb +++ b/lib/opensearch/api/actions/indices/exists_alias.rb @@ -30,8 +30,8 @@ def exists_alias(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_alias', _name].filter(&:present?).join('/').squeeze('/') method = 'HEAD' + url = [_index, '_alias', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXISTS_ALIAS_QUERY_PARAMS transport.perform_head_request method, url, args, body, headers diff --git a/lib/opensearch/api/actions/indices/exists_index_template.rb b/lib/opensearch/api/actions/indices/exists_index_template.rb index 0fe872c73..67231fc7b 100644 --- a/lib/opensearch/api/actions/indices/exists_index_template.rb +++ b/lib/opensearch/api/actions/indices/exists_index_template.rb @@ -28,8 +28,8 @@ def exists_index_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_index_template', _name].filter(&:present?).join('/').squeeze('/') method = 'HEAD' + url = ['_index_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXISTS_INDEX_TEMPLATE_QUERY_PARAMS transport.perform_head_request method, url, args, body, headers diff --git a/lib/opensearch/api/actions/indices/exists_template.rb b/lib/opensearch/api/actions/indices/exists_template.rb index 46aa9646b..39afc7e37 100644 --- a/lib/opensearch/api/actions/indices/exists_template.rb +++ b/lib/opensearch/api/actions/indices/exists_template.rb @@ -28,8 +28,8 @@ def exists_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_template', _name].filter(&:present?).join('/').squeeze('/') method = 'HEAD' + url = ['_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXISTS_TEMPLATE_QUERY_PARAMS transport.perform_head_request method, url, args, body, headers diff --git a/lib/opensearch/api/actions/indices/flush.rb b/lib/opensearch/api/actions/indices/flush.rb index 316f069b8..a1d258b6a 100644 --- a/lib/opensearch/api/actions/indices/flush.rb +++ b/lib/opensearch/api/actions/indices/flush.rb @@ -27,8 +27,8 @@ def flush(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_flush'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_flush'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, FLUSH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/forcemerge.rb b/lib/opensearch/api/actions/indices/forcemerge.rb index 92b661759..edacd1fbc 100644 --- a/lib/opensearch/api/actions/indices/forcemerge.rb +++ b/lib/opensearch/api/actions/indices/forcemerge.rb @@ -30,8 +30,8 @@ def forcemerge(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_forcemerge'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_forcemerge'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, FORCEMERGE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/get.rb b/lib/opensearch/api/actions/indices/get.rb index 6f21d71e8..93ea7d5fe 100644 --- a/lib/opensearch/api/actions/indices/get.rb +++ b/lib/opensearch/api/actions/indices/get.rb @@ -32,8 +32,8 @@ def get(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/get_alias.rb b/lib/opensearch/api/actions/indices/get_alias.rb index e4358dd6b..f329fe644 100644 --- a/lib/opensearch/api/actions/indices/get_alias.rb +++ b/lib/opensearch/api/actions/indices/get_alias.rb @@ -28,8 +28,8 @@ def get_alias(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_alias', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_alias', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_ALIAS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/get_data_stream.rb b/lib/opensearch/api/actions/indices/get_data_stream.rb index bdf078310..9a2793fef 100644 --- a/lib/opensearch/api/actions/indices/get_data_stream.rb +++ b/lib/opensearch/api/actions/indices/get_data_stream.rb @@ -22,8 +22,8 @@ def get_data_stream(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_data_stream', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_data_stream', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_DATA_STREAM_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/get_field_mapping.rb b/lib/opensearch/api/actions/indices/get_field_mapping.rb index 9c5a3fd41..bac24c53b 100644 --- a/lib/opensearch/api/actions/indices/get_field_mapping.rb +++ b/lib/opensearch/api/actions/indices/get_field_mapping.rb @@ -31,8 +31,8 @@ def get_field_mapping(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_mapping', 'field', _fields].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_mapping/field', _fields].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_FIELD_MAPPING_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/get_index_template.rb b/lib/opensearch/api/actions/indices/get_index_template.rb index 7b59cb002..337fc0884 100644 --- a/lib/opensearch/api/actions/indices/get_index_template.rb +++ b/lib/opensearch/api/actions/indices/get_index_template.rb @@ -26,8 +26,8 @@ def get_index_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_index_template', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_index_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_INDEX_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/get_mapping.rb b/lib/opensearch/api/actions/indices/get_mapping.rb index 66d2842c0..d4724ce8b 100644 --- a/lib/opensearch/api/actions/indices/get_mapping.rb +++ b/lib/opensearch/api/actions/indices/get_mapping.rb @@ -28,8 +28,8 @@ def get_mapping(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_mapping'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_mapping'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_MAPPING_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/get_settings.rb b/lib/opensearch/api/actions/indices/get_settings.rb index 399aa51c4..80df1881f 100644 --- a/lib/opensearch/api/actions/indices/get_settings.rb +++ b/lib/opensearch/api/actions/indices/get_settings.rb @@ -32,8 +32,8 @@ def get_settings(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_settings', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_settings', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_SETTINGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/get_template.rb b/lib/opensearch/api/actions/indices/get_template.rb index e353ca3d9..1e0e05914 100644 --- a/lib/opensearch/api/actions/indices/get_template.rb +++ b/lib/opensearch/api/actions/indices/get_template.rb @@ -26,8 +26,8 @@ def get_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_template', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/get_upgrade.rb b/lib/opensearch/api/actions/indices/get_upgrade.rb index 409827eb8..a8aa53de2 100644 --- a/lib/opensearch/api/actions/indices/get_upgrade.rb +++ b/lib/opensearch/api/actions/indices/get_upgrade.rb @@ -25,8 +25,8 @@ def get_upgrade(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_upgrade'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_upgrade'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_UPGRADE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/open.rb b/lib/opensearch/api/actions/indices/open.rb index 95e68af75..e8f5ac8b8 100644 --- a/lib/opensearch/api/actions/indices/open.rb +++ b/lib/opensearch/api/actions/indices/open.rb @@ -33,8 +33,8 @@ def open(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_open'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_open'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, OPEN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/put_alias.rb b/lib/opensearch/api/actions/indices/put_alias.rb index c8e7171e6..c43fda118 100644 --- a/lib/opensearch/api/actions/indices/put_alias.rb +++ b/lib/opensearch/api/actions/indices/put_alias.rb @@ -28,8 +28,8 @@ def put_alias(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_alias', _name].filter(&:present?).join('/').squeeze('/') method = _name.present? ? 'PUT' : 'POST' + url = [_index, '_aliases', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_ALIAS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/put_index_template.rb b/lib/opensearch/api/actions/indices/put_index_template.rb index 9d192299c..75f92fa06 100644 --- a/lib/opensearch/api/actions/indices/put_index_template.rb +++ b/lib/opensearch/api/actions/indices/put_index_template.rb @@ -30,8 +30,8 @@ def put_index_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_index_template', _name].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_index_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_INDEX_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/put_mapping.rb b/lib/opensearch/api/actions/indices/put_mapping.rb index 2f06541b9..d57b216a6 100644 --- a/lib/opensearch/api/actions/indices/put_mapping.rb +++ b/lib/opensearch/api/actions/indices/put_mapping.rb @@ -33,8 +33,8 @@ def put_mapping(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_mapping'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_mapping'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_MAPPING_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/put_settings.rb b/lib/opensearch/api/actions/indices/put_settings.rb index 34c77134d..b7e0a5db8 100644 --- a/lib/opensearch/api/actions/indices/put_settings.rb +++ b/lib/opensearch/api/actions/indices/put_settings.rb @@ -33,8 +33,8 @@ def put_settings(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_settings'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = [_index, '_settings'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_SETTINGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/put_template.rb b/lib/opensearch/api/actions/indices/put_template.rb index 7f3ad70bf..8bc991e65 100644 --- a/lib/opensearch/api/actions/indices/put_template.rb +++ b/lib/opensearch/api/actions/indices/put_template.rb @@ -30,8 +30,8 @@ def put_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_template', _name].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_template', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/recovery.rb b/lib/opensearch/api/actions/indices/recovery.rb index 2a3991e96..3dcfafb18 100644 --- a/lib/opensearch/api/actions/indices/recovery.rb +++ b/lib/opensearch/api/actions/indices/recovery.rb @@ -24,8 +24,8 @@ def recovery(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_recovery'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_recovery'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, RECOVERY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/refresh.rb b/lib/opensearch/api/actions/indices/refresh.rb index f67cb8716..02ab2c2a8 100644 --- a/lib/opensearch/api/actions/indices/refresh.rb +++ b/lib/opensearch/api/actions/indices/refresh.rb @@ -25,8 +25,8 @@ def refresh(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_refresh'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_refresh'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, REFRESH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/resolve_index.rb b/lib/opensearch/api/actions/indices/resolve_index.rb index 68d3cc5ea..aa3af3e91 100644 --- a/lib/opensearch/api/actions/indices/resolve_index.rb +++ b/lib/opensearch/api/actions/indices/resolve_index.rb @@ -25,8 +25,8 @@ def resolve_index(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_resolve', 'index', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_resolve/index', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, RESOLVE_INDEX_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/rollover.rb b/lib/opensearch/api/actions/indices/rollover.rb index d23b8c4f3..5479a3c5d 100644 --- a/lib/opensearch/api/actions/indices/rollover.rb +++ b/lib/opensearch/api/actions/indices/rollover.rb @@ -33,8 +33,8 @@ def rollover(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_alias, '_rollover', _new_index].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_alias, '_rollover', _new_index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, ROLLOVER_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/segments.rb b/lib/opensearch/api/actions/indices/segments.rb index 968ea1af2..f2f9493a5 100644 --- a/lib/opensearch/api/actions/indices/segments.rb +++ b/lib/opensearch/api/actions/indices/segments.rb @@ -26,8 +26,8 @@ def segments(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_segments'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_segments'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SEGMENTS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/shard_stores.rb b/lib/opensearch/api/actions/indices/shard_stores.rb index 9c89631c0..84a169c59 100644 --- a/lib/opensearch/api/actions/indices/shard_stores.rb +++ b/lib/opensearch/api/actions/indices/shard_stores.rb @@ -26,8 +26,8 @@ def shard_stores(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_shard_stores'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_shard_stores'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SHARD_STORES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/shrink.rb b/lib/opensearch/api/actions/indices/shrink.rb index 03e854fb5..5bf33f8d0 100644 --- a/lib/opensearch/api/actions/indices/shrink.rb +++ b/lib/opensearch/api/actions/indices/shrink.rb @@ -35,8 +35,8 @@ def shrink(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_shrink', _target].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_shrink', _target].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SHRINK_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/simulate_index_template.rb b/lib/opensearch/api/actions/indices/simulate_index_template.rb index a97ce338b..e5d334a1e 100644 --- a/lib/opensearch/api/actions/indices/simulate_index_template.rb +++ b/lib/opensearch/api/actions/indices/simulate_index_template.rb @@ -27,8 +27,8 @@ def simulate_index_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_index_template', '_simulate_index', _name].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_index_template/_simulate_index', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SIMULATE_INDEX_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/simulate_template.rb b/lib/opensearch/api/actions/indices/simulate_template.rb index 69c7e5465..d11395e9f 100644 --- a/lib/opensearch/api/actions/indices/simulate_template.rb +++ b/lib/opensearch/api/actions/indices/simulate_template.rb @@ -27,8 +27,8 @@ def simulate_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_index_template', '_simulate', _name].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_index_template/_simulate', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SIMULATE_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/split.rb b/lib/opensearch/api/actions/indices/split.rb index 73f913f59..7cb74fe58 100644 --- a/lib/opensearch/api/actions/indices/split.rb +++ b/lib/opensearch/api/actions/indices/split.rb @@ -35,8 +35,8 @@ def split(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_split', _target].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_split', _target].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SPLIT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/stats.rb b/lib/opensearch/api/actions/indices/stats.rb index 0caf7d1c3..2fb16a3b0 100644 --- a/lib/opensearch/api/actions/indices/stats.rb +++ b/lib/opensearch/api/actions/indices/stats.rb @@ -33,8 +33,8 @@ def stats(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_stats', _metric].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = [_index, '_stats', _metric].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/update_aliases.rb b/lib/opensearch/api/actions/indices/update_aliases.rb index 35d75d6e6..8213a9a92 100644 --- a/lib/opensearch/api/actions/indices/update_aliases.rb +++ b/lib/opensearch/api/actions/indices/update_aliases.rb @@ -25,8 +25,8 @@ def update_aliases(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_aliases'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_aliases' Utils.validate_query_params args, UPDATE_ALIASES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/upgrade.rb b/lib/opensearch/api/actions/indices/upgrade.rb index 209af675b..daec3da42 100644 --- a/lib/opensearch/api/actions/indices/upgrade.rb +++ b/lib/opensearch/api/actions/indices/upgrade.rb @@ -28,8 +28,8 @@ def upgrade(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_upgrade'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_upgrade'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPGRADE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/indices/validate_query.rb b/lib/opensearch/api/actions/indices/validate_query.rb index 0ef55cbed..74ec58cdc 100644 --- a/lib/opensearch/api/actions/indices/validate_query.rb +++ b/lib/opensearch/api/actions/indices/validate_query.rb @@ -35,8 +35,8 @@ def validate_query(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_validate', 'query'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_validate/query'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, VALIDATE_QUERY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/info.rb b/lib/opensearch/api/actions/info.rb index f8036871d..aee22105b 100644 --- a/lib/opensearch/api/actions/info.rb +++ b/lib/opensearch/api/actions/info.rb @@ -19,8 +19,8 @@ def info(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = [].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = Utils.validate_query_params args, INFO_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ingest/delete_pipeline.rb b/lib/opensearch/api/actions/ingest/delete_pipeline.rb index 4c881a1ce..3f690eb25 100644 --- a/lib/opensearch/api/actions/ingest/delete_pipeline.rb +++ b/lib/opensearch/api/actions/ingest/delete_pipeline.rb @@ -29,8 +29,8 @@ def delete_pipeline(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_ingest', 'pipeline', _id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_ingest/pipeline', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_PIPELINE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/ingest/get_pipeline.rb b/lib/opensearch/api/actions/ingest/get_pipeline.rb index 0d122d1a9..3a646e41a 100644 --- a/lib/opensearch/api/actions/ingest/get_pipeline.rb +++ b/lib/opensearch/api/actions/ingest/get_pipeline.rb @@ -24,8 +24,8 @@ def get_pipeline(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_ingest', 'pipeline', _id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_ingest/pipeline', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_PIPELINE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ingest/processor_grok.rb b/lib/opensearch/api/actions/ingest/processor_grok.rb index 0448db521..8d5c6c7de 100644 --- a/lib/opensearch/api/actions/ingest/processor_grok.rb +++ b/lib/opensearch/api/actions/ingest/processor_grok.rb @@ -20,8 +20,8 @@ def processor_grok(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_ingest', 'processor', 'grok'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_ingest/processor/grok' Utils.validate_query_params args, PROCESSOR_GROK_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ingest/put_pipeline.rb b/lib/opensearch/api/actions/ingest/put_pipeline.rb index 8e038b9ba..5b9a85004 100644 --- a/lib/opensearch/api/actions/ingest/put_pipeline.rb +++ b/lib/opensearch/api/actions/ingest/put_pipeline.rb @@ -29,8 +29,8 @@ def put_pipeline(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_ingest', 'pipeline', _id].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_ingest/pipeline', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_PIPELINE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ingest/simulate.rb b/lib/opensearch/api/actions/ingest/simulate.rb index a49115be6..0cb4c4ae7 100644 --- a/lib/opensearch/api/actions/ingest/simulate.rb +++ b/lib/opensearch/api/actions/ingest/simulate.rb @@ -26,8 +26,8 @@ def simulate(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_ingest', 'pipeline', _id, '_simulate'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = ['_ingest/pipeline', _id, '_simulate'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SIMULATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/insights/top_queries.rb b/lib/opensearch/api/actions/insights/top_queries.rb index 0a99c246a..887ea6c19 100644 --- a/lib/opensearch/api/actions/insights/top_queries.rb +++ b/lib/opensearch/api/actions/insights/top_queries.rb @@ -22,8 +22,8 @@ def top_queries(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_insights', 'top_queries'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_insights/top_queries' Utils.validate_query_params args, TOP_QUERIES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/add_policy.rb b/lib/opensearch/api/actions/ism/add_policy.rb index e05cd5d97..f6a32b2fb 100644 --- a/lib/opensearch/api/actions/ism/add_policy.rb +++ b/lib/opensearch/api/actions/ism/add_policy.rb @@ -25,8 +25,8 @@ def add_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'add', _index].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_ism/add', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, ADD_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/change_policy.rb b/lib/opensearch/api/actions/ism/change_policy.rb index 3f064a20e..e08f5b6f5 100644 --- a/lib/opensearch/api/actions/ism/change_policy.rb +++ b/lib/opensearch/api/actions/ism/change_policy.rb @@ -25,8 +25,8 @@ def change_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'change_policy', _index].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_ism/change_policy', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CHANGE_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/delete_policy.rb b/lib/opensearch/api/actions/ism/delete_policy.rb index 3005aedfb..a6cff1d4e 100644 --- a/lib/opensearch/api/actions/ism/delete_policy.rb +++ b/lib/opensearch/api/actions/ism/delete_policy.rb @@ -26,8 +26,8 @@ def delete_policy(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'policies', _policy_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_ism/policies', _policy_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_POLICY_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/ism/exists_policy.rb b/lib/opensearch/api/actions/ism/exists_policy.rb index 70457bede..397de4509 100644 --- a/lib/opensearch/api/actions/ism/exists_policy.rb +++ b/lib/opensearch/api/actions/ism/exists_policy.rb @@ -24,8 +24,8 @@ def exists_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'policies', _policy_id].filter(&:present?).join('/').squeeze('/') method = 'HEAD' + url = ['_plugins/_ism/policies', _policy_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXISTS_POLICY_QUERY_PARAMS transport.perform_head_request method, url, args, body, headers diff --git a/lib/opensearch/api/actions/ism/explain_policy.rb b/lib/opensearch/api/actions/ism/explain_policy.rb index 9eadf88b8..5b01fed2c 100644 --- a/lib/opensearch/api/actions/ism/explain_policy.rb +++ b/lib/opensearch/api/actions/ism/explain_policy.rb @@ -23,8 +23,8 @@ def explain_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'explain', _index].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = ['_plugins/_ism/explain', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXPLAIN_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/get_policies.rb b/lib/opensearch/api/actions/ism/get_policies.rb index c60183059..738542be3 100644 --- a/lib/opensearch/api/actions/ism/get_policies.rb +++ b/lib/opensearch/api/actions/ism/get_policies.rb @@ -19,8 +19,8 @@ def get_policies(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'policies'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_ism/policies' Utils.validate_query_params args, GET_POLICIES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/get_policy.rb b/lib/opensearch/api/actions/ism/get_policy.rb index edf1ecb77..41463eb73 100644 --- a/lib/opensearch/api/actions/ism/get_policy.rb +++ b/lib/opensearch/api/actions/ism/get_policy.rb @@ -24,8 +24,8 @@ def get_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'policies', _policy_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_ism/policies', _policy_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/put_policies.rb b/lib/opensearch/api/actions/ism/put_policies.rb index df4360dcd..f1a335461 100644 --- a/lib/opensearch/api/actions/ism/put_policies.rb +++ b/lib/opensearch/api/actions/ism/put_policies.rb @@ -25,8 +25,8 @@ def put_policies(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'policies'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_ism/policies' Utils.validate_query_params args, PUT_POLICIES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/put_policy.rb b/lib/opensearch/api/actions/ism/put_policy.rb index 8818eccc5..15ba3066a 100644 --- a/lib/opensearch/api/actions/ism/put_policy.rb +++ b/lib/opensearch/api/actions/ism/put_policy.rb @@ -27,8 +27,8 @@ def put_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'policies', _policy_id].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_ism/policies', _policy_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb b/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb index 17c344d7f..eb4ca1d4f 100644 --- a/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb +++ b/lib/opensearch/api/actions/ism/refresh_search_analyzers.rb @@ -24,8 +24,8 @@ def refresh_search_analyzers(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_refresh_search_analyzers', _index].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_refresh_search_analyzers', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, REFRESH_SEARCH_ANALYZERS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/remove_policy.rb b/lib/opensearch/api/actions/ism/remove_policy.rb index 25c4b286d..0e8c088f0 100644 --- a/lib/opensearch/api/actions/ism/remove_policy.rb +++ b/lib/opensearch/api/actions/ism/remove_policy.rb @@ -24,8 +24,8 @@ def remove_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'remove', _index].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_ism/remove', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, REMOVE_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ism/retry_index.rb b/lib/opensearch/api/actions/ism/retry_index.rb index 4a45d838a..77bfe848b 100644 --- a/lib/opensearch/api/actions/ism/retry_index.rb +++ b/lib/opensearch/api/actions/ism/retry_index.rb @@ -25,8 +25,8 @@ def retry_index(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ism', 'retry', _index].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_ism/retry', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, RETRY_INDEX_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/knn/delete_model.rb b/lib/opensearch/api/actions/knn/delete_model.rb index dfa1a680c..40b42b6f1 100644 --- a/lib/opensearch/api/actions/knn/delete_model.rb +++ b/lib/opensearch/api/actions/knn/delete_model.rb @@ -26,8 +26,8 @@ def delete_model(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_knn', 'models', _model_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_knn/models', _model_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_MODEL_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/knn/get_model.rb b/lib/opensearch/api/actions/knn/get_model.rb index b78c37a29..7c44ee876 100644 --- a/lib/opensearch/api/actions/knn/get_model.rb +++ b/lib/opensearch/api/actions/knn/get_model.rb @@ -24,8 +24,8 @@ def get_model(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_knn', 'models', _model_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_knn/models', _model_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_MODEL_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/knn/search_models.rb b/lib/opensearch/api/actions/knn/search_models.rb index 21e63dd82..c44249d3d 100644 --- a/lib/opensearch/api/actions/knn/search_models.rb +++ b/lib/opensearch/api/actions/knn/search_models.rb @@ -62,8 +62,8 @@ def search_models(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_knn', 'models', '_search'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = '_plugins/_knn/models/_search' Utils.validate_query_params args, SEARCH_MODELS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/knn/stats.rb b/lib/opensearch/api/actions/knn/stats.rb index 6ff1ac2ec..a27fe5f3a 100644 --- a/lib/opensearch/api/actions/knn/stats.rb +++ b/lib/opensearch/api/actions/knn/stats.rb @@ -25,8 +25,8 @@ def stats(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_knn', _node_id, 'stats', _stat].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_knn', _node_id, 'stats', _stat].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/knn/train_model.rb b/lib/opensearch/api/actions/knn/train_model.rb index e8c3959af..4d78a9acb 100644 --- a/lib/opensearch/api/actions/knn/train_model.rb +++ b/lib/opensearch/api/actions/knn/train_model.rb @@ -24,8 +24,8 @@ def train_model(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_knn', 'models', _model_id, '_train'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_knn/models', _model_id, '_train'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, TRAIN_MODEL_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/knn/warmup.rb b/lib/opensearch/api/actions/knn/warmup.rb index e015022ff..6253b7479 100644 --- a/lib/opensearch/api/actions/knn/warmup.rb +++ b/lib/opensearch/api/actions/knn/warmup.rb @@ -24,8 +24,8 @@ def warmup(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_knn', 'warmup', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_knn/warmup', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, WARMUP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/list/help.rb b/lib/opensearch/api/actions/list/help.rb index 229615335..51ffd3079 100644 --- a/lib/opensearch/api/actions/list/help.rb +++ b/lib/opensearch/api/actions/list/help.rb @@ -19,8 +19,8 @@ def help(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_list'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_list' Utils.validate_query_params args, HELP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/list/indices.rb b/lib/opensearch/api/actions/list/indices.rb index 795837fbf..3021ee76f 100644 --- a/lib/opensearch/api/actions/list/indices.rb +++ b/lib/opensearch/api/actions/list/indices.rb @@ -39,8 +39,8 @@ def indices(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_list', 'indices', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_list/indices', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, INDICES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/list/shards.rb b/lib/opensearch/api/actions/list/shards.rb index c208ebe2e..34dfbcb37 100644 --- a/lib/opensearch/api/actions/list/shards.rb +++ b/lib/opensearch/api/actions/list/shards.rb @@ -35,8 +35,8 @@ def shards(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_list', 'shards', _index].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_list/shards', _index].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SHARDS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/mget.rb b/lib/opensearch/api/actions/mget.rb index 049249a6f..3868ca76b 100644 --- a/lib/opensearch/api/actions/mget.rb +++ b/lib/opensearch/api/actions/mget.rb @@ -33,8 +33,8 @@ def mget(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_mget'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_mget'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, MGET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ml/create_connector.rb b/lib/opensearch/api/actions/ml/create_connector.rb index 79ac3f4e9..0f8924af8 100644 --- a/lib/opensearch/api/actions/ml/create_connector.rb +++ b/lib/opensearch/api/actions/ml/create_connector.rb @@ -20,8 +20,8 @@ def create_connector(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'connectors', '_create'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_ml/connectors/_create' Utils.validate_query_params args, CREATE_CONNECTOR_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ml/delete_agent.rb b/lib/opensearch/api/actions/ml/delete_agent.rb index 3c30adc2c..373128865 100644 --- a/lib/opensearch/api/actions/ml/delete_agent.rb +++ b/lib/opensearch/api/actions/ml/delete_agent.rb @@ -26,8 +26,8 @@ def delete_agent(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'agents', _agent_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_ml/agents', _agent_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_AGENT_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/ml/delete_connector.rb b/lib/opensearch/api/actions/ml/delete_connector.rb index 915bcd9ad..44c1a2c1e 100644 --- a/lib/opensearch/api/actions/ml/delete_connector.rb +++ b/lib/opensearch/api/actions/ml/delete_connector.rb @@ -26,8 +26,8 @@ def delete_connector(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'connectors', _connector_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_ml/connectors', _connector_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_CONNECTOR_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/ml/delete_model.rb b/lib/opensearch/api/actions/ml/delete_model.rb index b97a2a080..a8e30c831 100644 --- a/lib/opensearch/api/actions/ml/delete_model.rb +++ b/lib/opensearch/api/actions/ml/delete_model.rb @@ -26,8 +26,8 @@ def delete_model(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'models', _model_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_ml/models', _model_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_MODEL_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/ml/delete_model_group.rb b/lib/opensearch/api/actions/ml/delete_model_group.rb index cac366115..8c3285d19 100644 --- a/lib/opensearch/api/actions/ml/delete_model_group.rb +++ b/lib/opensearch/api/actions/ml/delete_model_group.rb @@ -26,8 +26,8 @@ def delete_model_group(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'model_groups', _model_group_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_ml/model_groups', _model_group_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_MODEL_GROUP_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/ml/delete_task.rb b/lib/opensearch/api/actions/ml/delete_task.rb index 082070c4a..b6450646a 100644 --- a/lib/opensearch/api/actions/ml/delete_task.rb +++ b/lib/opensearch/api/actions/ml/delete_task.rb @@ -26,8 +26,8 @@ def delete_task(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'tasks', _task_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_ml/tasks', _task_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_TASK_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/ml/deploy_model.rb b/lib/opensearch/api/actions/ml/deploy_model.rb index 8a8465e54..484fcdbc0 100644 --- a/lib/opensearch/api/actions/ml/deploy_model.rb +++ b/lib/opensearch/api/actions/ml/deploy_model.rb @@ -24,8 +24,8 @@ def deploy_model(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'models', _model_id, '_deploy'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_ml/models', _model_id, '_deploy'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DEPLOY_MODEL_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ml/get_model_group.rb b/lib/opensearch/api/actions/ml/get_model_group.rb index ce193681d..8419c25b3 100644 --- a/lib/opensearch/api/actions/ml/get_model_group.rb +++ b/lib/opensearch/api/actions/ml/get_model_group.rb @@ -24,8 +24,8 @@ def get_model_group(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'model_groups', _model_group_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_ml/model_groups', _model_group_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_MODEL_GROUP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ml/get_task.rb b/lib/opensearch/api/actions/ml/get_task.rb index ba2e76af9..490c76611 100644 --- a/lib/opensearch/api/actions/ml/get_task.rb +++ b/lib/opensearch/api/actions/ml/get_task.rb @@ -24,8 +24,8 @@ def get_task(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'tasks', _task_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_ml/tasks', _task_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_TASK_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ml/register_agents.rb b/lib/opensearch/api/actions/ml/register_agents.rb index 806114cf6..64d97cce4 100644 --- a/lib/opensearch/api/actions/ml/register_agents.rb +++ b/lib/opensearch/api/actions/ml/register_agents.rb @@ -20,8 +20,8 @@ def register_agents(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'agents', '_register'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_ml/agents/_register' Utils.validate_query_params args, REGISTER_AGENTS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ml/register_model.rb b/lib/opensearch/api/actions/ml/register_model.rb index 5af3178d2..a3276d92a 100644 --- a/lib/opensearch/api/actions/ml/register_model.rb +++ b/lib/opensearch/api/actions/ml/register_model.rb @@ -20,8 +20,8 @@ def register_model(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'models', '_register'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_ml/models/_register' Utils.validate_query_params args, REGISTER_MODEL_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ml/register_model_group.rb b/lib/opensearch/api/actions/ml/register_model_group.rb index 034e43333..01cdb6d89 100644 --- a/lib/opensearch/api/actions/ml/register_model_group.rb +++ b/lib/opensearch/api/actions/ml/register_model_group.rb @@ -20,8 +20,8 @@ def register_model_group(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'model_groups', '_register'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_ml/model_groups/_register' Utils.validate_query_params args, REGISTER_MODEL_GROUP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ml/search_models.rb b/lib/opensearch/api/actions/ml/search_models.rb index 40fd7e4d9..e7aeb73cc 100644 --- a/lib/opensearch/api/actions/ml/search_models.rb +++ b/lib/opensearch/api/actions/ml/search_models.rb @@ -20,8 +20,8 @@ def search_models(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'models', '_search'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_ml/models/_search' Utils.validate_query_params args, SEARCH_MODELS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ml/undeploy_model.rb b/lib/opensearch/api/actions/ml/undeploy_model.rb index 709add9fc..cac146047 100644 --- a/lib/opensearch/api/actions/ml/undeploy_model.rb +++ b/lib/opensearch/api/actions/ml/undeploy_model.rb @@ -24,8 +24,8 @@ def undeploy_model(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ml', 'models', _model_id, '_undeploy'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_ml/models', _model_id, '_undeploy'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UNDEPLOY_MODEL_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/msearch.rb b/lib/opensearch/api/actions/msearch.rb index 72244cd83..e3d83522c 100644 --- a/lib/opensearch/api/actions/msearch.rb +++ b/lib/opensearch/api/actions/msearch.rb @@ -32,8 +32,8 @@ def msearch(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = [_index, '_msearch'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_msearch'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, MSEARCH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/msearch_template.rb b/lib/opensearch/api/actions/msearch_template.rb index f4faed0ae..8d66d038b 100644 --- a/lib/opensearch/api/actions/msearch_template.rb +++ b/lib/opensearch/api/actions/msearch_template.rb @@ -30,8 +30,8 @@ def msearch_template(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = [_index, '_msearch', 'template'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_msearch/template'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, MSEARCH_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/mtermvectors.rb b/lib/opensearch/api/actions/mtermvectors.rb index 79ffe513f..057d3678d 100644 --- a/lib/opensearch/api/actions/mtermvectors.rb +++ b/lib/opensearch/api/actions/mtermvectors.rb @@ -35,8 +35,8 @@ def mtermvectors(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_mtermvectors'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_mtermvectors'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, MTERMVECTORS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/nodes/hot_threads.rb b/lib/opensearch/api/actions/nodes/hot_threads.rb index a25ec348f..d540bb236 100644 --- a/lib/opensearch/api/actions/nodes/hot_threads.rb +++ b/lib/opensearch/api/actions/nodes/hot_threads.rb @@ -28,8 +28,8 @@ def hot_threads(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_nodes', _node_id, 'hot_threads'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_nodes', _node_id, 'hot_threads'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, HOT_THREADS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/nodes/info.rb b/lib/opensearch/api/actions/nodes/info.rb index 17fb79908..de0240cc5 100644 --- a/lib/opensearch/api/actions/nodes/info.rb +++ b/lib/opensearch/api/actions/nodes/info.rb @@ -28,8 +28,8 @@ def info(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_nodes', _node_id, _metric].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_nodes', _node_id_or_metric].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, INFO_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/nodes/reload_secure_settings.rb b/lib/opensearch/api/actions/nodes/reload_secure_settings.rb index 448047c58..57423c717 100644 --- a/lib/opensearch/api/actions/nodes/reload_secure_settings.rb +++ b/lib/opensearch/api/actions/nodes/reload_secure_settings.rb @@ -24,8 +24,8 @@ def reload_secure_settings(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_nodes', _node_id, 'reload_secure_settings'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_nodes', _node_id, 'reload_secure_settings'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, RELOAD_SECURE_SETTINGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/nodes/stats.rb b/lib/opensearch/api/actions/nodes/stats.rb index ae575cfda..5847ca02f 100644 --- a/lib/opensearch/api/actions/nodes/stats.rb +++ b/lib/opensearch/api/actions/nodes/stats.rb @@ -34,8 +34,8 @@ def stats(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_nodes', _node_id, 'stats', _metric, _index_metric].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_nodes', _node_id, 'stats', _metric, _index_metric].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/nodes/usage.rb b/lib/opensearch/api/actions/nodes/usage.rb index 5d2a5325f..81d45478a 100644 --- a/lib/opensearch/api/actions/nodes/usage.rb +++ b/lib/opensearch/api/actions/nodes/usage.rb @@ -25,8 +25,8 @@ def usage(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_nodes', _node_id, 'usage', _metric].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_nodes', _node_id, 'usage', _metric].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, USAGE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/notifications/create_config.rb b/lib/opensearch/api/actions/notifications/create_config.rb index cf3d00b29..77bed06cb 100644 --- a/lib/opensearch/api/actions/notifications/create_config.rb +++ b/lib/opensearch/api/actions/notifications/create_config.rb @@ -22,8 +22,8 @@ def create_config(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_notifications', 'configs'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_notifications/configs' Utils.validate_query_params args, CREATE_CONFIG_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/notifications/delete_config.rb b/lib/opensearch/api/actions/notifications/delete_config.rb index 383b0b506..cc1cf243d 100644 --- a/lib/opensearch/api/actions/notifications/delete_config.rb +++ b/lib/opensearch/api/actions/notifications/delete_config.rb @@ -26,8 +26,8 @@ def delete_config(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_notifications', 'configs', _config_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_notifications/configs', _config_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_CONFIG_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/notifications/delete_configs.rb b/lib/opensearch/api/actions/notifications/delete_configs.rb index 0ce8b8622..6cd7244b2 100644 --- a/lib/opensearch/api/actions/notifications/delete_configs.rb +++ b/lib/opensearch/api/actions/notifications/delete_configs.rb @@ -25,8 +25,8 @@ def delete_configs(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_notifications', 'configs'].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = '_plugins/_notifications/configs' Utils.validate_query_params args, DELETE_CONFIGS_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/notifications/get_config.rb b/lib/opensearch/api/actions/notifications/get_config.rb index 0a8e5f936..ae8939312 100644 --- a/lib/opensearch/api/actions/notifications/get_config.rb +++ b/lib/opensearch/api/actions/notifications/get_config.rb @@ -24,8 +24,8 @@ def get_config(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_notifications', 'configs', _config_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_notifications/configs', _config_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_CONFIG_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/notifications/get_configs.rb b/lib/opensearch/api/actions/notifications/get_configs.rb index da792ba3d..9fd70ee3b 100644 --- a/lib/opensearch/api/actions/notifications/get_configs.rb +++ b/lib/opensearch/api/actions/notifications/get_configs.rb @@ -60,8 +60,8 @@ def get_configs(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_notifications', 'configs'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_notifications/configs' Utils.validate_query_params args, GET_CONFIGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/notifications/list_channels.rb b/lib/opensearch/api/actions/notifications/list_channels.rb index f3712abdd..2548b1a56 100644 --- a/lib/opensearch/api/actions/notifications/list_channels.rb +++ b/lib/opensearch/api/actions/notifications/list_channels.rb @@ -19,8 +19,8 @@ def list_channels(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_notifications', 'channels'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_notifications/channels' Utils.validate_query_params args, LIST_CHANNELS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/notifications/list_features.rb b/lib/opensearch/api/actions/notifications/list_features.rb index d1c1a03c2..ec2b57421 100644 --- a/lib/opensearch/api/actions/notifications/list_features.rb +++ b/lib/opensearch/api/actions/notifications/list_features.rb @@ -19,8 +19,8 @@ def list_features(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_notifications', 'features'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_notifications/features' Utils.validate_query_params args, LIST_FEATURES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/notifications/send_test.rb b/lib/opensearch/api/actions/notifications/send_test.rb index 9930f2fe1..06f380f6a 100644 --- a/lib/opensearch/api/actions/notifications/send_test.rb +++ b/lib/opensearch/api/actions/notifications/send_test.rb @@ -24,8 +24,8 @@ def send_test(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_notifications', 'feature', 'test', _config_id].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = ['_plugins/_notifications/feature/test', _config_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SEND_TEST_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/notifications/update_config.rb b/lib/opensearch/api/actions/notifications/update_config.rb index 941b1daa4..b8407962f 100644 --- a/lib/opensearch/api/actions/notifications/update_config.rb +++ b/lib/opensearch/api/actions/notifications/update_config.rb @@ -26,8 +26,8 @@ def update_config(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_notifications', 'configs', _config_id].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_notifications/configs', _config_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_CONFIG_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/observability/create_object.rb b/lib/opensearch/api/actions/observability/create_object.rb index 495eb4b9b..6cb9ad580 100644 --- a/lib/opensearch/api/actions/observability/create_object.rb +++ b/lib/opensearch/api/actions/observability/create_object.rb @@ -20,8 +20,8 @@ def create_object(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_observability', 'object'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_observability/object' Utils.validate_query_params args, CREATE_OBJECT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/observability/delete_object.rb b/lib/opensearch/api/actions/observability/delete_object.rb index ecf8d6b07..b2335a989 100644 --- a/lib/opensearch/api/actions/observability/delete_object.rb +++ b/lib/opensearch/api/actions/observability/delete_object.rb @@ -26,8 +26,8 @@ def delete_object(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_observability', 'object', _object_id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_observability/object', _object_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_OBJECT_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/observability/delete_objects.rb b/lib/opensearch/api/actions/observability/delete_objects.rb index a4ac265b2..28775e562 100644 --- a/lib/opensearch/api/actions/observability/delete_objects.rb +++ b/lib/opensearch/api/actions/observability/delete_objects.rb @@ -23,8 +23,8 @@ def delete_objects(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_observability', 'object'].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = '_plugins/_observability/object' Utils.validate_query_params args, DELETE_OBJECTS_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/observability/get_localstats.rb b/lib/opensearch/api/actions/observability/get_localstats.rb index bf96ba78f..adbdb2339 100644 --- a/lib/opensearch/api/actions/observability/get_localstats.rb +++ b/lib/opensearch/api/actions/observability/get_localstats.rb @@ -19,8 +19,8 @@ def get_localstats(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_observability', '_local', 'stats'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_observability/_local/stats' Utils.validate_query_params args, GET_LOCALSTATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/observability/get_object.rb b/lib/opensearch/api/actions/observability/get_object.rb index fae46507a..c0f5928ac 100644 --- a/lib/opensearch/api/actions/observability/get_object.rb +++ b/lib/opensearch/api/actions/observability/get_object.rb @@ -24,8 +24,8 @@ def get_object(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_observability', 'object', _object_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_observability/object', _object_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_OBJECT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/observability/list_objects.rb b/lib/opensearch/api/actions/observability/list_objects.rb index 72083ce4d..df82be53c 100644 --- a/lib/opensearch/api/actions/observability/list_objects.rb +++ b/lib/opensearch/api/actions/observability/list_objects.rb @@ -19,8 +19,8 @@ def list_objects(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_observability', 'object'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_observability/object' Utils.validate_query_params args, LIST_OBJECTS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/observability/update_object.rb b/lib/opensearch/api/actions/observability/update_object.rb index 71514f522..c3f1b07eb 100644 --- a/lib/opensearch/api/actions/observability/update_object.rb +++ b/lib/opensearch/api/actions/observability/update_object.rb @@ -25,8 +25,8 @@ def update_object(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_observability', 'object', _object_id].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_observability/object', _object_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_OBJECT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ping.rb b/lib/opensearch/api/actions/ping.rb index 2cade5ae8..ad8577d10 100644 --- a/lib/opensearch/api/actions/ping.rb +++ b/lib/opensearch/api/actions/ping.rb @@ -19,8 +19,8 @@ def ping(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = [].filter(&:present?).join('/').squeeze('/') method = 'HEAD' + url = Utils.validate_query_params args, PING_QUERY_PARAMS transport.perform_ping_request method, url, args, body, headers diff --git a/lib/opensearch/api/actions/ppl/explain.rb b/lib/opensearch/api/actions/ppl/explain.rb index c01436047..f471e86b7 100644 --- a/lib/opensearch/api/actions/ppl/explain.rb +++ b/lib/opensearch/api/actions/ppl/explain.rb @@ -24,8 +24,8 @@ def explain(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ppl', '_explain'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_ppl/_explain' Utils.validate_query_params args, EXPLAIN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ppl/get_stats.rb b/lib/opensearch/api/actions/ppl/get_stats.rb index e0587e66b..de58fa6c2 100644 --- a/lib/opensearch/api/actions/ppl/get_stats.rb +++ b/lib/opensearch/api/actions/ppl/get_stats.rb @@ -21,8 +21,8 @@ def get_stats(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ppl', 'stats'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_ppl/stats' Utils.validate_query_params args, GET_STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ppl/post_stats.rb b/lib/opensearch/api/actions/ppl/post_stats.rb index 4b17e9dc0..b94c75581 100644 --- a/lib/opensearch/api/actions/ppl/post_stats.rb +++ b/lib/opensearch/api/actions/ppl/post_stats.rb @@ -24,8 +24,8 @@ def post_stats(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ppl', 'stats'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_ppl/stats' Utils.validate_query_params args, POST_STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/ppl/query.rb b/lib/opensearch/api/actions/ppl/query.rb index 537c64f3e..a34ce3568 100644 --- a/lib/opensearch/api/actions/ppl/query.rb +++ b/lib/opensearch/api/actions/ppl/query.rb @@ -24,8 +24,8 @@ def query(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_ppl'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_ppl' Utils.validate_query_params args, QUERY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/put_script.rb b/lib/opensearch/api/actions/put_script.rb index a8c9e1575..328c199c4 100644 --- a/lib/opensearch/api/actions/put_script.rb +++ b/lib/opensearch/api/actions/put_script.rb @@ -31,8 +31,8 @@ def put_script(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_scripts', _id, _context].filter(&:present?).join('/').squeeze('/') method = _context.present? ? 'PUT' : 'POST' + url = ['_scripts', _id, _context].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_SCRIPT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/query/datasource_delete.rb b/lib/opensearch/api/actions/query/datasource_delete.rb index 5649bcac4..ab742e985 100644 --- a/lib/opensearch/api/actions/query/datasource_delete.rb +++ b/lib/opensearch/api/actions/query/datasource_delete.rb @@ -26,8 +26,8 @@ def datasource_delete(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_query', '_datasources', _datasource_name].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_query/_datasources', _datasource_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DATASOURCE_DELETE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/query/datasource_retrieve.rb b/lib/opensearch/api/actions/query/datasource_retrieve.rb index 29bfe04f6..9f7edd704 100644 --- a/lib/opensearch/api/actions/query/datasource_retrieve.rb +++ b/lib/opensearch/api/actions/query/datasource_retrieve.rb @@ -24,8 +24,8 @@ def datasource_retrieve(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_query', '_datasources', _datasource_name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_query/_datasources', _datasource_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DATASOURCE_RETRIEVE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/query/datasources_create.rb b/lib/opensearch/api/actions/query/datasources_create.rb index 83441da76..ea146891b 100644 --- a/lib/opensearch/api/actions/query/datasources_create.rb +++ b/lib/opensearch/api/actions/query/datasources_create.rb @@ -20,8 +20,8 @@ def datasources_create(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_query', '_datasources'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_query/_datasources' Utils.validate_query_params args, DATASOURCES_CREATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/query/datasources_list.rb b/lib/opensearch/api/actions/query/datasources_list.rb index 2bc1e6208..ba2bc7c3d 100644 --- a/lib/opensearch/api/actions/query/datasources_list.rb +++ b/lib/opensearch/api/actions/query/datasources_list.rb @@ -19,8 +19,8 @@ def datasources_list(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_query', '_datasources'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_query/_datasources' Utils.validate_query_params args, DATASOURCES_LIST_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/query/datasources_update.rb b/lib/opensearch/api/actions/query/datasources_update.rb index 019a01afe..dc541e0c0 100644 --- a/lib/opensearch/api/actions/query/datasources_update.rb +++ b/lib/opensearch/api/actions/query/datasources_update.rb @@ -20,8 +20,8 @@ def datasources_update(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_query', '_datasources'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_query/_datasources' Utils.validate_query_params args, DATASOURCES_UPDATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/rank_eval.rb b/lib/opensearch/api/actions/rank_eval.rb index 46c1c042f..4560f681d 100644 --- a/lib/opensearch/api/actions/rank_eval.rb +++ b/lib/opensearch/api/actions/rank_eval.rb @@ -29,8 +29,8 @@ def rank_eval(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_rank_eval'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_rank_eval'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, RANK_EVAL_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/reindex.rb b/lib/opensearch/api/actions/reindex.rb index ca53ddc08..c69054481 100644 --- a/lib/opensearch/api/actions/reindex.rb +++ b/lib/opensearch/api/actions/reindex.rb @@ -32,8 +32,8 @@ def reindex(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_reindex'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_reindex' Utils.validate_query_params args, REINDEX_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/reindex_rethrottle.rb b/lib/opensearch/api/actions/reindex_rethrottle.rb index b7692351c..bda97d349 100644 --- a/lib/opensearch/api/actions/reindex_rethrottle.rb +++ b/lib/opensearch/api/actions/reindex_rethrottle.rb @@ -25,8 +25,8 @@ def reindex_rethrottle(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_reindex', _task_id, '_rethrottle'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_reindex', _task_id, '_rethrottle'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, REINDEX_RETHROTTLE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/remote_store/restore.rb b/lib/opensearch/api/actions/remote_store/restore.rb index cbbce3191..e7cc4f9fd 100644 --- a/lib/opensearch/api/actions/remote_store/restore.rb +++ b/lib/opensearch/api/actions/remote_store/restore.rb @@ -24,8 +24,8 @@ def restore(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_remotestore', '_restore'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_remotestore/_restore' Utils.validate_query_params args, RESTORE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/render_search_template.rb b/lib/opensearch/api/actions/render_search_template.rb index 102ff865d..04a45ccab 100644 --- a/lib/opensearch/api/actions/render_search_template.rb +++ b/lib/opensearch/api/actions/render_search_template.rb @@ -23,8 +23,8 @@ def render_search_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_render', 'template', _id].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = ['_render/template', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, RENDER_SEARCH_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/autofollow_stats.rb b/lib/opensearch/api/actions/replication/autofollow_stats.rb index 84f3c7e0e..ab4790724 100644 --- a/lib/opensearch/api/actions/replication/autofollow_stats.rb +++ b/lib/opensearch/api/actions/replication/autofollow_stats.rb @@ -19,8 +19,8 @@ def autofollow_stats(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', 'autofollow_stats'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_replication/autofollow_stats' Utils.validate_query_params args, AUTOFOLLOW_STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/create_replication_rule.rb b/lib/opensearch/api/actions/replication/create_replication_rule.rb index 385599121..d85cffd51 100644 --- a/lib/opensearch/api/actions/replication/create_replication_rule.rb +++ b/lib/opensearch/api/actions/replication/create_replication_rule.rb @@ -22,8 +22,8 @@ def create_replication_rule(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', '_autofollow'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_replication/_autofollow' Utils.validate_query_params args, CREATE_REPLICATION_RULE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/delete_replication_rule.rb b/lib/opensearch/api/actions/replication/delete_replication_rule.rb index 2ea4cfa6d..0dcc1e563 100644 --- a/lib/opensearch/api/actions/replication/delete_replication_rule.rb +++ b/lib/opensearch/api/actions/replication/delete_replication_rule.rb @@ -24,8 +24,8 @@ def delete_replication_rule(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', '_autofollow'].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = '_plugins/_replication/_autofollow' Utils.validate_query_params args, DELETE_REPLICATION_RULE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/replication/follower_stats.rb b/lib/opensearch/api/actions/replication/follower_stats.rb index aa121ff5d..714ed11bd 100644 --- a/lib/opensearch/api/actions/replication/follower_stats.rb +++ b/lib/opensearch/api/actions/replication/follower_stats.rb @@ -19,8 +19,8 @@ def follower_stats(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', 'follower_stats'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_replication/follower_stats' Utils.validate_query_params args, FOLLOWER_STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/leader_stats.rb b/lib/opensearch/api/actions/replication/leader_stats.rb index 5ea283268..e5a3f4aac 100644 --- a/lib/opensearch/api/actions/replication/leader_stats.rb +++ b/lib/opensearch/api/actions/replication/leader_stats.rb @@ -19,8 +19,8 @@ def leader_stats(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', 'leader_stats'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_replication/leader_stats' Utils.validate_query_params args, LEADER_STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/pause.rb b/lib/opensearch/api/actions/replication/pause.rb index d01aaab2d..e345966b4 100644 --- a/lib/opensearch/api/actions/replication/pause.rb +++ b/lib/opensearch/api/actions/replication/pause.rb @@ -26,8 +26,8 @@ def pause(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', _index, '_pause'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_replication', _index, '_pause'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PAUSE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/resume.rb b/lib/opensearch/api/actions/replication/resume.rb index 35bf5ab1d..e44dd5180 100644 --- a/lib/opensearch/api/actions/replication/resume.rb +++ b/lib/opensearch/api/actions/replication/resume.rb @@ -26,8 +26,8 @@ def resume(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', _index, '_resume'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_replication', _index, '_resume'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, RESUME_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/start.rb b/lib/opensearch/api/actions/replication/start.rb index f5ae37182..47a7a02f1 100644 --- a/lib/opensearch/api/actions/replication/start.rb +++ b/lib/opensearch/api/actions/replication/start.rb @@ -26,8 +26,8 @@ def start(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', _index, '_start'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_replication', _index, '_start'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, START_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/status.rb b/lib/opensearch/api/actions/replication/status.rb index 715e1819b..1a934a8c1 100644 --- a/lib/opensearch/api/actions/replication/status.rb +++ b/lib/opensearch/api/actions/replication/status.rb @@ -24,8 +24,8 @@ def status(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', _index, '_status'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_replication', _index, '_status'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STATUS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/stop.rb b/lib/opensearch/api/actions/replication/stop.rb index 8ead07a88..2a1c0c39a 100644 --- a/lib/opensearch/api/actions/replication/stop.rb +++ b/lib/opensearch/api/actions/replication/stop.rb @@ -26,8 +26,8 @@ def stop(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', _index, '_stop'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_replication', _index, '_stop'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STOP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/replication/update_settings.rb b/lib/opensearch/api/actions/replication/update_settings.rb index e8b636cd2..8fcbfa561 100644 --- a/lib/opensearch/api/actions/replication/update_settings.rb +++ b/lib/opensearch/api/actions/replication/update_settings.rb @@ -26,8 +26,8 @@ def update_settings(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_replication', _index, '_update'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_replication', _index, '_update'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_SETTINGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/rollups/delete.rb b/lib/opensearch/api/actions/rollups/delete.rb index c6872817b..a13e90887 100644 --- a/lib/opensearch/api/actions/rollups/delete.rb +++ b/lib/opensearch/api/actions/rollups/delete.rb @@ -26,8 +26,8 @@ def delete(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_rollup', 'jobs', _id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_rollup/jobs', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/rollups/explain.rb b/lib/opensearch/api/actions/rollups/explain.rb index 7d0d2632c..061633542 100644 --- a/lib/opensearch/api/actions/rollups/explain.rb +++ b/lib/opensearch/api/actions/rollups/explain.rb @@ -24,8 +24,8 @@ def explain(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_rollup', 'jobs', _id, '_explain'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_rollup/jobs', _id, '_explain'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXPLAIN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/rollups/get.rb b/lib/opensearch/api/actions/rollups/get.rb index 7e73301d0..131565b5b 100644 --- a/lib/opensearch/api/actions/rollups/get.rb +++ b/lib/opensearch/api/actions/rollups/get.rb @@ -24,8 +24,8 @@ def get(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_rollup', 'jobs', _id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_rollup/jobs', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/rollups/put.rb b/lib/opensearch/api/actions/rollups/put.rb index 98ceaf0f9..df9e47764 100644 --- a/lib/opensearch/api/actions/rollups/put.rb +++ b/lib/opensearch/api/actions/rollups/put.rb @@ -27,8 +27,8 @@ def put(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_rollup', 'jobs', _id].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_rollup/jobs', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/rollups/start.rb b/lib/opensearch/api/actions/rollups/start.rb index ba5734ddc..1be1160c3 100644 --- a/lib/opensearch/api/actions/rollups/start.rb +++ b/lib/opensearch/api/actions/rollups/start.rb @@ -24,8 +24,8 @@ def start(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_rollup', 'jobs', _id, '_start'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_rollup/jobs', _id, '_start'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, START_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/rollups/stop.rb b/lib/opensearch/api/actions/rollups/stop.rb index d7423250d..20e80a8b3 100644 --- a/lib/opensearch/api/actions/rollups/stop.rb +++ b/lib/opensearch/api/actions/rollups/stop.rb @@ -24,8 +24,8 @@ def stop(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_rollup', 'jobs', _id, '_stop'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_rollup/jobs', _id, '_stop'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STOP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/scripts_painless_execute.rb b/lib/opensearch/api/actions/scripts_painless_execute.rb index a4e5d8072..b1e2d05d8 100644 --- a/lib/opensearch/api/actions/scripts_painless_execute.rb +++ b/lib/opensearch/api/actions/scripts_painless_execute.rb @@ -20,8 +20,8 @@ def scripts_painless_execute(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_scripts', 'painless', '_execute'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = '_scripts/painless/_execute' Utils.validate_query_params args, SCRIPTS_PAINLESS_EXECUTE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/scroll.rb b/lib/opensearch/api/actions/scroll.rb index 6cb1419a9..d95a71e32 100644 --- a/lib/opensearch/api/actions/scroll.rb +++ b/lib/opensearch/api/actions/scroll.rb @@ -25,8 +25,8 @@ def scroll(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_search', 'scroll', _scroll_id].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = ['_search/scroll', _scroll_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SCROLL_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/search.rb b/lib/opensearch/api/actions/search.rb index 087847c2d..e6c865562 100644 --- a/lib/opensearch/api/actions/search.rb +++ b/lib/opensearch/api/actions/search.rb @@ -69,8 +69,8 @@ def search(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_search'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_search'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SEARCH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/search_pipeline/delete.rb b/lib/opensearch/api/actions/search_pipeline/delete.rb index 5ecdf30fb..d97f522db 100644 --- a/lib/opensearch/api/actions/search_pipeline/delete.rb +++ b/lib/opensearch/api/actions/search_pipeline/delete.rb @@ -28,8 +28,8 @@ def delete(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_search', 'pipeline', _id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_search/pipeline', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/search_pipeline/get.rb b/lib/opensearch/api/actions/search_pipeline/get.rb index a681255ee..e9ed4eead 100644 --- a/lib/opensearch/api/actions/search_pipeline/get.rb +++ b/lib/opensearch/api/actions/search_pipeline/get.rb @@ -23,8 +23,8 @@ def get(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_search', 'pipeline', _id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_search/pipeline', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/search_pipeline/put.rb b/lib/opensearch/api/actions/search_pipeline/put.rb index e84772a84..00d687040 100644 --- a/lib/opensearch/api/actions/search_pipeline/put.rb +++ b/lib/opensearch/api/actions/search_pipeline/put.rb @@ -28,8 +28,8 @@ def put(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_search', 'pipeline', _id].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_search/pipeline', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/search_shards.rb b/lib/opensearch/api/actions/search_shards.rb index a4f85364a..f4c364660 100644 --- a/lib/opensearch/api/actions/search_shards.rb +++ b/lib/opensearch/api/actions/search_shards.rb @@ -29,8 +29,8 @@ def search_shards(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_search_shards'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_search_shards'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SEARCH_SHARDS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/search_template.rb b/lib/opensearch/api/actions/search_template.rb index 927c8a205..a0474622d 100644 --- a/lib/opensearch/api/actions/search_template.rb +++ b/lib/opensearch/api/actions/search_template.rb @@ -38,8 +38,8 @@ def search_template(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_search', 'template'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_search/template'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, SEARCH_TEMPLATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/authinfo.rb b/lib/opensearch/api/actions/security/authinfo.rb index 7ce02a9ab..6b2e9897d 100644 --- a/lib/opensearch/api/actions/security/authinfo.rb +++ b/lib/opensearch/api/actions/security/authinfo.rb @@ -21,8 +21,8 @@ def authinfo(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'authinfo'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = '_plugins/_security/authinfo' Utils.validate_query_params args, AUTHINFO_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/authtoken.rb b/lib/opensearch/api/actions/security/authtoken.rb index d2d743952..7f42567b2 100644 --- a/lib/opensearch/api/actions/security/authtoken.rb +++ b/lib/opensearch/api/actions/security/authtoken.rb @@ -19,8 +19,8 @@ def authtoken(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'authtoken'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_security/api/authtoken' Utils.validate_query_params args, AUTHTOKEN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/change_password.rb b/lib/opensearch/api/actions/security/change_password.rb index 437241054..2055edc7b 100644 --- a/lib/opensearch/api/actions/security/change_password.rb +++ b/lib/opensearch/api/actions/security/change_password.rb @@ -22,8 +22,8 @@ def change_password(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'account'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_security/api/account' Utils.validate_query_params args, CHANGE_PASSWORD_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/config_upgrade_check.rb b/lib/opensearch/api/actions/security/config_upgrade_check.rb index 8c585b119..8f8c001c0 100644 --- a/lib/opensearch/api/actions/security/config_upgrade_check.rb +++ b/lib/opensearch/api/actions/security/config_upgrade_check.rb @@ -19,8 +19,8 @@ def config_upgrade_check(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', '_upgrade_check'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/_upgrade_check' Utils.validate_query_params args, CONFIG_UPGRADE_CHECK_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/config_upgrade_perform.rb b/lib/opensearch/api/actions/security/config_upgrade_perform.rb index 08edd34ec..66ae485e6 100644 --- a/lib/opensearch/api/actions/security/config_upgrade_perform.rb +++ b/lib/opensearch/api/actions/security/config_upgrade_perform.rb @@ -20,8 +20,8 @@ def config_upgrade_perform(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', '_upgrade_perform'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_security/api/_upgrade_perform' Utils.validate_query_params args, CONFIG_UPGRADE_PERFORM_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/create_action_group.rb b/lib/opensearch/api/actions/security/create_action_group.rb index adc1f3471..184a17791 100644 --- a/lib/opensearch/api/actions/security/create_action_group.rb +++ b/lib/opensearch/api/actions/security/create_action_group.rb @@ -26,8 +26,8 @@ def create_action_group(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_security/api/actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_ACTION_GROUP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/create_allowlist.rb b/lib/opensearch/api/actions/security/create_allowlist.rb index 8c016e86e..25da1c4c5 100644 --- a/lib/opensearch/api/actions/security/create_allowlist.rb +++ b/lib/opensearch/api/actions/security/create_allowlist.rb @@ -22,8 +22,8 @@ def create_allowlist(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'allowlist'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_security/api/allowlist' Utils.validate_query_params args, CREATE_ALLOWLIST_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/create_role.rb b/lib/opensearch/api/actions/security/create_role.rb index 495863225..bdd60e303 100644 --- a/lib/opensearch/api/actions/security/create_role.rb +++ b/lib/opensearch/api/actions/security/create_role.rb @@ -26,8 +26,8 @@ def create_role(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'roles', _role].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_security/api/roles', _role].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_ROLE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/create_role_mapping.rb b/lib/opensearch/api/actions/security/create_role_mapping.rb index 37b1de5fb..43817da4f 100644 --- a/lib/opensearch/api/actions/security/create_role_mapping.rb +++ b/lib/opensearch/api/actions/security/create_role_mapping.rb @@ -26,8 +26,8 @@ def create_role_mapping(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'rolesmapping', _role].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_security/api/rolesmapping', _role].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_ROLE_MAPPING_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/create_tenant.rb b/lib/opensearch/api/actions/security/create_tenant.rb index e7543547c..8f5e09b9b 100644 --- a/lib/opensearch/api/actions/security/create_tenant.rb +++ b/lib/opensearch/api/actions/security/create_tenant.rb @@ -26,8 +26,8 @@ def create_tenant(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'tenants', _tenant].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_security/api/tenants', _tenant].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_TENANT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/create_update_tenancy_config.rb b/lib/opensearch/api/actions/security/create_update_tenancy_config.rb index 3f96e2694..b9d1499f1 100644 --- a/lib/opensearch/api/actions/security/create_update_tenancy_config.rb +++ b/lib/opensearch/api/actions/security/create_update_tenancy_config.rb @@ -22,8 +22,8 @@ def create_update_tenancy_config(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'tenancy', 'config'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_security/api/tenancy/config' Utils.validate_query_params args, CREATE_UPDATE_TENANCY_CONFIG_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/create_user.rb b/lib/opensearch/api/actions/security/create_user.rb index 83520cf3e..b9b0e46e1 100644 --- a/lib/opensearch/api/actions/security/create_user.rb +++ b/lib/opensearch/api/actions/security/create_user.rb @@ -26,8 +26,8 @@ def create_user(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'internalusers', _username].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_security/api/internalusers', _username].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_USER_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/create_user_legacy.rb b/lib/opensearch/api/actions/security/create_user_legacy.rb index f8e73c66f..71ed3e9a8 100644 --- a/lib/opensearch/api/actions/security/create_user_legacy.rb +++ b/lib/opensearch/api/actions/security/create_user_legacy.rb @@ -26,8 +26,8 @@ def create_user_legacy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'user', _username].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_security/api/user', _username].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_USER_LEGACY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/delete_action_group.rb b/lib/opensearch/api/actions/security/delete_action_group.rb index b612ef8c8..1fe4d47ac 100644 --- a/lib/opensearch/api/actions/security/delete_action_group.rb +++ b/lib/opensearch/api/actions/security/delete_action_group.rb @@ -26,8 +26,8 @@ def delete_action_group(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_security/api/actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_ACTION_GROUP_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/security/delete_distinguished_name.rb b/lib/opensearch/api/actions/security/delete_distinguished_name.rb index fce28d2d7..052b4cc96 100644 --- a/lib/opensearch/api/actions/security/delete_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/delete_distinguished_name.rb @@ -26,8 +26,8 @@ def delete_distinguished_name(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_security/api/nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_DISTINGUISHED_NAME_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/security/delete_role.rb b/lib/opensearch/api/actions/security/delete_role.rb index 0277dc6b7..a163b6fc4 100644 --- a/lib/opensearch/api/actions/security/delete_role.rb +++ b/lib/opensearch/api/actions/security/delete_role.rb @@ -26,8 +26,8 @@ def delete_role(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'roles', _role].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_security/api/roles', _role].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_ROLE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/security/delete_role_mapping.rb b/lib/opensearch/api/actions/security/delete_role_mapping.rb index a0094287a..04fda3cb2 100644 --- a/lib/opensearch/api/actions/security/delete_role_mapping.rb +++ b/lib/opensearch/api/actions/security/delete_role_mapping.rb @@ -26,8 +26,8 @@ def delete_role_mapping(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'rolesmapping', _role].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_security/api/rolesmapping', _role].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_ROLE_MAPPING_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/security/delete_tenant.rb b/lib/opensearch/api/actions/security/delete_tenant.rb index 45e4bcb3a..c6deb7277 100644 --- a/lib/opensearch/api/actions/security/delete_tenant.rb +++ b/lib/opensearch/api/actions/security/delete_tenant.rb @@ -26,8 +26,8 @@ def delete_tenant(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'tenants', _tenant].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_security/api/tenants', _tenant].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_TENANT_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/security/delete_user.rb b/lib/opensearch/api/actions/security/delete_user.rb index 686458e73..f66c38e2a 100644 --- a/lib/opensearch/api/actions/security/delete_user.rb +++ b/lib/opensearch/api/actions/security/delete_user.rb @@ -26,8 +26,8 @@ def delete_user(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'internalusers', _username].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_security/api/internalusers', _username].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_USER_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/security/delete_user_legacy.rb b/lib/opensearch/api/actions/security/delete_user_legacy.rb index 30890a637..e694b57f2 100644 --- a/lib/opensearch/api/actions/security/delete_user_legacy.rb +++ b/lib/opensearch/api/actions/security/delete_user_legacy.rb @@ -26,8 +26,8 @@ def delete_user_legacy(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'user', _username].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_security/api/user', _username].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_USER_LEGACY_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/security/flush_cache.rb b/lib/opensearch/api/actions/security/flush_cache.rb index 1e81dc6b9..3ef883ef1 100644 --- a/lib/opensearch/api/actions/security/flush_cache.rb +++ b/lib/opensearch/api/actions/security/flush_cache.rb @@ -21,8 +21,8 @@ def flush_cache(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'cache'].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = '_plugins/_security/api/cache' Utils.validate_query_params args, FLUSH_CACHE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/security/generate_obo_token.rb b/lib/opensearch/api/actions/security/generate_obo_token.rb index 0b2abbfdc..6314400c1 100644 --- a/lib/opensearch/api/actions/security/generate_obo_token.rb +++ b/lib/opensearch/api/actions/security/generate_obo_token.rb @@ -22,8 +22,8 @@ def generate_obo_token(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'generateonbehalfoftoken'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_security/api/generateonbehalfoftoken' Utils.validate_query_params args, GENERATE_OBO_TOKEN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/generate_user_token.rb b/lib/opensearch/api/actions/security/generate_user_token.rb index d9acea0a7..96436f724 100644 --- a/lib/opensearch/api/actions/security/generate_user_token.rb +++ b/lib/opensearch/api/actions/security/generate_user_token.rb @@ -24,8 +24,8 @@ def generate_user_token(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'internalusers', _username, 'authtoken'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_security/api/internalusers', _username, 'authtoken'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GENERATE_USER_TOKEN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/generate_user_token_legacy.rb b/lib/opensearch/api/actions/security/generate_user_token_legacy.rb index ec4ae9a54..f66c3fe86 100644 --- a/lib/opensearch/api/actions/security/generate_user_token_legacy.rb +++ b/lib/opensearch/api/actions/security/generate_user_token_legacy.rb @@ -24,8 +24,8 @@ def generate_user_token_legacy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'user', _username, 'authtoken'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_security/api/user', _username, 'authtoken'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GENERATE_USER_TOKEN_LEGACY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_account_details.rb b/lib/opensearch/api/actions/security/get_account_details.rb index 7de457f0f..7821cd12d 100644 --- a/lib/opensearch/api/actions/security/get_account_details.rb +++ b/lib/opensearch/api/actions/security/get_account_details.rb @@ -19,8 +19,8 @@ def get_account_details(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'account'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/account' Utils.validate_query_params args, GET_ACCOUNT_DETAILS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_action_group.rb b/lib/opensearch/api/actions/security/get_action_group.rb index f93e5fc9c..b8923d87f 100644 --- a/lib/opensearch/api/actions/security/get_action_group.rb +++ b/lib/opensearch/api/actions/security/get_action_group.rb @@ -24,8 +24,8 @@ def get_action_group(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_security/api/actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_ACTION_GROUP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_action_groups.rb b/lib/opensearch/api/actions/security/get_action_groups.rb index d27ae809e..4114bb473 100644 --- a/lib/opensearch/api/actions/security/get_action_groups.rb +++ b/lib/opensearch/api/actions/security/get_action_groups.rb @@ -19,8 +19,8 @@ def get_action_groups(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'actiongroups'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/actiongroups' Utils.validate_query_params args, GET_ACTION_GROUPS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_all_certificates.rb b/lib/opensearch/api/actions/security/get_all_certificates.rb index 890939302..ddfe04ca1 100644 --- a/lib/opensearch/api/actions/security/get_all_certificates.rb +++ b/lib/opensearch/api/actions/security/get_all_certificates.rb @@ -21,8 +21,8 @@ def get_all_certificates(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'certificates'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/certificates' Utils.validate_query_params args, GET_ALL_CERTIFICATES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_allowlist.rb b/lib/opensearch/api/actions/security/get_allowlist.rb index 67cae1495..975f160a7 100644 --- a/lib/opensearch/api/actions/security/get_allowlist.rb +++ b/lib/opensearch/api/actions/security/get_allowlist.rb @@ -19,8 +19,8 @@ def get_allowlist(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'allowlist'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/allowlist' Utils.validate_query_params args, GET_ALLOWLIST_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_audit_configuration.rb b/lib/opensearch/api/actions/security/get_audit_configuration.rb index 3258bca1b..ee946a1c7 100644 --- a/lib/opensearch/api/actions/security/get_audit_configuration.rb +++ b/lib/opensearch/api/actions/security/get_audit_configuration.rb @@ -19,8 +19,8 @@ def get_audit_configuration(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'audit'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/audit' Utils.validate_query_params args, GET_AUDIT_CONFIGURATION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_certificates.rb b/lib/opensearch/api/actions/security/get_certificates.rb index 7102d2381..d07365e65 100644 --- a/lib/opensearch/api/actions/security/get_certificates.rb +++ b/lib/opensearch/api/actions/security/get_certificates.rb @@ -19,8 +19,8 @@ def get_certificates(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'ssl', 'certs'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/ssl/certs' Utils.validate_query_params args, GET_CERTIFICATES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_configuration.rb b/lib/opensearch/api/actions/security/get_configuration.rb index f7d7e5e3c..02646a833 100644 --- a/lib/opensearch/api/actions/security/get_configuration.rb +++ b/lib/opensearch/api/actions/security/get_configuration.rb @@ -19,8 +19,8 @@ def get_configuration(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'securityconfig'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/securityconfig' Utils.validate_query_params args, GET_CONFIGURATION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_dashboards_info.rb b/lib/opensearch/api/actions/security/get_dashboards_info.rb index 8a18a6441..23586aa6d 100644 --- a/lib/opensearch/api/actions/security/get_dashboards_info.rb +++ b/lib/opensearch/api/actions/security/get_dashboards_info.rb @@ -19,8 +19,8 @@ def get_dashboards_info(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'dashboardsinfo'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/dashboardsinfo' Utils.validate_query_params args, GET_DASHBOARDS_INFO_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_distinguished_name.rb b/lib/opensearch/api/actions/security/get_distinguished_name.rb index feb54a146..50b17bb8a 100644 --- a/lib/opensearch/api/actions/security/get_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/get_distinguished_name.rb @@ -25,8 +25,8 @@ def get_distinguished_name(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_security/api/nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_DISTINGUISHED_NAME_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_distinguished_names.rb b/lib/opensearch/api/actions/security/get_distinguished_names.rb index 258abfc31..a5f2adae1 100644 --- a/lib/opensearch/api/actions/security/get_distinguished_names.rb +++ b/lib/opensearch/api/actions/security/get_distinguished_names.rb @@ -20,8 +20,8 @@ def get_distinguished_names(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'nodesdn'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/nodesdn' Utils.validate_query_params args, GET_DISTINGUISHED_NAMES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_node_certificates.rb b/lib/opensearch/api/actions/security/get_node_certificates.rb index cee9e0016..6d3be1f72 100644 --- a/lib/opensearch/api/actions/security/get_node_certificates.rb +++ b/lib/opensearch/api/actions/security/get_node_certificates.rb @@ -26,8 +26,8 @@ def get_node_certificates(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'certificates', _node_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_security/api/certificates', _node_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_NODE_CERTIFICATES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_permissions_info.rb b/lib/opensearch/api/actions/security/get_permissions_info.rb index 30083868d..f4398f23c 100644 --- a/lib/opensearch/api/actions/security/get_permissions_info.rb +++ b/lib/opensearch/api/actions/security/get_permissions_info.rb @@ -19,8 +19,8 @@ def get_permissions_info(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'permissionsinfo'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/permissionsinfo' Utils.validate_query_params args, GET_PERMISSIONS_INFO_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_role.rb b/lib/opensearch/api/actions/security/get_role.rb index 589077241..16acd97e5 100644 --- a/lib/opensearch/api/actions/security/get_role.rb +++ b/lib/opensearch/api/actions/security/get_role.rb @@ -24,8 +24,8 @@ def get_role(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'roles', _role].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_security/api/roles', _role].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_ROLE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_role_mapping.rb b/lib/opensearch/api/actions/security/get_role_mapping.rb index 5dd808407..08e7c81c5 100644 --- a/lib/opensearch/api/actions/security/get_role_mapping.rb +++ b/lib/opensearch/api/actions/security/get_role_mapping.rb @@ -24,8 +24,8 @@ def get_role_mapping(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'rolesmapping', _role].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_security/api/rolesmapping', _role].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_ROLE_MAPPING_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_role_mappings.rb b/lib/opensearch/api/actions/security/get_role_mappings.rb index 7c8777328..690375b8a 100644 --- a/lib/opensearch/api/actions/security/get_role_mappings.rb +++ b/lib/opensearch/api/actions/security/get_role_mappings.rb @@ -19,8 +19,8 @@ def get_role_mappings(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'rolesmapping'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/rolesmapping' Utils.validate_query_params args, GET_ROLE_MAPPINGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_roles.rb b/lib/opensearch/api/actions/security/get_roles.rb index 8c653a3c8..f29e85e61 100644 --- a/lib/opensearch/api/actions/security/get_roles.rb +++ b/lib/opensearch/api/actions/security/get_roles.rb @@ -19,8 +19,8 @@ def get_roles(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'roles'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/roles' Utils.validate_query_params args, GET_ROLES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_sslinfo.rb b/lib/opensearch/api/actions/security/get_sslinfo.rb index e9b67f76b..825ec08e9 100644 --- a/lib/opensearch/api/actions/security/get_sslinfo.rb +++ b/lib/opensearch/api/actions/security/get_sslinfo.rb @@ -20,8 +20,8 @@ def get_sslinfo(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_opendistro', '_security', 'sslinfo'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_opendistro/_security/sslinfo' Utils.validate_query_params args, GET_SSLINFO_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_tenancy_config.rb b/lib/opensearch/api/actions/security/get_tenancy_config.rb index ef6c6ea86..b9054bf89 100644 --- a/lib/opensearch/api/actions/security/get_tenancy_config.rb +++ b/lib/opensearch/api/actions/security/get_tenancy_config.rb @@ -19,8 +19,8 @@ def get_tenancy_config(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'tenancy', 'config'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/tenancy/config' Utils.validate_query_params args, GET_TENANCY_CONFIG_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_tenant.rb b/lib/opensearch/api/actions/security/get_tenant.rb index ce00094ac..cf8416a91 100644 --- a/lib/opensearch/api/actions/security/get_tenant.rb +++ b/lib/opensearch/api/actions/security/get_tenant.rb @@ -24,8 +24,8 @@ def get_tenant(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'tenants', _tenant].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_security/api/tenants', _tenant].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_TENANT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_tenants.rb b/lib/opensearch/api/actions/security/get_tenants.rb index 5aef1a778..90472e68a 100644 --- a/lib/opensearch/api/actions/security/get_tenants.rb +++ b/lib/opensearch/api/actions/security/get_tenants.rb @@ -19,8 +19,8 @@ def get_tenants(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'tenants'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/tenants' Utils.validate_query_params args, GET_TENANTS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_user.rb b/lib/opensearch/api/actions/security/get_user.rb index 21e15cd48..1f1a97c17 100644 --- a/lib/opensearch/api/actions/security/get_user.rb +++ b/lib/opensearch/api/actions/security/get_user.rb @@ -24,8 +24,8 @@ def get_user(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'internalusers', _username].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_security/api/internalusers', _username].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_USER_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_user_legacy.rb b/lib/opensearch/api/actions/security/get_user_legacy.rb index 8e1256aa5..c4a07eadd 100644 --- a/lib/opensearch/api/actions/security/get_user_legacy.rb +++ b/lib/opensearch/api/actions/security/get_user_legacy.rb @@ -24,8 +24,8 @@ def get_user_legacy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'user', _username].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_security/api/user', _username].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_USER_LEGACY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_users.rb b/lib/opensearch/api/actions/security/get_users.rb index 915462e9d..d39f6ccde 100644 --- a/lib/opensearch/api/actions/security/get_users.rb +++ b/lib/opensearch/api/actions/security/get_users.rb @@ -19,8 +19,8 @@ def get_users(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'internalusers'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/internalusers' Utils.validate_query_params args, GET_USERS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/get_users_legacy.rb b/lib/opensearch/api/actions/security/get_users_legacy.rb index 810f0cad5..fdbb58767 100644 --- a/lib/opensearch/api/actions/security/get_users_legacy.rb +++ b/lib/opensearch/api/actions/security/get_users_legacy.rb @@ -19,8 +19,8 @@ def get_users_legacy(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'user'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/user' Utils.validate_query_params args, GET_USERS_LEGACY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/health.rb b/lib/opensearch/api/actions/security/health.rb index 8da2e0122..a83ae8406 100644 --- a/lib/opensearch/api/actions/security/health.rb +++ b/lib/opensearch/api/actions/security/health.rb @@ -20,8 +20,8 @@ def health(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'health'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = '_plugins/_security/health' Utils.validate_query_params args, HEALTH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/migrate.rb b/lib/opensearch/api/actions/security/migrate.rb index d4befc8b2..9c2cbfa57 100644 --- a/lib/opensearch/api/actions/security/migrate.rb +++ b/lib/opensearch/api/actions/security/migrate.rb @@ -19,8 +19,8 @@ def migrate(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'migrate'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_security/api/migrate' Utils.validate_query_params args, MIGRATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_action_group.rb b/lib/opensearch/api/actions/security/patch_action_group.rb index 9cd948661..d019ceef9 100644 --- a/lib/opensearch/api/actions/security/patch_action_group.rb +++ b/lib/opensearch/api/actions/security/patch_action_group.rb @@ -26,8 +26,8 @@ def patch_action_group(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = ['_plugins/_security/api/actiongroups', _action_group].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PATCH_ACTION_GROUP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_action_groups.rb b/lib/opensearch/api/actions/security/patch_action_groups.rb index f7a2a928b..3045ed613 100644 --- a/lib/opensearch/api/actions/security/patch_action_groups.rb +++ b/lib/opensearch/api/actions/security/patch_action_groups.rb @@ -22,8 +22,8 @@ def patch_action_groups(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'actiongroups'].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = '_plugins/_security/api/actiongroups' Utils.validate_query_params args, PATCH_ACTION_GROUPS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_allowlist.rb b/lib/opensearch/api/actions/security/patch_allowlist.rb index e0fd7bdac..4f58d84ff 100644 --- a/lib/opensearch/api/actions/security/patch_allowlist.rb +++ b/lib/opensearch/api/actions/security/patch_allowlist.rb @@ -22,8 +22,8 @@ def patch_allowlist(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'allowlist'].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = '_plugins/_security/api/allowlist' Utils.validate_query_params args, PATCH_ALLOWLIST_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_audit_configuration.rb b/lib/opensearch/api/actions/security/patch_audit_configuration.rb index 75fc60fcf..3ebe8ee20 100644 --- a/lib/opensearch/api/actions/security/patch_audit_configuration.rb +++ b/lib/opensearch/api/actions/security/patch_audit_configuration.rb @@ -22,8 +22,8 @@ def patch_audit_configuration(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'audit'].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = '_plugins/_security/api/audit' Utils.validate_query_params args, PATCH_AUDIT_CONFIGURATION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_configuration.rb b/lib/opensearch/api/actions/security/patch_configuration.rb index 3bbfed40b..9f612fc4b 100644 --- a/lib/opensearch/api/actions/security/patch_configuration.rb +++ b/lib/opensearch/api/actions/security/patch_configuration.rb @@ -22,8 +22,8 @@ def patch_configuration(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'securityconfig'].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = '_plugins/_security/api/securityconfig' Utils.validate_query_params args, PATCH_CONFIGURATION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_distinguished_name.rb b/lib/opensearch/api/actions/security/patch_distinguished_name.rb index 097698fc8..c4b98c1c2 100644 --- a/lib/opensearch/api/actions/security/patch_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/patch_distinguished_name.rb @@ -25,8 +25,8 @@ def patch_distinguished_name(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = ['_plugins/_security/api/nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PATCH_DISTINGUISHED_NAME_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_distinguished_names.rb b/lib/opensearch/api/actions/security/patch_distinguished_names.rb index e3f5b9e84..29767f395 100644 --- a/lib/opensearch/api/actions/security/patch_distinguished_names.rb +++ b/lib/opensearch/api/actions/security/patch_distinguished_names.rb @@ -22,8 +22,8 @@ def patch_distinguished_names(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'nodesdn'].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = '_plugins/_security/api/nodesdn' Utils.validate_query_params args, PATCH_DISTINGUISHED_NAMES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_role.rb b/lib/opensearch/api/actions/security/patch_role.rb index 716d9ed10..bb5127bdf 100644 --- a/lib/opensearch/api/actions/security/patch_role.rb +++ b/lib/opensearch/api/actions/security/patch_role.rb @@ -26,8 +26,8 @@ def patch_role(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'roles', _role].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = ['_plugins/_security/api/roles', _role].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PATCH_ROLE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_role_mapping.rb b/lib/opensearch/api/actions/security/patch_role_mapping.rb index 9fd381068..e7d2fd211 100644 --- a/lib/opensearch/api/actions/security/patch_role_mapping.rb +++ b/lib/opensearch/api/actions/security/patch_role_mapping.rb @@ -26,8 +26,8 @@ def patch_role_mapping(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'rolesmapping', _role].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = ['_plugins/_security/api/rolesmapping', _role].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PATCH_ROLE_MAPPING_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_role_mappings.rb b/lib/opensearch/api/actions/security/patch_role_mappings.rb index e7e1a09a5..698c9b16c 100644 --- a/lib/opensearch/api/actions/security/patch_role_mappings.rb +++ b/lib/opensearch/api/actions/security/patch_role_mappings.rb @@ -22,8 +22,8 @@ def patch_role_mappings(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'rolesmapping'].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = '_plugins/_security/api/rolesmapping' Utils.validate_query_params args, PATCH_ROLE_MAPPINGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_roles.rb b/lib/opensearch/api/actions/security/patch_roles.rb index 4a21a1c2d..07f68e17e 100644 --- a/lib/opensearch/api/actions/security/patch_roles.rb +++ b/lib/opensearch/api/actions/security/patch_roles.rb @@ -22,8 +22,8 @@ def patch_roles(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'roles'].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = '_plugins/_security/api/roles' Utils.validate_query_params args, PATCH_ROLES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_tenant.rb b/lib/opensearch/api/actions/security/patch_tenant.rb index 5324e4250..73f1baf6d 100644 --- a/lib/opensearch/api/actions/security/patch_tenant.rb +++ b/lib/opensearch/api/actions/security/patch_tenant.rb @@ -26,8 +26,8 @@ def patch_tenant(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'tenants', _tenant].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = ['_plugins/_security/api/tenants', _tenant].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PATCH_TENANT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_tenants.rb b/lib/opensearch/api/actions/security/patch_tenants.rb index 2b3121001..c0de4984d 100644 --- a/lib/opensearch/api/actions/security/patch_tenants.rb +++ b/lib/opensearch/api/actions/security/patch_tenants.rb @@ -22,8 +22,8 @@ def patch_tenants(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'tenants'].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = '_plugins/_security/api/tenants' Utils.validate_query_params args, PATCH_TENANTS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_user.rb b/lib/opensearch/api/actions/security/patch_user.rb index d548a5938..98eebb984 100644 --- a/lib/opensearch/api/actions/security/patch_user.rb +++ b/lib/opensearch/api/actions/security/patch_user.rb @@ -26,8 +26,8 @@ def patch_user(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'internalusers', _username].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = ['_plugins/_security/api/internalusers', _username].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PATCH_USER_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/patch_users.rb b/lib/opensearch/api/actions/security/patch_users.rb index 9f8ff6d8c..0efc69b1e 100644 --- a/lib/opensearch/api/actions/security/patch_users.rb +++ b/lib/opensearch/api/actions/security/patch_users.rb @@ -22,8 +22,8 @@ def patch_users(args = {}) headers = (args.delete('headers') || {}).merge('Content-Type' => 'application/x-ndjson') body = Utils.bulkify(args.delete('body')) - url = ['_plugins', '_security', 'api', 'internalusers'].filter(&:present?).join('/').squeeze('/') method = 'PATCH' + url = '_plugins/_security/api/internalusers' Utils.validate_query_params args, PATCH_USERS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/post_dashboards_info.rb b/lib/opensearch/api/actions/security/post_dashboards_info.rb index 83ef4be32..5d054e061 100644 --- a/lib/opensearch/api/actions/security/post_dashboards_info.rb +++ b/lib/opensearch/api/actions/security/post_dashboards_info.rb @@ -19,8 +19,8 @@ def post_dashboards_info(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'dashboardsinfo'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_security/dashboardsinfo' Utils.validate_query_params args, POST_DASHBOARDS_INFO_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/reload_http_certificates.rb b/lib/opensearch/api/actions/security/reload_http_certificates.rb index 7aba2e2ce..12938abd7 100644 --- a/lib/opensearch/api/actions/security/reload_http_certificates.rb +++ b/lib/opensearch/api/actions/security/reload_http_certificates.rb @@ -19,8 +19,8 @@ def reload_http_certificates(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'ssl', 'http', 'reloadcerts'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_security/api/ssl/http/reloadcerts' Utils.validate_query_params args, RELOAD_HTTP_CERTIFICATES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/reload_transport_certificates.rb b/lib/opensearch/api/actions/security/reload_transport_certificates.rb index b01681dd0..5463212eb 100644 --- a/lib/opensearch/api/actions/security/reload_transport_certificates.rb +++ b/lib/opensearch/api/actions/security/reload_transport_certificates.rb @@ -19,8 +19,8 @@ def reload_transport_certificates(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'ssl', 'transport', 'reloadcerts'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_security/api/ssl/transport/reloadcerts' Utils.validate_query_params args, RELOAD_TRANSPORT_CERTIFICATES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/tenant_info.rb b/lib/opensearch/api/actions/security/tenant_info.rb index cf5861424..43117ef12 100644 --- a/lib/opensearch/api/actions/security/tenant_info.rb +++ b/lib/opensearch/api/actions/security/tenant_info.rb @@ -19,8 +19,8 @@ def tenant_info(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'tenantinfo'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = '_plugins/_security/tenantinfo' Utils.validate_query_params args, TENANT_INFO_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/update_audit_configuration.rb b/lib/opensearch/api/actions/security/update_audit_configuration.rb index 20bba6b71..dbe0c355a 100644 --- a/lib/opensearch/api/actions/security/update_audit_configuration.rb +++ b/lib/opensearch/api/actions/security/update_audit_configuration.rb @@ -22,8 +22,8 @@ def update_audit_configuration(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'audit', 'config'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_security/api/audit/config' Utils.validate_query_params args, UPDATE_AUDIT_CONFIGURATION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/update_configuration.rb b/lib/opensearch/api/actions/security/update_configuration.rb index 3bae06c4c..3e88be531 100644 --- a/lib/opensearch/api/actions/security/update_configuration.rb +++ b/lib/opensearch/api/actions/security/update_configuration.rb @@ -22,8 +22,8 @@ def update_configuration(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'securityconfig', 'config'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_security/api/securityconfig/config' Utils.validate_query_params args, UPDATE_CONFIGURATION_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/update_distinguished_name.rb b/lib/opensearch/api/actions/security/update_distinguished_name.rb index 4c748eb5a..11d63b42a 100644 --- a/lib/opensearch/api/actions/security/update_distinguished_name.rb +++ b/lib/opensearch/api/actions/security/update_distinguished_name.rb @@ -25,8 +25,8 @@ def update_distinguished_name(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_security/api/nodesdn', _cluster_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_DISTINGUISHED_NAME_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/validate.rb b/lib/opensearch/api/actions/security/validate.rb index c63d075a1..5859701d9 100644 --- a/lib/opensearch/api/actions/security/validate.rb +++ b/lib/opensearch/api/actions/security/validate.rb @@ -20,8 +20,8 @@ def validate(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'api', 'validate'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/api/validate' Utils.validate_query_params args, VALIDATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/who_am_i.rb b/lib/opensearch/api/actions/security/who_am_i.rb index f8b2d6d38..1b73cd4d6 100644 --- a/lib/opensearch/api/actions/security/who_am_i.rb +++ b/lib/opensearch/api/actions/security/who_am_i.rb @@ -19,8 +19,8 @@ def who_am_i(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'whoami'].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = '_plugins/_security/whoami' Utils.validate_query_params args, WHO_AM_I_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/security/who_am_i_protected.rb b/lib/opensearch/api/actions/security/who_am_i_protected.rb index 9a184bdb4..88af3ec36 100644 --- a/lib/opensearch/api/actions/security/who_am_i_protected.rb +++ b/lib/opensearch/api/actions/security/who_am_i_protected.rb @@ -19,8 +19,8 @@ def who_am_i_protected(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_security', 'whoamiprotected'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_security/whoamiprotected' Utils.validate_query_params args, WHO_AM_I_PROTECTED_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sm/create_policy.rb b/lib/opensearch/api/actions/sm/create_policy.rb index 4fcb20d05..58fb77f68 100644 --- a/lib/opensearch/api/actions/sm/create_policy.rb +++ b/lib/opensearch/api/actions/sm/create_policy.rb @@ -25,8 +25,8 @@ def create_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sm', 'policies', _policy_name].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_sm/policies', _policy_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sm/delete_policy.rb b/lib/opensearch/api/actions/sm/delete_policy.rb index caeb816da..794144b0a 100644 --- a/lib/opensearch/api/actions/sm/delete_policy.rb +++ b/lib/opensearch/api/actions/sm/delete_policy.rb @@ -26,8 +26,8 @@ def delete_policy(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sm', 'policies', _policy_name].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_sm/policies', _policy_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_POLICY_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/sm/explain_policy.rb b/lib/opensearch/api/actions/sm/explain_policy.rb index 621ee8236..171e5f187 100644 --- a/lib/opensearch/api/actions/sm/explain_policy.rb +++ b/lib/opensearch/api/actions/sm/explain_policy.rb @@ -24,8 +24,8 @@ def explain_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sm', 'policies', _policy_name, '_explain'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_sm/policies', _policy_name, '_explain'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXPLAIN_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sm/get_policies.rb b/lib/opensearch/api/actions/sm/get_policies.rb index 63c4accda..a6194d422 100644 --- a/lib/opensearch/api/actions/sm/get_policies.rb +++ b/lib/opensearch/api/actions/sm/get_policies.rb @@ -24,8 +24,8 @@ def get_policies(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sm', 'policies'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_sm/policies' Utils.validate_query_params args, GET_POLICIES_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sm/get_policy.rb b/lib/opensearch/api/actions/sm/get_policy.rb index 442f452fc..d3c3ca0d9 100644 --- a/lib/opensearch/api/actions/sm/get_policy.rb +++ b/lib/opensearch/api/actions/sm/get_policy.rb @@ -24,8 +24,8 @@ def get_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sm', 'policies', _policy_name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_sm/policies', _policy_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sm/start_policy.rb b/lib/opensearch/api/actions/sm/start_policy.rb index 540416d0d..a166f5f3e 100644 --- a/lib/opensearch/api/actions/sm/start_policy.rb +++ b/lib/opensearch/api/actions/sm/start_policy.rb @@ -24,8 +24,8 @@ def start_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sm', 'policies', _policy_name, '_start'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_sm/policies', _policy_name, '_start'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, START_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sm/stop_policy.rb b/lib/opensearch/api/actions/sm/stop_policy.rb index 886672035..5c041847a 100644 --- a/lib/opensearch/api/actions/sm/stop_policy.rb +++ b/lib/opensearch/api/actions/sm/stop_policy.rb @@ -24,8 +24,8 @@ def stop_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sm', 'policies', _policy_name, '_stop'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_sm/policies', _policy_name, '_stop'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STOP_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sm/update_policy.rb b/lib/opensearch/api/actions/sm/update_policy.rb index 7f9c420d8..0831ab41b 100644 --- a/lib/opensearch/api/actions/sm/update_policy.rb +++ b/lib/opensearch/api/actions/sm/update_policy.rb @@ -29,8 +29,8 @@ def update_policy(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sm', 'policies', _policy_name].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_sm/policies', _policy_name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_POLICY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/snapshot/cleanup_repository.rb b/lib/opensearch/api/actions/snapshot/cleanup_repository.rb index f37a8f992..937e5a9e9 100644 --- a/lib/opensearch/api/actions/snapshot/cleanup_repository.rb +++ b/lib/opensearch/api/actions/snapshot/cleanup_repository.rb @@ -27,8 +27,8 @@ def cleanup_repository(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository, '_cleanup'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_snapshot', _repository, '_cleanup'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CLEANUP_REPOSITORY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/snapshot/clone.rb b/lib/opensearch/api/actions/snapshot/clone.rb index 7e03a0c42..ed5751535 100644 --- a/lib/opensearch/api/actions/snapshot/clone.rb +++ b/lib/opensearch/api/actions/snapshot/clone.rb @@ -34,8 +34,8 @@ def clone(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository, _snapshot, '_clone', _target_snapshot].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_snapshot', _repository, _snapshot, '_clone', _target_snapshot].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CLONE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/snapshot/create.rb b/lib/opensearch/api/actions/snapshot/create.rb index 7401d9bdd..f0ddce5b4 100644 --- a/lib/opensearch/api/actions/snapshot/create.rb +++ b/lib/opensearch/api/actions/snapshot/create.rb @@ -31,8 +31,8 @@ def create(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository, _snapshot].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_snapshot', _repository, _snapshot].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/snapshot/create_repository.rb b/lib/opensearch/api/actions/snapshot/create_repository.rb index d57c1fb8b..6087de927 100644 --- a/lib/opensearch/api/actions/snapshot/create_repository.rb +++ b/lib/opensearch/api/actions/snapshot/create_repository.rb @@ -30,8 +30,8 @@ def create_repository(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_snapshot', _repository].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CREATE_REPOSITORY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/snapshot/delete.rb b/lib/opensearch/api/actions/snapshot/delete.rb index 6bf36ed5f..b205f3670 100644 --- a/lib/opensearch/api/actions/snapshot/delete.rb +++ b/lib/opensearch/api/actions/snapshot/delete.rb @@ -31,8 +31,8 @@ def delete(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository, _snapshot].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_snapshot', _repository, _snapshot].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/snapshot/delete_repository.rb b/lib/opensearch/api/actions/snapshot/delete_repository.rb index 4750c4e00..728191146 100644 --- a/lib/opensearch/api/actions/snapshot/delete_repository.rb +++ b/lib/opensearch/api/actions/snapshot/delete_repository.rb @@ -29,8 +29,8 @@ def delete_repository(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_snapshot', _repository].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_REPOSITORY_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/snapshot/get.rb b/lib/opensearch/api/actions/snapshot/get.rb index 8c444223d..98a683ebf 100644 --- a/lib/opensearch/api/actions/snapshot/get.rb +++ b/lib/opensearch/api/actions/snapshot/get.rb @@ -31,8 +31,8 @@ def get(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository, _snapshot].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_snapshot', _repository, _snapshot].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/snapshot/get_repository.rb b/lib/opensearch/api/actions/snapshot/get_repository.rb index 05bff437f..1462ada6c 100644 --- a/lib/opensearch/api/actions/snapshot/get_repository.rb +++ b/lib/opensearch/api/actions/snapshot/get_repository.rb @@ -25,8 +25,8 @@ def get_repository(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_snapshot', _repository].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_REPOSITORY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/snapshot/restore.rb b/lib/opensearch/api/actions/snapshot/restore.rb index 3e863697c..ec00accb4 100644 --- a/lib/opensearch/api/actions/snapshot/restore.rb +++ b/lib/opensearch/api/actions/snapshot/restore.rb @@ -31,8 +31,8 @@ def restore(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository, _snapshot, '_restore'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_snapshot', _repository, _snapshot, '_restore'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, RESTORE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/snapshot/status.rb b/lib/opensearch/api/actions/snapshot/status.rb index f3e1f24e9..accf24809 100644 --- a/lib/opensearch/api/actions/snapshot/status.rb +++ b/lib/opensearch/api/actions/snapshot/status.rb @@ -27,8 +27,8 @@ def status(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository, _snapshot, '_status'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_snapshot', _repository, _snapshot, '_status'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STATUS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/snapshot/verify_repository.rb b/lib/opensearch/api/actions/snapshot/verify_repository.rb index c45fa1d22..f480c73ef 100644 --- a/lib/opensearch/api/actions/snapshot/verify_repository.rb +++ b/lib/opensearch/api/actions/snapshot/verify_repository.rb @@ -27,8 +27,8 @@ def verify_repository(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_snapshot', _repository, '_verify'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_snapshot', _repository, '_verify'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, VERIFY_REPOSITORY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sql/close.rb b/lib/opensearch/api/actions/sql/close.rb index 6a38f78e8..9bb0c3504 100644 --- a/lib/opensearch/api/actions/sql/close.rb +++ b/lib/opensearch/api/actions/sql/close.rb @@ -22,8 +22,8 @@ def close(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sql', 'close'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_sql/close' Utils.validate_query_params args, CLOSE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sql/explain.rb b/lib/opensearch/api/actions/sql/explain.rb index 04d05779f..ceac09f38 100644 --- a/lib/opensearch/api/actions/sql/explain.rb +++ b/lib/opensearch/api/actions/sql/explain.rb @@ -22,8 +22,8 @@ def explain(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sql', '_explain'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_sql/_explain' Utils.validate_query_params args, EXPLAIN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sql/get_stats.rb b/lib/opensearch/api/actions/sql/get_stats.rb index 6dad97c88..9420f61ec 100644 --- a/lib/opensearch/api/actions/sql/get_stats.rb +++ b/lib/opensearch/api/actions/sql/get_stats.rb @@ -21,8 +21,8 @@ def get_stats(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sql', 'stats'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_sql/stats' Utils.validate_query_params args, GET_STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sql/post_stats.rb b/lib/opensearch/api/actions/sql/post_stats.rb index 496cb9465..948243717 100644 --- a/lib/opensearch/api/actions/sql/post_stats.rb +++ b/lib/opensearch/api/actions/sql/post_stats.rb @@ -22,8 +22,8 @@ def post_stats(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sql', 'stats'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_sql/stats' Utils.validate_query_params args, POST_STATS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sql/query.rb b/lib/opensearch/api/actions/sql/query.rb index 4b32b0449..6969df97a 100644 --- a/lib/opensearch/api/actions/sql/query.rb +++ b/lib/opensearch/api/actions/sql/query.rb @@ -22,8 +22,8 @@ def query(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_sql'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_sql' Utils.validate_query_params args, QUERY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/sql/settings.rb b/lib/opensearch/api/actions/sql/settings.rb index 3d400062a..8f9f15d34 100644 --- a/lib/opensearch/api/actions/sql/settings.rb +++ b/lib/opensearch/api/actions/sql/settings.rb @@ -21,8 +21,8 @@ def settings(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_query', 'settings'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_plugins/_query/settings' Utils.validate_query_params args, SETTINGS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/tasks/cancel.rb b/lib/opensearch/api/actions/tasks/cancel.rb index 3d29c40c0..02af0f5b1 100644 --- a/lib/opensearch/api/actions/tasks/cancel.rb +++ b/lib/opensearch/api/actions/tasks/cancel.rb @@ -26,8 +26,8 @@ def cancel(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_tasks', _task_id, '_cancel'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_tasks', _task_id, '_cancel'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, CANCEL_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/tasks/get.rb b/lib/opensearch/api/actions/tasks/get.rb index e6833826b..c6ace3d08 100644 --- a/lib/opensearch/api/actions/tasks/get.rb +++ b/lib/opensearch/api/actions/tasks/get.rb @@ -26,8 +26,8 @@ def get(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_tasks', _task_id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_tasks', _task_id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/tasks/list.rb b/lib/opensearch/api/actions/tasks/list.rb index 39bbdf1c0..f870cb680 100644 --- a/lib/opensearch/api/actions/tasks/list.rb +++ b/lib/opensearch/api/actions/tasks/list.rb @@ -26,8 +26,8 @@ def list(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_tasks'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_tasks' Utils.validate_query_params args, LIST_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/termvectors.rb b/lib/opensearch/api/actions/termvectors.rb index 3c4b49726..56fe7aa3d 100644 --- a/lib/opensearch/api/actions/termvectors.rb +++ b/lib/opensearch/api/actions/termvectors.rb @@ -38,8 +38,8 @@ def termvectors(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_termvectors', _id].filter(&:present?).join('/').squeeze('/') method = body ? 'POST' : 'GET' + url = [_index, '_termvectors', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, TERMVECTORS_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/transforms/delete.rb b/lib/opensearch/api/actions/transforms/delete.rb index 506d34bf7..f006f937e 100644 --- a/lib/opensearch/api/actions/transforms/delete.rb +++ b/lib/opensearch/api/actions/transforms/delete.rb @@ -26,8 +26,8 @@ def delete(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_transform', _id].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_plugins/_transform', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/transforms/explain.rb b/lib/opensearch/api/actions/transforms/explain.rb index 02ba65fd9..46956ad92 100644 --- a/lib/opensearch/api/actions/transforms/explain.rb +++ b/lib/opensearch/api/actions/transforms/explain.rb @@ -24,8 +24,8 @@ def explain(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_transform', _id, '_explain'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_transform', _id, '_explain'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, EXPLAIN_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/transforms/get.rb b/lib/opensearch/api/actions/transforms/get.rb index 22f193236..d2c916331 100644 --- a/lib/opensearch/api/actions/transforms/get.rb +++ b/lib/opensearch/api/actions/transforms/get.rb @@ -24,8 +24,8 @@ def get(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_transform', _id].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_plugins/_transform', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/transforms/preview.rb b/lib/opensearch/api/actions/transforms/preview.rb index 292ddff83..0d77b06ed 100644 --- a/lib/opensearch/api/actions/transforms/preview.rb +++ b/lib/opensearch/api/actions/transforms/preview.rb @@ -20,8 +20,8 @@ def preview(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_transform', '_preview'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = '_plugins/_transform/_preview' Utils.validate_query_params args, PREVIEW_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/transforms/put.rb b/lib/opensearch/api/actions/transforms/put.rb index 4d90e4a6b..946a9a9d8 100644 --- a/lib/opensearch/api/actions/transforms/put.rb +++ b/lib/opensearch/api/actions/transforms/put.rb @@ -27,8 +27,8 @@ def put(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_transform', _id].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_plugins/_transform', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, PUT_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/transforms/search.rb b/lib/opensearch/api/actions/transforms/search.rb index 597291fb4..5070e9af1 100644 --- a/lib/opensearch/api/actions/transforms/search.rb +++ b/lib/opensearch/api/actions/transforms/search.rb @@ -24,8 +24,8 @@ def search(args = {}) args = Utils.normalize_arguments(args) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_transform'].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = '_plugins/_transform' Utils.validate_query_params args, SEARCH_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/transforms/start.rb b/lib/opensearch/api/actions/transforms/start.rb index c7b1b4b5b..d38ce8e23 100644 --- a/lib/opensearch/api/actions/transforms/start.rb +++ b/lib/opensearch/api/actions/transforms/start.rb @@ -24,8 +24,8 @@ def start(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_transform', _id, '_start'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_transform', _id, '_start'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, START_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/transforms/stop.rb b/lib/opensearch/api/actions/transforms/stop.rb index 665e24b8c..fd176ebcb 100644 --- a/lib/opensearch/api/actions/transforms/stop.rb +++ b/lib/opensearch/api/actions/transforms/stop.rb @@ -24,8 +24,8 @@ def stop(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_plugins', '_transform', _id, '_stop'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_plugins/_transform', _id, '_stop'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, STOP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/update.rb b/lib/opensearch/api/actions/update.rb index 011e3b73b..c3f2ffa8e 100644 --- a/lib/opensearch/api/actions/update.rb +++ b/lib/opensearch/api/actions/update.rb @@ -41,8 +41,8 @@ def update(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_update', _id].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_update', _id].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/update_by_query.rb b/lib/opensearch/api/actions/update_by_query.rb index 2d8d9ba61..e7362d127 100644 --- a/lib/opensearch/api/actions/update_by_query.rb +++ b/lib/opensearch/api/actions/update_by_query.rb @@ -60,8 +60,8 @@ def update_by_query(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = [_index, '_update_by_query'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = [_index, '_update_by_query'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_BY_QUERY_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/update_by_query_rethrottle.rb b/lib/opensearch/api/actions/update_by_query_rethrottle.rb index c765d4001..040ae8af0 100644 --- a/lib/opensearch/api/actions/update_by_query_rethrottle.rb +++ b/lib/opensearch/api/actions/update_by_query_rethrottle.rb @@ -25,8 +25,8 @@ def update_by_query_rethrottle(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_update_by_query', _task_id, '_rethrottle'].filter(&:present?).join('/').squeeze('/') method = 'POST' + url = ['_update_by_query', _task_id, '_rethrottle'].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_BY_QUERY_RETHROTTLE_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/wlm/create_query_group.rb b/lib/opensearch/api/actions/wlm/create_query_group.rb index f1a6f6e4a..ee0e9a0f7 100644 --- a/lib/opensearch/api/actions/wlm/create_query_group.rb +++ b/lib/opensearch/api/actions/wlm/create_query_group.rb @@ -22,8 +22,8 @@ def create_query_group(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_wlm', 'query_group'].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = '_wlm/query_group' Utils.validate_query_params args, CREATE_QUERY_GROUP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/wlm/delete_query_group.rb b/lib/opensearch/api/actions/wlm/delete_query_group.rb index 4c428018d..abec44085 100644 --- a/lib/opensearch/api/actions/wlm/delete_query_group.rb +++ b/lib/opensearch/api/actions/wlm/delete_query_group.rb @@ -26,8 +26,8 @@ def delete_query_group(args = {}) ignore = args.delete('ignore') || [] headers = args.delete('headers') || {} body = args.delete('body') - url = ['_wlm', 'query_group', _name].filter(&:present?).join('/').squeeze('/') method = 'DELETE' + url = ['_wlm/query_group', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, DELETE_QUERY_GROUP_QUERY_PARAMS transport.perform_delete_request method, url, args, body, headers, ignore.include?(404) diff --git a/lib/opensearch/api/actions/wlm/get_query_group.rb b/lib/opensearch/api/actions/wlm/get_query_group.rb index f63f263b1..f5479bb0b 100644 --- a/lib/opensearch/api/actions/wlm/get_query_group.rb +++ b/lib/opensearch/api/actions/wlm/get_query_group.rb @@ -22,8 +22,8 @@ def get_query_group(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_wlm', 'query_group', _name].filter(&:present?).join('/').squeeze('/') method = 'GET' + url = ['_wlm/query_group', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, GET_QUERY_GROUP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body diff --git a/lib/opensearch/api/actions/wlm/update_query_group.rb b/lib/opensearch/api/actions/wlm/update_query_group.rb index f5b7a4e5a..47824fced 100644 --- a/lib/opensearch/api/actions/wlm/update_query_group.rb +++ b/lib/opensearch/api/actions/wlm/update_query_group.rb @@ -26,8 +26,8 @@ def update_query_group(args = {}) headers = args.delete('headers') || {} body = args.delete('body') - url = ['_wlm', 'query_group', _name].filter(&:present?).join('/').squeeze('/') method = 'PUT' + url = ['_wlm/query_group', _name].filter(&:present?).join('/').squeeze('/') Utils.validate_query_params args, UPDATE_QUERY_GROUP_QUERY_PARAMS transport.perform_request(method, url, args, body, headers).body