lib/elasticsearch/api/actions/reindex_rethrottle.rb in elasticsearch-api-8.10.0 vs lib/elasticsearch/api/actions/reindex_rethrottle.rb in elasticsearch-api-8.11.0

- old
+ new

@@ -25,13 +25,21 @@ # # @option arguments [String] :task_id The task id to rethrottle # @option arguments [Number] :requests_per_second The throttle to set on this request in floating sub-requests per second. -1 means set no throttle. (*Required*) # @option arguments [Hash] :headers Custom HTTP headers # - # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.10/docs-reindex.html + # @see https://www.elastic.co/guide/en/elasticsearch/reference/8.11/docs-reindex.html # def reindex_rethrottle(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || "reindex_rethrottle" } + + defined_params = [:task_id].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 'task_id' missing" unless arguments[:task_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -42,10 +50,10 @@ method = Elasticsearch::API::HTTP_POST path = "_reindex/#{Utils.__listify(_task_id)}/_rethrottle" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( - perform_request(method, path, params, body, headers) + perform_request(method, path, params, body, headers, request_opts) ) end end end end