Method: Elasticsearch::API::Indices::Actions#get_alias

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

#get_alias(arguments = {}) ⇒ Object

Returns an alias.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :name (List)

    A comma-separated list of alias names to return

  • :index (List)

    A comma-separated list of index names to filter aliases

  • :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)

  • :local (Boolean)

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

  • :headers (Hash)

    Custom HTTP headers

See Also:


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

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

  body = nil

  _name = arguments.delete(:name)

  _index = arguments.delete(:index)

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

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