module Elasticsearch::XPack::API::Enrich::Actions

Public Instance Methods

delete_policy(arguments = {}) click to toggle source

Deletes an existing enrich policy and its enrich index.

@option arguments [String] :name The name of the enrich policy @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/delete-enrich-policy-api.html

# File lib/elasticsearch/xpack/api/actions/enrich/delete_policy.rb, line 30
def delete_policy(arguments = {})
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_DELETE
  path   = "_enrich/policy/#{Elasticsearch::API::Utils.__listify(_name)}"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
execute_policy(arguments = {}) click to toggle source

Creates the enrich index for an existing enrich policy.

@option arguments [String] :name The name of the enrich policy @option arguments [Boolean] :wait_for_completion Should the request should block until the execution is complete. @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/execute-enrich-policy-api.html

# File lib/elasticsearch/xpack/api/actions/enrich/execute_policy.rb, line 31
def execute_policy(arguments = {})
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_enrich/policy/#{Elasticsearch::API::Utils.__listify(_name)}/_execute"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

  body = nil
  perform_request(method, path, params, body, headers).body
end
get_policy(arguments = {}) click to toggle source

Gets information about an enrich policy.

@option arguments [List] :name A comma-separated list of enrich policy names @option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/get-enrich-policy-api.html

# File lib/elasticsearch/xpack/api/actions/enrich/get_policy.rb, line 30
def get_policy(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _name
             "_enrich/policy/#{Elasticsearch::API::Utils.__listify(_name)}"
           else
             "_enrich/policy"
           end
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end
put_policy(arguments = {}) click to toggle source

Creates a new enrich policy.

@option arguments [String] :name The name of the enrich policy @option arguments [Hash] :headers Custom HTTP headers @option arguments [Hash] :body The enrich policy to register (Required)

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/put-enrich-policy-api.html

# File lib/elasticsearch/xpack/api/actions/enrich/put_policy.rb, line 31
def put_policy(arguments = {})
  raise ArgumentError, "Required argument 'body' missing" unless arguments[:body]
  raise ArgumentError, "Required argument 'name' missing" unless arguments[:name]

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

  arguments = arguments.clone

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_PUT
  path   = "_enrich/policy/#{Elasticsearch::API::Utils.__listify(_name)}"
  params = {}

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end
stats(arguments = {}) click to toggle source

Gets enrich coordinator statistics and information about enrich policies that are currently executing.

@option arguments [Hash] :headers Custom HTTP headers

@see www.elastic.co/guide/en/elasticsearch/reference/7.14/enrich-stats-api.html

# File lib/elasticsearch/xpack/api/actions/enrich/stats.rb, line 29
def stats(arguments = {})
  headers = arguments.delete(:headers) || {}

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_GET
  path   = "_enrich/_stats"
  params = {}

  body = nil
  perform_request(method, path, params, body, headers).body
end