Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update comments around deprecated and inclusive naming #112

Merged
merged 5 commits into from
Nov 21, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added Sigv4 Support with `opensearch-aws-sigv4` gem ([#71](https://github.com/opensearch-project/opensearch-ruby/issues/71))

### Changed
- Updated for inclusive naming ([#112](https://github.com/opensearch-project/opensearch-ruby/issues/112))
- Updated release/build.sh and root folder's Gemfile to include `opensearch-aws-sigv4` ([#71](https://github.com/opensearch-project/opensearch-ruby/issues/71))

### Deprecated
Expand Down
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']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can change this later, but I think this should be opensearch_ because OS assumes operating system a lot.

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
6 changes: 4 additions & 2 deletions opensearch-api/lib/opensearch/api/actions/cat/allocation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ module Actions
# @option arguments [List] :node_id A comma-separated list of node IDs or names to limit the returned information
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb)
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node (default: false)
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
Expand Down Expand Up @@ -70,6 +71,7 @@ def allocation(arguments = {})
:bytes,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# 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.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.

module OpenSearch
module API
module Cat
module Actions
# Returns information about the cluster_manager node.
#
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node (default: false)
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
# @option arguments [Boolean] :v Verbose mode. Display column headers
# @option arguments [Hash] :headers Custom HTTP headers
#
#
def cluster_manager(arguments = {})
headers = arguments.delete(:headers) || {}

arguments = arguments.clone

method = OpenSearch::API::HTTP_GET
path = '_cat/cluster_manager'
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

body = nil
perform_request(method, path, params, body, headers).body
end

# Register this action with its valid params when the module is loaded.
#
# @since 6.2.0
ParamsRegistry.register(:cluster_manager, %i[
format
local
cluster_manager_timeout
h
help
s
v
].freeze)
end
end
end
end
6 changes: 4 additions & 2 deletions opensearch-api/lib/opensearch/api/actions/cat/indices.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ module Actions
# @option arguments [List] :index A comma-separated list of index names to limit the returned information
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb)
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated*
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node (default: false)
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [String] :health A health status ("green", "yellow", or "red" to filter only indices matching the specified health status (options: green, yellow, red)
# @option arguments [Boolean] :help Return help information
Expand Down Expand Up @@ -75,6 +76,7 @@ def indices(arguments = {})
:bytes,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:health,
:help,
Expand Down
4 changes: 3 additions & 1 deletion opensearch-api/lib/opensearch/api/actions/cat/master.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.


# @deprecated Please use cluster_manager instead.
module OpenSearch
module API
module Cat
Expand Down Expand Up @@ -60,6 +61,7 @@ def master(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
6 changes: 4 additions & 2 deletions opensearch-api/lib/opensearch/api/actions/cat/nodeattrs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ module Actions
# Returns information about custom node attributes.
#
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node (default: false)
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
Expand Down Expand Up @@ -60,6 +61,7 @@ def nodeattrs(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
6 changes: 4 additions & 2 deletions opensearch-api/lib/opensearch/api/actions/cat/nodes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ module Actions
# @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb)
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [Boolean] :full_id Return the full node ID instead of the shortened version (default: false)
# @option arguments [Boolean] :local Calculate the selected nodes using the local cluster state rather than the state from master node (default: false) *Deprecated*
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Calculate the selected nodes using the local cluster state rather than the state from cluster_manager node (default: false) *Deprecated*
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
Expand Down Expand Up @@ -67,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 @@ -31,8 +31,9 @@ module Actions
# Returns a concise representation of the cluster pending tasks.
#
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node (default: false)
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
Expand Down Expand Up @@ -62,6 +63,7 @@ def pending_tasks(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
6 changes: 4 additions & 2 deletions opensearch-api/lib/opensearch/api/actions/cat/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ module Actions
# Returns information about installed plugins across nodes node.
#
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node (default: false)
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [Boolean] :include_bootstrap Include bootstrap plugins in the response
Expand Down Expand Up @@ -61,6 +62,7 @@ def plugins(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:include_bootstrap,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ module Actions
# Returns information about snapshot repositories registered in the cluster.
#
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
Expand Down Expand Up @@ -61,6 +62,7 @@ def repositories(arguments = {})
:format,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
6 changes: 4 additions & 2 deletions opensearch-api/lib/opensearch/api/actions/cat/shards.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ module Actions
# @option arguments [List] :index A comma-separated list of index names to limit the returned information
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb)
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false) *Deprecated*
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node (default: false) *Deprecated*
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
Expand Down Expand Up @@ -71,6 +72,7 @@ def shards(arguments = {})
:bytes,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ module Actions
# @option arguments [List] :repository Name of repository from which to fetch the snapshot information
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [Boolean] :ignore_unavailable Set to true to ignore unavailable snapshots
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
Expand Down Expand Up @@ -68,6 +69,7 @@ def snapshots(arguments = {})
:format,
:ignore_unavailable,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
6 changes: 4 additions & 2 deletions opensearch-api/lib/opensearch/api/actions/cat/templates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ module Actions
#
# @option arguments [String] :name A pattern that returned template names must match
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node (default: false)
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
Expand Down Expand Up @@ -67,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 @@ -34,8 +34,9 @@ module Actions
# @option arguments [List] :thread_pool_patterns A comma-separated list of regular-expressions to filter the thread pools in the output
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
# @option arguments [String] :size The multiplier in which to display values *Deprecated* (options: , k, m, g, t, p)
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
# @option arguments [Boolean] :local Return local information, do not retrieve the state from cluster_manager node (default: false)
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Explicit operation timeout for connection to master node
# @option arguments [Time] :cluster_manager_timeout Explicit operation timeout for connection to cluster_manager node
# @option arguments [List] :h Comma-separated list of column names to display
# @option arguments [Boolean] :help Return help information
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
Expand Down Expand Up @@ -71,6 +72,7 @@ def thread_pool(arguments = {})
:size,
:local,
:master_timeout,
:cluster_manager_timeout,
:h,
:help,
:s,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ module Actions
#
# @option arguments [String] :name The name of the template
# @option arguments [Time] :timeout Explicit operation timeout
# @option arguments [Time] :master_timeout Specify timeout for connection to master
# @option arguments [Time] :master_timeout (DEPRECATED: use cluster_manager_timeout instead) Specify timeout for connection to master
# @option arguments [Time] :cluster_manager_timeout Specify timeout for connection to cluster_manager
nhtruong marked this conversation as resolved.
Show resolved Hide resolved
# @option arguments [Hash] :headers Custom HTTP headers
#
#
Expand All @@ -58,7 +59,8 @@ def delete_component_template(arguments = {})
# @since 6.2.0
ParamsRegistry.register(:delete_component_template, [
:timeout,
:master_timeout
:master_timeout,
:cluster_manager_timeout
].freeze)
end
end
Expand Down
Loading