Module: Elasticsearch::XPack::API::Fleet::Actions
- Included in:
- FleetClient
- Defined in:
- lib/elasticsearch/xpack/api/namespace/fleet.rb,
lib/elasticsearch/xpack/api/actions/fleet/search.rb,
lib/elasticsearch/xpack/api/actions/fleet/msearch.rb,
lib/elasticsearch/xpack/api/actions/fleet/params_registry.rb,
lib/elasticsearch/xpack/api/actions/fleet/global_checkpoints.rb
Defined Under Namespace
Modules: ParamsRegistry
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.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/elasticsearch/xpack/api/actions/fleet/global_checkpoints.rb', line 34 def global_checkpoints(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] headers = arguments.delete(:headers) || {} arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_GET path = "#{Elasticsearch::API::Utils.__listify(_index)}/_fleet/global_checkpoints" params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = nil perform_request(method, path, params, body, headers).body 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.
35 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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/elasticsearch/xpack/api/actions/fleet/msearch.rb', line 35 def msearch(arguments = {}) raise ArgumentError, "Required argument 'body' missing" unless arguments[:body] headers = arguments.delete(:headers) || {} arguments = arguments.clone _index = arguments.delete(:index) method = Elasticsearch::API::HTTP_POST path = if _index "#{Elasticsearch::API::Utils.__listify(_index)}/_fleet/_fleet_msearch" else "_fleet/_fleet_msearch" end params = {} body = arguments[:body] 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 = Elasticsearch::API::Utils.ndjson_headers(headers) perform_request(method, path, params, payload, headers).body 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.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/elasticsearch/xpack/api/actions/fleet/search.rb', line 38 def search(arguments = {}) raise ArgumentError, "Required argument 'index' missing" unless arguments[:index] headers = arguments.delete(:headers) || {} arguments = arguments.clone arguments[:index] = UNDERSCORE_ALL if !arguments[:index] && arguments[:type] _index = arguments.delete(:index) method = if arguments[:body] Elasticsearch::API::HTTP_POST else Elasticsearch::API::HTTP_GET end path = "#{Elasticsearch::API::Utils.__listify(_index)}/_fleet/_fleet_search" params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__) body = arguments[:body] perform_request(method, path, params, body, headers).body end |