Skip to content

Commit c00ee5b

Browse files
committed
[API] Updates cat and indices endpoints
cat.segments - Adds :master_timeout and :local Boolean parameter: return local information, do not retrieve the state from master node (default: false) cat.tasks - Adds :timeout and :wait_for_completion parameters indices.get_field_mapping - Removes :local parameter indices.resolve_cluster - Adds :timeout parameter, :name no longer a required parameter
1 parent f49bb6d commit c00ee5b

File tree

5 files changed

+16
-10
lines changed

5 files changed

+16
-10
lines changed

elasticsearch-api/lib/elasticsearch/api/actions/cat/segments.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ module Actions
2626
#
2727
# @option arguments [List] :index A comma-separated list of index names to limit the returned information
2828
# @option arguments [String] :format a short version of the Accept header, e.g. json, yaml
29+
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
30+
# @option arguments [Time] :master_timeout Explicit operation timeout for connection to master node
2931
# @option arguments [String] :bytes The unit in which to display byte values (options: b, k, kb, m, mb, g, gb, t, tb, p, pb)
3032
# @option arguments [List] :h Comma-separated list of column names to display
3133
# @option arguments [Boolean] :help Return help information

elasticsearch-api/lib/elasticsearch/api/actions/cat/tasks.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ module Actions
3838
# @option arguments [List] :s Comma-separated list of column names or column aliases to sort by
3939
# @option arguments [String] :time The unit in which to display time values (options: d, h, m, s, ms, micros, nanos)
4040
# @option arguments [Boolean] :v Verbose mode. Display column headers
41+
# @option arguments [Time] :timeout Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
42+
# @option arguments [Boolean] :wait_for_completion If `true`, the request blocks until the task has completed.
4143
# @option arguments [Hash] :headers Custom HTTP headers
4244
#
4345
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/tasks.html

elasticsearch-api/lib/elasticsearch/api/actions/enrich/stats.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ module Enrich
2424
module Actions
2525
# Gets enrich coordinator statistics and information about enrich policies that are currently executing.
2626
#
27-
# @option arguments [Time] :master_timeout Timeout for processing on master node
27+
# @option arguments [Time] :master_timeout Timeout for waiting for new cluster state in case it is blocked
2828
# @option arguments [Hash] :headers Custom HTTP headers
2929
#
3030
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-stats-api.html

elasticsearch-api/lib/elasticsearch/api/actions/indices/get_field_mapping.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ module Actions
3030
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
3131
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
3232
# @option arguments [String] :expand_wildcards Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)
33-
# @option arguments [Boolean] :local Return local information, do not retrieve the state from master node (default: false)
3433
# @option arguments [Hash] :headers Custom HTTP headers
3534
#
3635
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-field-mapping.html

elasticsearch-api/lib/elasticsearch/api/actions/indices/resolve_cluster.rb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ module Elasticsearch
2222
module API
2323
module Indices
2424
module Actions
25-
# Resolves the specified index expressions to return information about each cluster, including the local cluster, if included.
25+
# Resolves the specified index expressions to return information about each cluster. If no index expression is provided, this endpoint will return information about all the remote clusters that are configured on the local cluster.
2626
#
2727
# @option arguments [List] :name A comma-separated list of cluster:index names or wildcard expressions
28-
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed)
29-
# @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled
30-
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)
31-
# @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)
28+
# @option arguments [Boolean] :ignore_unavailable Whether specified concrete indices should be ignored when unavailable (missing or closed). Only allowed when providing an index expression.
29+
# @option arguments [Boolean] :ignore_throttled Whether specified concrete, expanded or aliased indices should be ignored when throttled. Only allowed when providing an index expression.
30+
# @option arguments [Boolean] :allow_no_indices Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified). Only allowed when providing an index expression.
31+
# @option arguments [String] :expand_wildcards Whether wildcard expressions should get expanded to open or closed indices (default: open). Only allowed when providing an index expression. (options: open, closed, hidden, none, all)
32+
# @option arguments [Time] :timeout The maximum time to wait for remote clusters to respond
3233
# @option arguments [Hash] :headers Custom HTTP headers
3334
#
3435
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-resolve-cluster-api.html
@@ -41,8 +42,6 @@ def resolve_cluster(arguments = {})
4142
end
4243
request_opts[:defined_params] = defined_params unless defined_params.empty?
4344

44-
raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]
45-
4645
arguments = arguments.clone
4746
headers = arguments.delete(:headers) || {}
4847

@@ -51,7 +50,11 @@ def resolve_cluster(arguments = {})
5150
_name = arguments.delete(:name)
5251

5352
method = Elasticsearch::API::HTTP_GET
54-
path = "_resolve/cluster/#{Utils.__listify(_name)}"
53+
path = if _name
54+
"_resolve/cluster/#{Utils.__listify(_name)}"
55+
else
56+
'_resolve/cluster'
57+
end
5558
params = Utils.process_params(arguments)
5659

5760
Elasticsearch::API::Response.new(

0 commit comments

Comments
 (0)