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

- old
+ new

@@ -29,10 +29,18 @@ # @option arguments [Hash] :body The shutdown type definition to register (*Required*) # # @see https://www.elastic.co/guide/en/elasticsearch/reference/current # def put_node(arguments = {}) + request_opts = { endpoint: arguments[:endpoint] || "shutdown.put_node" } + + defined_params = [:node_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 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'node_id' missing" unless arguments[:node_id] arguments = arguments.clone headers = arguments.delete(:headers) || {} @@ -44,10 +52,10 @@ method = Elasticsearch::API::HTTP_PUT path = "_nodes/#{Utils.__listify(_node_id)}/shutdown" 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