Skip to content

Commit 023ea46

Browse files
committed
[API] Updates indices.resolve_cluster - Adds timeout, name no longer a required parameter
1 parent 45c42b1 commit 023ea46

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

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/8.17/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)