Module: Elasticsearch::API::Eql::Actions
- Defined in:
- lib/elasticsearch/api/actions/eql/get.rb,
lib/elasticsearch/api/actions/eql/delete.rb,
lib/elasticsearch/api/actions/eql/search.rb,
lib/elasticsearch/api/actions/eql/get_status.rb
Instance Method Summary collapse
-
#delete(arguments = {}) ⇒ Object
Delete an async EQL search.
-
#get(arguments = {}) ⇒ Object
Get async EQL search results.
-
#get_status(arguments = {}) ⇒ Object
Get the async EQL status.
-
#search(arguments = {}) ⇒ Object
Get EQL search results.
Instance Method Details
#delete(arguments = {}) ⇒ Object
Delete an async EQL search. Delete an async EQL search or a stored synchronous EQL search. The API also deletes results for the search.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/elasticsearch/api/actions/eql/delete.rb', line 36 def delete(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'eql.delete' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_DELETE path = "_eql/search/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get(arguments = {}) ⇒ Object
Get async EQL search results. Get the current status and available results for an async EQL search or a stored synchronous EQL search.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/elasticsearch/api/actions/eql/get.rb', line 37 def get(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'eql.get' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET path = "_eql/search/#{Utils.listify(_id)}" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#get_status(arguments = {}) ⇒ Object
Get the async EQL status. Get the current status for an async EQL search or a stored synchronous EQL search without returning results.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/elasticsearch/api/actions/eql/get_status.rb', line 33 def get_status(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'eql.get_status' } defined_params = [:id].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'id' missing" unless arguments[:id] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _id = arguments.delete(:id) method = Elasticsearch::API::HTTP_GET path = "_eql/search/status/#{Utils.listify(_id)}" params = {} Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |
#search(arguments = {}) ⇒ Object
Get EQL search results. Returns search results for an Event Query Language (EQL) query. EQL assumes each document in a data stream or index corresponds to an event.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/elasticsearch/api/actions/eql/search.rb', line 44 def search(arguments = {}) request_opts = { endpoint: arguments[:endpoint] || 'eql.search' } defined_params = [:index].each_with_object({}) do |variable, set_variables| set_variables[variable] = arguments[variable] if arguments.key?(variable) end request_opts[:defined_params] = defined_params unless defined_params.empty? raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = "#{Utils.listify(_index)}/_eql/search" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers, request_opts) ) end |