Skip to content

Commit

Permalink
Adding cluster manager to more URL params
Browse files Browse the repository at this point in the history
Signed-off-by: Harsha Vamsi Kalluri <[email protected]>
  • Loading branch information
harshavamsi committed Nov 16, 2022
1 parent b3640c5 commit ac31ec3
Show file tree
Hide file tree
Showing 46 changed files with 56 additions and 16 deletions.
6 changes: 3 additions & 3 deletions opensearch-api/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ namespace :test do
url = ENV['TEST_CLUSTER_URL'] || ENV['TEST_OPENSEARCH_SERVER']
url = "http://localhost:#{ENV['TEST_CLUSTER_PORT'] || 9200}" unless url
client = OpenSearch::Client.new :url => url
es_version_info = client.info['version']
version_number = es_version_info['number']
build_hash = es_version_info['build_hash']
os_version_info = client.info['version']
version_number = os_version_info['number']
build_hash = os_version_info['build_hash']
rescue Faraday::ConnectionFailed
STDERR.puts "[!] Test cluster not running?"
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def allocation(arguments = {})
:bytes,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/cat/indices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def indices(arguments = {})
:bytes,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:health,
:help,
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/cat/master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def master(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/cat/nodeattrs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def nodeattrs(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/cat/nodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def nodes(arguments = {})
:full_id,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def pending_tasks(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/cat/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def plugins(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:include_bootstrap,
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/cat/shards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def shards(arguments = {})
:bytes,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/cat/templates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def templates(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def exists_component_template(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:exists_component_template, [
:master_timeout,
:cluster_manager_timeout,
:local
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def get_component_template(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:get_component_template, [
:master_timeout,
:cluster_manager_timeout,
:local
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def get_settings(arguments = {})
ParamsRegistry.register(:get_settings, [
:flat_settings,
:master_timeout,
:cluster_manager_timeout,
:timeout,
:include_defaults
].freeze)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def health(arguments = {})
:level,
:local,
:master_timeout,
:cluster_manager_timeout,
:timeout,
:wait_for_active_shards,
:wait_for_nodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def reroute(arguments = {})
:retry_failed,
:metric,
:master_timeout,
:cluster_manager_timeout,
:timeout
].freeze)
end
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/cluster/state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def state(arguments = {})
ParamsRegistry.register(:state, [
:local,
:master_timeout,
:cluster_manager_timeout,
:flat_settings,
:wait_for_metadata_version,
:wait_for_timeout,
Expand Down
3 changes: 2 additions & 1 deletion opensearch-api/lib/opensearch/api/actions/delete_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def delete_script(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:delete_script, [
:timeout,
:master_timeout
:master_timeout,
:cluster_manager_timeout
].freeze)
end
end
Expand Down
3 changes: 2 additions & 1 deletion opensearch-api/lib/opensearch/api/actions/get_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def get_script(arguments = {})
#
# @since 6.2.0
ParamsRegistry.register(:get_script, [
:master_timeout
:master_timeout,
:cluster_manager_timeout
].freeze)
end
end
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/indices/clone.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def clone(arguments = {})
ParamsRegistry.register(:clone, [
:timeout,
:master_timeout,
:cluster_manager_timeout,
:wait_for_active_shards
].freeze)
end
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/indices/close.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def close(arguments = {})
ParamsRegistry.register(:close, [
:timeout,
:master_timeout,
:cluster_manager_timeout,
:ignore_unavailable,
:allow_no_indices,
:expand_wildcards,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def delete(arguments = {})
ParamsRegistry.register(:delete, [
:timeout,
:master_timeout,
:cluster_manager_timeout,
:ignore_unavailable,
:allow_no_indices,
:expand_wildcards
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def exists_template(arguments = {})
ParamsRegistry.register(:exists_template, [
:flat_settings,
:master_timeout,
:cluster_manager_timeout,
:local
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def get_index_template(arguments = {})
ParamsRegistry.register(:get_index_template, [
:flat_settings,
:master_timeout,
:cluster_manager_timeout,
:local
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def get_mapping(arguments = {})
:allow_no_indices,
:expand_wildcards,
:master_timeout,
:cluster_manager_timeout,
:local
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ def get_settings(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:get_settings, [
:master_timeout,
:cluster_manager_timeout,
:ignore_unavailable,
:allow_no_indices,
:expand_wildcards,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def get_template(arguments = {})
ParamsRegistry.register(:get_template, [
:flat_settings,
:master_timeout,
:cluster_manager_timeout,
:local
].freeze)
end
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/indices/open.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def open(arguments = {})
ParamsRegistry.register(:open, [
:timeout,
:master_timeout,
:cluster_manager_timeout,
:ignore_unavailable,
:allow_no_indices,
:expand_wildcards,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def put_mapping(arguments = {})
ParamsRegistry.register(:put_mapping, [
:timeout,
:master_timeout,
:cluster_manager_timeout,
:ignore_unavailable,
:allow_no_indices,
:expand_wildcards,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def put_settings(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:put_settings, [
:master_timeout,
:cluster_manager_timeout,
:timeout,
:preserve_existing,
:ignore_unavailable,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def rollover(arguments = {})
:timeout,
:dry_run,
:master_timeout,
:cluster_manager_timeout,
:wait_for_active_shards
].freeze)
end
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/indices/split.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def split(arguments = {})
:copy_settings,
:timeout,
:master_timeout,
:cluster_manager_timeout,
:wait_for_active_shards
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def delete_pipeline(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:delete_pipeline, [
:master_timeout,
:cluster_manager_timeout,
:timeout
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def put_pipeline(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:put_pipeline, [
:master_timeout,
:cluster_manager_timeout,
:timeout
].freeze)
end
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/put_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def put_script(arguments = {})
ParamsRegistry.register(:put_script, [
:timeout,
:master_timeout,
:cluster_manager_timeout,
:context
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def create(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:create, [
:master_timeout,
:cluster_manager_timeout,
:wait_for_completion
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def create_repository(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:create_repository, [
:master_timeout,
:cluster_manager_timeout,
:timeout,
:verify
].freeze)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def delete_repository(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:delete_repository, [
:master_timeout,
:cluster_manager_timeout,
:timeout
].freeze)
end
Expand Down
1 change: 1 addition & 0 deletions opensearch-api/lib/opensearch/api/actions/snapshot/get.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def get(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:get, [
:master_timeout,
:cluster_manager_timeout,
:ignore_unavailable,
:index_details,
:include_repository,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def get_repository(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:get_repository, [
:master_timeout,
:cluster_manager_timeout,
:local
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def restore(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:restore, [
:master_timeout,
:cluster_manager_timeout,
:wait_for_completion
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def status(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:status, [
:master_timeout,
:cluster_manager_timeout,
:ignore_unavailable
].freeze)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def verify_repository(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:verify_repository, [
:master_timeout,
:cluster_manager_timeout,
:timeout
].freeze)
end
Expand Down
2 changes: 1 addition & 1 deletion opensearch-api/lib/opensearch/api/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@

module OpenSearch
module API
VERSION = '2.0.2'.freeze
VERSION = '2.1.0'.freeze
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,17 @@
require 'spec_helper'

describe 'client.cat#allocation' do

let(:expected_args) do
[
'GET',
'_cat/allocation',
{},
nil,
{}
'GET',
'_cat/allocation',
{cluster_manager_timeout: 2},
nil,
{}
]
end

it 'performs the request' do
expect(client_double.cat.allocation).to eq({})
expect(client_double.cat.allocation(cluster_manager_timeout: 2)).to eq({})
end
end
2 changes: 1 addition & 1 deletion opensearch/lib/opensearch/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@
# under the License.

module OpenSearch
VERSION = '2.0.3'.freeze
VERSION = '2.1.0'.freeze
end
4 changes: 2 additions & 2 deletions opensearch/opensearch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Gem::Specification.new do |s|

s.required_ruby_version = '>= 2.4'

s.add_dependency 'opensearch-transport', '~> 2.0.0'
s.add_dependency 'opensearch-api', '2.0.2'
s.add_dependency 'opensearch-transport', '~> 2.0'
s.add_dependency 'opensearch-api', '~> 2.1'

s.add_development_dependency 'bundler'
s.add_development_dependency 'byebug' unless defined?(JRUBY_VERSION) || defined?(Rubinius)
Expand Down

0 comments on commit ac31ec3

Please sign in to comment.