Method: Elasticsearch::XPack::API::Security::Actions#get_user

Defined in:
lib/elasticsearch/xpack/api/actions/security/get_user.rb

#get_user(arguments = {}) ⇒ Object

Retrieves information about users in the native realm and built-in users.

Parameters:

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

    a customizable set of options

Options Hash (arguments):

  • :username (List)

    A comma-separated list of usernames

  • :headers (Hash)

    Custom HTTP headers

See Also:



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

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

  arguments = arguments.clone

  _username = arguments.delete(:username)

  method = Elasticsearch::API::HTTP_GET
  path   = if _username
             "_security/user/#{Elasticsearch::API::Utils.__listify(_username)}"
           else
             "_security/user"
           end
  params = {}

  body = nil
  if Array(arguments[:ignore]).include?(404)
    Elasticsearch::API::Utils.__rescue_from_not_found { perform_request(method, path, params, body, headers).body }
  else
    perform_request(method, path, params, body, headers).body
  end
end