Module: Elasticsearch::XPack::API::Actions

Defined in:
lib/elasticsearch/xpack/api/actions/info.rb,
lib/elasticsearch/xpack/api/actions/usage.rb,
lib/elasticsearch/xpack/api/actions/terms_enum.rb,
lib/elasticsearch/xpack/api/actions/params_registry.rb

Defined Under Namespace

Modules: ParamsRegistry

Instance Method Summary collapse

Instance Method Details

#info(arguments = {}) ⇒ Object

Retrieves information about the installed X-Pack features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :categories (List)

    Comma-separated list of info categories. Can be any of: build, license, features

  • :accept_enterprise (Boolean)

    If an enterprise license is installed, return the type and mode as ‘enterprise’ (default: false)

  • :headers (Hash)

    Custom HTTP headers

See Also:



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/elasticsearch/xpack/api/actions/info.rb', line 30

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

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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

#terms_enum(arguments = {}) ⇒ Object

The terms enum API can be used to discover terms in the index that begin with the provided string. It is designed for low-latency look-ups used in auto-complete scenarios.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (List)

    A comma-separated list of index names to search; use ‘_all` or empty string to perform the operation on all indices

  • :headers (Hash)

    Custom HTTP headers

  • :body (Hash)

    field name, string which is the prefix expected in matching terms, timeout and size for max number of results

Raises:

  • (ArgumentError)

See Also:



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

def terms_enum(arguments = {})
  raise ArgumentError, "Required argument 'index' missing" unless arguments[:index]

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = if arguments[:body]
             Elasticsearch::API::HTTP_POST
           else
             Elasticsearch::API::HTTP_GET
           end

  path   = "#{Elasticsearch::API::Utils.__listify(_index)}/_terms_enum"
  params = {}

  body = arguments[:body]
  perform_request(method, path, params, body, headers).body
end

#usage(arguments = {}) ⇒ Object

Retrieves usage information about the installed X-Pack features.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :master_timeout (Time)

    Specify timeout for watch write operation

  • :headers (Hash)

    Custom HTTP headers

See Also:



29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/elasticsearch/xpack/api/actions/usage.rb', line 29

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

  arguments = arguments.clone

  method = Elasticsearch::API::HTTP_GET
  path   = "_xpack/usage"
  params = Elasticsearch::API::Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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