Skip to content

Commit

Permalink
[API] Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
estolfo committed Oct 22, 2018
1 parent 732d367 commit 412d650
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ module Elasticsearch
module API
module Actions

# The valid parameters for this action.
#
# @since 6.0.1
VALID_PARAMS =

# Return the number of queries matching a document.
#
# Percolator allows you to register queries and then evaluate a document against them:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ module Actions
#
def delete_script(arguments={})
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

valid_params =

method = HTTP_DELETE
path = "_scripts/#{arguments.has_key?(:lang) ? "#{arguments.delete(:lang)}/" : ''}#{arguments[:id]}"
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
Expand Down
3 changes: 0 additions & 3 deletions elasticsearch-api/lib/elasticsearch/api/actions/explain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ def explain(arguments={})
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
raise ArgumentError, "Required argument 'type' missing" unless arguments[:type]
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]

valid_params =

method = HTTP_GET
path = Utils.__pathify Utils.__escape(arguments[:index]),
Utils.__escape(arguments[:type]),
Expand Down
18 changes: 3 additions & 15 deletions elasticsearch-api/lib/elasticsearch/api/actions/field_caps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,10 @@ def field_caps(arguments={})
#
# @since 6.1.1
ParamsRegistry.register(:field_caps, [
:analyze_wildcard,
:analyzer,
:default_operator,
:df,
:fields,
:lenient,
:lowercase_expanded_terms,
:parent,
:preference,
:q,
:routing,
:source,
:_source,
:_source_include,
:_source_exclude,
:stored_fields ].freeze)
:ignore_unavailable,
:allow_no_indices,
:expand_wildcards ].freeze)
end
end
end
3 changes: 0 additions & 3 deletions elasticsearch-api/lib/elasticsearch/api/actions/get.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ def get(arguments={})
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
raise ArgumentError, "Required argument 'id' missing" unless arguments[:id]
arguments[:type] ||= UNDERSCORE_ALL

valid_params =

method = HTTP_GET
path = Utils.__pathify Utils.__escape(arguments[:index]),
Utils.__escape(arguments[:type]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def delete_alias(arguments={})
# Register this action with its valid params when the module is loaded.
#
# @since 6.1.1
ParamsRegistry.register(:delete, [ :timeout ].freeze)
ParamsRegistry.register(:delete_alias, [ :timeout ].freeze)
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ module Actions
def put_alias(arguments={})
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
valid_params = [ :timeout ]

method = HTTP_PUT
path = Utils.__pathify Utils.__listify(arguments[:index]), '_alias', Utils.__escape(arguments[:name])

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ module Actions
#
def update_aliases(arguments={})
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
valid_params = [ :timeout ]

method = HTTP_POST
path = "_aliases"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ module Actions
#
def msearch_template(arguments={})
raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

valid_params = [ :search_type ]
method = HTTP_GET
path = Utils.__pathify Utils.__listify(arguments[:index]),
Utils.__listify(arguments[:type]),
'_msearch/template'
params = Utils.__validate_and_extract_params arguments, valid_params
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
body = arguments[:body]

case
Expand All @@ -40,6 +38,11 @@ def msearch_template(arguments={})

perform_request(method, path, params, payload, {"Content-Type" => "application/x-ndjson"}).body
end

# Register this action with its valid params when the module is loaded.
#
# @since 6.1.1
ParamsRegistry.register(:msearch_template, [ :search_type ].freeze)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ module Actions
# @see http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html
#
def render_search_template(arguments={})
valid_params = [
:id
]
method = 'GET'
path = "_render/template"
params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def verify_repository(arguments={})
# Register this action with its valid params when the module is loaded.
#
# @since 6.1.1
ParamsRegistry.register(:status, [
ParamsRegistry.register(:verify_repository, [
:repository,
:master_timeout,
:timeout ].freeze)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def get(arguments={})
# Register this action with its valid params when the module is loaded.
#
# @since 6.1.1
ParamsRegistry.register(:cancel, [ :wait_for_completion ].freeze)
ParamsRegistry.register(:get, [ :wait_for_completion ].freeze)
end
end
end
Expand Down

0 comments on commit 412d650

Please sign in to comment.