Method: OpenSearch::API::Indices::Actions#get

Defined in:
lib/opensearch/api/actions/indices/get.rb

#get(arguments = {}) ⇒ Object

Returns information about 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

  • :include_type_name (Boolean)

    Whether to add the type name to the response (default: false)

  • :local (Boolean)

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

  • :ignore_unavailable (Boolean)

    Ignore unavailable indexes (default: false)

  • :allow_no_indices (Boolean)

    Ignore if a wildcard expression resolves to no concrete indices (default: false)

  • :expand_wildcards (String)

    Whether wildcard expressions should get expanded to open or closed indices (default: open) (options: open, closed, hidden, none, all)

  • :flat_settings (Boolean)

    Return settings in flat format (default: false)

  • :include_defaults (Boolean)

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

  • :master_timeout (Time)

    Specify timeout for connection to master

  • :headers (Hash)

    Custom HTTP headers

Raises:

  • (ArgumentError)


45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/opensearch/api/actions/indices/get.rb', line 45

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

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

  arguments = arguments.clone

  _index = arguments.delete(:index)

  method = OpenSearch::API::HTTP_GET
  path   = "#{Utils.__listify(_index)}"
  params = Utils.__validate_and_extract_params arguments, ParamsRegistry.get(__method__)

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