Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[API] Updates esql.async_query_stop #2590

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,32 @@
# specific language governing permissions and limitations
# under the License.
#
# Auto generated from build hash f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch/tree/main/rest-api-spec
# Auto generated from commit f284cc16f4d4b4289bc679aa1529bb504190fe80
# @see https://github.com/elastic/elasticsearch-specification
#
module Elasticsearch
module API
module Esql
module Actions
# Stops a previously submitted async query request given its ID and collects the results.
# Stop async ES|QL query.
# This API interrupts the query execution and returns the results so far.
# If the Elasticsearch security features are enabled, only the user who first submitted the ES|QL query can stop it.
#
# @option arguments [String] :id The async query ID
# @option arguments [String] :id The unique identifier of the query.
# A query ID is provided in the ES|QL async query API response for a query that does not complete in the designated time.
# A query ID is also provided when the request was submitted with the +keep_on_completion+ parameter set to +true+. (*Required*)
# @option arguments [Boolean] :drop_null_columns Indicates whether columns that are entirely +null+ will be removed from the +columns+ and +values+ portion of the results.
# If +true+, the response will include an extra section under the name +all_columns+ which has the name of all the columns.
# @option arguments [Hash] :headers Custom HTTP headers
#
# @see https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-async-query-stop-api.html
#
def async_query_stop(arguments = {})
request_opts = { endpoint: arguments[:endpoint] || 'esql.async_query_stop' }

defined_params = [:id].each_with_object({}) do |variable, set_variables|
defined_params = [: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?

Expand All @@ -48,7 +55,7 @@ def async_query_stop(arguments = {})

method = Elasticsearch::API::HTTP_POST
path = "_query/async/#{Utils.__listify(_id)}/stop"
params = {}
params = Utils.process_params(arguments)

Elasticsearch::API::Response.new(
perform_request(method, path, params, body, headers, request_opts)
Expand Down