lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/index_lifecycle_management/retry.rb in elasticsearch-api-8.11.0
- old
+ new
@@ -25,13 +25,21 @@
# Retries executing the policy for an index that is in the ERROR step.
#
# @option arguments [String] :index The name of the indices (comma-separated) whose failed lifecycle step is to be retry
# @option arguments [Hash] :headers Custom HTTP headers
#
- # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/ilm-retry-policy.html
+ # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/ilm-retry-policy.html
#
def retry(arguments = {})
+ request_opts = { endpoint: arguments[:endpoint] || "ilm.retry" }
+
+ defined_params = [:index].inject({}) do |set_variables, variable|
+ set_variables[variable] = arguments[variable] if arguments.key?(variable)
+ set_variables
+ end
+ request_opts[:defined_params] = defined_params unless defined_params.empty?
+
raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]
arguments = arguments.clone
headers = arguments.delete(:headers) || {}
@@ -42,10 +50,10 @@
method = Elasticsearch::API::HTTP_POST
path = "#{Utils.__listify(_index)}/_ilm/retry"
params = {}
Elasticsearch::API::Response.new(
- perform_request(method, path, params, body, headers)
+ perform_request(method, path, params, body, headers, request_opts)
)
end
end
end
end