Module: Elasticsearch::API::Fleet::Actions
- Included in:
- FleetClient
- Defined in:
- lib/elasticsearch/api/namespace/fleet.rb,
lib/elasticsearch/api/actions/fleet/search.rb,
lib/elasticsearch/api/actions/fleet/msearch.rb,
lib/elasticsearch/api/actions/fleet/global_checkpoints.rb
Instance Method Summary collapse
-
#global_checkpoints(arguments = {}) ⇒ Object
Returns the current global checkpoints for an index.
-
#msearch(arguments = {}) ⇒ Object
Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh.
-
#search(arguments = {}) ⇒ Object
Search API where the search will only be executed after specified checkpoints are available due to a refresh.
Instance Method Details
#global_checkpoints(arguments = {}) ⇒ Object
Returns the current global checkpoints for an index. This API is design for internal use by the fleet server project.
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/elasticsearch/api/actions/fleet/global_checkpoints.rb', line 36 def global_checkpoints(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = nil _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = "#{Utils.__listify(_index)}/_fleet/global_checkpoints" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |
#msearch(arguments = {}) ⇒ Object
Multi Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.
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 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/elasticsearch/api/actions/fleet/msearch.rb', line 37 def msearch(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] arguments = arguments.clone headers = arguments.delete(:headers) || {} body = arguments.delete(:body) _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Utils.__listify(_index)}/_fleet/_fleet_msearch" else "_fleet/_fleet_msearch" end params = {} case when body.is_a?(Array) && body.any? { |d| d.has_key? :search } payload = body .inject([]) do |sum, item| = item data = .delete(:search) sum << sum << data sum end .map { |item| Elasticsearch::API.serializer.dump(item) } payload << "" unless payload.empty? payload = payload.join("\n") when body.is_a?(Array) payload = body.map { |d| d.is_a?(String) ? d : Elasticsearch::API.serializer.dump(d) } payload << "" unless payload.empty? payload = payload.join("\n") else payload = body end headers.merge!("Content-Type" => "application/x-ndjson") Elasticsearch::API::Response.new( perform_request(method, path, params, payload, headers) ) end |
#search(arguments = {}) ⇒ Object
Search API where the search will only be executed after specified checkpoints are available due to a refresh. This API is designed for internal use by the fleet server project. This functionality is Experimental and may be changed or removed completely in a future release. Elastic will take a best effort approach to fix any issues, but experimental features are not subject to the support SLA of official GA features.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/elasticsearch/api/actions/fleet/search.rb', line 40 def search(arguments = {}) 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 = if body Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = "#{Utils.__listify(_index)}/_fleet/_fleet_search" params = Utils.process_params(arguments) Elasticsearch::API::Response.new( perform_request(method, path, params, body, headers) ) end |