esql-async-query-get-api.asciidoc 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. [[esql-async-query-get-api]]
  2. === {esql} async query get API
  3. ++++
  4. <titleabbrev>{esql} async query get API</titleabbrev>
  5. ++++
  6. .New API reference
  7. [sidebar]
  8. --
  9. For the most up-to-date API details, refer to {api-es}/group/endpoint-esql[ES|QL APIs].
  10. --
  11. Returns the current status and available results for an <<esql-async-query-api,{esql}
  12. async query>> or a stored results.
  13. [source,console]
  14. ----
  15. GET /_query/async/FkpMRkJGS1gzVDRlM3g4ZzMyRGlLbkEaTXlJZHdNT09TU2VTZVBoNDM3cFZMUToxMDM=
  16. ----
  17. // TEST[skip: no access to query ID]
  18. [[esql-async-query-get-api-request]]
  19. ==== {api-request-title}
  20. `GET /_query/async/<query_id>`
  21. [[esql-async-query-get-api-prereqs]]
  22. ==== {api-prereq-title}
  23. * If the {es} {security-features} are enabled, only the user who first submitted
  24. the {esql} query can retrieve the results using this API.
  25. [[esql-async-query-get-api-path-params]]
  26. ==== {api-path-parms-title}
  27. `<query_id>`::
  28. (Required, string)
  29. Identifier for the query.
  30. +
  31. A query ID is provided in the <<esql-async-query-api,{esql} async query API>>'s
  32. response for a query that does not complete in the awaited time. A query ID is
  33. also provided if the request's <<esql-async-query-api-keep-on-completion,`keep_on_completion`>>
  34. parameter is `true`.
  35. [[esql-async-query-get-api-query-params]]
  36. ==== {api-query-parms-title}
  37. The API accepts the same parameters as the synchronous
  38. <<esql-query-api-query-params,query API>>, along with the following
  39. parameters:
  40. `wait_for_completion_timeout`::
  41. (Optional, <<time-units,time value>>)
  42. Timeout duration to wait for the request to finish. Defaults to no timeout,
  43. meaning the request waits for complete query results.
  44. +
  45. If this parameter is specified and the request completes during this period,
  46. complete query results are returned.
  47. +
  48. If the request does not complete during this period, the response returns an
  49. `is_running` value of `true` and no results.
  50. [[esql-async-query-get-api-response-body]]
  51. ==== {api-response-body-title}
  52. The {esql} async query get API returns the same response body as the {esql}
  53. query API. See the {esql} query API's <<esql-query-api-response-body,response
  54. body parameters>>.