Method: Elasticsearch::API::SQL::Actions#clear_cursor

Defined in:
lib/elasticsearch/api/actions/sql/clear_cursor.rb

#clear_cursor(arguments = {}) ⇒ Object

Clears the SQL cursor

Parameters:

  • arguments (Hash) (defaults to: {})

    a customizable set of options

Options Hash (arguments):

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    Specify the cursor value in the cursor element to clean the cursor. (Required)

Raises:

  • (ArgumentError)

See Also:



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/elasticsearch/api/actions/sql/clear_cursor.rb', line 32

def clear_cursor(arguments = {})
  request_opts = { endpoint: arguments[:endpoint] || 'sql.clear_cursor' }

  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]

  arguments = arguments.clone
  headers = arguments.delete(:headers) || {}

  body   = arguments.delete(:body)

  method = Elasticsearch::API::HTTP_POST
  path   = '_sql/close'
  params = {}

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