Method: Elasticsearch::API::Indices::Actions#get_settings

Defined in:
lib/elasticsearch/api/actions/indices/get_settings.rb

#get_settings(arguments = {}) ⇒ Object

Returns settings for one or more indices.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :index (List)

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

  • :name (List)

    The name of the settings that should be included

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :ignore_unavailable (Boolean)

    Whether specified concrete indices should be ignored when unavailable (missing or closed)

  • :allow_no_indices (Boolean)

    Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes ‘_all` string or when no indices have been specified)

  • :expand_wildcards (String)

    Whether to expand wildcard expression to concrete indices that are open, closed or both. (options: open, closed, hidden, none, all)

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :local (Boolean)

    Return local information, do not retrieve the state from master node (default: false)

  • :include_defaults (Boolean)

    Whether to return all default setting for each of the indices.

  • :headers (Hash)

    Custom HTTP headers

See Also:


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
# File 'lib/elasticsearch/api/actions/indices/get_settings.rb', line 40

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

  body   = nil

  _index = arguments.delete(:index)

  _name = arguments.delete(:name)

  method = Elasticsearch::API::HTTP_GET
  path   = if _index && _name
             "#{Utils.__listify(_index)}/_settings/#{Utils.__listify(_name)}"
           elsif _index
             "#{Utils.__listify(_index)}/_settings"
           elsif _name
             "_settings/#{Utils.__listify(_name)}"
           else
             "_settings"
           end
  params = Utils.process_params(arguments)

  Elasticsearch::API::Response.new(
    perform_request(method, path, params, body, headers)
  )
end